-
Notifications
You must be signed in to change notification settings - Fork 377
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
remove preparePayload #83
Conversation
5f37782
to
f1cd8ea
Compare
f1cd8ea
to
ae7e898
Compare
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.
Looks good to me! 👍 Added a couple of minor suggestions
Got a tentative 👍 from @mkalinin out of band. Can @lightclient or @mkalinin give a final approval here? |
|
||
#### Returns | ||
None or an error | ||
|
||
`Object|Error` - Either instance of response object or an error. Response object: |
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.
Doesn't appear the errors that can be returned are described?
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.
Must we describe all errors? Anything that actually fails on the client during this call might bubble up an error. At interop, the general idea was to have return values not error under normal operation (thus SYNCING instead of "error: block missing") and for errors to actually represent errors in the operation.
Peter made it seem like if any number of things fail in geth, they'd surface that here.
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.
You can have SUCCESS
or you could be or enter into SYNCING
. In the event that something fails outside of those two, you then send an error.
Can we define all such errors?
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.
Yeah that's fair. I think the small thing that's bothering me is that Object|Error
when Error
doesn't feel very well defined. I will take a stab fixing this myself after we merge this though!
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'm not sure we should restrict errors to only those specifically specified
See discussion points below
|
||
#### Returns | ||
None or an error | ||
|
||
`Object|Error` - Either instance of response object or an error. Response object: |
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.
Must we describe all errors? Anything that actually fails on the client during this call might bubble up an error. At interop, the general idea was to have return values not error under normal operation (thus SYNCING instead of "error: block missing") and for errors to actually represent errors in the operation.
Peter made it seem like if any number of things fail in geth, they'd surface that here.
|
||
#### Returns | ||
None or an error | ||
|
||
`Object|Error` - Either instance of response object or an error. Response object: |
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.
You can have SUCCESS
or you could be or enter into SYNCING
. In the event that something fails outside of those two, you then send an error.
Can we define all such errors?
Co-authored-by: lightclient <14004106+lightclient@users.noreply.github.com>
Fair points - I'm happy to merge this PR and improve the clarity of the error codes in a subsequent PR :) |
|
||
`Object|Error` - Either instance of response object or an error. Response object: | ||
1. `status`: `String` - The result of updating the fork choice | ||
- `SUCCESS` - The fork choice is successfully updated, and if requested, the payload build process has successfully started |
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.
What is SUCCESS
status supposed to mean? Success fo receiving the call or updating the fork choice state? The former doesn't seem valuable as JSON-RPC would send a respond in any case indicating whether it's been successfully received or not. The latter implies the failure scenario, one of such scenarios is the absence of either finalized or head block coming in the method call; and if we have a success scenario signalled in the response then the failure should be signalled as well. Or we may rename SUCCESS
to ACK
to avoid confusion which won't be useful by itself but would allow for SYNCING
to be returned as an alternative.
As discussed at the amphora interop, we are combining
engine_preparePayload
functionality as an extension ofengine_forkchoiceUpdated
via an additional parameter. This avoids potential synchronicity issues that arise when the methods are decoupled.Intuitively the call semantics become
Changes enumerated below. I apologize that the diff isn't the easiest to parse:
forkchoiceUpdated
:preparePayload
PayloadAttributes
object (the former fields frompreparePayload
) for use as an optional parameter inforkchoiceUpdated
preparePayload
specs to a subset offorkchoiceUpdated
specsgetPayload
to be belowforkchoiceUpdated
to aid in readability/natural sequentiality of callspayloadId
procedurally based on input parameters (make bytes-8 instead of integer to avoid dealing with bytes to integer encoding). This greatly simplifies the requisite various return values forforkchoiceUpdated
by not needing to returnpayloadId
forkchoiceUpdated
return values. Now statusSUCCESS
orSYNCING
OR return an Error