Skip to content

feat: add artifact dumping for aggregation proof debugging#800

Closed
fakedev9999 wants to merge 4 commits intofakedev9999/prover-mainnet-readyfrom
fakedev9999/agg-save-artifacts
Closed

feat: add artifact dumping for aggregation proof debugging#800
fakedev9999 wants to merge 4 commits intofakedev9999/prover-mainnet-readyfrom
fakedev9999/agg-save-artifacts

Conversation

@fakedev9999
Copy link
Member

Summary

Add tooling to dump aggregation proof artifacts for external debugging and reproduction of failing proofs on the prover network.

New features:

  • scripts/prove/bin/agg.rs: Add --save-artifacts flag to dump program.bin (ELF) and stdin.bin (serialized SP1Stdin)
  • validity/bin/dump_proofs.rs: New binary to extract range proof BLOBs from the proposer DB for local use

Test plan

  • cargo build --bin agg --release — compiles with new flags
  • cargo build --bin dump_proofs --release — new binary compiles
  • cargo run --bin agg --release -- --help — flags are visible and documented
  • cargo run --bin dump_proofs --release -- --help — usage is clear

@fakedev9999 fakedev9999 changed the base branch from main to fakedev9999/prover-mainnet-ready February 7, 2026 12:42
@github-actions
Copy link
Contributor

github-actions bot commented Feb 7, 2026

Performance Comparison (ELF: eigenda-range-elf-embedded)

Range 1276952~1276957

Metric Base Branch Current PR Diff (%)
Total Instructions 556451419 442299650 -20.51%
Oracle Verify Cycles 46789256 42387652 -9.41%
Derivation Cycles 360910351 323340972 -10.41%
Block Execution Cycles 6857069 6458957 -5.81%
Blob Verification Cycles 728 633 -13.05%
Total SP1 Gas 893766905 660437909 -26.11%
Cycles per Block 111290283 88459930 -20.51%
Cycles per Transaction 111290283 88459930 -20.51%
BN Pair Cycles 0 0 0.00%
BN Add Cycles 0 0 0.00%
BN Mul Cycles 0 0 0.00%
KZG Eval Cycles 0 0 0.00%
EC Recover Cycles 0 0 0.00%
P256 Verify Cycles 0 0 0.00%

Add --save-artifacts and --artifacts-dir CLI flags to scripts/prove/bin/agg.rs.
When enabled, after constructing the aggregation SP1Stdin, the binary saves:
- program.bin: the aggregation ELF (~775KB)
- stdin.bin: bincode-serialized SP1Stdin with compressed proofs and aggregation inputs

This enables external debugging by allowing reproduction of failing aggregation
proofs with minimal setup overhead.
New validity/bin/dump_proofs.rs binary that connects to the proposer's Postgres
database and exports completed range proofs as BLOB files for use in local
aggregation proof debugging.

The binary:
- Queries range proofs in a given block range
- Writes each proof to data/fetched_proofs/{start}-{end}.bin
- Prints aggregation request metadata (checkpoint hash, prover address)
- Outputs a ready-to-use agg command with --save-artifacts

This streamlines the workflow for reproducing aggregation proof failures.
… tokio runtime

CpuProver::new() creates its own tokio runtime internally, causing
"Cannot start a runtime from within a runtime" panic when called from
#[tokio::main] async main. Wrap load_aggregation_proof_data body in
tokio::task::spawn_blocking, matching the pattern in lib.rs and
cost_estimator.rs.
…y check

The prover network's recursion pipeline may embed a different vk hash
in the proof's public values than what the local CpuProver recomputes,
causing verification to fail with "sp1 vk hash mismatch". This is a
known SDK-vs-network discrepancy in rc.1 and does not affect the
aggregation stdin or on-chain verification.

When --skip-verification is set, CpuProver initialization is skipped
entirely (saving ~10s), and proofs are loaded without local verification.
@fakedev9999 fakedev9999 force-pushed the fakedev9999/agg-save-artifacts branch from baa1e24 to ad71c22 Compare February 8, 2026 00:25
@fakedev9999 fakedev9999 closed this Feb 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant