Unverified Commit 4315bad8 authored by Andronik Ordian's avatar Andronik Ordian Committed by GitHub
Browse files

allow some overhead in MERKLE_NODE_MAX_SIZE (#3724)



* allow overhead in MERKLE_NODE_MAX_SIZE

* Update node/primitives/src/lib.rs
Co-authored-by: cheme's avatarcheme <emericchevalier.pro@gmail.com>
Co-authored-by: cheme's avatarcheme <emericchevalier.pro@gmail.com>
parent 38598678
Pipeline #154252 passed with stages
in 38 minutes and 18 seconds
......@@ -52,8 +52,10 @@ pub use disputes::{
SignedDisputeStatement, UncheckedDisputeMessage, ValidDisputeVote,
};
// For a 16-ary Merkle Prefix Trie, we can expect at most 16 32-byte hashes per node.
const MERKLE_NODE_MAX_SIZE: usize = 512;
// For a 16-ary Merkle Prefix Trie, we can expect at most 16 32-byte hashes per node
// plus some overhead:
// header 1 + bitmap 2 + max partial_key 8 + children 16 * (32 + len 1) + value 32 + value len 1
const MERKLE_NODE_MAX_SIZE: usize = 512 + 100;
// 16-ary Merkle Prefix Trie for 32-bit ValidatorIndex has depth at most 8.
const MERKLE_PROOF_MAX_DEPTH: usize = 8;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment