V1.10.2 statediff 0.0.20 #68
No reviewers
Labels
No Label
bug
critical
duplicate
enhancement
epic
help wanted
in progress
invalid
low priority
question
rebase
v1
v5
wontfix
Copied from Github
Kind/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: cerc-io/go-ethereum#68
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "v1.10.2-statediff-0.0.20"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This took a lot longer than expected. This includes the fixes to support EIP-2718/EIP-2930 transactions.
tx_type
field in thetransaction_cids
tableaccess_list_element
table which contains the access list elements which reference thetransaction_cids
tx they belong to by FKMarshalBinary
andUnmarshalBinary
methods forReceipt
. This should probably be upstreamed, they ought to already exist as they are counterparts to analogousTransaction
methods.To add to that last point:
A lot of confusion was due to these methods not existing on
Receipt
and the methods we previously used,EncodeRLP
/DecodeRLP
, now being under documented and overloaded.In particular, the
EncodeRLP
method for an EIP-2718 tx is outputtingrlp(TransactionType || TransactionPayload)
. For EIP-2930 txs this isrlp(0x01 || rlp([chainId, nonce, gasPrice, gasLimit, to, value, data, access_list, yParity, senderR, senderS]))
.This makes sense from the definition of Transaction in EIP-2718:
"Transaction is either TransactionType || TransactionPayload or LegacyTransaction"
So the RLP encoding of Transaction is either
rlp(TransactionType || TransactionPayload)
orrlp(LegacyTransaction)
.But EIP-2718 also states
"LegacyTransaction is rlp([nonce, gasPrice, gasLimit, to, value, data, v, r, s])"
So strictly following the same logic that is being used for a 2718 Transaction would suggest the output of
EncodeRLP
for a legacy Transaction should berlp(rlp([nonce, gasPrice, gasLimit, to, value, data, v, r, s]))
.When I get time I may upstream a patch to the EIP doc to help clarify this as well, but I need to give it some more thought.
In this context it is more appropriate to define
LegacyTransaction
andLegacyReceipt
in EIP-2718 as"LegacyTransaction is [nonce, gasPrice, gasLimit, to, value, data, v, r, s]" and "LegacyReceipt is [status, cumulativeGasUsed, logsBloom, logs]"
Except then the assertion that "the transaction/receipt root in the block header MUST be the root hash of patriciaTrie(rlp(Index) => Transaction)" breaks down as for legacy txs it expects
rlp([nonce, gasPrice, gasLimit, to, value, data, v, r, s])
and for 2718 it expectsTransactionType || TransactionPayload
, notrlp(TransactionType || TransactionPayload)
.Awesome work. Please make the appropriate upstream PRs. Thanks!