beacon/engine, miner: fix testing_buildBlockV1 response

Add omitempty to SlotNumber in ExecutableData so it is omitted for
pre-Amsterdam payloads where ExecutionPayloadV3 does not include
the field.

Pass actual block fees instead of zero in BuildTestingPayload so
blockValue reflects the real priority fees.
This commit is contained in:
Gaurav Dhiman 2026-04-11 21:37:37 +05:30
parent deda47f6a1
commit 479bbff1f7
3 changed files with 4 additions and 4 deletions

View file

@ -34,7 +34,7 @@ func (e ExecutableData) MarshalJSON() ([]byte, error) {
Withdrawals []*types.Withdrawal `json:"withdrawals"`
BlobGasUsed *hexutil.Uint64 `json:"blobGasUsed"`
ExcessBlobGas *hexutil.Uint64 `json:"excessBlobGas"`
SlotNumber *hexutil.Uint64 `json:"slotNumber"`
SlotNumber *hexutil.Uint64 `json:"slotNumber,omitempty"`
}
var enc ExecutableData
enc.ParentHash = e.ParentHash
@ -83,7 +83,7 @@ func (e *ExecutableData) UnmarshalJSON(input []byte) error {
Withdrawals []*types.Withdrawal `json:"withdrawals"`
BlobGasUsed *hexutil.Uint64 `json:"blobGasUsed"`
ExcessBlobGas *hexutil.Uint64 `json:"excessBlobGas"`
SlotNumber *hexutil.Uint64 `json:"slotNumber"`
SlotNumber *hexutil.Uint64 `json:"slotNumber,omitempty"`
}
var dec ExecutableData
if err := json.Unmarshal(input, &dec); err != nil {

View file

@ -99,7 +99,7 @@ type ExecutableData struct {
Withdrawals []*types.Withdrawal `json:"withdrawals"`
BlobGasUsed *uint64 `json:"blobGasUsed"`
ExcessBlobGas *uint64 `json:"excessBlobGas"`
SlotNumber *uint64 `json:"slotNumber"`
SlotNumber *uint64 `json:"slotNumber,omitempty"`
}
// JSON type overrides for executableData.

View file

@ -360,5 +360,5 @@ func (miner *Miner) BuildTestingPayload(args *BuildPayloadArgs, transactions []*
if res.err != nil {
return nil, res.err
}
return engine.BlockToExecutableData(res.block, new(big.Int), res.sidecars, res.requests), nil
return engine.BlockToExecutableData(res.block, res.fees, res.sidecars, res.requests), nil
}