Skip to content

Commit

Permalink
removal_records_integrity: audit preloaded data
Browse files Browse the repository at this point in the history
Add audit of preloaded data, without auditing at the end. This is done
this way because this check is unfortunately very expensive for the
removal records which contains a `ChunkDictionary` field which is a list
of variable-sized elements.

This check adds ~25% to the cost of this program, and the cost scales
linearly with the number of inputs.

A profile reveals the cost of this check, for both 2 and for inputs.

Cf. #190.
  • Loading branch information
Sword-Smith authored and aszepieniec committed Sep 30, 2024
1 parent a2d980d commit 54be9c2
Show file tree
Hide file tree
Showing 6 changed files with 161 additions and 63 deletions.
2 changes: 1 addition & 1 deletion benches/consensus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ mod transaction {
profile_consensus_program(cp, input, nondeterminism, name);
}

#[divan::bench(sample_count = 1, args = [COMMON])]
#[divan::bench(sample_count = 1, args = [COMMON, LARGEISH])]
fn removal_records_integrity(args: (usize, usize)) {
let (num_inputs, num_outputs) = args;
let mut test_runner = TestRunner::deterministic();
Expand Down
10 changes: 5 additions & 5 deletions benchmarks/RemovalRecordsIntegrity-2in-2out.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
{
"name": "RemovalRecordsIntegrity-2in-2out",
"benchmark_result": {
"clock_cycle_count": 29099,
"hash_table_height": 17825,
"u32_table_height": 13442,
"op_stack_table_height": 20187,
"ram_table_height": 26655
"clock_cycle_count": 38135,
"hash_table_height": 18317,
"u32_table_height": 13819,
"op_stack_table_height": 26582,
"ram_table_height": 27318
},
"case": "CommonCase"
}
Expand Down
13 changes: 13 additions & 0 deletions benchmarks/RemovalRecordsIntegrity-4in-4out.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[
{
"name": "RemovalRecordsIntegrity-4in-4out",
"benchmark_result": {
"clock_cycle_count": 78428,
"hash_table_height": 36553,
"u32_table_height": 26224,
"op_stack_table_height": 54026,
"ram_table_height": 58040
},
"case": "CommonCase"
}
]
Loading

0 comments on commit 54be9c2

Please sign in to comment.