-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Refactor tests and test EXTCODECOPY Failure Behavior #25
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
Refactor tests and test EXTCODECOPY Failure Behavior #25
Conversation
Other changes: * Add helper method for making ovm calls
... when provided an invalid address
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wowza! This is a real refactor! Super dope! The actual EXTCODECOPY tests look good but hilariously I feel like it might even be worth changing the title of the PR to "Refactor tests & test EXTCODECOPY Failure Behavior" or something.
It looks to me like a bunch of code was removed which is awesome! It adds a test but the overall code size is negative which is great. I had a couple comments with opinions weakly held on the style but overall think this looks good!
I'd give it an approve but I'm curious if @willmeister has any more sophisticated code style opinions. But if not imo this should be good to go & I'll change to approve! Dope!
Oh random question -- is it possible to add the "no unused imports / variables" to our automatic lint procedure? This was one lint that I really feel we're missing as I love knowing what I am and am not using in a file.
| addressToBytes32Address(callContractAddress), | ||
| methodIds.makeStaticCallThenCall, | ||
| addressToBytes32Address(callContractAddress), | ||
| ]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't feel qualified to really comment on much of this file because it's largely a matter of code style. @willmeister curious if you have any feedback here instead.
My gut reaction is that this update is slightly more readable but at the same time style is such a tricky thing to judge & there's totally cases to be made for the explicit string concatenation as well. Anyway I'm pretty laid back on this sort of stuff though so curious if anyone involved has a real strong opinion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't review the whole PR, but looks good to me 👍
| 0, | ||
| dummyContractBytecode.length, | ||
| ] | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice solid code size reduction
packages/ovm/package.json
Outdated
| "ethereum-waffle": "2.1.0", | ||
| "ethers": "^4.0.37", | ||
| "ethlint": "^1.2.5", | ||
| "lodash": "^4.17.15", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I kiiinda am a fan of not requiring lodash because it technically doesn't have to be used & adds weight to the package. That said, I also do really enjoy programming with lodash. Maybe if we only used lodash for testing functions & added it only to devDependencies then it'd be a no brainer? Either way, this is not a strong opinion so I'm personally fine with keeping lodash usage exactly as is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah agreed we shouldn't add dependencies unless their benefit outweighs the cost. I was using native reduce but fromPairs made it a bit more readable. I moved it to a devDependency so we can punt on that decision for now. I also added it to a list of things we can discuss as a team while we're all in person next week! 😄 -> TypeScript/Solidity Style Guide Discussion
Good call, changed! 👍
|
* Upgraded to new RingBuffer * First pass at verification function * Removed BaseChain as a contract * Update OVM_CanonicalTransactionChain.spec.ts * Removed unused chain variable * Added overwriting logic to CTC * Corrected CTC event emit * Remove timebound ring buffer tests * Integrated bond manager PR Co-authored-by: Georgios Konstantopoulos <[email protected]>
Update introduction.md Co-authored-by: Maurelian <[email protected]> Update introduction.md Co-authored-by: Maurelian <[email protected]> Update introduction.md Co-authored-by: Maurelian <[email protected]> Update introduction.md Co-authored-by: Maurelian <[email protected]> Update introduction.md Co-authored-by: Maurelian <[email protected]> Update introduction.md Co-authored-by: Maurelian <[email protected]> Address the rest of the feedback
88047e707 Add tbcd, a small bitcoin daemon that participates on bitcoin p2p (ethereum-optimism#50) 1146a08b5 localnet reorg fix (ethereum-optimism#76) 87f18a191 build(deps): bump github.com/docker/docker (ethereum-optimism#64) 9073baeaf localnet (ethereum-optimism#37) 1588cbf04 Add common user-specific files to gitignore (ethereum-optimism#51) 210aabe7a Update popm.go, fix typo (ethereum-optimism#40) a5e689493 make: automate copyright headers (#31) 1c3bfc9bc Use `maps.Clone(m)` to copy returned map in `APICommands()` (#33) 1be4df2a3 Use 'errors.Is' to compare errors (#32) 3f6bc5f8e e2e: sync ElectrumX environment variables with infra (ethereum-optimism#36) c5b0fea01 electrumx: add connection reuse and pooling (#26) cfc1293e9 Update README.md (#29) 8896259f0 retry mine keystone on failure (#18) a10e3bb29 Use '%w' verb in fmt.Errorf to wrap errors (fixes #13) (#27) 6cd677611 deps: update google.golang.org/protobuf to v1.33.0 (#28) ed7eb8e97 ci: fix concurrency cancel-in-progress for pull requests (#16) ac3b7eacb docker: update golang image to v1.22.1 (#25) d6b0ac8af returning response errors if they exist from bfg -> popm (#24) d450b787a Network test start height + no panic (#22) b390805c5 allowing BTC Block and L2 Keystone generation rates to be configurable in local network (#19) bfd3b1dc0 make: add -local flag to goimports (#9) e0e8964fc Move internal error into protocol package (#10) 7875a897c l2 keystone mining fixes (#3) git-subtree-dir: heminetwork git-subtree-split: 88047e707e2db8522e2ad77c5f849e55bc94cd10
88047e707 Add tbcd, a small bitcoin daemon that participates on bitcoin p2p (ethereum-optimism#50) 1146a08b5 localnet reorg fix (ethereum-optimism#76) 87f18a191 build(deps): bump github.com/docker/docker (ethereum-optimism#64) 9073baeaf localnet (ethereum-optimism#37) 1588cbf04 Add common user-specific files to gitignore (ethereum-optimism#51) 210aabe7a Update popm.go, fix typo (ethereum-optimism#40) a5e689493 make: automate copyright headers (#31) 1c3bfc9bc Use `maps.Clone(m)` to copy returned map in `APICommands()` (#33) 1be4df2a3 Use 'errors.Is' to compare errors (#32) 3f6bc5f8e e2e: sync ElectrumX environment variables with infra (ethereum-optimism#36) c5b0fea01 electrumx: add connection reuse and pooling (#26) cfc1293e9 Update README.md (#29) 8896259f0 retry mine keystone on failure (#18) a10e3bb29 Use '%w' verb in fmt.Errorf to wrap errors (fixes #13) (#27) 6cd677611 deps: update google.golang.org/protobuf to v1.33.0 (#28) ed7eb8e97 ci: fix concurrency cancel-in-progress for pull requests (#16) ac3b7eacb docker: update golang image to v1.22.1 (#25) d6b0ac8af returning response errors if they exist from bfg -> popm (#24) d450b787a Network test start height + no panic (#22) b390805c5 allowing BTC Block and L2 Keystone generation rates to be configurable in local network (#19) bfd3b1dc0 make: add -local flag to goimports (#9) e0e8964fc Move internal error into protocol package (#10) 7875a897c l2 keystone mining fixes (#3) git-subtree-dir: heminetwork git-subtree-split: 88047e707e2db8522e2ad77c5f849e55bc94cd10
merge from optimism develop
* test: add L2 standard bridge interop unit tests (#13) * test: add L2 standard bridge interop unit tests * fix: add tests natspec * fix: unit tests fixes * fix: super to legacy tests failing * fix: mock and expect mint and burn * fix: add generic factory interface (#14) * test: add L2 standard bridge interop unit tests * fix: add tests natspec * fix: add generic factory interface * feat: modify OptimismMintableERC20Factory for convert (#17) * test: add L2 standard bridge interop unit tests * fix: add tests natspec * fix: add generic factory interface * feat: modify OptimismMintableERC20Factory for convert * fix: use only a public function for create3 * feat: rollback interop factory, modify legacy one * fix: delete local token return variable * fix: PR fixes * feat: add superchain erc20 factory implementation (#23) * feat: add superchain erc20 factory implementation * fix: remove createX comments * test: add superchain erc20 factory tests (#25) * test: add superchain erc20 factory tests * test: add erc20 asserts * test: fix expect emit * fix: remove comments * feat: add constructor to superchain ERC20 beacon (#34) * test: remove factory predeploy etch ---------- Co-authored-by: 0xng <[email protected]> Co-authored-by: 0xParticle <[email protected]> Co-authored-by: gotzenx <[email protected]> * fix: set an arbitrary address for superchain erc20 impl * fix: deploy a proxy for the beacon on genesis (#45) --------- Co-authored-by: 0xng <[email protected]> * fix: conflicts and imports * fix: interfaces * chore: add .testdata * fix: adding back .testdata to gitignore * fix: new conflicts from ci improvements --------- Co-authored-by: 0xng <[email protected]> Co-authored-by: 0xParticle <[email protected]> Co-authored-by: gotzenx <[email protected]> Co-authored-by: Disco <[email protected]>
* test: add L2 standard bridge interop unit tests (ethereum-optimism#13) * test: add L2 standard bridge interop unit tests * fix: add tests natspec * fix: unit tests fixes * fix: super to legacy tests failing * fix: mock and expect mint and burn * fix: add generic factory interface (ethereum-optimism#14) * test: add L2 standard bridge interop unit tests * fix: add tests natspec * fix: add generic factory interface * feat: modify OptimismMintableERC20Factory for convert (ethereum-optimism#17) * test: add L2 standard bridge interop unit tests * fix: add tests natspec * fix: add generic factory interface * feat: modify OptimismMintableERC20Factory for convert * fix: use only a public function for create3 * feat: rollback interop factory, modify legacy one * fix: delete local token return variable * fix: PR fixes * feat: add superchain erc20 factory implementation (ethereum-optimism#23) * feat: add superchain erc20 factory implementation * fix: remove createX comments * test: add superchain erc20 factory tests (ethereum-optimism#25) * test: add superchain erc20 factory tests * test: add erc20 asserts * test: fix expect emit * fix: remove comments * feat: add constructor to superchain ERC20 beacon (ethereum-optimism#34) * test: remove factory predeploy etch ---------- Co-authored-by: 0xng <[email protected]> Co-authored-by: 0xParticle <[email protected]> Co-authored-by: gotzenx <[email protected]> * fix: set an arbitrary address for superchain erc20 impl * fix: deploy a proxy for the beacon on genesis (ethereum-optimism#45) --------- Co-authored-by: 0xng <[email protected]> * fix: conflicts and imports * fix: interfaces * chore: add .testdata * fix: adding back .testdata to gitignore * fix: new conflicts from ci improvements --------- Co-authored-by: 0xng <[email protected]> Co-authored-by: 0xParticle <[email protected]> Co-authored-by: gotzenx <[email protected]> Co-authored-by: Disco <[email protected]>
…r-payload-bytes
88047e707 Add tbcd, a small bitcoin daemon that participates on bitcoin p2p (ethereum-optimism#50) 1146a08b5 localnet reorg fix (ethereum-optimism#76) 87f18a191 build(deps): bump github.com/docker/docker (ethereum-optimism#64) 9073baeaf localnet (ethereum-optimism#37) 1588cbf04 Add common user-specific files to gitignore (ethereum-optimism#51) 210aabe7a Update popm.go, fix typo (ethereum-optimism#40) a5e689493 make: automate copyright headers (#31) 1c3bfc9bc Use `maps.Clone(m)` to copy returned map in `APICommands()` (#33) 1be4df2a3 Use 'errors.Is' to compare errors (#32) 3f6bc5f8e e2e: sync ElectrumX environment variables with infra (ethereum-optimism#36) c5b0fea01 electrumx: add connection reuse and pooling (#26) cfc1293e9 Update README.md (#29) 8896259f0 retry mine keystone on failure (#18) a10e3bb29 Use '%w' verb in fmt.Errorf to wrap errors (fixes #13) (#27) 6cd677611 deps: update google.golang.org/protobuf to v1.33.0 (#28) ed7eb8e97 ci: fix concurrency cancel-in-progress for pull requests (#16) ac3b7eacb docker: update golang image to v1.22.1 (#25) d6b0ac8af returning response errors if they exist from bfg -> popm (#24) d450b787a Network test start height + no panic (#22) b390805c5 allowing BTC Block and L2 Keystone generation rates to be configurable in local network (#19) bfd3b1dc0 make: add -local flag to goimports (#9) e0e8964fc Move internal error into protocol package (#10) 7875a897c l2 keystone mining fixes (#3) git-subtree-dir: heminetwork git-subtree-split: 88047e707e2db8522e2ad77c5f849e55bc94cd10
88047e707 Add tbcd, a small bitcoin daemon that participates on bitcoin p2p (ethereum-optimism#50) 1146a08b5 localnet reorg fix (ethereum-optimism#76) 87f18a191 build(deps): bump github.com/docker/docker (ethereum-optimism#64) 9073baeaf localnet (ethereum-optimism#37) 1588cbf04 Add common user-specific files to gitignore (ethereum-optimism#51) 210aabe7a Update popm.go, fix typo (ethereum-optimism#40) a5e689493 make: automate copyright headers (#31) 1c3bfc9bc Use `maps.Clone(m)` to copy returned map in `APICommands()` (#33) 1be4df2a3 Use 'errors.Is' to compare errors (#32) 3f6bc5f8e e2e: sync ElectrumX environment variables with infra (ethereum-optimism#36) c5b0fea01 electrumx: add connection reuse and pooling (#26) cfc1293e9 Update README.md (#29) 8896259f0 retry mine keystone on failure (#18) a10e3bb29 Use '%w' verb in fmt.Errorf to wrap errors (fixes #13) (#27) 6cd677611 deps: update google.golang.org/protobuf to v1.33.0 (#28) ed7eb8e97 ci: fix concurrency cancel-in-progress for pull requests (#16) ac3b7eacb docker: update golang image to v1.22.1 (#25) d6b0ac8af returning response errors if they exist from bfg -> popm (#24) d450b787a Network test start height + no panic (#22) b390805c5 allowing BTC Block and L2 Keystone generation rates to be configurable in local network (#19) bfd3b1dc0 make: add -local flag to goimports (#9) e0e8964fc Move internal error into protocol package (#10) 7875a897c l2 keystone mining fixes (#3) git-subtree-dir: heminetwork git-subtree-split: 88047e707e2db8522e2ad77c5f849e55bc94cd10
* update gas * fix no suffix * revert * follow the naming convention for SGT * fix comments
* Add cursor rules * Fix db
* ♻ Clean up `OracleReader` * ♻ Cleanup
commit 033b865 Author: Zena-park <[email protected]> Date: Wed Jul 10 19:37:02 2024 +0900 refactor: delete try-catch statement ethereum-optimism#25 commit d5627e4 Author: Zena-park <[email protected]> Date: Tue Jul 9 15:52:29 2024 +0900 test: setExplorer ethereum-optimism#24 commit f07c2db Author: Zena-park <[email protected]> Date: Tue Jul 9 14:34:24 2024 +0900 feat: setExplorer function ethereum-optimism#24
Include deposit in arbitrary testing
Include deposit in arbitrary testing
Description
Add a test to ensure EXTCODECOPY returns zeroed bytes when the provided range is out of bounds or the provided address is invalid.
Other Changes
executeOVMCall,encodeMethodIdandencodeRawArgumentstest helperstslintQuestions
noUnusedLocalsandnoUnusedParametersin ourtsconfigto prevent unused variables?Metadata
Fixes
Contributing Agreement