Skip to content

Commit e5b6f44

Browse files
committed
fix: address code review feedback
- Add comment clarifying proveCommittedBatchState uses eth_call as dry-run validation before sending the actual shadow tx - Skip shadow tx when dry-run validation fails (continue instead of falling through) - Align alloy-primitives version (1.5.6 -> 1.5.7) with Cargo.lock - Add trailing newline to .gitignore
1 parent 5ccc78a commit e5b6f44

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

prover/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ out
2727
lib
2828

2929
proof
30-
state
30+
state

prover/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ alloy-genesis = { version = "1.6.3", default-features = false, features = [
8484
] }
8585
alloy-json-rpc = { version = "1.6.3", default-features = false }
8686
alloy-network = { version = "1.6.3", default-features = false }
87-
alloy-primitives = { version = "1.5.6", default-features = false, features = [
87+
alloy-primitives = { version = "1.5.7", default-features = false, features = [
8888
"sha3-keccak",
8989
"map-hashbrown",
9090
] }

prover/bin/shadow-prove/src/shadow_prove.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,19 +200,21 @@ where
200200

201201
log::info!(">Starting prove state onchain, batch index = {:#?}", batch_index);
202202
let aggr_proof = Bytes::from(prove_result.proof_data);
203+
// Dry-run via eth_call to validate the proof before sending the actual shadow tx.
203204
match self
204205
.l1_rollup
205206
.proveCommittedBatchState(batch_header.clone(), aggr_proof.clone())
206207
.call()
207208
.await
208209
{
209210
Ok(_) => log::info!(
210-
"proveCommittedBatchState call success, batch index = {:#?}",
211+
"proveCommittedBatchState dry-run success, batch index = {:#?}",
211212
batch_index
212213
),
213214
Err(e) => {
214-
log::error!("proveCommittedBatchState call error: {:#?}", e);
215+
log::error!("proveCommittedBatchState dry-run failed: {:#?}", e);
215216
METRICS.shadow_verify_result.set(2);
217+
continue;
216218
}
217219
}
218220
let shadow_tx = self.l1_shadow_rollup.proveState(batch_index, aggr_proof);

0 commit comments

Comments
 (0)