signTransaction API bug-fixes: Mark the tx as private before signing #864
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
eth_signTransaction
: Fixes bug when signing private txs with this API and then submitting them (e.g. witheth_sendRawPrivateTransaction
).Prior to this change, the tx is only marked as private after signing, so it is signed with the EIP155 signer. The signed tx's
v
is then overridden to37
. As a result, when callingeth_sendRawPrivateTransaction
, the recipient attempts to verify the signature using the QuorumPrivateTx signer, recovering the incorrect address.There are two outcomes for the transaction once submitted, depending on the nonce of the tx:
0
the tx will be minted but have the incorrectfrom
value0
the tx will get stuck queued in the txpool as the recovered, wrong, acct will have a tx count of 0.personal_signTransaction
: Fixes bug where signed private txs cannot be submitted usingeth_sendRawPrivateTransaction
. Prior to this change, the tx is never marked as private so any request toeth_sendRawPrivateTransaction
fails with error"transaction is not private"