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

add new RLP test #562

Closed

Conversation

ayrat555
Copy link
Contributor

@ayrat555 ayrat555 commented Dec 2, 2018

We discovered that our implementation of RLP encoding decodes some RLP binaries incorrectly after recent PR (mana-ethereum/ex_rlp#17) but it passes all RLP test cases.

This PR adds a new test case which is not covered by existing RLP tests

@winsvega
Copy link
Collaborator

winsvega commented Dec 2, 2018

the output I got with aleth:

/home/wins/Ethereum/cpp-ethereum/test/tools/jsontests/RLPTests.cpp(88): error: in "RlpTests/rlptest": (listofbinaries) Encoding Failed: expected: 0xf8a7b841299ca6acfd35e3d72d8ba3d1e2b60b5561d5af5218eb5bc182045769eb4226910a301acae3b369fffc4a4899d6b02531e89fd4fe36a2cf0d93607ba470b50f7800b840fda1cff674c90c9a197539fe3dfb53086ace64f83ed7c6eabec741f7f381cc803e52ab2cd55d5569bce4347107a310dfd5f88a010cd2ffd1005ca406f1842877a07e968bba13b6c50e2c4cd7f241cc0d64d1ac25c7f5952df231ac6a2bda8ee5d604000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
 But Computed: 0xf90450b884307832393963613661636664333565336437326438626133643165326236306235353631643561663532313865623562633138323034353736396562343232363931306133303161636165336233363966666663346134383939643662303235333165383966643466653336613263663064393336303762613437306235306637383030b88230786664613163666636373463393063396131393735333966653364666235333038366163653634663833656437633665616265633734316637663338316363383033653532616232636435356435353639626365343334373130376133313064666435663838613031306364326666643130303563613430366631383432383737b8423078376539363862626131336236633530653263346364376632343163633064363464316163323563376635393532646632333161633661326264613865653564368430783034843078303084307830308430783030843078303084307830308430783030843078303084307830308430783030843078303084307830308430783030843078303084307830308430783030843078303084307830308430783030843078303084307830308430783030843078303084307830308430783030843078303084307830308430783030843078303084307830308430783030843078303084307830308430783030843078303084307830308430783030843078303084307830308430783030843078303084307830308430783030843078303084307830308430783030843078303084307830308430783030843078303084307830308430783030843078303084307830308430783030843078303084307830308430783030843078303084307830308430783030843078303084307830308430783030843078303084307830308430783030843078303084307830308430783030843078303084307830308430783030843078303084307830308430783030843078303084307830308430783030843078303084307830308430783030843078303084307830308430783030843078303084307830308430783030843078303084307830308430783030843078303084307830308430783030843078303084307830308430783030843078303084307830308430783030843078303084307830308430783030843078303084307830308430783030843078303084307830308430783030843078303084307830308430783030843078303084307830308430783030843078303084307830308430783030843078303084307830308430783030843078303084307830308430783030843078303084307830308430783030843078303084307830308430783030843078303084307830308430783030843078303084307830308430783030843078303084307830308430783030843078303084307830308430783030843078303084307830308430783030843078303084307830308430783030843078303084307830308430783030843078303084307830308430783030

@ayrat555
Copy link
Contributor Author

ayrat555 commented Dec 3, 2018

@winsvega @holgerd77 output from rust rlp library

                let data = hex!("f8a7b841299ca6acfd35e3d72d8ba3d1e2b60b5561d5af5218eb5bc182045769eb4226910a301acae3b369fffc4a4899d6b02531e89fd4fe36a2cf0d93607ba470b50f7800b840fda1cff674c90c9a197539fe3dfb53086ace64f83ed7c6eabec741f7f381cc803e52ab2cd55d5569bce4347107a310dfd5f88a010cd2ffd1005ca406f1842877a07e968bba13b6c50e2c4cd7f241cc0d64d1ac25c7f5952df231ac6a2bda8ee5d604000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000");
                let rlp = Rlp::new(&data);

                println!("{}", rlp);
["0x299ca6acfd35e3d72d8ba3d1e2b60b5561d5af5218eb5bc182045769eb4226910a301acae3b369fffc4a4899d6b02531e89fd4fe36a2cf0d93607ba470b50f7800", "0xfda1cff674c90c9a197539fe3dfb53086ace64f83ed7c6eabec741f7f381cc803e52ab2cd55d5569bce4347107a310dfd5f88a010cd2ffd1005ca406f1842877", "0x7e968bba13b6c50e2c4cd7f241cc0d64d1ac25c7f5952df231ac6a2bda8ee5d6", "0x04", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00", "0x00"]

@ethereum ethereum deleted a comment from sea51930 Dec 3, 2018
@winsvega
Copy link
Collaborator

winsvega commented Dec 3, 2018

Could yoy post rlp that rust calculate in a hex binary string representation?

Copy link
Collaborator

@winsvega winsvega left a comment

Choose a reason for hiding this comment

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

Aleth failing on this test.

@winsvega winsvega added the expire soon outdated PR/Issue needs to be resolve or closed label Jul 10, 2019
@winsvega
Copy link
Collaborator

up

@winsvega
Copy link
Collaborator

winsvega commented Jul 25, 2019

@gumb0, do you think there is a bug in aleth RLP implementation here ?
looks like an array element that is "0x00" is treated as string 8430783030

@gumb0
Copy link
Member

gumb0 commented Jul 26, 2019

It looks like the trailing zeroes in

f8a7b841299ca6acfd35e3d72d8ba3d1e2b60b5561d5af5218eb5bc182045769eb4226910a301acae3b369fffc4a4899d6b02531e89fd4fe36a2cf0d93607ba470b50f7800b840fda1cff674c90c9a197539fe3dfb53086ace64f83ed7c6eabec741f7f381cc803e52ab2cd55d5569bce4347107a310dfd5f88a010cd2ffd1005ca406f1842877a07e968bba13b6c50e2c4cd7f241cc0d64d1ac25c7f5952df231ac6a2bda8ee5d604000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

are beyond the data size given in the prefix, i.e. it's trailing data outside of RLP.

So aleth's implementation returns "OversizeRLP" error on this.

@winsvega
Copy link
Collaborator

expired

@winsvega winsvega closed this Feb 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
expire soon outdated PR/Issue needs to be resolve or closed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants