plugeth/core/state
Martin Holst Swende f62c58f8de
trie: make rhs-proof align with last key in range proofs (#28311)
During snap-sync, we request ranges of values: either a range of accounts or a range of storage values. For any large trie, e.g. the main account trie or a large storage trie, we cannot fetch everything at once.

Short version; we split it up and request in multiple stages. To do so, we use an origin field, to say "Give me all storage key/values where key > 0x20000000000000000". When the server fulfils this, the server provides the first key after origin, let's say 0x2e030000000000000 -- never providing the exact origin. However, the client-side needs to be able to verify that the 0x2e03.. indeed is the first one after 0x2000.., and therefore the attached proof concerns the origin, not the first key.

So, short-short version: the left-hand side of the proof relates to the origin, and is free-standing from the first leaf.

On the other hand, (pun intended), the right-hand side, there's no such 'gap' between "along what path does the proof walk" and the last provided leaf. The proof must prove the last element (unless there are no elements).

Therefore, we can simplify the semantics for trie.VerifyRangeProof by removing an argument. This doesn't make much difference in practice, but makes it so that we can remove some tests. The reason I am raising this is that the upcoming stacktrie-based verifier does not support such fancy features as standalone right-hand borders.
2023-10-13 16:05:29 +02:00
..
pruner all: activate pbss as experimental feature (#26274) 2023-08-10 22:21:36 +03:00
snapshot trie: make rhs-proof align with last key in range proofs (#28311) 2023-10-13 16:05:29 +02:00
access_list.go all: implement EIP-2929 (gas cost increases for state access opcodes) + yolo-v2 (#21509) 2020-10-23 08:26:57 +02:00
database.go all: activate pbss as experimental feature (#26274) 2023-08-10 22:21:36 +03:00
dump.go all: expose block number information to statedb (#27753) 2023-07-24 13:22:09 +03:00
iterator_test.go all: activate pbss as experimental feature (#26274) 2023-08-10 22:21:36 +03:00
iterator.go all: use rlp.DecodeBytes instead of rlp.Decode where possible (#27994) 2023-08-24 11:47:42 +03:00
journal.go core, trie: track state change set with account address (#27815) 2023-07-31 15:07:51 +03:00
metrics.go core/state: value diff tracking in StateDB (#27349) 2023-07-11 15:43:23 +02:00
state_object_test.go build: use golangci-lint (#20295) 2019-11-18 10:49:17 +02:00
state_object.go core/state: simplify storage trie update and commit (#28030) 2023-08-31 14:33:18 -04:00
state_test.go all: expose block number information to statedb (#27753) 2023-07-24 13:22:09 +03:00
statedb_fuzz_test.go core, trie: cleanup trie database (#28062) 2023-09-07 21:17:14 +08:00
statedb_test.go core/state: implement fast storage deletion (#27955) 2023-08-26 04:13:22 -04:00
statedb.go trie: remove owner and binary marshaling from stacktrie (#28291) 2023-10-11 06:12:45 +02:00
sync_test.go all: activate pbss as experimental feature (#26274) 2023-08-10 22:21:36 +03:00
sync.go all: use rlp.DecodeBytes instead of rlp.Decode where possible (#27994) 2023-08-24 11:47:42 +03:00
transient_storage.go all: implement EIP-1153 transient storage (#26003) 2022-11-16 10:18:52 +01:00
trie_prefetcher_test.go all: new empty trie with types.EmptyRootHash instead of null (#27230) 2023-05-11 10:19:42 +03:00
trie_prefetcher.go core/state: small trie prefetcher nits (#28183) 2023-09-29 17:46:23 +03:00