Skip to content
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

Closed
wants to merge 6 commits into from

Conversation

PhilWindle
Copy link
Collaborator

Please read contributing guidelines and remove this line.

@PhilWindle PhilWindle added e2e-all CI: Deprecated, use ci-full. Enable all master checks. network-all CI: Deprecated, use ci-full. Runs all CI master checks. labels Feb 14, 2025
@@ -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);
Copy link
Collaborator

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?

Comment on lines +41 to +42
private blockHashes = new Map<number, string>();
private l2Tips: L2Tips | undefined = undefined;
Copy link
Collaborator

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;
Copy link
Collaborator

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?

Copy link
Collaborator

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?

@PhilWindle PhilWindle linked an issue Feb 17, 2025 that may be closed by this pull request
spalladino added a commit that referenced this pull request Feb 21, 2025
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>
@PhilWindle PhilWindle closed this Feb 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
e2e-all CI: Deprecated, use ci-full. Enable all master checks. network-all CI: Deprecated, use ci-full. Runs all CI master checks.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

error(prover-node): unable to remove historical block
2 participants