panic if size is invalid

This commit is contained in:
Guillaume Ballet 2026-04-28 15:28:32 +02:00
parent 73b2cde717
commit 7c97633746
No known key found for this signature in database

View file

@ -127,7 +127,7 @@ func (t *BinaryTrie) ToDot() string {
// groupDepth specifies the number of levels per serialized group (1-8).
func NewBinaryTrie(root common.Hash, db database.NodeDatabase, groupDepth int) (*BinaryTrie, error) {
if groupDepth < 1 || groupDepth > MaxGroupDepth {
groupDepth = MaxGroupDepth // Default to 8
panic("invalid group depth size")
}
reader, err := trie.NewReader(root, common.Hash{}, db)
if err != nil {