Skip to content

Commit

Permalink
Fix build errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ImTei committed Apr 17, 2024
1 parent 84c5e75 commit 0476024
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
4 changes: 3 additions & 1 deletion consensus/misc/eip1559.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ func (f eip1559Calculator) CurrentFees(chainConfig *chain.Config, db kv.Getter)

if chainConfig != nil {
if currentHeader.BaseFee != nil {
baseFee = CalcBaseFee(chainConfig, currentHeader).Uint64()
// Block time of every OP superchains is 2sec for now.
// Add 2 for next block. TODO: support custom block time for OP chain
baseFee = CalcBaseFee(chainConfig, currentHeader, currentHeader.Time+2).Uint64()
}

if currentHeader.ExcessBlobGas != nil {
Expand Down
4 changes: 2 additions & 2 deletions erigon-lib/txpool/pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -1668,8 +1668,8 @@ func (p *TxPool) onSenderStateChange(senderID uint64, senderNonce uint64, sender

needBalance := requiredBalance(mt.Tx)

if l1CostFn != nil {
if l1Cost := l1CostFn(mt.Tx); l1Cost != nil {
if p.l1Cost != nil {
if l1Cost := p.l1Cost(mt.Tx); l1Cost != nil {
needBalance.Add(needBalance, l1Cost)
}
}
Expand Down
16 changes: 9 additions & 7 deletions eth/stagedsync/stagebuilder.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,13 @@ func MiningStages(
{
ID: stages.MiningCreateBlock,
Description: "Mining: add force-txs",
Forward: func(firstCycle bool, badBlockUnwind bool, s *StageState, u Unwinder, tx kv.RwTx, logger log.Logger) error {
return SpawnMiningForceTxsStage(s, tx, createBlockCfg, ctx.Done())
Forward: func(firstCycle bool, badBlockUnwind bool, s *StageState, u Unwinder, txc wrap.TxContainer, logger log.Logger) error {
return SpawnMiningForceTxsStage(s, txc.Tx, createBlockCfg, ctx.Done())
},
Unwind: func(firstCycle bool, u *UnwindState, s *StageState, tx kv.RwTx, logger log.Logger) error { return nil },
Prune: func(firstCycle bool, u *PruneState, tx kv.RwTx, logger log.Logger) error { return nil },
Unwind: func(firstCycle bool, u *UnwindState, s *StageState, txc wrap.TxContainer, logger log.Logger) error {
return nil
},
Prune: func(firstCycle bool, u *PruneState, tx kv.RwTx, logger log.Logger) error { return nil },
},
{
ID: stages.MiningCreateBlock,
Expand Down Expand Up @@ -72,7 +74,7 @@ func MiningStages(
return SpawnMiningExecStage(s, txc.Tx, execCfg, ctx.Done(), logger)
},
Unwind: func(firstCycle bool, u *UnwindState, s *StageState, txc wrap.TxContainer, logger log.Logger) error {
return UnwindMiningExecutionStage(u, s, txc, ctx, execCfg, logger)
return UnwindMiningExecutionStage(u, s, txc.Tx, ctx, execCfg, logger)
},
Prune: func(firstCycle bool, u *PruneState, tx kv.RwTx, logger log.Logger) error { return nil },
},
Expand All @@ -83,7 +85,7 @@ func MiningStages(
return SpawnHashStateStage(s, txc.Tx, hashStateCfg, ctx, logger)
},
Unwind: func(firstCycle bool, u *UnwindState, s *StageState, txc wrap.TxContainer, logger log.Logger) error {
return UnwindHashStateStage(u, s, txc, hashStateCfg, ctx, logger)
return UnwindHashStateStage(u, s, txc.Tx, hashStateCfg, ctx, logger)
},
Prune: func(firstCycle bool, u *PruneState, tx kv.RwTx, logger log.Logger) error { return nil },
},
Expand All @@ -99,7 +101,7 @@ func MiningStages(
return nil
},
Unwind: func(firstCycle bool, u *UnwindState, s *StageState, txc wrap.TxContainer, logger log.Logger) error {
return UnwindIntermediateHashesStage(u, s, txc, trieCfg, ctx, logger)
return UnwindIntermediateHashesStage(u, s, txc.Tx, trieCfg, ctx, logger)
},
Prune: func(firstCycle bool, u *PruneState, tx kv.RwTx, logger log.Logger) error { return nil },
},
Expand Down

0 comments on commit 0476024

Please sign in to comment.