-
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
Execution API: execution requests serialization #14498
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,8 @@ import ( | |
type ExecutionPayloadElectra = ExecutionPayloadDeneb | ||
type ExecutionPayloadHeaderElectra = ExecutionPayloadHeaderDeneb | ||
|
||
// GetDecodedExecutionRequests decodes the byte array in ExecutionBundleElectra and returns a ExecutionRequests container object | ||
// based on specifications from EIP-7685 | ||
func (eb *ExecutionBundleElectra) GetDecodedExecutionRequests() (*ExecutionRequests, error) { | ||
if len(eb.ExecutionRequests) == 0 { | ||
return nil, errors.New("no execution requests found") | ||
|
@@ -93,6 +95,7 @@ func processRequestBytes( | |
return processRequestBytes(remainingBytes, requests) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think a loop instead of a recursive algorithm is better here, the tail recursion elimination in this case is simple. |
||
} | ||
|
||
// EncodeExecutionRequests is a helper function that takes a ExecutionRequests container and converts it into a hash used for `engine_NewPayloadV4` | ||
func EncodeExecutionRequests(eb *ExecutionRequests) (common.Hash, error) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Pending questions here on whether ordering would matter to the EL. cc @fjl |
||
var executionRequestBytes []byte | ||
depositBytes, err := encodeExecutionRequestsByType(0, eb.Deposits) | ||
|
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.
should this error out or return empty?
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 this should be the empty requests, we need to guarantee that the slice is not nil before though.