Skip to content

Commit

Permalink
Optimisze coinbase address during recovery for the sequencer (#1043)
Browse files Browse the repository at this point in the history
* update

* recover coinbase in injected batch
  • Loading branch information
zjg555543 authored Aug 29, 2024
1 parent 8a9c807 commit 19a54a2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion zk/stages/stage_sequence_execute.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,8 @@ func SpawnSequencingStage(

ibs := state.New(sdb.stateReader)
getHashFn := core.GetHashFn(header, func(hash common.Hash, number uint64) *types.Header { return rawdb.ReadHeader(sdb.tx, hash, number) })
blockContext := core.NewEVMBlockContext(header, getHashFn, cfg.engine, &cfg.zk.AddressSequencer, parentBlock.ExcessDataGas())
coinbase := batchState.getCoinbase(&cfg)
blockContext := core.NewEVMBlockContext(header, getHashFn, cfg.engine, &coinbase, parentBlock.ExcessDataGas())
batchState.blockState.builtBlockElements.resetBlockBuildingArrays()

parentRoot := parentBlock.Root()
Expand Down
2 changes: 1 addition & 1 deletion zk/stages/stage_sequence_execute_blocks.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ func finaliseBlock(

finalHeader := finalBlock.HeaderNoCopy()
finalHeader.Root = newRoot
finalHeader.Coinbase = batchContext.cfg.zk.AddressSequencer
finalHeader.Coinbase = batchState.getCoinbase(batchContext.cfg)
finalHeader.GasLimit = utils.GetBlockGasLimitForFork(batchState.forkId)
finalHeader.ReceiptHash = types.DeriveSha(builtBlockElements.receipts)
finalHeader.Bloom = types.CreateBloom(builtBlockElements.receipts)
Expand Down

0 comments on commit 19a54a2

Please sign in to comment.