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: Gossip Before Import #8905
Conversation
WalkthroughWalkthroughThe overall change introduces an asynchronous gossiping mechanism into a blockchain node's operation. The Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #8905 +/- ##
===========================================
- Coverage 28.61% 0.69% -27.93%
===========================================
Files 166 87 -79
Lines 7216 2155 -5061
Branches 1235 500 -735
===========================================
- Hits 2065 15 -2050
+ Misses 5030 2140 -2890
+ Partials 121 0 -121
Flags with carried forward coverage won't be shown. Click here to find out more. |
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.
Really nice changes. I don't think this will interfere much with the engine queue / controller changes. Maybe after stuff has settled down we'll want to change the Start/Confirm payload APIs.
Semgrep found 10
Named return arguments to functions must be appended with an underscore ( Semgrep found 39
Prefer |
a6b0d97
to
c015e54
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.
I think we're close - only real issue I think is making sure we clear invalid payloads in all cases.
I must admit I'm not entirely confident in my knowledge of all the logic flows in this area so would really like @trianglesphere to review before approval given he's been working in this area more recently. And to be clear, if @trianglesphere is happy to merge I'm ok with trusting him on that - no need to wait for my approval as well.
And we have the merge conflict. I think the clear logic is correct |
f1f6ce2
to
3bb2202
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.
LGTM
What
Adds "Async Gossiper" component to the derivation pipeline, and wires it into the state loop and related interfaces.
Why
There is interest in gossiping earlier in the derivation pipeline. Currently, the flow is:
We would like to insert the gossiping of the block between the receiving and reinserting of the block to avoid waiting any longer than needed before gossiping.
How
A new component has been written and added to the Driver. This component, the AsyncGossiper, is an asynchronous worker with a synchronized interface for Gossiping. The Driver passes this component down through the layers, and is used during the internal
confirmPayload
work.It also stores and can return the most recently gossiped payload. This feature allows for the derivation pipeline to reuse a payload which was created during
confirmPayload
, if the insertion failed. This is done because we want to avoid regenerating a new block at the same height if we've already begun gossiping this one. As the component is passed down through the layers, it is used byRunNextSequencerAction
to decide if there's already a usable block, and byconfirmPayload
to potentially get a cached block instead of asking the engine to rebuild one.When the
confirmPayload
function is able to reinsert the payload, it callsClear
on this component, which wipes out the stored payload. This is because the AsyncGossiper only needs to know about the payload from the time it exists, to the time it has been inserted, and any re-attempts that may live in between those two points.Testing
Notes, Nuance, Concerns
nil
as needed. There's anil
check prior to use which should guard against NPEsrollout/async
due to import cycle issues.