-
Notifications
You must be signed in to change notification settings - Fork 380
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
Engine API: Version -> Type Renaming for Static Data Structure Suffixes #369
Engine API: Version -> Type Renaming for Static Data Structure Suffixes #369
Conversation
Could you please shed some light on why replacing |
Reasoning is that we now with making the Engine API methods hardfork agnostic - see e.g. #355 - we have got two different semantics of what a "version" is in the Engine API. For methods it is an expansion of the functionality (the old functionality is still preserved), while for the static attribute types a now called "version" is just a new/different data type, not being compatible with the old one. Adding these same "V1", "V2" suffixes on both methods binds them very strongly togehter, in a sense that one is inclined to think that a "WithdrawalV1" is likely associated with e.g. "ExecutionPayloadV1", which is not the case (used in "ExecutionPayloadV2"). So my assumption is that taking this apart on the naming side will help people on differentiation and better understand the API and not mix things up. |
This is an alternative naming scheme which might be a still better option: Copying over the argumentation from a chat message:
cc @ethDreamer |
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.
I like the clarification to help distinguish between method names and types as this has been a source of confusion in conversations: V1 method behaviour vs V1 data shape.
This PR still has the issue of numbers not aligning, e.g. V2 not aligning with Type1 despite Type1 being introduced in V2.
Yet another alternative (which I'm not completely sold on myself) could be to keep the types consistent with the versions, e.g. engine_newPayloadV2 has WithdrawalV2 type, so we're really saying "TypeAssociatedWithV2Method". There would be duplication for any types that don't change, but at least it's consistent.
I do really like ExecutionPayloadCancun, but as Mikhail said, the API may change separately to the fork boundary
- [Sync](#sync) | ||
- [Payload building](#payload-building) | ||
- [Methods](#methods) | ||
- [engine\_newPayloadV1](#engine_newpayloadv1) |
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.
typos? engine\_
Just to note: this is put on hold for now after taking some feedback from client developers not giving a clear picture yet. So we can take this as PoC for one way of doing it (if we want to make changes). Will keep this open for a couple of more days for awareness and eventual follow-up discussions or comments. Otherwise I might close at some point. |
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.
I can see how the current way of distinction between different structures is confusing and personally not opposed to this change. I would give client developers more time to decide whether they do want it or not.
I think that type version should not strictly be incremental, allowing for ExecutionPayloadType6110
to exist and comply with the spec. This kind of type numbers are suitable for experimental features to discern them from a stream of hard fork versions.
- `blockValue` : `QUANTITY`, 256 Bits - The expected value to be received by the `feeRecipient` in wei | ||
* error: code and message set in case an exception happens while getting the payload. | ||
|
||
#### Specification | ||
|
||
Refer to the specification for `engine_getPayloadV2`. | ||
|
||
### engine_getBlobsBundleV1 | ||
### engine_getBlobsBundleType1 |
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.
Shouldn't we distinct method versions from structure types? I.e. shouldn't methods always be suffixed with VX
?
This was my initial thought yes. Still open to it although there are some drawbacks:
The only way to do this while maintaining the decoupling of methods from hard forks would be to design every new type to work with all hard forks. Thus instead of |
I think you could still achieve the same thing where Let's say there's a change in behaviour in You'd have
In the case of Withdrawals, you'd start at V2, so for The advantage of this approach being that for the latest blocks, engine_methodVx uses TypeVx. This advantage is most clear I think when we introduce a new Type, e.g. for Withdrawal since using a V1 type within a V2 type is confusing IMO. Main disadvantage is redundant type version increments :) As I write this, the more typing of Types I have to do, the less convinced I am about this redundant version increment approach 😆 |
Stalled and no further follow-up, will close. |
Hi @mkalinin, here is the renaming PR for the static structures in the Engine API. Please wait with merging until tomorrow sometime during the morning, I would like to get/take in another round of feedback on this.