Skip to content

Commit e05ca72

Browse files
committed
Satisfy the lint gate
`cargo fmt --all`, plus a `clone()` on a `Copy` field that the new out-of-domain tamper arm introduced.
1 parent 54c81ae commit e05ca72

6 files changed

Lines changed: 23 additions & 21 deletions

File tree

bin/cli/src/main.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,19 @@ fn keep_large_buffers_warm() {
5151
// Not fatal, but the run is then indistinguishable from one
5252
// where the knob worked — which is exactly what makes a
5353
// memory measurement unreadable. Say so.
54-
log::warn!("keep_large_buffers_warm: cannot read opt.narenas ({e}); \
55-
the oversize arena keeps jemalloc's default decay");
54+
log::warn!(
55+
"keep_large_buffers_warm: cannot read opt.narenas ({e}); \
56+
the oversize arena keeps jemalloc's default decay"
57+
);
5658
return;
5759
}
5860
};
5961
let decay = format!("arena.{huge_arena}.dirty_decay_ms\0");
6062
if let Err(e) = raw::write(decay.as_bytes(), -1i64) {
61-
log::warn!("keep_large_buffers_warm: cannot disable decay on arena \
62-
{huge_arena} ({e}); the oversize arena keeps jemalloc's default");
63+
log::warn!(
64+
"keep_large_buffers_warm: cannot disable decay on arena \
65+
{huge_arena} ({e}); the oversize arena keeps jemalloc's default"
66+
);
6367
return;
6468
}
6569
log::debug!("keep_large_buffers_warm: decay disabled on arena {huge_arena}");

crypto/crypto/src/merkle_tree/merkle.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,15 +330,20 @@ where
330330
leaves_len: usize,
331331
sibling_leaf: B::Node,
332332
) -> Option<Proof<B::Node>> {
333-
if leaves_len <= 1 || pos >= leaves_len {
333+
if leaves_len <= 1 || pos >= leaves_len || self.is_root_only() {
334334
return None;
335335
}
336336
let mut merkle_path = Vec::with_capacity(leaves_len.trailing_zeros() as usize);
337337
merkle_path.push(sibling_leaf);
338338

339339
let mut node = parent_index(pos + leaves_len - 1);
340340
while node != ROOT {
341-
merkle_path.push(self.nodes.get(sibling_index(node))?.clone());
341+
// `node_get`, not `self.nodes` directly: every other read in this
342+
// file goes through it for the disk-spill mmap indirection. The two
343+
// are mutually exclusive today — `drop_leaves` refuses an mmap-backed
344+
// tree — but a direct read would silently yield `None` here if that
345+
// ever stopped holding, and the prover's opening path unwraps this.
346+
merkle_path.push(self.node_get(sibling_index(node))?.clone());
342347
node = parent_index(node);
343348
}
344349
self.create_proof(merkle_path)

crypto/stark/src/prover.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -691,10 +691,6 @@ pub struct TableDeep<FieldExtension: IsField> {
691691
pub trace_rows: usize,
692692
/// The DEEP composition codeword, `lde_size` long.
693693
pub deep: Vec<FieldElement<FieldExtension>>,
694-
/// Where the table sits in the AIR order, carried so the batch can say
695-
/// which group each table ended up in once the codewords are sorted by
696-
/// domain rather than by position.
697-
pub air_index: usize,
698694
/// What the batch's coefficient is drawn from: this table's public round-3
699695
/// data, in the order a transcript absorbs it.
700696
///
@@ -2186,7 +2182,6 @@ pub trait IsStarkProver<
21862182
lde_size: domain.interpolation_domain_size * domain.blowup_factor,
21872183
trace_rows: domain.interpolation_domain_size,
21882184
deep,
2189-
air_index: usize::MAX,
21902185
bus_contribution: round_1_result
21912186
.bus_public_inputs
21922187
.as_ref()

prover/src/batched_verifier.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,10 @@ pub fn replay(
124124
coefficients[idx] = seed.sample_field_element();
125125
}
126126

127-
Ok(Replay { logup, coefficients })
127+
Ok(Replay {
128+
logup,
129+
coefficients,
130+
})
128131
}
129132

130133
/// Verify a batched proof of `elf_bytes`.

prover/src/logup_phase.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -626,13 +626,9 @@ pub fn run_batched(
626626
// One FRI per accumulator, and the mapping from table to group.
627627
let mut group_of = vec![usize::MAX; n];
628628
let sizes: Vec<usize> = acc.keys().copied().collect();
629-
for (&idx, _) in tables.iter().map(|(i, t)| (i, t)) {
630-
let rows = tables
631-
.iter()
632-
.find(|(i, _)| *i == idx)
633-
.map(|(_, t)| t.trace_rows)
634-
.expect("table just listed");
635-
let lde = rows * proof_options.blowup_factor as usize;
629+
for (idx, table) in tables.iter() {
630+
let lde = table.trace_rows * proof_options.blowup_factor as usize;
631+
let idx = *idx;
636632
group_of[idx] = sizes.iter().position(|s| *s == lde).ok_or_else(|| {
637633
Error::Prover(format!(
638634
"batched phase: table {idx} has no group of size {lde}"

prover/src/tests/batched_fri_tests.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,6 @@ fn alpha_moves_when_any_table_moves() {
146146
lde_size: 8,
147147
trace_rows: 4,
148148
deep: Vec::new(),
149-
air_index: seed as usize,
150149
bus_contribution: Some(FieldElement::<E>::from(seed)),
151150
main_roots: stark::prover::MainRoots {
152151
precomputed: None,
@@ -673,7 +672,7 @@ fn a_tampered_batched_proof_is_rejected() {
673672
accepted(&proof);
674673

675674
// An out-of-domain value, the other thing the fold seed binds.
676-
let orig = proof.tables[0].trace_ood.get(0, 0).clone();
675+
let orig = *proof.tables[0].trace_ood.get(0, 0);
677676
proof.tables[0].trace_ood.set(0, 0, &orig + &one);
678677
rejected(&proof, "an out-of-domain trace value");
679678
proof.tables[0].trace_ood.set(0, 0, orig);

0 commit comments

Comments
 (0)