go-ethereum/trie
Martin HS c8c8d6c403
trie: add edgecase for rangeproof correctness (#31667)
This PR adds checking for an edgecase which theoretically can happen in
the range-prover. Right now, we check that a key does not overwrite a
previous one by checking that the key is increasing. However, if keys
are of different lengths, it is possible to create a key which is
increasing _and_ overwrites the previous key. Example: `0xaabbcc`
followed by `0xaabbccdd`.

This can not happen in go-ethereum, which always uses fixed-size paths
for accounts and storage slot paths in the trie, but it might happen if
the range prover is used without guaranteed fixed-size keys.

This PR also adds some testcases for the errors that are expected.
2025-04-28 14:37:02 +08:00
..
trienode all: update license comments and AUTHORS (#31133) 2025-02-05 23:01:17 +01:00
utils all: update license comments and AUTHORS (#31133) 2025-02-05 23:01:17 +01:00
bytepool.go trie: reduce allocations in stacktrie (#30743) 2025-01-23 10:17:12 +01:00
committer.go trie: optimize memory allocation (#30932) 2025-03-25 14:59:44 +01:00
database_test.go core, trie, triedb: minor changes from snapshot integration (#30599) 2024-10-18 17:06:31 +02:00
encoding.go trie: reduce allocations in stacktrie (#30743) 2025-01-23 10:17:12 +01:00
encoding_test.go trie: reduce allocs in recHash (#27770) 2023-08-18 22:41:19 +02:00
errors.go all: fix various typos (#29600) 2024-04-23 13:09:42 +03:00
hasher.go trie: optimize memory allocation (#30932) 2025-03-25 14:59:44 +01:00
iterator.go trie: iterate values pre-order and fix seek behavior (#27838) 2024-06-04 11:17:26 +08:00
iterator_test.go core, trie, triedb: minor changes from snapshot integration (#30599) 2024-10-18 17:06:31 +02:00
node.go trie: optimize memory allocation (#30932) 2025-03-25 14:59:44 +01:00
node_enc.go trie: reduce allocations in stacktrie (#30743) 2025-01-23 10:17:12 +01:00
node_test.go trie: improve node rlp decoding performance (#25357) 2022-08-19 00:39:47 +02:00
proof.go trie: add edgecase for rangeproof correctness (#31667) 2025-04-28 14:37:02 +08:00
proof_test.go trie: add edgecase for rangeproof correctness (#31667) 2025-04-28 14:37:02 +08:00
secure_trie.go trie: copy preimage store pointer in StateTrie.Copy (#31158) 2025-02-12 09:55:00 +08:00
secure_trie_test.go core/state, eth/protocols, trie, triedb/pathdb: remove unused error from trie Commit (#29869) 2024-06-12 12:23:16 +03:00
stacktrie.go trie: reduce allocations in stacktrie (#30743) 2025-01-23 10:17:12 +01:00
stacktrie_fuzzer_test.go trie: do not expect ordering in stacktrie during fuzzing (#31170) 2025-02-18 10:48:42 +08:00
stacktrie_test.go trie: reduce allocations in stacktrie (#30743) 2025-01-23 10:17:12 +01:00
sync.go trie: update the valid function comments (#29809) 2024-05-21 19:53:34 +08:00
sync_test.go core, trie, triedb: minor changes from snapshot integration (#30599) 2024-10-18 17:06:31 +02:00
tracer.go trie, consensus/clique: use maps.Clone (#29616) 2024-04-24 14:27:58 +02:00
tracer_test.go core/state, eth/protocols, trie, triedb/pathdb: remove unused error from trie Commit (#29869) 2024-06-12 12:23:16 +03:00
trie.go trie: optimize memory allocation (#30932) 2025-03-25 14:59:44 +01:00
trie_id.go all: update license comments and AUTHORS (#31133) 2025-02-05 23:01:17 +01:00
trie_reader.go triedb/pathdb: configure different node hasher in pathdb (#31008) 2025-01-10 20:51:19 +08:00
trie_test.go trie: optimize memory allocation (#30932) 2025-03-25 14:59:44 +01:00
verkle.go all: update license comments and AUTHORS (#31133) 2025-02-05 23:01:17 +01:00
verkle_test.go all: update license comments and AUTHORS (#31133) 2025-02-05 23:01:17 +01:00