-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
op-node: Don't invoke p2p unsafe sync for old L2 blocks #5626
Conversation
|
✅ Deploy Preview for opstack-docs canceled.
|
c2dd75c
to
363b6f1
Compare
I'm missing some context here - why can't we request these blocks from p2p? From what I understand we shouldn't be using alt-sync at all if we're syncing from L1 ( optimism/op-node/rollup/driver/state.go Lines 237 to 242 in 0d7859b
I can see that requesting really old blocks would likely cause a lot of blocks to be held in the quarantine as p2p sync walked backwards along the chain so some limit likely makes sense there, just want to properly understand the situations we'd hit that limit as it likely affects what sizing is right.
|
So there are two uses for alt-sync
I put the time check inside the P2P sync because the rpc sync should be able to request old blocks. For the P2P sync it should just fetch blocks from L1 unless they are unsafe. The alt sync ticker mostly does this, but I wanted to add a second check for this so we don't accidentally request blocks that we cannot use. |
363b6f1
to
8e59ae9
Compare
8e59ae9
to
2eb6679
Compare
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.
Ah yeah that makes sense to me. Looks good.
This PR has been added to the merge queue, and will be merged soon. |
This PR is next in line to be merged, and will be merged as soon as checks pass. |
This PR is next in line to be merged, and will be merged as soon as checks pass. |
Description
Limits when the p2p unsafe sync gets invoked to make sure that we don't request old blocks.
There is another mechanism which will limit how often a p2p request is made, but it is not
guaranteed to work.
Tests
Unit tests.