Skip to content

trie: fix range prover#22210

Merged
holiman merged 2 commits intoethereum:masterfrom
rjl493456442:fix-trie-prover
Jan 22, 2021
Merged

trie: fix range prover#22210
holiman merged 2 commits intoethereum:masterfrom
rjl493456442:fix-trie-prover

Conversation

@rjl493456442
Copy link
Copy Markdown
Member

Fixes the issue described #22179 (comment)

It's a special case that the trie only has a single trie node and the range proof only contains a single element.

TRACE[01-20|15:53:31.702] Fetching range of accounts               id=nice-a reqid=4037200794235010051 root="c2661f…b0463a" origin="000000…000000" limit="0fffff…ffffff" bytes=512.00KiB
TRACE[01-20|15:53:31.702] Delivering range of accounts             id=nice-a reqid=4037200794235010051 hashes=1 accounts=1 proofs=1 bytes=210.00B
panic: interface conversion: trie.node is nil, not *trie.fullNode

goroutine 20 [running]:
github.com/ethereum/go-ethereum/trie.unsetInternal(0xa5c2a0, 0xc00007ed70, 0xc00002b9a0, 0x41, 0x41, 0xc00002b9f0, 0x41, 0x41, 0x20, 0xa5c1a0)
	/home/user/go/src/github.com/ethereum/go-ethereum/trie/proof.go:302 +0xd65
github.com/ethereum/go-ethereum/trie.VerifyRangeProof(0x6657bd231f66c2, 0x723c83101df021d9, 0xea1a61864a975b5e, 0x3a46b00c81ac76fa, 0xc00014a630, 0x20, 0x20, 0xc000352400, 0x20, 0x20, ...)
	/home/user/go/src/github.com/ethereum/go-ethereum/trie/proof.go:563 +0x7e5
github.com/ethereum/go-ethereum/eth/protocols/snap.(*Syncer).OnAccounts(0xc000147b00, 0xa62960, 0xc00016a3f0, 0x380704bb7b4d7c03, 0xc0003522a0, 0x1, 0x1, 0xc00034c140, 0x1, 0x1, ...)
	/home/user/go/src/github.com/ethereum/go-ethereum/eth/protocols/snap/sync.go:2033 +0x876
github.com/ethereum/go-ethereum/eth/protocols/snap.defaultAccountRequestHandler(0xc00016a3f0, 0x380704bb7b4d7c03, 0x6657bd231f66c2, 0x723c83101df021d9, 0xea1a61864a975b5e, 0x3a46b00c81ac76fa, 0x0, 0x0, 0x0, 0x0, ...)
	/home/user/go/src/github.com/ethereum/go-ethereum/eth/protocols/snap/sync_test.go:220 +0x11b
created by github.com/ethereum/go-ethereum/eth/protocols/snap.(*testPeer).RequestAccountRange
	/home/user/go/src/github.com/ethereum/go-ethereum/eth/protocols/snap/sync_test.go:162 +0x365

Copy link
Copy Markdown
Contributor

@holiman holiman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, minor comments

Comment thread trie/proof.go Outdated
Comment thread trie/proof.go Outdated
Comment thread trie/proof.go Outdated
@holiman holiman merged commit 9e1bd0f into ethereum:master Jan 22, 2021
@holiman holiman added this to the 1.10.0 milestone Jan 22, 2021
@karalabe
Copy link
Copy Markdown
Member

Erm, doesn't this PR always return false?

@karalabe
Copy link
Copy Markdown
Member

Oh, there was a true, just in a new return line so it didn't get extra-highlighted. Sry for the noise.

@rjl493456442
Copy link
Copy Markdown
Member Author

bulgakovk pushed a commit to bulgakovk/go-ethereum that referenced this pull request Jan 26, 2021
Fixes a special case when the trie only has a single trie node and the range proof only contains a single element.
gzliudan pushed a commit to gzliudan/XDPoSChain that referenced this pull request Jun 9, 2025
Fixes a special case when the trie only has a single trie node and the range proof only contains a single element.
gzliudan pushed a commit to gzliudan/XDPoSChain that referenced this pull request Jun 25, 2025
Fixes a special case when the trie only has a single trie node and the range proof only contains a single element.
gzliudan added a commit to XinFinOrg/XDPoSChain that referenced this pull request Jul 11, 2025
Fixes a special case when the trie only has a single trie node and the range proof only contains a single element.

Co-authored-by: gary rong <garyrong0905@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants