Skip to content

Commit

Permalink
Merge branch 'thv/remove-auth-paths-from-tvm-memory'
Browse files Browse the repository at this point in the history
Adds bounds/sanity checks on

Enforces memory conventions in that it forces the entire Proof to live
in the ND section of memory. Also adds a new type for Proof where all
authentication paths have been stripped. Intended to be put into ND
memory.
  • Loading branch information
Sword-Smith committed Sep 23, 2024
2 parents 87a9bf7 + 04e9d72 commit 79630b2
Show file tree
Hide file tree
Showing 23 changed files with 1,071 additions and 1,019 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": 44905,
"hash_table_height": 14646,
"u32_table_height": 17928,
"op_stack_table_height": 42893,
"ram_table_height": 17534
"clock_cycle_count": 45087,
"hash_table_height": 14784,
"u32_table_height": 17958,
"op_stack_table_height": 43009,
"ram_table_height": 17567
},
"case": "CommonCase"
},
{
"name": "tasmlib_verifier_fri_verify",
"benchmark_result": {
"clock_cycle_count": 44905,
"hash_table_height": 14646,
"u32_table_height": 17324,
"op_stack_table_height": 42893,
"ram_table_height": 17534
"clock_cycle_count": 45087,
"hash_table_height": 14784,
"u32_table_height": 17354,
"op_stack_table_height": 43009,
"ram_table_height": 17567
},
"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": 194859,
"hash_table_height": 142849,
"u32_table_height": 25541,
"op_stack_table_height": 176992,
"ram_table_height": 289182
"clock_cycle_count": 195215,
"hash_table_height": 143125,
"u32_table_height": 26065,
"op_stack_table_height": 177172,
"ram_table_height": 289262
},
"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": 202884,
"hash_table_height": 150541,
"u32_table_height": 34793,
"op_stack_table_height": 182148,
"ram_table_height": 290360
"clock_cycle_count": 203285,
"hash_table_height": 150817,
"u32_table_height": 33925,
"op_stack_table_height": 182354,
"ram_table_height": 290449
},
"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": 183156,
"hash_table_height": 128803,
"u32_table_height": 25891,
"op_stack_table_height": 169186,
"ram_table_height": 285283
"clock_cycle_count": 183512,
"hash_table_height": 129085,
"u32_table_height": 25825,
"op_stack_table_height": 169366,
"ram_table_height": 285363
},
"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": 191181,
"hash_table_height": 136495,
"u32_table_height": 34185,
"op_stack_table_height": 174342,
"ram_table_height": 286461
"clock_cycle_count": 191582,
"hash_table_height": 136777,
"u32_table_height": 34566,
"op_stack_table_height": 174548,
"ram_table_height": 286550
},
"case": "CommonCase"
}
Expand Down
24 changes: 24 additions & 0 deletions tasm-lib/benchmarks/tasmlib_verifier_vm_proof_iter_drop.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[
{
"name": "tasmlib_verifier_vm_proof_iter_drop",
"benchmark_result": {
"clock_cycle_count": 13,
"hash_table_height": 12,
"u32_table_height": 0,
"op_stack_table_height": 11,
"ram_table_height": 5
},
"case": "CommonCase"
},
{
"name": "tasmlib_verifier_vm_proof_iter_drop",
"benchmark_result": {
"clock_cycle_count": 13,
"hash_table_height": 12,
"u32_table_height": 0,
"op_stack_table_height": 11,
"ram_table_height": 5
},
"case": "WorstCase"
}
]
19 changes: 10 additions & 9 deletions tasm-lib/src/neptune/neptune_like_types_for_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@ 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: 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 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 lock_script_hashes: Vec<Digest>,
pub type_script_hashes: Vec<Digest>,
pub kernel_mast_hash: Digest,
Expand Down Expand Up @@ -115,8 +116,8 @@ pub(crate) struct MergeWitnessLookalike {
left_kernel: TransactionKernelLookalike,
right_kernel: TransactionKernelLookalike,
new_kernel: TransactionKernelLookalike,
left_proof: Proof,
right_proof: Proof,
left_proof: ProofForNdMemory,
right_proof: ProofForNdMemory,
}

#[derive(Debug, Clone, TasmObject, BFieldCodec, Arbitrary)]
Expand Down Expand Up @@ -153,7 +154,7 @@ pub(crate) struct UpdateWitnessLookalike {
new_kernel: TransactionKernelLookalike,
old_kernel_mast_hash: Digest,
new_kernel_mast_hash: Digest,
old_proof: Proof,
old_proof: ProofForNdMemory,
new_swbfi_bagged: Digest,
new_aocl: MmrAccumulator,
new_swbfa_hash: Digest,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
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 79630b2

Please sign in to comment.