Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trie: test for edgecase in VerifyRangeProof #24257

Merged
merged 3 commits into from Jan 21, 2022

Conversation

darioush
Copy link
Contributor

@darioush darioush commented Jan 19, 2022

This is probably a case where I am setting up something incorrectly, though the test fails when I remove the 1st elements of keys and vals (but passes otherwise). I was hoping you could take a look, since I couldn't exactly figure it out.

I'm assuming it's because there's a shared prefix on the keys, though not sure.

This is the stack trace I am getting:

panic: trie.hashNode: invalid node: <a94e2bd8ee1e6b49b14831e8bd8a7fa01f4582bd1c22e514468c62ee05ca144e>

goroutine 19 [running]:
testing.tRunner.func1.2({0x43a35a0, 0xc000212620})
	/usr/local/Cellar/go/1.17.2/libexec/src/testing/testing.go:1209 +0x36c
testing.tRunner.func1()
	/usr/local/Cellar/go/1.17.2/libexec/src/testing/testing.go:1212 +0x3b6
panic({0x43a35a0, 0xc000212620})
	/usr/local/Cellar/go/1.17.2/libexec/src/runtime/panic.go:1047 +0x266
github.com/ethereum/go-ethereum/trie.hasRightElement({0x445dc38, 0xc00018ea00}, {0xc0001a2ac0, 0x20, 0x40})
	/.../go-ethereum/trie/proof.go:431 +0x579
github.com/ethereum/go-ethereum/trie.VerifyRangeProof({0x60, 0x78, 0xfa, 0xa7, 0x31, 0x9c, 0x98, 0x7c, 0x67, 0xe5, ...}, ...)
	/.../go-ethereum/trie/proof.go:566 +0x10eb

@holiman
Copy link
Contributor

holiman commented Jan 21, 2022

Thanks for the PR! Good find

@holiman
Copy link
Contributor

holiman commented Jan 21, 2022

I've rebased this on master, and removed the todo left there. Should be good to go now

@holiman holiman added this to the 1.10.16 milestone Jan 21, 2022
Copy link
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

@holiman holiman changed the title trie/proof: edge case for VerifyRangeProof trie: test for edgecase in VerifyRangeProof Jan 21, 2022
@holiman holiman merged commit 2dfa4bc into ethereum:master Jan 21, 2022
sidhujag pushed a commit to syscoin/go-ethereum that referenced this pull request Jan 21, 2022
* trie/proof: edge case for VerifyRangeProof

* more consistency with other tests in the file

* trie: fix test todo

Co-authored-by: Martin Holst Swende <martin@swende.se>
ValentinTrinque pushed a commit to vegaprotocol/go-ethereum that referenced this pull request Jan 25, 2022
* trie/proof: edge case for VerifyRangeProof

* more consistency with other tests in the file

* trie: fix test todo

Co-authored-by: Martin Holst Swende <martin@swende.se>
MariusVanDerWijden pushed a commit to MariusVanDerWijden/go-ethereum that referenced this pull request Jan 27, 2022
* trie/proof: edge case for VerifyRangeProof

* more consistency with other tests in the file

* trie: fix test todo

Co-authored-by: Martin Holst Swende <martin@swende.se>
JacekGlen pushed a commit to JacekGlen/go-ethereum that referenced this pull request May 26, 2022
* trie/proof: edge case for VerifyRangeProof

* more consistency with other tests in the file

* trie: fix test todo

Co-authored-by: Martin Holst Swende <martin@swende.se>
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.

None yet

2 participants