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

Fix eip-155 transactions not being signed correctly for large chain ids #1470

Conversation

jframe
Copy link
Contributor

@jframe jframe commented Aug 4, 2021

What does this PR do?

Fixes an issue signing EIP155 transactions that have large chain ids. Without this change signing EIP155 transactions with a large chain id such as 9218438534861846528 creates an incorrect v value and when the transaction is decoded it has an incorrect chain id.

Where should the reviewer start?

Look at the TransactionEncoder createEip155SignatureData method specifically line 67 to change the assignment of v from BigInteger.valueOf(chainId * 2) to BigInteger.valueOf(chainId).multiply(BigInteger.valueOf(2)

Why is it needed?

Without this change large chain ids are not encoded correctly in the signature data for EIP155 transactions.

@jframe jframe requested a review from conor10 as a code owner August 4, 2021 05:36
@jframe jframe force-pushed the fix_eip1559_tx_encoding_large_chainid branch from 39250f7 to f0df5d1 Compare August 4, 2021 10:05
@AlexandrouR AlexandrouR merged commit 521430f into hyperledger-web3j:master Aug 4, 2021
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.

2 participants