Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions core/state_prefetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func (p *statePrefetcher) Prefetch(transactions types.Transactions, header *type
for i := 0; i < prefetchThread; i++ {
go func() {
newStatedb := statedb.CopyDoPrefetch()
if !p.config.IsHertzfix(header.Number) {
if p.config.NeedBadSharedStorage(header.Number) {
newStatedb.EnableWriteOnSharedStorage()
}

Expand Down Expand Up @@ -106,10 +106,6 @@ func (p *statePrefetcher) PrefetchMining(txs TransactionsByPriceAndNonce, header
for i := 0; i < prefetchThread; i++ {
go func(startCh <-chan *types.Transaction, stopCh <-chan struct{}) {
newStatedb := statedb.CopyDoPrefetch()
if !p.config.IsHertzfix(header.Number) { // need in local env before Hertzfix hard fork
newStatedb.EnableWriteOnSharedStorage()
}

evm := vm.NewEVM(NewEVMBlockContext(header, p.chain, nil), newStatedb, p.config, cfg)
idx := 0
// Iterate over and process the individual transactions
Expand Down
16 changes: 16 additions & 0 deletions params/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -967,6 +967,22 @@ func (c *ChainConfig) IsHertzfix(num *big.Int) bool {
return isBlockForked(c.HertzfixBlock, num)
}

func (c *ChainConfig) NeedBadSharedStorage(num *big.Int) bool {
if c.IsHertzfix(num) {
return false
}

if c.ChainID.Cmp(big.NewInt(56)) == 0 && num.Cmp(big.NewInt(33851236)) == 0 {
return true
}

if c.ChainID.Cmp(big.NewInt(97)) == 0 && (num.Cmp(big.NewInt(35547779)) == 0 || num.Cmp(big.NewInt(35548081)) == 0) {
return true
}

return false
}

func (c *ChainConfig) IsOnHertzfix(num *big.Int) bool {
return configBlockEqual(c.HertzfixBlock, num)
}
Expand Down