-
Notifications
You must be signed in to change notification settings - Fork 998
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
Transaction Type representation in the Merge #2608
Comments
@mkalinin @MicahZoltu @djrtwo please take a look |
I like option 1. Any thoughts on having 2 types for "legacy transactions" though, one for pre-155 (without chainID) and one for post-155 (with chainID)? If we are going to give a type to legacy transactions, it would be nice to have them be separate types. |
Option 1 seems the most reasonable to me. @MicahZoltu why do you think we should care about pre-155 transactions after the Merge? |
They are technically different transaction types, they just have the same shape so they are difficult to differentiate. If we are going to give them type numbers, we should just do it right and give both types their own number to ease differentiation across the ecosystem. |
I was thinking that pre-155 transaction format is not used by anyone as migrating to post-155 doesn't require any changes on the dapp layer and is rather a matter of software upgrade. Thus, |
Pre-155 is still used when you want a transaction that is intentionally replayable across networks to allow for deterministic contract addresses. It would be cool to introduce this as a built-in feature like making a CREATE2 pre-compile, but at the moment we don't have any such thing so we cannot deprecate 155. |
I see! Then why don't we have this two types distinguished by the EIP? I would not stem from the EIP designing this part of the beacon chain. |
EIP-155 was before we had typed transactions. When we introduced EIP-2718: Typed Transactions there was discussion of creating a new transaction type for legacy transactions or two new transaction types for pre-155 and post-155. I think we didn't follow through with it just because it was deemed unnecessary since we would still need to support legacy transactions for some indefinite period of time. With the introduction of the beacon chain however, the argument that "we have to support legacy forever" no longer holds since beacon chain is starting from a clean slate. In this case, I would prefer to start from the cleanest slate possible which IMO would mean separate pre-155 and post-155 transaction types. |
You mean we do the following at the Merge:
And we would need these changes to be specified in a separate EIP. Did I get this right? Also, |
I suspect that convincing the client teams to fully deprecate legacy transactions before or with the merge will not go over well, so I propose we only implement this new typing scheme in the consensus layer stuff which doesn't currently have the legacy baggage. At a later point in time we can apply a similar change (using the same numbers) to execution client gossip, transaction trie, and receipt trie. This would mean that for now we just need to pick two numbers ( |
I would suggest to have them specified on the execution layer and passing the ACD governance first. Adding these numbers on the consensus layer would be straightforward (requiring HF though). Starting to make this change from the consensus layer looks like an inversion and seems useless without the corresponding update on the execution layer. |
IIUC, consensus layer needs a decision prior to the merge (code needs to be written), and the execution layer refuses to write any new code (or even discuss execution layer changes) prior to the merge, which is why I think it is politically not realistic to make the decision at the execution layer first. Maybe since the consensus layer needs a decision we can force the execution teams to think about the problem as part of required The Merge work? |
We may introduce the change proposed by this issue (Option 1) and then when new transaction types are decided to be added to the execution layer it may also be reflected on the consensus layer. There is no need to introduce new transaction types in advance. |
Resolved in #2684, closing this |
Problem
The transaction typing forward-compatibility is broken:
due to double transaction type identification, and the execution engine only recognizing the first,
introducing additional types to the current
Union
definition is not possible.Background
The current Merge spec defines transactions and payloads as:
So in JSON this looks like:
The Merge API then just uses:
Read: Merge API uses a list of
OpaqueTransaction
, not a list ofUnion[OpaqueTransaction]
And the
block_hash
(execution layer hash, same as eth1 today) is constructed by hashing the header,which includes a transactions-trie, which is built from EIP-2718 transactions, not from
Transaction
withUnion
selector data."Why do we even have this
Union
?" you may ask, well:The benefit of
Union
:The problems of
Union
:selector
byte and EIP-2718 byte are different, can be confusingThis is kind of messy, and for new things like Rollups using the same Execution Engine API,
we definitely want typed transactions to just work and not break the next hardfork after the Merge.
Proposal to fix
There are a few ways this can improve:
Union[OpaqueTransaction]
with union-selector, keep 2 layers of ids1. Translate EIP-2718 transaction IDs into the Union type, and translate back before insertion into execution layer
Union
type benefitsCommitmentContainer
extension to SSZ we can be even more forward compatible2. Update the execution layer to parse
Union[OpaqueTransaction]
with union-selector, keep 2 layers of idsThis likely requires another transaction typing EIP, and seems way more complex and unnecessary than the other solutions.
But this is what it is like if we keep
Union
and expect the execution engine to just handle it.Just for illustration:
transaction index -> Union[OpaqueTransaction]
selector
andvalue
fields everywhere3. Drop the Union idea
Union
(losing type-structured merkleization of future types, losing transaction-type mix-in for easy type proof, etc.)CommitmentContainer
proposal) benefitsMy opinion
Union
And you could think of variants of Option 1 that try and combine transaction types 0, 1 and 2 but consistency between Union selector and EIP-2718 type identifier seems more important.
The text was updated successfully, but these errors were encountered: