mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 23:26:44 +00:00
fix(worker): set row consumption for genesis and empty blocks (#428)
* fix: initialize row consumption for genesis and empty blocks * bump version
This commit is contained in:
parent
096e7b527a
commit
b51736fd3c
4 changed files with 9 additions and 1 deletions
|
|
@ -280,6 +280,9 @@ func NewBlockChain(db ethdb.Database, cacheConfig *CacheConfig, chainConfig *par
|
|||
// initialize L1 message index for genesis block
|
||||
rawdb.WriteFirstQueueIndexNotInL2Block(db, bc.genesisBlock.Hash(), 0)
|
||||
|
||||
// initialize row consumption for genesis block
|
||||
rawdb.WriteBlockRowConsumption(db, bc.genesisBlock.Hash(), &types.RowConsumption{})
|
||||
|
||||
var nilBlock *types.Block
|
||||
bc.currentBlock.Store(nilBlock)
|
||||
bc.currentFastBlock.Store(nilBlock)
|
||||
|
|
@ -699,6 +702,7 @@ func (bc *BlockChain) ResetWithGenesisBlock(genesis *types.Block) error {
|
|||
rawdb.WriteTd(batch, genesis.Hash(), genesis.NumberU64(), genesis.Difficulty())
|
||||
rawdb.WriteBlock(batch, genesis)
|
||||
rawdb.WriteFirstQueueIndexNotInL2Block(batch, genesis.Hash(), 0)
|
||||
rawdb.WriteBlockRowConsumption(batch, genesis.Hash(), &types.RowConsumption{})
|
||||
if err := batch.Write(); err != nil {
|
||||
log.Crit("Failed to write genesis block", "err", err)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -353,6 +353,7 @@ func (g *Genesis) Commit(db ethdb.Database) (*types.Block, error) {
|
|||
rawdb.WriteHeadHeaderHash(db, block.Hash())
|
||||
rawdb.WriteChainConfig(db, block.Hash(), config)
|
||||
rawdb.WriteFirstQueueIndexNotInL2Block(db, block.Hash(), 0)
|
||||
rawdb.WriteBlockRowConsumption(db, block.Hash(), &types.RowConsumption{})
|
||||
return block, nil
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -768,6 +768,9 @@ func (w *worker) makeCurrent(parent *types.Block, header *types.Header) error {
|
|||
env.l1TxCount = 0
|
||||
env.maxL1Index = 0
|
||||
|
||||
// make sure accRows is not nil, even for empty blocks
|
||||
env.accRows = &types.RowConsumption{}
|
||||
|
||||
// Swap out the old work with the new one, terminating any leftover prefetcher
|
||||
// processes in the mean time and starting a new one.
|
||||
if w.current != nil && w.current.state != nil {
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ import (
|
|||
const (
|
||||
VersionMajor = 4 // Major version component of the current release
|
||||
VersionMinor = 3 // Minor version component of the current release
|
||||
VersionPatch = 8 // Patch version component of the current release
|
||||
VersionPatch = 9 // Patch version component of the current release
|
||||
VersionMeta = "sepolia" // Version metadata to append to the version string
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue