go-ethereum/cmd/devp2p/internal/ethtest
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
..
testdata all: remove ethash pow, only retain shims needed for consensus and tests (#27178) 2023-05-03 12:58:39 +03:00
chain_test.go cmd/devp2p, eth: drop eth/66 (#28239) 2023-10-03 15:03:19 +03:00
chain.go core/forkid: correctly compute forkid when timestamp fork is activated in genesis (#27895) 2023-08-16 23:31:02 +02:00
helpers.go cmd/devp2p, eth: drop eth/66 (#28239) 2023-10-03 15:03:19 +03:00
large.go all: update license headers and AUTHORS from git history (#24947) 2022-05-24 20:39:40 +02:00
snap.go trie: make rhs-proof align with last key in range proofs (#28311) 2023-10-13 16:05:29 +02:00
snapTypes.go cmd/devp2p/internal/ethtest: update tests for eth/67 (#25306) 2022-08-02 14:48:55 +02:00
suite_test.go core, accounts, eth, trie: handle genesis state missing (#28171) 2023-09-28 10:00:53 +03:00
suite.go cmd/devp2p, eth: drop eth/66 (#28239) 2023-10-03 15:03:19 +03:00
transaction.go cmd: use errrors.New instead of empty fmt.Errorf (#27329) 2023-05-24 12:21:29 +02:00
types.go cmd/devp2p, eth: drop eth/66 (#28239) 2023-10-03 15:03:19 +03:00