-
Notifications
You must be signed in to change notification settings - Fork 325
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
fix: Fix for detecting the correct blocks/epochs to prove #12014
Conversation
@@ -216,7 +216,7 @@ export class ProverNode implements EpochMonitorHandler, ProverNodeApi, Traceable | |||
|
|||
// Fast forward world state to right before the target block and get a fork | |||
this.log.verbose(`Creating proving job for epoch ${epochNumber} for block range ${fromBlock} to ${toBlock}`); | |||
await this.worldState.syncImmediate(fromBlock - 1); | |||
await this.worldState.syncImmediate(toBlock); |
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.
This is so we can check that the resulting state of re-executing a block for proving yields the expected world state roots? Otherwise some blocks may still not be on world-state?
private blockHashes = new Map<number, string>(); | ||
private l2Tips: L2Tips | undefined = undefined; |
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.
The L2TipsStore
encapsulates most of the work for keeping the "local" view of the data in sync. Maybe using it here would remove some code from this class.
this.log.trace(`Received chain proven event for block ${event.blockNumber}`); | ||
|
||
// Update our proven tip and clean any historic blocks | ||
this.l2Tips!.proven.hash = undefined; |
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.
We should be able to grab the hash from the blockHashes
map, right?
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.
Why not add the test here to e2e_epochs
to reuse most of the setup and helpers?
Fixes the prover-node's epoch monitor so it accounts for the previous epoch to be proven. The updated logic is that an epoch is ready to prove only if it is completed and it contains the first unproven block (which gets updated over a reorg). Also fixes #11840 Builds on top of @PhilWindle's #12014 --------- Co-authored-by: PhilWindle <philip.windle@gmail.com>
Please read contributing guidelines and remove this line.