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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix RLP encoding error #743

Merged
merged 1 commit into from Feb 6, 2019

Conversation

Projects
None yet
3 participants
@LLFourn
Copy link
Contributor

LLFourn commented Feb 5, 2019

Ethereum apparently expects that signature components do not start
with 0x00 (i.e be treated as RLP integers) Why? No body knows.

So we have to wrap the (R,s) values in U256s so they encode properly.

馃う

Fix #740.

@wafflebot wafflebot bot added the review label Feb 5, 2019

@D4nte D4nte added this to the Sprint 8 馃懍馃 milestone Feb 5, 2019

@@ -44,8 +44,8 @@ impl<'a> SignedTransaction<'a> {

impl<'a> Encodable for SignedTransaction<'a> {
fn rlp_append(&self, stream: &mut RlpStream) {
let r = &self.signature.0[0..32];
let s = &self.signature.0[32..64];
let r = U256::from(&self.signature.0[0..32]);

This comment has been minimized.

@D4nte

D4nte Feb 5, 2019

Member

as mentioned, please as add a comment 馃く

This comment has been minimized.

@LLFourn

LLFourn Feb 6, 2019

Author Contributor

Done.

Fix RLP encoding error
Ethereum apparently expects that signature components do not start
with 0x00 (i.e be treated as RLP integers) Why? No body knows.

So we have to wrap the (R,s) values in U256s so they encode properly.

馃う

@LLFourn LLFourn force-pushed the rlp_encoing_error branch from 647ab7a to a445160 Feb 6, 2019

// For some reason Ethereum thinks that the (r,s) of a ECDSA
// signature should be encoded as integers which means they
// cannot start with 0x00 and be a valid RLP encoding. So we
// wrap them in U256s so they RLP encode correctly. 馃う

This comment has been minimized.

@thomaseizinger

thomaseizinger Feb 6, 2019

Member

Love the emoji 馃槀

@D4nte

D4nte approved these changes Feb 6, 2019

Copy link
Member

D4nte left a comment

馃く

@D4nte D4nte merged commit 080017e into master Feb 6, 2019

1 check passed

license/cla Contributor License Agreement is signed.
Details

@D4nte D4nte deleted the rlp_encoing_error branch Feb 6, 2019

@wafflebot wafflebot bot removed the review label Feb 6, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can鈥檛 perform that action at this time.