@ -75,6 +75,7 @@ type Payload struct {
full * types . Block
full * types . Block
fullWitness * stateless . Witness
fullWitness * stateless . Witness
sidecars [ ] * types . BlobTxSidecar
sidecars [ ] * types . BlobTxSidecar
emptyRequests [ ] [ ] byte
requests [ ] [ ] byte
requests [ ] [ ] byte
fullFees * big . Int
fullFees * big . Int
stop chan struct { }
stop chan struct { }
@ -83,10 +84,11 @@ type Payload struct {
}
}
// newPayload initializes the payload object.
// newPayload initializes the payload object.
func newPayload ( empty * types . Block , witness * stateless . Witness , id engine . PayloadID ) * Payload {
func newPayload ( empty * types . Block , emptyRequests [ ] [ ] byte , witness * stateless . Witness , id engine . PayloadID ) * Payload {
payload := & Payload {
payload := & Payload {
id : id ,
id : id ,
empty : empty ,
empty : empty ,
emptyRequests : emptyRequests ,
emptyWitness : witness ,
emptyWitness : witness ,
stop : make ( chan struct { } ) ,
stop : make ( chan struct { } ) ,
}
}
@ -143,16 +145,14 @@ func (payload *Payload) Resolve() *engine.ExecutionPayloadEnvelope {
close ( payload . stop )
close ( payload . stop )
}
}
if payload . full != nil {
if payload . full != nil {
envelope := engine . BlockToExecutableData ( payload . full , payload . fullFees , payload . sidecars )
envelope := engine . BlockToExecutableData ( payload . full , payload . fullFees , payload . sidecars , payload . emptyRequests )
envelope . Requests = payload . requests
if payload . fullWitness != nil {
if payload . fullWitness != nil {
envelope . Witness = new ( hexutil . Bytes )
envelope . Witness = new ( hexutil . Bytes )
* envelope . Witness , _ = rlp . EncodeToBytes ( payload . fullWitness ) // cannot fail
* envelope . Witness , _ = rlp . EncodeToBytes ( payload . fullWitness ) // cannot fail
}
}
return envelope
return envelope
}
}
envelope := engine . BlockToExecutableData ( payload . empty , big . NewInt ( 0 ) , nil )
envelope := engine . BlockToExecutableData ( payload . empty , big . NewInt ( 0 ) , nil , payload . emptyRequests )
envelope . Requests = payload . requests
if payload . emptyWitness != nil {
if payload . emptyWitness != nil {
envelope . Witness = new ( hexutil . Bytes )
envelope . Witness = new ( hexutil . Bytes )
* envelope . Witness , _ = rlp . EncodeToBytes ( payload . emptyWitness ) // cannot fail
* envelope . Witness , _ = rlp . EncodeToBytes ( payload . emptyWitness ) // cannot fail
@ -166,8 +166,7 @@ func (payload *Payload) ResolveEmpty() *engine.ExecutionPayloadEnvelope {
payload . lock . Lock ( )
payload . lock . Lock ( )
defer payload . lock . Unlock ( )
defer payload . lock . Unlock ( )
envelope := engine . BlockToExecutableData ( payload . empty , big . NewInt ( 0 ) , nil )
envelope := engine . BlockToExecutableData ( payload . empty , big . NewInt ( 0 ) , nil , payload . emptyRequests )
envelope . Requests = payload . requests
if payload . emptyWitness != nil {
if payload . emptyWitness != nil {
envelope . Witness = new ( hexutil . Bytes )
envelope . Witness = new ( hexutil . Bytes )
* envelope . Witness , _ = rlp . EncodeToBytes ( payload . emptyWitness ) // cannot fail
* envelope . Witness , _ = rlp . EncodeToBytes ( payload . emptyWitness ) // cannot fail
@ -198,8 +197,7 @@ func (payload *Payload) ResolveFull() *engine.ExecutionPayloadEnvelope {
default :
default :
close ( payload . stop )
close ( payload . stop )
}
}
envelope := engine . BlockToExecutableData ( payload . full , payload . fullFees , payload . sidecars )
envelope := engine . BlockToExecutableData ( payload . full , payload . fullFees , payload . sidecars , payload . requests )
envelope . Requests = payload . requests
if payload . fullWitness != nil {
if payload . fullWitness != nil {
envelope . Witness = new ( hexutil . Bytes )
envelope . Witness = new ( hexutil . Bytes )
* envelope . Witness , _ = rlp . EncodeToBytes ( payload . fullWitness ) // cannot fail
* envelope . Witness , _ = rlp . EncodeToBytes ( payload . fullWitness ) // cannot fail
@ -227,7 +225,7 @@ func (miner *Miner) buildPayload(args *BuildPayloadArgs, witness bool) (*Payload
return nil , empty . err
return nil , empty . err
}
}
// Construct a payload object for return.
// Construct a payload object for return.
payload := newPayload ( empty . block , empty . witness , args . Id ( ) )
payload := newPayload ( empty . block , empty . requests , empty . witness , args . Id ( ) )
// Spin up a routine for updating the payload in background. This strategy
// Spin up a routine for updating the payload in background. This strategy
// can maximum the revenue for including transactions with highest fee.
// can maximum the revenue for including transactions with highest fee.