-
Notifications
You must be signed in to change notification settings - Fork 268
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
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.
- Loading branch information
1 parent
2f1d19a
commit 5901dc2
Showing
48 changed files
with
1,114 additions
and
269 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
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
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 @@ | ||
export * from './mock_l2_block_source.js'; |
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.