Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Altda devnet monitoring #11

Draft
wants to merge 27 commits into
base: develop
Choose a base branch
from
Draft

Altda devnet monitoring #11

wants to merge 27 commits into from

Conversation

samlaf
Copy link
Collaborator

@samlaf samlaf commented Sep 12, 2024

This doesn't work right now because rebased on top of op 1.9.3, which has a bug: ethereum-optimism#12354

Until this is fixed, I cherry-picked the commits here on top of a previous release. Use the altda-devnet-monitoring-1.9.2 branch

@samlaf samlaf marked this pull request as draft September 12, 2024 05:29
@samlaf samlaf force-pushed the altda-devnet-monitoring branch 3 times, most recently from 5aff9b4 to 6660c24 Compare September 29, 2024 17:50
samlaf pushed a commit that referenced this pull request Oct 7, 2024
…11776)

* chore: configure medusa with basic supERC20 self-bridging (ethereum-optimism#19)

- used --foundry-compile-all to ensure the test contract under
  `test/properties` is compiled (otherwise it is not compiled and medusa
  crashes when it can't find it's compiled representation)
- set src,test,script to test/properties/medusa to not waste time
  compiling contracts that are not required for the medusa campaign
- used an atomic bridge, which doesnt allow for testing of several of
  the proposed invariants

fix: delete dead code
test: give the fuzzer a head start
docs: fix properties order
test: document & implement assertions 22, 23  and 24
fix: fixes from self-review
test: guide the fuzzer a little bit less
  previously: initial mint, bound on transfer amount: 146625 calls in 200s
  now: no initial mint, no bound on transfer amount: 176835 calls in 200s
  it doesn't seem to slow the fuzzer down
fix: fixes after lovely feedback by disco
docs: merge both documents and categorized properties by their milestone
fix: fixes from parti's review
fix: feedback from disco
fix: feedback from doc
refactor: separate state transitions from pure properties
docs: update tested properties
refactor: move all assertions into properties contract
fix: move function without assertions back into handler
test: only use assertion mode
fix: improve justfile recipie for medusa

* feat: halmos symbolic tests (ethereum-optimism#21)

* feat: introduce OptimismSuperchainERC20

* fix: contract fixes

* feat: add snapshots and semver

* test: add supports interface tests

* test: add invariant test

* feat: add parameters to the RelayERC20 event

* fix: typo

* fix: from param description

* fix: event signature and interface pragma

* feat: add initializer

* feat: use unstructured storage and OZ v5

* feat: update superchain erc20 interfaces

* fix: adapt storage to ERC7201

* test: add initializable OZ v5 test

* fix: invariant docs

* fix: ERC165 implementation

* test: improve superc20 invariant (#11)

* fix: gas snapshot

* chore: configure medusa with basic supERC20 self-bridging

- used --foundry-compile-all to ensure the test contract under
  `test/properties` is compiled (otherwise it is not compiled and medusa
  crashes when it can't find it's compiled representation)
- set src,test,script to test/properties/medusa to not waste time
  compiling contracts that are not required for the medusa campaign
- used an atomic bridge, which doesnt allow for testing of several of
  the proposed invariants

* fix: delete dead code

* test: give the fuzzer a head start

* feat: create suite for sybolic tests with halmos

* test: setup and 3 properties with symbolic tests

* chore: remove todo comment

* docs: fix properties order

* test: document & implement assertions 22, 23  and 24

* fix: fixes from self-review

* test: guide the fuzzer a little bit less

previously: initial mint, bound on transfer amount: 146625 calls in 200s
now: no initial mint, no bound on transfer amount: 176835 calls in 200s

it doesn't seem to slow the fuzzer down

* feat: add property for burn

* refactor: remove symbolic address on mint property

* refactor: order the tests based on the property id

* feat: checkpoint

* chore: set xdomain sender on failing test

* chore: enhance mocks

* Revert "Merge branch 'chore/setup-medusa' into feat/halmos-symbolic-tests"

This reverts commit 945d6b6, reversing
changes made to 5dcb3a8.

* refactor: remove symbolic addresses to make all of the test work

* chore: remove console logs

* feat: add properties file

* chore: polish

* refactor: enhance test on property 7 using direct try catch (now works)

* fix: review comments

* refactor: add symbolic addresses on test functions

* feat: create halmos toml

* chore: polish test contract and mock

* chore: update property

* refactor: move symbolic folder into properties one

* feat: create advanced tests helper contract

* refactor: enhance tests using symbolic addresses instead of concrete ones

* chore: remove 0 property natspec

* feat: add halmos profile and just script

* chore: rename symbolic folder to halmos

* feat: add halmos commands to justfile

* chore: reorder assertions on one test

* refactor: complete test property seven

* chore: mark properties as completed

* chore: add halmos-cheatcodes dependency

* chore: rename advancedtest->halmosbase

* chore: minimize mocked messenger

* chore: delete empty halmos file

* chore: revert changes to medusa.json

* docs: update changes to PROPERTIES.md from base branch

* test: sendERC20 destination fix

* chore: natspec fixes

---------

Co-authored-by: agusduha <[email protected]>
Co-authored-by: 0xng <[email protected]>
Co-authored-by: teddy <[email protected]>

* test: remaining protocol properties (ethereum-optimism#26)

* test: cross-user fuzzed bridges + actor setup

* test: fuzz properties 8 and 9

* test: properties 7 and 25

* fix: implement doc's feedback

* test: superc20 tob properties (ethereum-optimism#27)

* chore: add crytic/properties dependency

* test: extend protocol properties so it also covers ToB erc20 properties

* chore: small linter fixes

* docs: update property list

* test: handlers for remaining superc20 state transitions

* fix: disable ToB properties we are not using and guide the fuzzer a bit more

* fix: disable another ToB property not implemented by solady

* chore: remove zero-initializations

* fix: feedback from disco

* chore: separate fuzz campaign tests in guided vs unguided

* test: dont revert on successful unguided relay

* test: add fuzzed calls to burn and mint

* docs: document the separation of fuzz test functions

* chore: move the properties file to its own directory

* chore: consistently use fuzz_ and property_ + camelcase

* chore: fix typo

* chore: camelcase for handlers as well

* fix: revert change that broke halmos campaign compile :D

* test: fuzz non atomic bridging (ethereum-optimism#31)

* test: changed mocked messenger ABI for message sending but kept assertions the same

* docs: add new properties 26&27

* test: queue cross-chain messages and test related properties

* test: relay random messages from queue and check associated invariants

* chore: rename bridge->senderc20 method for consistency with relayerc20

* test: not-yet-deployed supertokens can get funds sent to them

* chore: medusa runs forever by default

doable since it also handles SIGINTs gracefully

* chore: document the reason behind relay zero and send zero inconsistencies

* fix: feedback from doc

* fix: walk around possible medusa issue

I'm getting an 'unknown opcode 0x4e' in ProtocolAtomic constructor when
calling the MockL2ToL2CrossDomainMessenger for the first time

* test: unguided handler for sendERC20

* fix: feedback from disco

* chore: remove halmos testsuite

* chore: foundry migration (ethereum-optimism#40)

* chore: track assertion failures

this is so foundry's invariant contract can check that an assertion
returned false in the handler, while still allowing `fail_on_revert =
false` so we can still take full advantage of medusa's fuzzer & coverage
reports

* fix: explicitly skip duplicate supertoken deployments

* chore: remove duplicated PROPERTIES.md file

* chore: expose data to foundry's external invariant checker

* test: run medusa fuzzing campaign from within foundry

* fix: eagerly check for duplicate deployments

* fix: feedback from doc

* chore: shoehorn medusa campaign into foundry dir structure

* chore: remove PROPERTIES.md file

* chore: delete medusa config

* docs: limited support for subdirectories in test/invariant

* chore: rename contracts to be more sneaky about medusa

* docs: rewrite invariant docs in a way compliant with autogen scripts

* chore: fixes from rebase

* fix: cleanup superc20 invariants (ethereum-optimism#46)

* chore: revert modifications from medusa campaign

* docs: extra docs on why ForTest contract is required

* doc: add list of all supertoken properties

* chore: run forge fmt

* ci: allow for testfiles to be deleted

* fix: run doc autogen script after rebase

---------

Co-authored-by: Disco <[email protected]>
Co-authored-by: agusduha <[email protected]>
Co-authored-by: 0xng <[email protected]>
@@ -26,6 +27,37 @@

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

## devnet with eigenda alt-da

First you will need to build the dev docker image for eigenda-proxy, until we make a new release.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: change this after we release the new proxy

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

smartcontracts and others added 4 commits October 7, 2024 16:49
Adds sol-style-malformed-require to local semgrep and actually
fixes the rule so that it works. Fixes a couple of findings that
the rule found.
* contracts-bedrock: cleanup `FeeVault`

Updates the `FeeVault` to follow modern conventions used in the repo
by moving to usage of interfaces rather than implementations. Also
moves the `FeeVault` into the `L2` package as its only really useful
on L2. This is meant to reduce the diff for the Stanard L2 Genesis
by breaking up the refactor into its own small PR.

* contracts: update semver-lock

* semver-lock: fixup

* cleanup: refactor

* lint: fix

* snapshots: regenerate

* interface check: ignore fee vaults

There is an issue with normalization of enums when they are return
values
…um-optimism#12306)

* contracts-bedrock: fixes `OptimismMintableERC721Factory` test

This contract is only used as a predeploy so it should be tested based
on the L2 genesis generation setup. Ensures that the address is stored
and labeled as part of in memory test setup, as well as updates the
tests to work based on the predeploy.

This is a small refactor to make future Standard L2 genesis work more
simple.

Also includes a small ABI fix to the `OptimismMintableERC721Factory`
since this contract has not been updated to decouple immutable naming
conventions from its ABI.

* snapshots: update

* checks: fix

* lint: fix

* typo: fix
Adds sol-style-malformed-revert to local semgrep and fixes the
rule so that it actually works. Fixes a couple of findings that
the updated rule discovered.
@tynes
Copy link

tynes commented Oct 7, 2024

Do you have plans on migrating to kurtosis? We would like to delete the docker compose devnet soon and rely strictly on kurtosis

smartcontracts and others added 3 commits October 7, 2024 21:08
A few things in this commit:
- Adds a new check for unused imports in contracts
- Cleans up contracts based on that check
- Removes several files that aren't being used anymore
Adds the Solidity unused imports check to ci.
@samlaf
Copy link
Collaborator Author

samlaf commented Oct 7, 2024

Do you have plans on migrating to kurtosis? We would like to delete the docker compose devnet soon and rely strictly on kurtosis

@tynes yes sir! but there's still a bunch of stuff missing for me to use kurtosis, and don't have time to fix them right now. Plus I still have this PR open that needs to be unblocked by you guys ethpandaops/optimism-package#69

For now we just want to use this devnet to make a high-throughput eigenda x op-stack announcement. We don't plan on supporting it or using it long term. Will try to migrate to kurtosis slowly for future projects. But for now would be super useful if we can fix the issue mentioned in the description so we can make this announcement.

@tynes
Copy link

tynes commented Oct 7, 2024

It should be a simple fix, did you see my comment on the monorepo?

smartcontracts and others added 12 commits October 7, 2024 23:41
Adds MIPSInstructions as an exception to malformed require.
* OPCM: DepolyOPChain additional testing checks.

* fix: absolute prestate.

* fix: adding to assertions.

* fix: maxClockDuration check added.
Adds a new configuration to DeployImplementations so that it
knows which MIPS version to deploy.
Adds semgrep-scan-local to top-level justfile.
…configs in init() methods (ethereum-optimism#12307)

This was causing op-program to spend cycles parsing the config JSON files to set constants that weren't actually used.
* op-node,op-supervisor: feed local-unsafe/local-safe/l1-finalized data to supervisor

* op-node,op-service,op-e2e: wip, fix interop op-node tests

* post-rebase compilation fixes

* BlockRef

* op-supervisor: fix service test, cleanup todo

* op-supervisor: link TODO comments to issue

* interop: fix e2e action test

---------

Co-authored-by: protolambda <[email protected]>
)

Update README to use singlethreaded-2 since the old singlethreaded likely isn't available if just compiling the latest version.
…m-optimism#12200)

* 1. Added `WithRegisters` for initializing state's `Registers`.
2. Added `ThreadProofEncoder` helper function to generate `ThreadProof`.
3. Updated `AssertEVMReverts` to include `statePCs` for multiple memory requirements, added `ProofData` parameter for passing `ThreadProof`, and introduced `expectedReason` parameter for more precise testing.
4. Revised `TestEVMFault` and `TestEVM_UnsupportedSyscall` test functions to be compatible with `AssertEVMReverts`.

* lint fix and comment fix

* avoid false negatives

* delete WithRegisters && create ProofGenerator

* assert multi outputs

* fix naming issue

* Update cannon/mipsevm/tests/evm_multithreaded_test.go

Nice catch!

Co-authored-by: mbaxter <[email protected]>

* Small fix

* link check

* make expectedReason a value & delete nil check

---------

Co-authored-by: mbaxter <[email protected]>
Ports the interface checks command to go. Updates build command
to execute forge fmt and the interface checks.
blmalone and others added 7 commits October 8, 2024 20:32
)

* OPCM: AddressManager and ProxyAdmin assertions.

* fix: Added logic for proxy types to check implementations.

* fix: touch ups for RDP impl checking.

* fix: fully fledged proxies added to tests because of new assertions.

* fix: removing console2 lib.

* fix: semgrep complaining.

* fix: comment cleanup and logical split to avoid stack too deep error.

* fix: adding comment back in.

* fix: added natspec comments for new DeployUtils functions.

* fix: removed unused imports.
Updates the dockerfile for building contracts-bedrock to use
just forge-build instead of just build since just build now does
a few other things for the sake of devex.
- update README
- create make altda-devnet-up command
- swap da-server for eigenda-proxy
- use redis-cache for eigenda-proxy

devnet(high-throughput): change devnetL1-template to use 60M gas with eip1559 elasticity of 2
@@ -26,6 +27,37 @@

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

## devnet with eigenda alt-da

First you will need to build the dev docker image for eigenda-proxy, until we make a new release.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now create a `.env` file in the root of this repository with the following content (you will need to add an ecdsa private key that is authorized on the eigenda disperser, as well as an ethereum rpc endpoint):

```bash
MEMSTORE_ENABLED=false
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

update the flag to EIGENDA_PROXY_MEMSTORE_ENABLED

# This outputs state.json (VM state) and meta.json (for debug symbols).
./bin/cannon load-elf --type singlethreaded --path=../op-program/bin/op-program-client.elf
# This outputs state.bin.gz (VM state) and meta.json (for debug symbols).
./bin/cannon load-elf --type singlethreaded-2 --path=../op-program/bin/op-program-client.elf
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why change into bin.gz?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ehhh this PR is prob just targeting the wrong commit. :\

@@ -315,6 +315,69 @@ func TestEVMSingleStep_LoadStore(t *testing.T) {
}
}

func TestEVMSingleStep_MovzMovn(t *testing.T) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the reason to change EVM test?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ehhh this PR is prob just targeting the wrong commit. :
I didn't change this.

Copy link

github-actions bot commented Nov 6, 2024

This PR is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the Stale label Nov 6, 2024
@samlaf samlaf removed the Stale label Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.