integration-tests: Add contract tests#1694
integration-tests: Add contract tests#1694mslipper merged 1 commit intoethereum-optimism:regenesis/0.5.0from
Conversation
|
Codecov Report
@@ Coverage Diff @@
## regenesis/0.5.0 #1694 +/- ##
===================================================
- Coverage 72.71% 72.58% -0.13%
===================================================
Files 69 69
Lines 2272 2276 +4
Branches 336 337 +1
===================================================
Hits 1652 1652
- Misses 620 624 +4
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
daedda3 to
2f613bb
Compare
smartcontracts
left a comment
There was a problem hiding this comment.
LGTM. Assuming this passes CI, feel free to merge.
## Overview Adds a path for finalizing L2 blocks, based off of the L1 block they were derived from. To accomplish this: 1. The derivation pipeline now attaches the L1 block that the L2 block was derived from, within `OpAttributesWithParent`. 2. The DA watcher actor now watches a stream of finalized L1 blocks, polled every 1m. 3. The engine actor now holds onto a map of `l1_block_number => highest_l2_block_in_epoch`, saturated when it receives attributes from the derivation actor. - When a new finalized L1 block is observed by the engine actor, it will find the highest L2 block whose batch data is contained within the finalized L1 chain, and finalize it (if it knows of any.) This approach is different than suggested by the tickets, but results in a more slim outcome that takes advantage of existing actors. ### Periphery changes - Some refactoring of the `OpAttributesWithParent` type. - The sync start algorithm now stops safe block traversal at the finalized head, to ensure it never assigns a safe block past it. - The `L1WatcherRpc` now uses a custom `BlockStream`, since alloy's `watch_blocks` stream doesn't dedup nor allow for observing anything other than head block updates. ### Result Finalized blocks are correctly streaming in 😄 <img width="1228" alt="Screenshot 2025-05-24 at 5 09 01 PM" src="https://github.com/user-attachments/assets/609184a5-35b8-4b04-a124-eeece8ef53e4" /> ### Meta closes #1693 closes #1694 closes #1695 closes #1696 closes #1698
## Overview Adds a path for finalizing L2 blocks, based off of the L1 block they were derived from. To accomplish this: 1. The derivation pipeline now attaches the L1 block that the L2 block was derived from, within `OpAttributesWithParent`. 2. The DA watcher actor now watches a stream of finalized L1 blocks, polled every 1m. 3. The engine actor now holds onto a map of `l1_block_number => highest_l2_block_in_epoch`, saturated when it receives attributes from the derivation actor. - When a new finalized L1 block is observed by the engine actor, it will find the highest L2 block whose batch data is contained within the finalized L1 chain, and finalize it (if it knows of any.) This approach is different than suggested by the tickets, but results in a more slim outcome that takes advantage of existing actors. ### Periphery changes - Some refactoring of the `OpAttributesWithParent` type. - The sync start algorithm now stops safe block traversal at the finalized head, to ensure it never assigns a safe block past it. - The `L1WatcherRpc` now uses a custom `BlockStream`, since alloy's `watch_blocks` stream doesn't dedup nor allow for observing anything other than head block updates. ### Result Finalized blocks are correctly streaming in 😄 <img width="1228" alt="Screenshot 2025-05-24 at 5 09 01 PM" src="https://github.com/user-attachments/assets/609184a5-35b8-4b04-a124-eeece8ef53e4" /> ### Meta closes #1693 closes #1694 closes #1695 closes #1696 closes #1698
This PR adds integration tests for basic smart contract interactions and swaps on Uniswap. Tested against both my local Hardhat node and the Kovan staging environment.
Note that in order to deploy the Uniswap contracts I had to change the Solidity compiler version in the integration tests to
^0.7.6.