Skip to content

integration-tests: Add contract tests#1694

Merged
mslipper merged 1 commit intoethereum-optimism:regenesis/0.5.0from
mslipper:feat/contract-tests
Nov 4, 2021
Merged

integration-tests: Add contract tests#1694
mslipper merged 1 commit intoethereum-optimism:regenesis/0.5.0from
mslipper:feat/contract-tests

Conversation

@mslipper
Copy link
Collaborator

@mslipper mslipper commented Nov 4, 2021

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.

@changeset-bot
Copy link

changeset-bot bot commented Nov 4, 2021

⚠️ No Changeset found

Latest commit: 2f613bb

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions github-actions bot added the A-integration Area: integration tests label Nov 4, 2021
@codecov-commenter
Copy link

codecov-commenter commented Nov 4, 2021

Codecov Report

Merging #1694 (daedda3) into regenesis/0.5.0 (92007cd) will decrease coverage by 0.12%.
The diff coverage is n/a.

❗ Current head daedda3 differs from pull request most recent head 2f613bb. Consider uploading reports for the commit 2f613bb to get more accurate results
Impacted file tree graph

@@                 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     
Flag Coverage Δ
batch-submitter 61.33% <ø> (ø)
contracts 87.96% <ø> (ø)
core-utils 57.72% <ø> (-0.69%) ⬇️
data-transport-layer 38.23% <ø> (ø)
message-relayer 83.17% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
packages/core-utils/src/provider.ts 15.38% <0.00%> (-6.84%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 92007cd...2f613bb. Read the comment docs.

@mslipper mslipper force-pushed the feat/contract-tests branch from daedda3 to 2f613bb Compare November 4, 2021 21:00
Copy link
Contributor

@smartcontracts smartcontracts left a comment

Choose a reason for hiding this comment

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

LGTM. Assuming this passes CI, feel free to merge.

@mslipper mslipper merged commit 2ba1a55 into ethereum-optimism:regenesis/0.5.0 Nov 4, 2021
theochap pushed a commit that referenced this pull request Dec 10, 2025
## 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
theochap pushed a commit that referenced this pull request Jan 14, 2026
## 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-integration Area: integration tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants