Skip to content

Commit 94fb493

Browse files
committed
perf(verify_mmr_successor): Use new algorithm
Rewrite the snippet to use the new algorithm introduced in `twenty-first` v0.44.1. Also: - document & sign-off on the snippet - add additional negative test cases
1 parent a8be202 commit 94fb493

File tree

4 files changed

+485
-525
lines changed

4 files changed

+485
-525
lines changed

tasm-lib/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ serde = { version = "1", features = ["derive"] }
3636
serde_json = "1"
3737
strum = { version = "0.26", features = ["derive"] }
3838
tasm-object-derive.workspace = true
39-
triton-vm = { version = "0.44.0", default-features = false }
39+
triton-vm = { version = "0.44.1", default-features = false }
4040

4141
[dev-dependencies.cargo-husky]
4242
version = "1"

tasm-lib/benchmarks/tasm_lib_mmr_verify_mmr_successor.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,22 @@
22
{
33
"name": "tasm_lib_mmr_verify_mmr_successor",
44
"benchmark_result": {
5-
"clock_cycle_count": 21555,
6-
"hash_table_height": 3738,
7-
"u32_table_height": 9291,
8-
"op_stack_table_height": 12832,
9-
"ram_table_height": 473
5+
"clock_cycle_count": 1578,
6+
"hash_table_height": 696,
7+
"u32_table_height": 1552,
8+
"op_stack_table_height": 918,
9+
"ram_table_height": 176
1010
},
1111
"case": "CommonCase"
1212
},
1313
{
1414
"name": "tasm_lib_mmr_verify_mmr_successor",
1515
"benchmark_result": {
16-
"clock_cycle_count": 63263,
17-
"hash_table_height": 12288,
18-
"u32_table_height": 17851,
19-
"op_stack_table_height": 35990,
20-
"ram_table_height": 893
16+
"clock_cycle_count": 2658,
17+
"hash_table_height": 876,
18+
"u32_table_height": 1875,
19+
"op_stack_table_height": 1518,
20+
"ram_table_height": 326
2121
},
2222
"case": "WorstCase"
2323
}

tasm-lib/src/mmr/leaf_index_to_mt_index_and_peak_index.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ use crate::traits::basic_snippet::SignOffFingerprint;
3333
/// - all output arguments are properly [`BFieldCodec`] encoded
3434
///
3535
/// [rust]: twenty_first::util_types::mmr::shared_basic::leaf_index_to_mt_index_and_peak_index
36-
#[derive(Debug, Clone, Copy, Eq, PartialEq, Hash)]
36+
#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
3737
pub struct MmrLeafIndexToMtIndexAndPeakIndex;
3838

3939
impl MmrLeafIndexToMtIndexAndPeakIndex {

0 commit comments

Comments
 (0)