-
Notifications
You must be signed in to change notification settings - Fork 234
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Prover node sends quotes on new epochs (#8864)
Modifies the prover node so it no longer automatically attempts to prove unproven blocks, but instead sends quotes to the proof coordinator. Also monitors for claims, and if one that matches the prover address is posted, only then starts a new epoch proving job. Other changes include: - Fixes `assumeProvenThroughBlockNumber` in Rollup so it fakes a claim for the epoch, otherwise `nextEpochToProve` reports an old epoch and confuses the sequencer. - Deletes the e2e-prover-node test, replacing it with the `e2e_prover/full`. Adds the `e2e_prover/full` with `FAKE_PROOFS` set to run on every PR. Deletes the `e2e_prover/with_padding` which was not testing anything (didn't even wait for the proofs). - Adds new CheatCodes class for playing around with the Rollup contract itself. - Adds new methods to the archiver for returning the current L2 slot and epoch, for retrieving blocks based on epoch number, and for determining whether an epoch is complete. - Changes the default behaviour of `SnapshotManager.publicDeployAccounts` so it doesn't wait for accounts to be proven. - Adds new env vars `PROVER_NODE_POLLING_INTERVAL_MS`, `QUOTE_PROVIDER_BASIS_POINT_FEE`, and `QUOTE_PROVIDER_BOND_AMOUNT`. - Deletes the `aztec-node-prover-coordination` wrapper and instead just works with an `AztecNode`. - Adds methods to the L1 publisher to get the epoch to prove and current claim. These methods should not go in there, or we should rename it to something more general than a publisher. Fix #8684 Fix #8683
- Loading branch information
1 parent
2fd4be9
commit 4adf860
Showing
60 changed files
with
1,342 additions
and
554 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { AZTEC_EPOCH_DURATION, AZTEC_SLOT_DURATION } from '@aztec/circuits.js'; | ||
|
||
/** Returns the slot number for a given timestamp. */ | ||
export function getSlotAtTimestamp(ts: bigint, constants: { l1GenesisTime: bigint }) { | ||
return ts < constants.l1GenesisTime ? 0n : (ts - constants.l1GenesisTime) / BigInt(AZTEC_SLOT_DURATION); | ||
} | ||
|
||
/** Returns the epoch number for a given timestamp. */ | ||
export function getEpochNumberAtTimestamp(ts: bigint, constants: { l1GenesisTime: bigint }) { | ||
return getSlotAtTimestamp(ts, constants) / BigInt(AZTEC_EPOCH_DURATION); | ||
} | ||
|
||
/** Returns the range of slots (inclusive) for a given epoch number. */ | ||
export function getSlotRangeForEpoch(epochNumber: bigint) { | ||
const startSlot = epochNumber * BigInt(AZTEC_EPOCH_DURATION); | ||
return [startSlot, startSlot + BigInt(AZTEC_EPOCH_DURATION) - 1n]; | ||
} | ||
|
||
/** Returns the range of L1 timestamps (inclusive) for a given epoch number. */ | ||
export function getTimestampRangeForEpoch(epochNumber: bigint, constants: { l1GenesisTime: bigint }) { | ||
const [startSlot, endSlot] = getSlotRangeForEpoch(epochNumber); | ||
return [ | ||
constants.l1GenesisTime + startSlot * BigInt(AZTEC_SLOT_DURATION), | ||
constants.l1GenesisTime + endSlot * BigInt(AZTEC_SLOT_DURATION), | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.