@ -206,7 +206,7 @@ type worker struct {
mu sync . RWMutex // The lock used to protect the coinbase and extra fields
mu sync . RWMutex // The lock used to protect the coinbase and extra fields
coinbase common . Address
coinbase common . Address
extra [ ] byte
extra [ ] byte
tip * big . Int // Minimum tip needed for non-local transaction to include them
tip * uint256 . Int // Minimum tip needed for non-local transaction to include them
pendingMu sync . RWMutex
pendingMu sync . RWMutex
pendingTasks map [ common . Hash ] * task
pendingTasks map [ common . Hash ] * task
@ -253,7 +253,7 @@ func newWorker(config *Config, chainConfig *params.ChainConfig, engine consensus
isLocalBlock : isLocalBlock ,
isLocalBlock : isLocalBlock ,
coinbase : config . Etherbase ,
coinbase : config . Etherbase ,
extra : config . ExtraData ,
extra : config . ExtraData ,
tip : config . GasPrice ,
tip : uint256 . MustFromBig ( config . GasPrice ) ,
pendingTasks : make ( map [ common . Hash ] * task ) ,
pendingTasks : make ( map [ common . Hash ] * task ) ,
txsCh : make ( chan core . NewTxsEvent , txChanSize ) ,
txsCh : make ( chan core . NewTxsEvent , txChanSize ) ,
chainHeadCh : make ( chan core . ChainHeadEvent , chainHeadChanSize ) ,
chainHeadCh : make ( chan core . ChainHeadEvent , chainHeadChanSize ) ,
@ -334,7 +334,7 @@ func (w *worker) setExtra(extra []byte) {
func ( w * worker ) setGasTip ( tip * big . Int ) {
func ( w * worker ) setGasTip ( tip * big . Int ) {
w . mu . Lock ( )
w . mu . Lock ( )
defer w . mu . Unlock ( )
defer w . mu . Unlock ( )
w . tip = tip
w . tip = uint256 . MustFromBig ( tip )
}
}
// setRecommitInterval updates the interval for miner sealing work recommitting.
// setRecommitInterval updates the interval for miner sealing work recommitting.
@ -556,15 +556,15 @@ func (w *worker) mainLoop() {
Hash : tx . Hash ( ) ,
Hash : tx . Hash ( ) ,
Tx : nil , // Do *not* set this! We need to resolve it later to pull blobs in
Tx : nil , // Do *not* set this! We need to resolve it later to pull blobs in
Time : tx . Time ( ) ,
Time : tx . Time ( ) ,
GasFeeCap : tx . GasFeeCap ( ) ,
GasFeeCap : uint256 . MustFromBig ( tx . GasFeeCap ( ) ) ,
GasTipCap : tx . GasTipCap ( ) ,
GasTipCap : uint256 . MustFromBig ( tx . GasTipCap ( ) ) ,
Gas : tx . Gas ( ) ,
Gas : tx . Gas ( ) ,
BlobGas : tx . BlobGas ( ) ,
BlobGas : tx . BlobGas ( ) ,
} )
} )
}
}
txset := newTransactionsByPriceAndNonce ( w . current . signer , txs , w . current . header . BaseFee )
txset := newTransactionsByPriceAndNonce ( w . current . signer , txs , w . current . header . BaseFee )
tcount := w . current . tcount
tcount := w . current . tcount
w . commitTransactions ( w . current , txset , nil , new ( big . Int ) )
w . commitTransactions ( w . current , txset , nil , new ( uint256 . Int ) )
// Only update the snapshot if any new transactions were added
// Only update the snapshot if any new transactions were added
// to the pending block
// to the pending block
@ -802,7 +802,7 @@ func (w *worker) applyTransaction(env *environment, tx *types.Transaction) (*typ
return receipt , err
return receipt , err
}
}
func ( w * worker ) commitTransactions ( env * environment , txs * transactionsByPriceAndNonce , interrupt * atomic . Int32 , minTip * big . Int ) error {
func ( w * worker ) commitTransactions ( env * environment , txs * transactionsByPriceAndNonce , interrupt * atomic . Int32 , minTip * uint256 . Int ) error {
gasLimit := env . header . GasLimit
gasLimit := env . header . GasLimit
if env . gasPool == nil {
if env . gasPool == nil {
env . gasPool = new ( core . GasPool ) . AddGas ( gasLimit )
env . gasPool = new ( core . GasPool ) . AddGas ( gasLimit )
@ -1013,7 +1013,7 @@ func (w *worker) fillTransactions(interrupt *atomic.Int32, env *environment) err
if env . header . ExcessBlobGas != nil {
if env . header . ExcessBlobGas != nil {
blobFee = uint256 . MustFromBig ( eip4844 . CalcBlobFee ( * env . header . ExcessBlobGas ) )
blobFee = uint256 . MustFromBig ( eip4844 . CalcBlobFee ( * env . header . ExcessBlobGas ) )
}
}
pending := w . eth . TxPool ( ) . Pending ( uint256 . MustFromBig ( tip ) , baseFee , blobFee )
pending := w . eth . TxPool ( ) . Pending ( tip , baseFee , blobFee )
// Split the pending transactions into locals and remotes.
// Split the pending transactions into locals and remotes.
localTxs , remoteTxs := make ( map [ common . Address ] [ ] * txpool . LazyTransaction ) , pending
localTxs , remoteTxs := make ( map [ common . Address ] [ ] * txpool . LazyTransaction ) , pending
@ -1027,7 +1027,7 @@ func (w *worker) fillTransactions(interrupt *atomic.Int32, env *environment) err
// Fill the block with all available pending transactions.
// Fill the block with all available pending transactions.
if len ( localTxs ) > 0 {
if len ( localTxs ) > 0 {
txs := newTransactionsByPriceAndNonce ( env . signer , localTxs , env . header . BaseFee )
txs := newTransactionsByPriceAndNonce ( env . signer , localTxs , env . header . BaseFee )
if err := w . commitTransactions ( env , txs , interrupt , new ( big . Int ) ) ; err != nil {
if err := w . commitTransactions ( env , txs , interrupt , new ( uint256 . Int ) ) ; err != nil {
return err
return err
}
}
}
}