Skip to content

Commit 47fe812

Browse files
committed
add doc and debug_assert
1 parent 2a38a69 commit 47fe812

3 files changed

Lines changed: 17 additions & 0 deletions

File tree

prover/src/continuation.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,14 @@ fn l2g_constraints()
123123
///
124124
/// `epoch_label` is this epoch's 1-based label; it is the `fini_epoch` constant
125125
/// the fini token carries (not a trace column, since it's the same for every row).
126+
///
127+
/// Uses `empty_constraints()` deliberately: the MU boolean (`MU·(1-MU)=0`), the
128+
/// column range checks, and the `init_epoch < fini_epoch` ordering are NOT
129+
/// re-asserted here. They are enforced once in the epoch proof's `l2g_memory_air`,
130+
/// and `verify_l2g_commitment_binding` ties this global L2G sub-table to the *same*
131+
/// committed trace (equal Merkle roots). So under collision resistance the trace the
132+
/// global bus runs over already satisfies all those constraints — do not add them
133+
/// here (it would be redundant, not a missing check).
126134
fn l2g_global_air(
127135
opts: &ProofOptions,
128136
epoch_label: u64,

prover/src/tables/global_memory.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,10 @@ pub fn bus_interactions(page_base: u64) -> Vec<BusInteraction> {
189189
],
190190
),
191191
// GM-FINAL: receive the finalization token [address, fini, fini_epoch].
192+
// Note: FINI has no explicit AreBytes range check here (unlike PAGE's fini).
193+
// It's byte-checked transitively: this receiver must match an L2G fini token
194+
// on the GlobalMemory bus, and L2G already AreBytes-checks its fini value. So
195+
// a non-byte FINI could never balance. Do not "add a missing AreBytes" here.
192196
BusInteraction::receiver(
193197
BusId::GlobalMemory,
194198
Multiplicity::One,

prover/src/tables/local_to_global.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,11 @@ pub fn memory_bus_interactions() -> Vec<BusInteraction> {
409409
/// trace, so its columns inherit the same guarantee via the commitment binding.
410410
/// Keep this in sync with [`collect_bitwise_from_l2g`].
411411
pub fn range_check_interactions(epoch_label: u64) -> Vec<BusInteraction> {
412+
// `epoch_label` is a 1-based fini epoch, never `GENESIS_EPOCH` (0): genesis is
413+
// only ever an `init`/originating epoch, never a fini. The ordering term below
414+
// computes `epoch_label - 1 - init_epoch`, so a 0 label would make the constant
415+
// `-1` (field `p-1`) and no honest prover could satisfy the IsB20 check.
416+
debug_assert!(epoch_label >= 1, "epoch_label must be a 1-based fini epoch");
412417
let mut interactions = Vec::with_capacity(2 + cols::RANGE_CHECKED_HALFWORDS.len());
413418
interactions.push(BusInteraction::sender(
414419
BusId::AreBytes,

0 commit comments

Comments
 (0)