-
Notifications
You must be signed in to change notification settings - Fork 20.2k
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
core/types: add derived chain ID to LegacyTx JSON encoding #27452
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple nits, but I think this change is okay. The api spec currently has chainid
as an optional field for transaction objects. So this will still be within spec. Since it is only adding a field, it should be backward compatible.
Adding to triage. Main question I have is now legacy transactions don't check if the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, if this feature is something we want
For legacy transactions ChainID is optional (missing in pre-[EIP155](https://eips.ethereum.org/EIPS/eip-155) transactions) and is derived from `V` anyway. Also, cherry pick ethereum/go-ethereum#27452.
…27452) Co-authored-by: lightclient <14004106+lightclient@users.noreply.github.com>
…thereum#27452)" This reverts commit 120956b.
…thereum#27452)" This reverts commit 120956b.
When marshalling a legacy type transaction to JSON, the chain ID field is always omitted, despite the fact that it can be derived using the signature values after EIP-155.
This change adds the chain ID to a legacy transaction's JSON encoding when it can be derived.
If the transaction is not signed or is pre EIP-155, the chain ID will be omitted.