Skip to content

Commit

Permalink
Revert "refactor(verifier): Remove authentication paths from TVM memory"
Browse files Browse the repository at this point in the history
This reverts commit 9a58641.

Revert the commits that stripped authentication paths from ND-memory
insertion, as it proved very hard to integrate downstream with Neptune
Core. I think this is OK, though, since we're checking that all size
indicators are consistent both inside the proof and on the struct-layer
above the proof.
  • Loading branch information
Sword-Smith committed Sep 23, 2024
1 parent 97ee58d commit 31ed607
Show file tree
Hide file tree
Showing 14 changed files with 924 additions and 254 deletions.
20 changes: 10 additions & 10 deletions tasm-lib/benchmarks/tasmlib_verifier_fri_verify.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@
{
"name": "tasmlib_verifier_fri_verify",
"benchmark_result": {
"clock_cycle_count": 45087,
"hash_table_height": 14784,
"u32_table_height": 17958,
"op_stack_table_height": 43009,
"ram_table_height": 17567
"clock_cycle_count": 45117,
"hash_table_height": 14802,
"u32_table_height": 17988,
"op_stack_table_height": 43025,
"ram_table_height": 17565
},
"case": "CommonCase"
},
{
"name": "tasmlib_verifier_fri_verify",
"benchmark_result": {
"clock_cycle_count": 45087,
"hash_table_height": 14784,
"u32_table_height": 17354,
"op_stack_table_height": 43009,
"ram_table_height": 17567
"clock_cycle_count": 45117,
"hash_table_height": 14802,
"u32_table_height": 17384,
"op_stack_table_height": 43025,
"ram_table_height": 17565
},
"case": "WorstCase"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
{
"name": "tasmlib_verifier_stark_verify_dynamic_inner_padded_height_256_fri_exp_4",
"benchmark_result": {
"clock_cycle_count": 195215,
"hash_table_height": 143125,
"u32_table_height": 26065,
"op_stack_table_height": 177172,
"ram_table_height": 289262
"clock_cycle_count": 195445,
"hash_table_height": 143209,
"u32_table_height": 26276,
"op_stack_table_height": 177328,
"ram_table_height": 289288
},
"case": "CommonCase"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
{
"name": "tasmlib_verifier_stark_verify_dynamic_inner_padded_height_512_fri_exp_4",
"benchmark_result": {
"clock_cycle_count": 203285,
"hash_table_height": 150817,
"u32_table_height": 33925,
"op_stack_table_height": 182354,
"ram_table_height": 290449
"clock_cycle_count": 203544,
"hash_table_height": 150901,
"u32_table_height": 33607,
"op_stack_table_height": 182530,
"ram_table_height": 290476
},
"case": "CommonCase"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
{
"name": "tasmlib_verifier_stark_verify_static_inner_padded_height_256_fri_exp_4",
"benchmark_result": {
"clock_cycle_count": 183512,
"hash_table_height": 129085,
"u32_table_height": 25825,
"op_stack_table_height": 169366,
"ram_table_height": 285363
"clock_cycle_count": 183742,
"hash_table_height": 129163,
"u32_table_height": 24623,
"op_stack_table_height": 169522,
"ram_table_height": 285389
},
"case": "CommonCase"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
{
"name": "tasmlib_verifier_stark_verify_static_inner_padded_height_512_fri_exp_4",
"benchmark_result": {
"clock_cycle_count": 191582,
"hash_table_height": 136777,
"u32_table_height": 34566,
"op_stack_table_height": 174548,
"ram_table_height": 286550
"clock_cycle_count": 191841,
"hash_table_height": 136855,
"u32_table_height": 34378,
"op_stack_table_height": 174724,
"ram_table_height": 286577
},
"case": "CommonCase"
}
Expand Down
19 changes: 9 additions & 10 deletions tasm-lib/src/neptune/neptune_like_types_for_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,15 @@ use twenty_first::prelude::MmrMembershipProof;
use twenty_first::util_types::mmr::mmr_accumulator::MmrAccumulator;

use crate::prelude::TasmObject;
use crate::verifier::proof_for_nd_memory::ProofForNdMemory;

#[derive(Debug, Clone, TasmObject, BFieldCodec, Arbitrary)]
pub(crate) struct ProofCollectionLookalike {
pub removal_records_integrity: ProofForNdMemory,
pub collect_lock_scripts: ProofForNdMemory,
pub lock_scripts_halt: Vec<ProofForNdMemory>,
pub kernel_to_outputs: ProofForNdMemory,
pub collect_type_scripts: ProofForNdMemory,
pub type_scripts_halt: Vec<ProofForNdMemory>,
pub removal_records_integrity: Proof,
pub collect_lock_scripts: Proof,
pub lock_scripts_halt: Vec<Proof>,
pub kernel_to_outputs: Proof,
pub collect_type_scripts: Proof,
pub type_scripts_halt: Vec<Proof>,
pub lock_script_hashes: Vec<Digest>,
pub type_script_hashes: Vec<Digest>,
pub kernel_mast_hash: Digest,
Expand Down Expand Up @@ -116,8 +115,8 @@ pub(crate) struct MergeWitnessLookalike {
left_kernel: TransactionKernelLookalike,
right_kernel: TransactionKernelLookalike,
new_kernel: TransactionKernelLookalike,
left_proof: ProofForNdMemory,
right_proof: ProofForNdMemory,
left_proof: Proof,
right_proof: Proof,
}

#[derive(Debug, Clone, TasmObject, BFieldCodec, Arbitrary)]
Expand Down Expand Up @@ -154,7 +153,7 @@ pub(crate) struct UpdateWitnessLookalike {
new_kernel: TransactionKernelLookalike,
old_kernel_mast_hash: Digest,
new_kernel_mast_hash: Digest,
old_proof: ProofForNdMemory,
old_proof: Proof,
new_swbfi_bagged: Digest,
new_aocl: MmrAccumulator,
new_swbfa_hash: Digest,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
pub mod claim;
pub mod fri_response;
pub mod mmr_accumulator;
pub mod mmr_membership_proof;
pub mod mmr_successor_proof;
Expand Down
Loading

0 comments on commit 31ed607

Please sign in to comment.