-
Notifications
You must be signed in to change notification settings - Fork 1k
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
electra engine api support #13978
electra engine api support #13978
Conversation
return blocks.WrappedExecutionPayloadDeneb( | ||
&pb.ExecutionPayloadDeneb{ | ||
return blocks.WrappedExecutionPayloadElectra( | ||
&pb.ExecutionPayloadElectra{ |
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.
We are missing DepositReceipts
and WithdrawalRequests
here. I think we will need an ExecutionPayloadBodyV2
and a new version of engine_getPayloadBodiesByRoot
to accompany that
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.
This is going to be a bigger change and still a little ambiguous with upstream specs. Can we handle this in a follow-up PR?
} | ||
|
||
func (j *ExecutionPayloadElectraJSON) ElectraDepositReceipts() []*DepositReceipt { | ||
rcpt := make([]*DepositReceipt, 0, len(j.DepositRequests)) |
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.
Is there a reason why we dont want to define the size make([]*DepositReceipt, len(j.DepositRequests))
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.
Not really, I can write it the other way if you prefer!
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.
changed it create the fixed size slices and assign to index
if j.ExcessBlobGas == nil { | ||
return errors.New("missing required field 'excessBlobGas' for ExecutionPayload") | ||
} | ||
return nil |
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.
Do we need check for nils here for deposit receipts and withdrawal requests?
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 think if those fields are not present in the EL response, their keys could be omitted in the response? In which case the unmarshaled fields would be an empty list or possibly nil.
If those fields are either nil or empty lists, eg ElectraExecutionLayerWithdrawalRequests
will return an empty list as len
and range
are safe on nil list values. So I think it's safe for them to be nil as far as the unmarshaling process is concerned, and I think we probably don't want to treat such a payload as invalid. This is equivalent to how we deal with Withdrawals:
if dec.ExecutionPayload.Withdrawals == nil {
dec.ExecutionPayload.Withdrawals = make([]*Withdrawal, 0)
}
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
* electra engine api support * add marshaling support for ExecutionPayloadElectra * add receipts to json tests * deep source * simplify slice handling * deep source lint about type/method order --------- Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
* electra engine api support * add marshaling support for ExecutionPayloadElectra * add receipts to json tests * deep source * simplify slice handling * deep source lint about type/method order --------- Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
What type of PR is this?
Feature
What does this PR do? Why is it needed?
Adds support for interacting with the prague engine api to support the electra fork.