-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
collect_lock_scripts: audit preloaded witness
Benchmarks and profiles reveal that this is surprisingly expensive. So we only do this check at program init. This program loops over variable-sized elements *without* any range checks, so I consider this commit essential for soundness. Cf. #190.
- Loading branch information
1 parent
44eb9cd
commit f843a48
Showing
6 changed files
with
73 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[ | ||
{ | ||
"name": "CollectLockScripts-4in-4out", | ||
"benchmark_result": { | ||
"clock_cycle_count": 924, | ||
"hash_table_height": 415, | ||
"u32_table_height": 202, | ||
"op_stack_table_height": 686, | ||
"ram_table_height": 143 | ||
}, | ||
"case": "CommonCase" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,14 @@ | ||
CollectLockScripts-2in-2out: | ||
| Subroutine | Processor | Op Stack | RAM | Hash | U32 | | ||
|:---------------------------------------------------------------------------------|---------------------:|---------------------:|---------------------:|---------------------:|---------------------:| | ||
| tasmlib_hashing_algebraic_hasher_hash_varlen | 182 ( 59.5%) | 137 ( 55.0%) | 45 ( 72.6%) | 37 ( 17.5%) | 12 ( 11.8%) | | ||
| ··tasmlib_hashing_absorb_multiple | 168 ( 54.9%) | 122 ( 49.0%) | 45 ( 72.6%) | 30 ( 14.2%) | 12 ( 11.8%) | | ||
| ····tasmlib_hashing_absorb_multiple_hash_all_full_chunks | 30 ( 9.8%) | 20 ( 8.0%) | 40 ( 64.5%) | 24 ( 11.4%) | 0 ( 0.0%) | | ||
| ····tasmlib_hashing_absorb_multiple_pad_varnum_zeros | 50 ( 16.3%) | 32 ( 12.9%) | 0 ( 0.0%) | 0 ( 0.0%) | 0 ( 0.0%) | | ||
| ····tasmlib_hashing_absorb_multiple_read_remainder | 51 ( 16.7%) | 29 ( 11.6%) | 5 ( 8.1%) | 0 ( 0.0%) | 0 ( 0.0%) | | ||
| tasmlib_hashing_eq_digest | 16 ( 5.2%) | 9 ( 3.6%) | 0 ( 0.0%) | 0 ( 0.0%) | 0 ( 0.0%) | | ||
| neptune_consensus_transaction_collect_lock_scripts_write_all_lock_script_digests | 70 ( 22.9%) | 72 ( 28.9%) | 14 ( 22.6%) | 0 ( 0.0%) | 30 ( 29.4%) | | ||
| Total | 306 (100.0%) | 249 (100.0%) | 62 (100.0%) | 211 (100.0%) | 102 (100.0%) | | ||
| Subroutine | Processor | Op Stack | RAM | Hash | U32 | | ||
|:----------------------------------------------------------------------------------|---------------------:|---------------------:|---------------------:|---------------------:|---------------------:| | ||
| tasmlib_structure_verify_nd_si_integrity___CollectLockScriptsWitness | 297 ( 49.0%) | 194 ( 43.1%) | 15 ( 19.5%) | 0 ( 0.0%) | 188 ( 94.0%) | | ||
| ··tasmlib_structure_tasmobject_verify_size_indicators_dyn_elem_sizes___Utxo | 236 ( 38.9%) | 156 ( 34.7%) | 12 ( 15.6%) | 0 ( 0.0%) | 120 ( 60.0%) | | ||
| ····tasmlib_structure_tasmobject_verify_size_indicators_dyn_elem_sizes___Coin | 118 ( 19.5%) | 80 ( 17.8%) | 6 ( 7.8%) | 0 ( 0.0%) | 60 ( 30.0%) | | ||
| tasmlib_hashing_algebraic_hasher_hash_varlen | 182 ( 30.0%) | 137 ( 30.4%) | 45 ( 58.4%) | 37 ( 9.5%) | 12 ( 6.0%) | | ||
| ··tasmlib_hashing_absorb_multiple | 168 ( 27.7%) | 122 ( 27.1%) | 45 ( 58.4%) | 30 ( 7.7%) | 12 ( 6.0%) | | ||
| ····tasmlib_hashing_absorb_multiple_hash_all_full_chunks | 30 ( 5.0%) | 20 ( 4.4%) | 40 ( 51.9%) | 24 ( 6.1%) | 0 ( 0.0%) | | ||
| ····tasmlib_hashing_absorb_multiple_pad_varnum_zeros | 50 ( 8.3%) | 32 ( 7.1%) | 0 ( 0.0%) | 0 ( 0.0%) | 0 ( 0.0%) | | ||
| ····tasmlib_hashing_absorb_multiple_read_remainder | 51 ( 8.4%) | 29 ( 6.4%) | 5 ( 6.5%) | 0 ( 0.0%) | 0 ( 0.0%) | | ||
| tasmlib_hashing_eq_digest | 16 ( 2.6%) | 9 ( 2.0%) | 0 ( 0.0%) | 0 ( 0.0%) | 0 ( 0.0%) | | ||
| neptune_consensus_transaction_collect_lock_scripts_write_all_lock_script_digests | 70 ( 11.6%) | 72 ( 16.0%) | 14 ( 18.2%) | 0 ( 0.0%) | 0 ( 0.0%) | | ||
| Total | 606 (100.0%) | 450 (100.0%) | 77 (100.0%) | 391 (100.0%) | 200 (100.0%) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
CollectLockScripts-4in-4out: | ||
| Subroutine | Processor | Op Stack | RAM | Hash | U32 | | ||
|:----------------------------------------------------------------------------------|---------------------:|---------------------:|---------------------:|---------------------:|---------------------:| | ||
| tasmlib_structure_verify_nd_si_integrity___CollectLockScriptsWitness | 527 ( 57.0%) | 346 ( 50.4%) | 27 ( 18.9%) | 0 ( 0.0%) | 189 ( 93.6%) | | ||
| ··tasmlib_structure_tasmobject_verify_size_indicators_dyn_elem_sizes___Utxo | 466 ( 50.4%) | 308 ( 44.9%) | 24 ( 16.8%) | 0 ( 0.0%) | 120 ( 59.4%) | | ||
| ····tasmlib_structure_tasmobject_verify_size_indicators_dyn_elem_sizes___Coin | 236 ( 25.5%) | 160 ( 23.3%) | 12 ( 8.4%) | 0 ( 0.0%) | 60 ( 29.7%) | | ||
| tasmlib_hashing_algebraic_hasher_hash_varlen | 206 ( 22.3%) | 153 ( 22.3%) | 85 ( 59.4%) | 61 ( 14.7%) | 13 ( 6.4%) | | ||
| ··tasmlib_hashing_absorb_multiple | 192 ( 20.8%) | 138 ( 20.1%) | 85 ( 59.4%) | 54 ( 13.0%) | 13 ( 6.4%) | | ||
| ····tasmlib_hashing_absorb_multiple_hash_all_full_chunks | 54 ( 5.8%) | 36 ( 5.2%) | 80 ( 55.9%) | 48 ( 11.6%) | 0 ( 0.0%) | | ||
| ····tasmlib_hashing_absorb_multiple_pad_varnum_zeros | 50 ( 5.4%) | 32 ( 4.7%) | 0 ( 0.0%) | 0 ( 0.0%) | 0 ( 0.0%) | | ||
| ····tasmlib_hashing_absorb_multiple_read_remainder | 51 ( 5.5%) | 29 ( 4.2%) | 5 ( 3.5%) | 0 ( 0.0%) | 0 ( 0.0%) | | ||
| tasmlib_hashing_eq_digest | 16 ( 1.7%) | 9 ( 1.3%) | 0 ( 0.0%) | 0 ( 0.0%) | 0 ( 0.0%) | | ||
| neptune_consensus_transaction_collect_lock_scripts_write_all_lock_script_digests | 134 ( 14.5%) | 140 ( 20.4%) | 28 ( 19.6%) | 0 ( 0.0%) | 0 ( 0.0%) | | ||
| Total | 924 (100.0%) | 686 (100.0%) | 143 (100.0%) | 415 (100.0%) | 202 (100.0%) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters