-
-
Notifications
You must be signed in to change notification settings - Fork 290
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
Reprocess unknown block root attestations #3564
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3564 +/- ##
==========================================
- Coverage 37.40% 37.17% -0.23%
==========================================
Files 311 312 +1
Lines 8374 8452 +78
Branches 1299 1317 +18
==========================================
+ Hits 3132 3142 +10
- Misses 5093 5161 +68
Partials 149 149 |
Code Climate has analyzed commit fbad895 and detected 3 issues on this pull request. Here's the issue category breakdown:
View more on Code Climate. |
Performance Report✔️ no performance regression detected Full benchmark results
|
@tuyennhv I've changed the design a bit as in my opinion make the change more manageable:
Please review my changes and keep them only if you agree. Please make sure I haven't broken any assumptions from our previous design |
* reprocess attestations, it should control when the attestations are ready to reprocess instead. | ||
*/ | ||
export class ReprocessController { | ||
private readonly awaitingPromisesByRootBySlot: MapDef<Slot, MapDef<RootHex, AwaitingAttestationPromise[]>>; |
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 wonder if we can make do with MapDef<Slot, MapDef<RootHex, AwaitingAttestationPromise>>
Reusing the same promise for attestations relying on the same block.
We would just be tracking the maximum wait time before resolve/reject per block.
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.
Good idea! Implemented 👍
@tuyennhv I've moved back the code to handlers to implemented #3613 in the future without nasty stuff. I think it looks decently clean now and allows for extension here:
|
thanks @dapplion , it looks great now. The latest update works well on contabo-20 👍 |
@tuyennhv File conflicts from pass attestations to the forkchoice |
c264a3c
to
fbad895
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.
Looks great!
Motivation
Right now when attestations come before the block, we ignore attestations. We should follow other clients to queue and reprocess those attestations when the block becomes known. This:
Description
Since we used to have performance issue with this
reprocess
work, the approach is quite conservativeReprocessController
to wait for the block, add awaiting promises toawaitingPromisesByRootBySlot
awaitingPromisesByRootBySlot
per clock slot since we don't want to reprocess old slot attestationsREPROCESS_MIN_TIME_TO_NEXT_SLOT_SEC
constantCloses #3560
Some considerations
js-libp2p-gossipsub
, I do this reprocess in the gossip handlerTest
I don't see any big differences with the metrics, except for the peer count with=> peer count is the same after running 2 instances for 9 days. Although total attestations reprocessed per slot is only around 20 - 60/slot, the total attestations accepted is a big difference after I leave 2 instances (contabo 19 vs cotabo 20) for 9 dayssubscribeAllSubnets
flag