-
Notifications
You must be signed in to change notification settings - Fork 3
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
Replace proof Verification by go-ethereum impl #3
Conversation
67039e0
to
cdf5400
Compare
It would be nice to add some extra test to this "new code". We could use the Proofs hardcoded on this test from vocdoni-node What do you think @ed255? |
- Remove the custom Merkle Patricia Trie proof verification implementation - Remove the custom RLP encoding/decoding implementation - Use the Merkle Patricia Trie proof verification function from go-ethereum - This adds support to all types of non-existence proofs - Use the RLP encoding/decoding functions from go-ethereum - Add BytesHex and SliceBytesHex to abstract encoding of byte slices in the StorageProof types
cdf5400
to
d61533d
Compare
Add proofs from https://github.com/vocdoni/vocdoni-node/blob/5b292fc7e74327f0127908636072482660b060b2/vochain/proof_test.go#L574 Add a minime storage proof of non-existence that couldn't be verified with the previous VerifyProof implementation.
I've added a new commit which will:
I had to edit the |
RLP encoding can produce even-length hex strings, i.e 0x0 means "null" for RLP. So the Marshaling/Unmarshaling should take this into account, instead of using hex.Decode() you probably want to use some specific RLP function. Or you can just list the cases where the length can be even and modify the original hex string accordingly. I.e https://github.com/vocdoni/storage-proofs-eth-go/blob/master/ethstorageproof/ethstorageproof.go#L339 |
Whenever this is addresses, ping me please :) |
LGTM now, just minor comments. You can address them or let it for a future PR. Please, "rebase and merge" yourself. |
9b1e72a
to
5224583
Compare
implementation
go-ethereum
BytesHexQuantityBytes and SliceData to abstract encoding of QUANTITY and slices of bytes inthe StorageProof types