zkMIPS / zkm

The universal zkVM empowering Ethereum as the Global Settlement Layer
https://zkm.io
MIT License
105 stars 50 forks source link

When the parameter changes, public_inputs remain unchanged #137

Closed xander42280 closed 4 months ago

xander42280 commented 5 months ago

1.

BASEDIR=test-vectors RUST_LOG=info ELF_PATH=/mnt/data/xander/test/test_proof/hello_world_mips1.22 SEG_OUTPUT=/tmp/output SEG_SIZE=262144 ARGS="123456 321" cargo run --release --example zkmips split
warning: `/mnt/data/.cargo/config` is deprecated in favor of `config.toml`
note: if you need to support cargo 1.38 or earlier, you can symlink `config` to `config.toml`
    Finished `release` profile [optimized] target(s) in 0.25s
     Running `target/release/examples/zkmips split`
[]string{"123456", "321"}
result 39629376

BASEDIR=test-vectors RUST_LOG=info SEG_FILE_NUM=2 SEG_FILE_DIR=/tmp/output SEG_SIZE=262144 cargo run --release --example zkmips aggregate_proof_all
warning: `/mnt/data/.cargo/config` is deprecated in favor of `config.toml`
note: if you need to support cargo 1.38 or earlier, you can symlink `config` to `config.toml`
    Finished `release` profile [optimized] target(s) in 0.25s
     Running `target/release/examples/zkmips aggregate_proof_all`
[2024-06-17T07:01:19Z INFO  zkmips] Process segment 0
[2024-06-17T07:01:22Z INFO  zkm::cpu::bootstrap_kernel] Bootstrapping took 21030 cycles
[2024-06-17T07:01:23Z INFO  zkm::generation] CPU halted after 283174 cycles
[2024-06-17T07:01:24Z INFO  zkm::generation] CPU trace padded to 524288 cycles
[2024-06-17T07:01:24Z INFO  zkm::generation] Trace lengths (before padding): TraceCheckpoint { arithmetic_len: 141876, cpu_len: 524288, poseidon_len: 42058, poseidon_sponge_len: 42058, logic_len: 17928, memory_len: 2714935 }
[2024-06-17T07:02:41Z INFO  plonky2::util::timing] 81.7848s to prove root first
[2024-06-17T07:02:41Z INFO  zkmips] Process segment 1
[2024-06-17T07:02:44Z INFO  zkm::cpu::bootstrap_kernel] Bootstrapping took 27222 cycles
[2024-06-17T07:02:44Z INFO  zkm::generation] CPU halted after 131428 cycles
[2024-06-17T07:02:45Z INFO  zkm::generation] CPU trace padded to 262144 cycles
[2024-06-17T07:02:45Z INFO  zkm::generation] Trace lengths (before padding): TraceCheckpoint { arithmetic_len: 41320, cpu_len: 262144, poseidon_len: 54442, poseidon_sponge_len: 54442, logic_len: 4941, memory_len: 2427913 }
[2024-06-17T07:03:43Z INFO  plonky2::util::timing] 62.6836s to prove root second
[2024-06-17T07:03:45Z INFO  plonky2::util::timing] 1.2870s to prove aggression
[2024-06-17T07:03:47Z INFO  zkmips] proof size: 412845
[2024-06-17T07:03:50Z INFO  zkmips] build finish
[2024-06-17T07:03:55Z INFO  plonky2x::backend::wrapper::wrap] Succesfully wrote common circuit data to common_circuit_data.json
[2024-06-17T07:03:55Z INFO  plonky2x::backend::wrapper::wrap] Succesfully wrote verifier data to verifier_only_circuit_data.json
[2024-06-17T07:03:55Z INFO  plonky2x::backend::wrapper::wrap] Succesfully wrote proof to proof_with_public_inputs.json
[2024-06-17T07:03:55Z INFO  plonky2::util::timing] 204.8115s to prove total time

public_inputs in proof_with_public_inputs.json

"public_inputs":[3,176,196,66,152,252,28,20,154,251,244,200,153,111,185,36,39,174,65,228,100,155,147,76,164,149,153,27,120,82,184,85,3,176,196,66,152,252,28,20,154,251,244,200,153,111,185,36,39,174,65,228,100,155,147,76,164,149,153,27,120,82,184,85]}

2.

BASEDIR=test-vectors RUST_LOG=info ELF_PATH=/mnt/data/xander/test/test_proof/hello_world_mips1.22 SEG_OUTPUT=/tmp/output SEG_SIZE=262144 ARGS="123 321" cargo run --release --example zkmips split
warning: `/mnt/data/.cargo/config` is deprecated in favor of `config.toml`
note: if you need to support cargo 1.38 or earlier, you can symlink `config` to `config.toml`
    Finished `release` profile [optimized] target(s) in 0.27s
     Running `target/release/examples/zkmips split`
[]string{"123", "321"}
result 39483
[2024-06-17T07:09:36Z INFO  zkmips] Split done 365745

BASEDIR=test-vectors RUST_LOG=info SEG_FILE_NUM=2 SEG_FILE_DIR=/tmp/output SEG_SIZE=262144 cargo run --release --example zkmips aggregate_proof_all
warning: `/mnt/data/.cargo/config` is deprecated in favor of `config.toml`
note: if you need to support cargo 1.38 or earlier, you can symlink `config` to `config.toml`
    Finished `release` profile [optimized] target(s) in 0.24s
     Running `target/release/examples/zkmips aggregate_proof_all`
[2024-06-17T07:10:52Z INFO  zkmips] Process segment 0
[2024-06-17T07:10:56Z INFO  zkm::cpu::bootstrap_kernel] Bootstrapping took 21030 cycles
[2024-06-17T07:10:56Z INFO  zkm::generation] CPU halted after 283174 cycles
[2024-06-17T07:10:57Z INFO  zkm::generation] CPU trace padded to 524288 cycles
[2024-06-17T07:10:57Z INFO  zkm::generation] Trace lengths (before padding): TraceCheckpoint { arithmetic_len: 141871, cpu_len: 524288, poseidon_len: 42058, poseidon_sponge_len: 42058, logic_len: 17928, memory_len: 2714924 }
[2024-06-17T07:12:15Z INFO  plonky2::util::timing] 82.6788s to prove root first
[2024-06-17T07:12:15Z INFO  zkmips] Process segment 1
[2024-06-17T07:12:18Z INFO  zkm::cpu::bootstrap_kernel] Bootstrapping took 27222 cycles
[2024-06-17T07:12:18Z INFO  zkm::generation] CPU halted after 130823 cycles
[2024-06-17T07:12:20Z INFO  zkm::generation] CPU trace padded to 262144 cycles
[2024-06-17T07:12:20Z INFO  zkm::generation] Trace lengths (before padding): TraceCheckpoint { arithmetic_len: 41008, cpu_len: 262144, poseidon_len: 54442, poseidon_sponge_len: 54442, logic_len: 4923, memory_len: 2425143 }
[2024-06-17T07:13:18Z INFO  plonky2::util::timing] 62.9830s to prove root second
[2024-06-17T07:13:19Z INFO  plonky2::util::timing] 1.2882s to prove aggression
[2024-06-17T07:13:21Z INFO  zkmips] proof size: 412855
[2024-06-17T07:13:25Z INFO  zkmips] build finish
[2024-06-17T07:13:29Z INFO  plonky2x::backend::wrapper::wrap] Succesfully wrote common circuit data to common_circuit_data.json
[2024-06-17T07:13:29Z INFO  plonky2x::backend::wrapper::wrap] Succesfully wrote verifier data to verifier_only_circuit_data.json
[2024-06-17T07:13:29Z INFO  plonky2x::backend::wrapper::wrap] Succesfully wrote proof to proof_with_public_inputs.json
[2024-06-17T07:13:29Z INFO  plonky2::util::timing] 205.9857s to prove total time

public_inputs in proof_with_public_inputs.json

"public_inputs":[3,176,196,66,152,252,28,20,154,251,244,200,153,111,185,36,39,174,65,228,100,155,147,76,164,149,153,27,120,82,184,85,3,176,196,66,152,252,28,20,154,251,244,200,153,111,185,36,39,174,65,228,100,155,147,76,164,149,153,27,120,82,184,85]}
eigmax commented 4 months ago

fixed by https://github.com/zkMIPS/succinctx/commit/885530166fa5895dbcd7e2db57a72e1f2c982c0d