Skip to content

Conversation

ajsutton
Copy link
Contributor

Description

Previously when testing withdrawals, we would wait until the output root is published and finalized, then prove the withdrawal then wait the withdrawal period again before finalizing. We also mixed up the starting point for the finalisation period - using the block the output root was published, not the block the withdrawal was proven which meant we waited one block too few which breaks when estimateGas switches to using latest instead of pending.

Now there are two separate functions:

  • WaitForOutputRootPublished - waits for an output root to be published that has a block number after the L2 withdrawal transaction. At this point the withdrawal can be proven. Removed the calculations around finding the submission boundary interval which couples too tightly to the details of production code. We can just get the block number to use when proving from the output root rather than calculating it.
  • WaitForFinalizationPeriod - given an L1 block, waits until it is old enough to be considered finalized. This doesn't involve the output oracle at all and operates entirely on L1 info.

Both functions now use waiters from e2eutils rather than manually re-implementing waiting logic.

@ajsutton ajsutton requested a review from a team as a code owner June 29, 2023 03:47
@ajsutton ajsutton requested a review from Inphi June 29, 2023 03:47
@changeset-bot
Copy link

changeset-bot bot commented Jun 29, 2023

⚠️ No Changeset found

Latest commit: dc11249

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

@netlify
Copy link

netlify bot commented Jun 29, 2023

Deploy Preview for opstack-docs canceled.

Name Link
🔨 Latest commit dc11249
🔍 Latest deploy log https://app.netlify.com/sites/opstack-docs/deploys/649ef4007989ff0008cf68e0

@ajsutton ajsutton force-pushed the aj/e2e-withdrawal-timing branch from 466200d to 7ae5c33 Compare June 29, 2023 03:48
@codecov
Copy link

codecov bot commented Jun 29, 2023

Codecov Report

Merging #6193 (e85c483) into develop (6c643be) will decrease coverage by 1.31%.
The diff coverage is 0.00%.

❗ Current head e85c483 differs from pull request most recent head dc11249. Consider uploading reports for the commit dc11249 to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #6193      +/-   ##
===========================================
- Coverage    44.93%   43.63%   -1.31%     
===========================================
  Files          427      318     -109     
  Lines        28042    24656    -3386     
  Branches       352        0     -352     
===========================================
- Hits         12601    10758    -1843     
+ Misses       14361    12905    -1456     
+ Partials      1080      993      -87     
Flag Coverage Δ
bedrock-go-tests 43.63% <0.00%> (-0.10%) ⬇️
cannon-go-tests ?
common-ts-tests ?
contracts-bedrock-tests ?
core-utils-tests ?
fault-detector-tests ?

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

Impacted Files Coverage Δ
op-node/withdrawals/utils.go 4.89% <0.00%> (+0.72%) ⬆️

... and 113 files with indirect coverage changes

Copy link
Contributor

@trianglesphere trianglesphere left a comment

Choose a reason for hiding this comment

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

Thanks for cleaning this up

@mergify
Copy link
Contributor

mergify bot commented Jun 30, 2023

This PR has been added to the merge queue, and will be merged soon.

@mergify
Copy link
Contributor

mergify bot commented Jun 30, 2023

This PR is next in line to be merged, and will be merged as soon as checks pass.

@mergify
Copy link
Contributor

mergify bot commented Jun 30, 2023

This PR is next in line to be merged, and will be merged as soon as checks pass.

@OptimismBot OptimismBot merged commit c264ed2 into develop Jun 30, 2023
@OptimismBot OptimismBot deleted the aj/e2e-withdrawal-timing branch June 30, 2023 15:39
@mergify mergify bot removed the on-merge-train label Jun 30, 2023
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.

3 participants