Skip to content

op-node: handle when L1 time gap is larger than sequencer time drift#4809

Merged
mslipper merged 1 commit intodevelopfrom
fix-derivation-origin-selection
Feb 17, 2023
Merged

op-node: handle when L1 time gap is larger than sequencer time drift#4809
mslipper merged 1 commit intodevelopfrom
fix-derivation-origin-selection

Conversation

@protolambda
Copy link
Copy Markdown
Contributor

@protolambda protolambda commented Jan 31, 2023

Description

Subset of original #4758.

Handle rare case when L1 block time gap is larger than the sequencer time drift to not halt safe head.

Tests

See new unit tests to cover new sequencer time drift handling.

Invariants

  • Ensure L2 time >= L1 origin time at all times
  • Ensure max sequencer time drift is respected, but make exception to always preserve L1 Origin advancement and above invariant.

Additional context

See design doc.

Fix CLI-3354

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Jan 31, 2023

⚠️ No Changeset found

Latest commit: 48a8024

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

@trianglesphere
Copy link
Copy Markdown
Contributor

Adding a comment at

// to preserve that L2 time >= L1 time
and in the specs to clarify that we generate empty batches past the sequencer drift until the next L1 block if there is a large gap would be helpful

@github-actions
Copy link
Copy Markdown
Contributor

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 Feb 15, 2023
@protolambda protolambda force-pushed the fix-derivation-origin-selection branch from b1f2812 to 92d06e0 Compare February 16, 2023 19:02
@protolambda protolambda marked this pull request as ready for review February 16, 2023 19:06
@protolambda protolambda requested review from a team as code owners February 16, 2023 19:06
@codecov
Copy link
Copy Markdown

codecov bot commented Feb 16, 2023

Codecov Report

Merging #4809 (48a8024) into develop (e636534) will decrease coverage by 4.61%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #4809      +/-   ##
===========================================
- Coverage    40.44%   35.83%   -4.61%     
===========================================
  Files          323      183     -140     
  Lines        19549    15475    -4074     
  Branches       761        0     -761     
===========================================
- Hits          7906     5546    -2360     
+ Misses       11034     9359    -1675     
+ Partials       609      570      -39     
Flag Coverage Δ
bedrock-go-tests 35.83% <100.00%> (+0.13%) ⬆️
contracts-bedrock-tests ?
contracts-tests ?
core-utils-tests ?
dtl-tests ?
fault-detector-tests ?
sdk-tests ?

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

Impacted Files Coverage Δ
op-node/rollup/derive/batches.go 100.00% <100.00%> (+6.49%) ⬆️
...ontracts/libraries/bridge/Lib_CrossDomainUtils.sol
.../contracts-bedrock/contracts/L1/L2OutputOracle.sol
...ts-bedrock/contracts/deployment/SystemDictator.sol
.../contracts-bedrock/contracts/libraries/Hashing.sol
...bedrock/contracts/legacy/ResolvedDelegateProxy.sol
...ckages/contracts/contracts/L2/predeploys/WETH9.sol
.../contracts-bedrock/contracts/L2/L2ERC721Bridge.sol
...ntracts-bedrock/contracts/legacy/L1BlockNumber.sol
...acts-bedrock/contracts/libraries/rlp/RLPWriter.sol
... and 133 more

@protolambda
Copy link
Copy Markdown
Contributor Author

Rebasing this now, to ensure it runs on top of latest derivation changes

@protolambda protolambda force-pushed the fix-derivation-origin-selection branch from 92d06e0 to 634dd94 Compare February 16, 2023 19:38
@protolambda
Copy link
Copy Markdown
Contributor Author

will rebase to fix the lint timeout issue

@protolambda protolambda force-pushed the fix-derivation-origin-selection branch from 634dd94 to 48a8024 Compare February 16, 2023 21:29
@protolambda protolambda requested a review from mslipper February 17, 2023 16:57
Copy link
Copy Markdown
Contributor

@mslipper mslipper left a comment

Choose a reason for hiding this comment

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

LGTM. Proto walked me through this live, and we reviewed together.

@mslipper mslipper merged commit 2c892d5 into develop Feb 17, 2023
@mslipper mslipper deleted the fix-derivation-origin-selection branch February 17, 2023 17:51
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