Skip to content

Commit

Permalink
n=18 ok
Browse files Browse the repository at this point in the history
  • Loading branch information
einar-polygon committed Nov 15, 2024
1 parent cb98478 commit e47731d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
4 changes: 4 additions & 0 deletions evm_arithmetization/src/generation/jumpdest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ impl JumpDestTableProcessed {
let witness_context = *batch_ctx - self.ctx_offset;
self.witness_contexts.remove(&witness_context);
}

pub fn max_batch_ctx(&self) -> usize {
self.witness_contexts.keys().max().copied().unwrap_or(0)
}
}

impl JumpDestTableWitness {
Expand Down
21 changes: 11 additions & 10 deletions evm_arithmetization/src/generation/prover_input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -826,18 +826,17 @@ impl<F: RichField> GenerationState<F> {
fn generate_jumpdest_table(&mut self) -> Result<(), ProgramError> {
let tx_in_batch_idx = self.next_txn_index - 1;
let prev_max_witness_ctx: usize = self
.inputs
.jumpdest_table
.jumpdest_tables
.get(tx_in_batch_idx - 1)
.map(|x| x.as_ref())
.flatten()
.map(|x| x.max_batch_ctx())
.unwrap_or(0);
log::info!("Maximum CTX in previous tx: {}", prev_max_witness_ctx);
log::info!("TXIDX: {}", tx_in_batch_idx);
log::info!("TX BATCH: {:#?}", self.inputs.txn_hashes);
log::info!("BATCH LEN: {}", self.inputs.txn_hashes.len());
log::info!("TXN_NUM_BEFORE: {}", self.inputs.txn_number_before);
log::info!("TX BATCH: {:#?}", self.inputs.txn_hashes);
log::info!("Maximum CTX in previous tx: {}", prev_max_witness_ctx);
log::info!("TXIDX: {}", tx_in_batch_idx);
log::info!("TX HASH: {:#?}", self.inputs.txn_hashes[tx_in_batch_idx]);
let rpcw = self.inputs.jumpdest_table[tx_in_batch_idx].clone();
let rpcp: Option<JumpDestTableProcessed> =
Expand All @@ -860,14 +859,16 @@ impl<F: RichField> GenerationState<F> {
self.jumpdest_tables[tx_in_batch_idx] = None;
let (simp, simw) = simulate_cpu_and_get_user_jumps("terminate_common", &*self)
.ok_or(ProgramError::ProverInputError(InvalidJumpdestSimulation))?;
// self.jumpdest_table = Some(simp.clone());
log::info!("SIMW {:#?}", &simw);
log::info!("SIMP {:#?}", &simp);

// if let Some(rpcp) = rpcp {
// dbg!(rpcp.as_ref().map(|x| x.normalize()), Some(&simp));
// assert_eq!(rpcp.is_super(&simp));
// }
if let Some(rpcp) = rpcp {
if &rpcp != &simp {
log::warn!("MISMATCH");
dbg!(Some(&rpcp), Some(&simp));
}
}

self.jumpdest_tables[tx_in_batch_idx] = Some(simp);
return Ok(());
}
Expand Down
1 change: 1 addition & 0 deletions zero/src/bin/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ async fn main() -> anyhow::Result<()> {
// With the default configuration trace information is written
// to stdout, but we already use stdout to write our payload (the witness).
.with_writer(std::io::stderr)
// .json()
.with_ansi(false)
.with_filter(EnvFilter::from_default_env()),
)
Expand Down

0 comments on commit e47731d

Please sign in to comment.