@@ -94,13 +94,22 @@ type executableDataMarshaling struct {
94
94
ExcessBlobGas * hexutil.Uint64
95
95
}
96
96
97
+ // StatelessPayloadStatusV1 is the result of a stateless payload execution.
98
+ type StatelessPayloadStatusV1 struct {
99
+ Status string `json:"status"`
100
+ StateRoot common.Hash `json:"stateRoot"`
101
+ ReceiptsRoot common.Hash `json:"receiptsRoot"`
102
+ ValidationError * string `json:"validationError"`
103
+ }
104
+
97
105
//go:generate go run github.com/fjl/gencodec -type ExecutionPayloadEnvelope -field-override executionPayloadEnvelopeMarshaling -out gen_epe.go
98
106
99
107
type ExecutionPayloadEnvelope struct {
100
108
ExecutionPayload * ExecutableData `json:"executionPayload" gencodec:"required"`
101
109
BlockValue * big.Int `json:"blockValue" gencodec:"required"`
102
110
BlobsBundle * BlobsBundleV1 `json:"blobsBundle"`
103
111
Override bool `json:"shouldOverrideBuilder"`
112
+ Witness * hexutil.Bytes `json:"witness"`
104
113
}
105
114
106
115
type BlobsBundleV1 struct {
@@ -115,9 +124,10 @@ type executionPayloadEnvelopeMarshaling struct {
115
124
}
116
125
117
126
type PayloadStatusV1 struct {
118
- Status string `json:"status"`
119
- LatestValidHash * common.Hash `json:"latestValidHash"`
120
- ValidationError * string `json:"validationError"`
127
+ Status string `json:"status"`
128
+ Witness * hexutil.Bytes `json:"witness"`
129
+ LatestValidHash * common.Hash `json:"latestValidHash"`
130
+ ValidationError * string `json:"validationError"`
121
131
}
122
132
123
133
type TransitionConfigurationV1 struct {
@@ -198,6 +208,20 @@ func decodeTransactions(enc [][]byte) ([]*types.Transaction, error) {
198
208
// Withdrawals value will propagate through the returned block. Empty
199
209
// Withdrawals value must be passed via non-nil, length 0 value in data.
200
210
func ExecutableDataToBlock (data ExecutableData , versionedHashes []common.Hash , beaconRoot * common.Hash ) (* types.Block , error ) {
211
+ block , err := ExecutableDataToBlockNoHash (data , versionedHashes , beaconRoot )
212
+ if err != nil {
213
+ return nil , err
214
+ }
215
+ if block .Hash () != data .BlockHash {
216
+ return nil , fmt .Errorf ("blockhash mismatch, want %x, got %x" , data .BlockHash , block .Hash ())
217
+ }
218
+ return block , nil
219
+ }
220
+
221
+ // ExecutableDataToBlockNoHash is analogous to ExecutableDataToBlock, but is used
222
+ // for stateless execution, so it skips checking if the executable data hashes to
223
+ // the requested hash (stateless has to *compute* the root hash, it's not given).
224
+ func ExecutableDataToBlockNoHash (data ExecutableData , versionedHashes []common.Hash , beaconRoot * common.Hash ) (* types.Block , error ) {
201
225
txs , err := decodeTransactions (data .Transactions )
202
226
if err != nil {
203
227
return nil , err
@@ -267,13 +291,10 @@ func ExecutableDataToBlock(data ExecutableData, versionedHashes []common.Hash, b
267
291
ParentBeaconRoot : beaconRoot ,
268
292
RequestsHash : requestsHash ,
269
293
}
270
- block := types .NewBlockWithHeader (header )
271
- block = block .WithBody (types.Body {Transactions : txs , Uncles : nil , Withdrawals : data .Withdrawals , Requests : requests })
272
- block = block .WithWitness (data .ExecutionWitness )
273
- if block .Hash () != data .BlockHash {
274
- return nil , fmt .Errorf ("blockhash mismatch, want %x, got %x" , data .BlockHash , block .Hash ())
275
- }
276
- return block , nil
294
+ return types .NewBlockWithHeader (header ).
295
+ WithBody (types.Body {Transactions : txs , Uncles : nil , Withdrawals : data .Withdrawals , Requests : requests }).
296
+ WithWitness (data .ExecutionWitness ),
297
+ nil
277
298
}
278
299
279
300
// BlockToExecutableData constructs the ExecutableData structure by filling the
0 commit comments