Turns out we were never returning the correct From address when decoding unprotected EIP-155 transactions. This is because we were treating all txs as EIP-155, and thus using RLP(Nonce, GasPrice, Gas, To, Value, Input, ChainId, 0, 0) as the signing pre-image (where ChainId was always 0), but the correct pre-image for pre-EIP-155 unprotected transactions *those with v=27 or v=28) is just the 6-element list RLP(Nonce, GasPrice, Gas, To, Value, Input) from the yellow paper Appendix F, equations (287).
This PR fixes that and ensures that our unprotected tx test case inspects all the fields (prior to this PR the From field was wrong, all other fields were correct).
Turns out we were never returning the correct
From
address when decoding unprotected EIP-155 transactions. This is because we were treating all txs as EIP-155, and thus usingRLP(Nonce, GasPrice, Gas, To, Value, Input, ChainId, 0, 0)
as the signing pre-image (where ChainId was always0
), but the correct pre-image for pre-EIP-155 unprotected transactions *those withv=27
orv=28
) is just the 6-element listRLP(Nonce, GasPrice, Gas, To, Value, Input)
from the yellow paper Appendix F, equations(287)
.This PR fixes that and ensures that our unprotected tx test case inspects all the fields (prior to this PR the
From
field was wrong, all other fields were correct).