Add sidecars to execution data

This commit is contained in:
Ferran Borreguero 2024-04-05 15:41:31 +01:00
parent 9bd3c47f72
commit a8512d65de

View file

@ -57,7 +57,7 @@ func (e *EthBackendServer) BuildEthBlock(ctx context.Context, buildArgs *types.B
}
// TODO: we're not adding blobs, but this is not where you would do it anyways
return engine.BlockToExecutableData(block, profit, nil), nil
return engine.BlockToExecutableData(block, profit, getSidecars(block)), nil
}
func (e *EthBackendServer) BuildEthBlockFromBundles(ctx context.Context, buildArgs *types.BuildBlockArgs, bundles []types.SBundle) (*engine.ExecutionPayloadEnvelope, error) {
@ -81,9 +81,20 @@ func (e *EthBackendServer) BuildEthBlockFromBundles(ctx context.Context, buildAr
}
// TODO: we're not adding blobs, but this is not where you would do it anyways
return engine.BlockToExecutableData(block, profit, nil), nil
return engine.BlockToExecutableData(block, profit, getSidecars(block)), nil
}
func (e *EthBackendServer) Call(ctx context.Context, contractAddr common.Address, input []byte) ([]byte, error) {
return e.b.Call(ctx, contractAddr, input)
}
func getSidecars(block *types.Block) []*types.BlobTxSidecar {
sidecars := []*types.BlobTxSidecar{}
for _, tx := range block.Transactions() {
sidecar := tx.BlobTxSidecar()
if sidecar != nil {
sidecars = append(sidecars, sidecar)
}
}
return sidecars
}