Skip to content

Commit

Permalink
Remove DAO fork handling (not applicable) (#1234)
Browse files Browse the repository at this point in the history
  • Loading branch information
darioush authored and aaronbuchwald committed Apr 11, 2023
1 parent 0e82b37 commit f27fa47
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 491 deletions.
96 changes: 0 additions & 96 deletions consensus/misc/dao.go

This file was deleted.

17 changes: 0 additions & 17 deletions core/chain_makers.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import (

"github.com/ava-labs/coreth/consensus"
"github.com/ava-labs/coreth/consensus/dummy"
"github.com/ava-labs/coreth/consensus/misc"
"github.com/ava-labs/coreth/core/rawdb"
"github.com/ava-labs/coreth/core/state"
"github.com/ava-labs/coreth/core/types"
Expand Down Expand Up @@ -223,22 +222,6 @@ func GenerateChain(config *params.ChainConfig, parent *types.Block, engine conse
b := &BlockGen{i: i, chain: blocks, parent: parent, statedb: statedb, config: config, engine: engine}
b.header = makeHeader(chainreader, config, parent, gap, statedb, b.engine)

// Mutate the state and block according to any hard-fork specs
timestamp := new(big.Int).SetUint64(b.header.Time)
if !config.IsApricotPhase3(timestamp) {
// avoid dynamic fee extra data override
if daoBlock := config.DAOForkBlock; daoBlock != nil {
limit := new(big.Int).Add(daoBlock, params.DAOForkExtraRange)
if b.header.Number.Cmp(daoBlock) >= 0 && b.header.Number.Cmp(limit) < 0 {
if config.DAOForkSupport {
b.header.Extra = common.CopyBytes(params.DAOForkBlockExtra)
}
}
}
}
if config.DAOForkSupport && config.DAOForkBlock != nil && config.DAOForkBlock.Cmp(b.header.Number) == 0 {
misc.ApplyDAOHardFork(statedb)
}
// Execute any user modifications to the block
if gen != nil {
gen(i, b)
Expand Down
201 changes: 0 additions & 201 deletions core/dao_test.go

This file was deleted.

5 changes: 0 additions & 5 deletions core/state_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import (
"math/big"

"github.com/ava-labs/coreth/consensus"
"github.com/ava-labs/coreth/consensus/misc"
"github.com/ava-labs/coreth/core/state"
"github.com/ava-labs/coreth/core/types"
"github.com/ava-labs/coreth/core/vm"
Expand Down Expand Up @@ -81,10 +80,6 @@ func (p *StateProcessor) Process(block *types.Block, parent *types.Header, state
// Configure any stateful precompiles that should go into effect during this block.
p.config.CheckConfigurePrecompiles(new(big.Int).SetUint64(parent.Time), block, statedb)

// Mutate the block and state according to any hard-fork specs
if p.config.DAOForkSupport && p.config.DAOForkBlock != nil && p.config.DAOForkBlock.Cmp(block.Number()) == 0 {
misc.ApplyDAOHardFork(statedb)
}
blockContext := NewEVMBlockContext(header, p.bc, nil)
vmenv := vm.NewEVM(blockContext, vm.TxContext{}, statedb, p.config, cfg)
// Iterate over and process the individual transactions
Expand Down
4 changes: 0 additions & 4 deletions miner/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ import (
"github.com/ava-labs/avalanchego/utils/units"
"github.com/ava-labs/coreth/consensus"
"github.com/ava-labs/coreth/consensus/dummy"
"github.com/ava-labs/coreth/consensus/misc"
"github.com/ava-labs/coreth/core"
"github.com/ava-labs/coreth/core/state"
"github.com/ava-labs/coreth/core/types"
Expand Down Expand Up @@ -168,9 +167,6 @@ func (w *worker) commitNewWork() (*types.Block, error) {
if err != nil {
return nil, fmt.Errorf("failed to create new current environment: %w", err)
}
if w.chainConfig.DAOForkSupport && w.chainConfig.DAOForkBlock != nil && w.chainConfig.DAOForkBlock.Cmp(header.Number) == 0 {
misc.ApplyDAOHardFork(env.state)
}
// Configure any stateful precompiles that should go into effect during this block.
w.chainConfig.CheckConfigurePrecompiles(new(big.Int).SetUint64(parent.Time()), types.NewBlockWithHeader(header), env.state)

Expand Down
Loading

0 comments on commit f27fa47

Please sign in to comment.