Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wip: use libevm (params, core/vm) #1335

Draft
wants to merge 49 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
6d60741
wip: use libevm (params)
darioush Sep 5, 2024
d999563
base change
darioush Sep 6, 2024
1c7e25b
test unmarshal capability
darioush Sep 6, 2024
a119516
separate avalanche stuff to its own type
darioush Sep 6, 2024
25bb446
separate RulesExtra
darioush Sep 6, 2024
c371a3a
separate calls to extra
darioush Sep 6, 2024
9b27ebe
use darioush/access-list-for-hook
darioush Sep 9, 2024
784e2e6
config_extra: move methods off Rules/ChainConfig receivers
darioush Sep 9, 2024
a8a5c80
un-embed RulesExtra
darioush Sep 9, 2024
d74cea6
params: use gethparams.Rules
darioush Sep 9, 2024
ed1165b
unused
darioush Sep 9, 2024
e1088b1
update chainConfig.Rules callsites to pass params.IsMergeTODO
darioush Sep 10, 2024
846f52a
params/config: type alias ConfigCompatError
darioush Sep 10, 2024
932967d
bring in gethparams.ChainConfig (wip)
darioush Sep 10, 2024
053af95
params: add LondonBlock
darioush Sep 10, 2024
44db6c7
params: add ShanghaiTime
darioush Sep 10, 2024
cd5adc9
params: add BerlinBlock
darioush Sep 10, 2024
70659d3
params: unused code
darioush Sep 10, 2024
5d5fb59
reduce diff
darioush Sep 10, 2024
07203b0
update to darioush/json-root branch
darioush Sep 10, 2024
99c1b70
params: add IsLondon checks to Cancun (similar to upstream)
darioush Sep 10, 2024
e8febb8
race free impl for WithExtra, still hack
darioush Sep 11, 2024
04338c7
Merge branch 'master' of github.com:ava-labs/subnet-evm into use-libe…
darioush Sep 11, 2024
a5a43cc
use RulesExtra (instead of ptr)
darioush Sep 11, 2024
4a41e81
bump libevm
darioush Sep 11, 2024
5049989
bump libevm
darioush Sep 11, 2024
2a46ead
chain hooks for create
darioush Sep 11, 2024
672f54e
use geth forks in core/vm/evm.go
darioush Sep 11, 2024
7b8ec21
core/types, core/state: import gethparams
darioush Sep 12, 2024
f30f450
core/vm: use gethparams and hook in precompiles
darioush Sep 12, 2024
dc4b361
core/types: use upstream Log type
darioush Sep 12, 2024
5038b15
core/types: use upstream for AccessList
darioush Sep 12, 2024
dad843a
core/vm: use libevm
darioush Sep 12, 2024
0fe10ff
linting
darioush Sep 12, 2024
5b073ad
fix mockgen
darioush Sep 12, 2024
34a17a6
adjustment for libevm chainconfig changes
darioush Sep 12, 2024
73b5559
populate vm.BlockContext.Random as Difficulty starting at Durango (to…
darioush Sep 13, 2024
61b1694
nit
darioush Sep 13, 2024
8d2493f
Merge branch 'master' of github.com:ava-labs/subnet-evm into use-libe…
darioush Sep 17, 2024
12cd83e
update libevm
darioush Sep 17, 2024
20854a1
update libevm
darioush Sep 17, 2024
e9ee414
rebase to latest libevm (+ fix commit on darioush/json-root)
darioush Sep 24, 2024
61eb933
add support for custom upstream tag
darioush Sep 24, 2024
28caecc
remove eth/tracers subdirs
darioush Sep 24, 2024
86cdfbe
update geth-allowed-packages.txt
darioush Sep 24, 2024
f1d77d2
Merge branch 'master' of github.com:ava-labs/subnet-evm into use-libe…
darioush Sep 24, 2024
7bfbe08
lint
darioush Sep 24, 2024
27a8bfb
more lint
darioush Sep 24, 2024
d72ff25
more lint
darioush Sep 24, 2024
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
5 changes: 5 additions & 0 deletions accounts/abi/bind/bind_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2179,6 +2179,11 @@ func golangBindings(t *testing.T, overload bool) {
if out, err := replacer.CombinedOutput(); err != nil {
t.Fatalf("failed to replace binding test dependency to current source tree: %v\n%s", err, out)
}
replacer = exec.Command(gocmd, "mod", "edit", "-x", "-require", "github.com/ethereum/[email protected]", "-replace", "github.com/ethereum/go-ethereum=github.com/ava-labs/[email protected]")
replacer.Dir = pkg
if out, err := replacer.CombinedOutput(); err != nil {
t.Fatalf("failed to replace binding test dependency to current source tree: %v\n%s", err, out)
}
tidier := exec.Command(gocmd, "mod", "tidy", "-compat=1.21")
tidier.Dir = pkg
if out, err := tidier.CombinedOutput(); err != nil {
Expand Down
5 changes: 5 additions & 0 deletions accounts/abi/bind/precompilebind/precompile_bind_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,11 @@ func TestPrecompileBind(t *testing.T) {
if out, err := replacer.CombinedOutput(); err != nil {
t.Fatalf("failed to replace binding test dependency to current source tree: %v\n%s", err, out)
}
replacer = exec.Command(gocmd, "mod", "edit", "-x", "-require", "github.com/ethereum/[email protected]", "-replace", "github.com/ethereum/go-ethereum=github.com/ava-labs/[email protected]")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any reason why we not directly use ava-labs/go-ethereum as directy dependency?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The module renaming is not ready yet, we will use it directly once it is ready.

replacer.Dir = pkg
if out, err := replacer.CombinedOutput(); err != nil {
t.Fatalf("failed to replace binding test dependency to current source tree: %v\n%s", err, out)
}
tidier := exec.Command(gocmd, "mod", "tidy", "-compat=1.21")
tidier.Dir = pkg
if out, err := tidier.CombinedOutput(); err != nil {
Expand Down
11 changes: 5 additions & 6 deletions cmd/evm/internal/t8ntool/execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ import (
"github.com/ava-labs/subnet-evm/core/rawdb"
"github.com/ava-labs/subnet-evm/core/state"
"github.com/ava-labs/subnet-evm/core/types"
"github.com/ava-labs/subnet-evm/core/vm"
"github.com/ava-labs/subnet-evm/params"
"github.com/ava-labs/subnet-evm/trie"
"github.com/ava-labs/subnet-evm/triedb"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/math"
"github.com/ethereum/go-ethereum/core/vm"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/log"
Expand Down Expand Up @@ -169,12 +169,11 @@ func (pre *Prestate) Apply(vmConfig vm.Config, chainConfig *params.ChainConfig,
if pre.Env.BaseFee != nil {
vmContext.BaseFee = new(big.Int).Set(pre.Env.BaseFee)
}
// NOTE: this has been removed
// If random is defined, add it to the vmContext.
// if pre.Env.Random != nil {
// rnd := common.BigToHash(pre.Env.Random)
// vmContext.Random = &rnd
// }
if pre.Env.Random != nil {
rnd := common.BigToHash(pre.Env.Random)
vmContext.Random = &rnd
}
// Calculate the BlobBaseFee
var excessBlobGas uint64
if pre.Env.ExcessBlobGas != nil {
Expand Down
2 changes: 1 addition & 1 deletion cmd/evm/internal/t8ntool/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ import (
"fmt"
"strings"

"github.com/ava-labs/subnet-evm/core/vm"
"github.com/ava-labs/subnet-evm/tests"
"github.com/ethereum/go-ethereum/core/vm"
"github.com/urfave/cli/v2"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/evm/internal/t8ntool/tracewriter.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ import (
"io"
"math/big"

"github.com/ava-labs/subnet-evm/core/vm"
"github.com/ava-labs/subnet-evm/eth/tracers"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/vm"
"github.com/ethereum/go-ethereum/log"
)

Expand Down
4 changes: 2 additions & 2 deletions cmd/evm/internal/t8ntool/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ func Transaction(ctx *cli.Context) error {
r.Address = sender
}
// Check intrinsic gas
rules := chainConfig.Rules(new(big.Int), 0)
rules := chainConfig.Rules(new(big.Int), params.IsMergeTODO, 0)
if gas, err := core.IntrinsicGas(tx.Data(), tx.AccessList(), tx.To() == nil, rules); err != nil {
r.Error = err
results = append(results, r)
Expand Down Expand Up @@ -176,7 +176,7 @@ func Transaction(ctx *cli.Context) error {
r.Error = errors.New("gas * maxFeePerGas exceeds 256 bits")
}
// Check whether the init code size has been exceeded.
if chainConfig.IsDurango(0) && tx.To() == nil && len(tx.Data()) > params.MaxInitCodeSize {
if params.GetExtra(chainConfig).IsDurango(0) && tx.To() == nil && len(tx.Data()) > params.MaxInitCodeSize {
r.Error = errors.New("max initcode size exceeded")
}
results = append(results, r)
Expand Down
6 changes: 3 additions & 3 deletions cmd/evm/internal/t8ntool/transition.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ import (
"github.com/ava-labs/subnet-evm/consensus/dummy"
"github.com/ava-labs/subnet-evm/core/state"
"github.com/ava-labs/subnet-evm/core/types"
"github.com/ava-labs/subnet-evm/core/vm"
"github.com/ava-labs/subnet-evm/eth/tracers"
"github.com/ava-labs/subnet-evm/eth/tracers/logger"
"github.com/ava-labs/subnet-evm/params"
"github.com/ava-labs/subnet-evm/tests"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/core/vm"
"github.com/ethereum/go-ethereum/eth/tracers/logger"
"github.com/ethereum/go-ethereum/log"
"github.com/urfave/cli/v2"
)
Expand Down Expand Up @@ -205,7 +205,7 @@ func Transition(ctx *cli.Context) error {

func applyLondonChecks(env *stEnv, chainConfig *params.ChainConfig) error {
// NOTE: IsLondon replaced with IsSubnetEVM here
if !chainConfig.IsSubnetEVM(env.Timestamp) {
if !params.GetExtra(chainConfig).IsSubnetEVM(env.Timestamp) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should just use London here

return nil
}
// Sanity check, to not `panic` in state_transition
Expand Down
4 changes: 2 additions & 2 deletions cmd/evm/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ import (
"github.com/urfave/cli/v2"

// Force-load the tracer engines to trigger registration
_ "github.com/ava-labs/subnet-evm/eth/tracers/js"
_ "github.com/ava-labs/subnet-evm/eth/tracers/native"
_ "github.com/ethereum/go-ethereum/eth/tracers/js"
_ "github.com/ethereum/go-ethereum/eth/tracers/native"
)

var (
Expand Down
4 changes: 2 additions & 2 deletions cmd/evm/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ import (
"github.com/ava-labs/subnet-evm/core"
"github.com/ava-labs/subnet-evm/core/rawdb"
"github.com/ava-labs/subnet-evm/core/state"
"github.com/ava-labs/subnet-evm/core/vm"
"github.com/ava-labs/subnet-evm/core/vm/runtime"
"github.com/ava-labs/subnet-evm/eth/tracers/logger"
"github.com/ava-labs/subnet-evm/internal/flags"
"github.com/ava-labs/subnet-evm/params"
"github.com/ava-labs/subnet-evm/triedb"
"github.com/ava-labs/subnet-evm/triedb/hashdb"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/vm"
"github.com/ethereum/go-ethereum/eth/tracers/logger"
"github.com/urfave/cli/v2"
)

Expand Down
4 changes: 2 additions & 2 deletions cmd/evm/staterunner.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ import (

"github.com/ava-labs/subnet-evm/core/rawdb"
"github.com/ava-labs/subnet-evm/core/state"
"github.com/ava-labs/subnet-evm/core/vm"
"github.com/ava-labs/subnet-evm/eth/tracers/logger"
"github.com/ava-labs/subnet-evm/tests"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/vm"
"github.com/ethereum/go-ethereum/eth/tracers/logger"
"github.com/urfave/cli/v2"
)

Expand Down
10 changes: 5 additions & 5 deletions consensus/dummy/consensus.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ func (eng *DummyEngine) verifyHeaderGasFields(config *params.ChainConfig, header
if err != nil {
return err
}
if config.IsSubnetEVM(header.Time) {
if params.GetExtra(config).IsSubnetEVM(header.Time) {
expectedGasLimit := feeConfig.GasLimit.Uint64()
if header.GasLimit != expectedGasLimit {
return fmt.Errorf("expected gas limit to be %d, but found %d", expectedGasLimit, header.GasLimit)
Expand Down Expand Up @@ -206,11 +206,11 @@ func (eng *DummyEngine) verifyHeader(chain consensus.ChainHeaderReader, header *
return errUnclesUnsupported
}
switch {
case config.IsDurango(header.Time):
case params.GetExtra(config).IsDurango(header.Time):
if len(header.Extra) < params.DynamicFeeExtraDataSize {
return fmt.Errorf("expected extra-data field length >= %d, found %d", params.DynamicFeeExtraDataSize, len(header.Extra))
}
case config.IsSubnetEVM(header.Time):
case params.GetExtra(config).IsSubnetEVM(header.Time):
if len(header.Extra) != params.DynamicFeeExtraDataSize {
return fmt.Errorf("expected extra-data field to be: %d, but found %d", params.DynamicFeeExtraDataSize, len(header.Extra))
}
Expand Down Expand Up @@ -363,7 +363,7 @@ func (eng *DummyEngine) verifyBlockFee(
}

func (eng *DummyEngine) Finalize(chain consensus.ChainHeaderReader, block *types.Block, parent *types.Header, state *state.StateDB, receipts []*types.Receipt) error {
if chain.Config().IsSubnetEVM(block.Time()) {
if params.GetExtra(chain.Config()).IsSubnetEVM(block.Time()) {
// we use the parent to determine the fee config
// since the current block has not been finalized yet.
feeConfig, _, err := chain.GetFeeConfigAt(parent)
Expand Down Expand Up @@ -402,7 +402,7 @@ func (eng *DummyEngine) Finalize(chain consensus.ChainHeaderReader, block *types
func (eng *DummyEngine) FinalizeAndAssemble(chain consensus.ChainHeaderReader, header *types.Header, parent *types.Header, state *state.StateDB, txs []*types.Transaction,
uncles []*types.Header, receipts []*types.Receipt,
) (*types.Block, error) {
if chain.Config().IsSubnetEVM(header.Time) {
if params.GetExtra(chain.Config()).IsSubnetEVM(header.Time) {
// we use the parent to determine the fee config
// since the current block has not been finalized yet.
feeConfig, _, err := chain.GetFeeConfigAt(parent)
Expand Down
4 changes: 2 additions & 2 deletions consensus/dummy/dynamic_fees.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
func CalcBaseFee(config *params.ChainConfig, feeConfig commontype.FeeConfig, parent *types.Header, timestamp uint64) ([]byte, *big.Int, error) {
// If the current block is the first EIP-1559 block, or it is the genesis block
// return the initial slice and initial base fee.
isSubnetEVM := config.IsSubnetEVM(parent.Time)
isSubnetEVM := params.GetExtra(config).IsSubnetEVM(parent.Time)
extraDataSize := params.DynamicFeeExtraDataSize

if !isSubnetEVM || parent.Number.Cmp(common.Big0) == 0 {
Expand Down Expand Up @@ -248,7 +248,7 @@ func calcBlockGasCost(
//
// This function will return nil for all return values prior to Subnet EVM.
func MinRequiredTip(config *params.ChainConfig, header *types.Header) (*big.Int, error) {
if !config.IsSubnetEVM(header.Time) {
if !params.GetExtra(config).IsSubnetEVM(header.Time) {
return nil, nil
}
if header.BaseFee == nil {
Expand Down
2 changes: 1 addition & 1 deletion core/bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ import (
"github.com/ava-labs/subnet-evm/consensus/dummy"
"github.com/ava-labs/subnet-evm/core/rawdb"
"github.com/ava-labs/subnet-evm/core/types"
"github.com/ava-labs/subnet-evm/core/vm"
"github.com/ava-labs/subnet-evm/params"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/math"
"github.com/ethereum/go-ethereum/core/vm"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/ethdb"
)
Expand Down
2 changes: 1 addition & 1 deletion core/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ import (
"github.com/ava-labs/subnet-evm/core/state"
"github.com/ava-labs/subnet-evm/core/state/snapshot"
"github.com/ava-labs/subnet-evm/core/types"
"github.com/ava-labs/subnet-evm/core/vm"
"github.com/ava-labs/subnet-evm/internal/version"
"github.com/ava-labs/subnet-evm/metrics"
"github.com/ava-labs/subnet-evm/params"
Expand All @@ -56,6 +55,7 @@ import (
"github.com/ava-labs/subnet-evm/triedb/pathdb"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/lru"
"github.com/ethereum/go-ethereum/core/vm"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/log"
Expand Down
2 changes: 1 addition & 1 deletion core/blockchain_log_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import (
"github.com/ava-labs/subnet-evm/consensus/dummy"
"github.com/ava-labs/subnet-evm/core/rawdb"
"github.com/ava-labs/subnet-evm/core/types"
"github.com/ava-labs/subnet-evm/core/vm"
"github.com/ava-labs/subnet-evm/params"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/vm"
"github.com/ethereum/go-ethereum/crypto"
"github.com/stretchr/testify/require"
)
Expand Down
12 changes: 6 additions & 6 deletions core/blockchain_reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ import (
"github.com/ava-labs/subnet-evm/core/state"
"github.com/ava-labs/subnet-evm/core/state/snapshot"
"github.com/ava-labs/subnet-evm/core/types"
"github.com/ava-labs/subnet-evm/core/vm"
"github.com/ava-labs/subnet-evm/params"
"github.com/ava-labs/subnet-evm/precompile/contracts/feemanager"
"github.com/ava-labs/subnet-evm/precompile/contracts/rewardmanager"
"github.com/ava-labs/subnet-evm/triedb"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/vm"
"github.com/ethereum/go-ethereum/event"
)

Expand Down Expand Up @@ -366,8 +366,8 @@ func (bc *BlockChain) SubscribeAcceptedTransactionEvent(ch chan<- NewTxsEvent) e
// Assumes that a valid configuration is stored when the precompile is activated.
func (bc *BlockChain) GetFeeConfigAt(parent *types.Header) (commontype.FeeConfig, *big.Int, error) {
config := bc.Config()
if !config.IsPrecompileEnabled(feemanager.ContractAddress, parent.Time) {
return config.FeeConfig, common.Big0, nil
if !params.GetExtra(config).IsPrecompileEnabled(feemanager.ContractAddress, parent.Time) {
return params.GetExtra(config).FeeConfig, common.Big0, nil
}

// try to return it from the cache
Expand Down Expand Up @@ -400,12 +400,12 @@ func (bc *BlockChain) GetFeeConfigAt(parent *types.Header) (commontype.FeeConfig
// If fee recipients are allowed, returns true in the second return value.
func (bc *BlockChain) GetCoinbaseAt(parent *types.Header) (common.Address, bool, error) {
config := bc.Config()
if !config.IsSubnetEVM(parent.Time) {
if !params.GetExtra(config).IsSubnetEVM(parent.Time) {
return constants.BlackholeAddr, false, nil
}

if !config.IsPrecompileEnabled(rewardmanager.ContractAddress, parent.Time) {
if bc.chainConfig.AllowFeeRecipients {
if !params.GetExtra(config).IsPrecompileEnabled(rewardmanager.ContractAddress, parent.Time) {
if params.GetExtra(bc.chainConfig).AllowFeeRecipients {
return common.Address{}, true, nil
} else {
return constants.BlackholeAddr, false, nil
Expand Down
8 changes: 4 additions & 4 deletions core/blockchain_repair_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ import (
"github.com/ava-labs/subnet-evm/consensus/dummy"
"github.com/ava-labs/subnet-evm/core/rawdb"
"github.com/ava-labs/subnet-evm/core/types"
"github.com/ava-labs/subnet-evm/core/vm"
"github.com/ava-labs/subnet-evm/params"
"github.com/ava-labs/subnet-evm/triedb"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/vm"
"github.com/ethereum/go-ethereum/crypto"
"github.com/stretchr/testify/require"
)
Expand Down Expand Up @@ -527,14 +527,14 @@ func testRepairWithScheme(t *testing.T, tt *rewindTest, snapshots bool, scheme s
defer db.Close() // Might double close, should be fine

// Initialize a fresh chain
chainConfig := *params.TestChainConfig
chainConfig.FeeConfig.MinBaseFee = big.NewInt(1)
chainConfig := params.Copy(params.TestChainConfig)
params.GetExtra(&chainConfig).FeeConfig.MinBaseFee = big.NewInt(1)
var (
require = require.New(t)
key1, _ = crypto.HexToECDSA("b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291")
addr1 = crypto.PubkeyToAddress(key1.PublicKey)
gspec = &Genesis{
BaseFee: chainConfig.FeeConfig.MinBaseFee,
BaseFee: params.GetExtra(&chainConfig).FeeConfig.MinBaseFee,
Config: &chainConfig,
Alloc: GenesisAlloc{addr1: {Balance: big.NewInt(params.Ether)}},
}
Expand Down
2 changes: 1 addition & 1 deletion core/blockchain_snapshot_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ import (
"github.com/ava-labs/subnet-evm/consensus/dummy"
"github.com/ava-labs/subnet-evm/core/rawdb"
"github.com/ava-labs/subnet-evm/core/types"
"github.com/ava-labs/subnet-evm/core/vm"
"github.com/ava-labs/subnet-evm/params"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/vm"
"github.com/ethereum/go-ethereum/ethdb"
)

Expand Down
18 changes: 12 additions & 6 deletions core/blockchain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ import (
"github.com/ava-labs/subnet-evm/core/state"
"github.com/ava-labs/subnet-evm/core/state/pruner"
"github.com/ava-labs/subnet-evm/core/types"
"github.com/ava-labs/subnet-evm/core/vm"
"github.com/ava-labs/subnet-evm/eth/tracers/logger"
"github.com/ava-labs/subnet-evm/params"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/vm"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/eth/tracers/logger"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/holiman/uint256"
)
Expand Down Expand Up @@ -313,8 +313,11 @@ func testRepopulateMissingTriesParallel(t *testing.T, parallelism int) {
// Ensure that key1 has some funds in the genesis block.
genesisBalance := big.NewInt(1000000)
gspec := &Genesis{
Config: &params.ChainConfig{HomesteadBlock: new(big.Int), FeeConfig: params.DefaultFeeConfig},
Alloc: types.GenesisAlloc{addr1: {Balance: genesisBalance}},
Config: params.WithExtra(
&params.ChainConfig{HomesteadBlock: new(big.Int)},
&params.ChainConfigExtra{FeeConfig: params.DefaultFeeConfig},
),
Alloc: types.GenesisAlloc{addr1: {Balance: genesisBalance}},
}

blockchain, err := createBlockChain(chainDB, pruningConfig, gspec, common.Hash{})
Expand Down Expand Up @@ -426,8 +429,11 @@ func TestUngracefulAsyncShutdown(t *testing.T) {
// Ensure that key1 has some funds in the genesis block.
genesisBalance := big.NewInt(1000000)
gspec := &Genesis{
Config: &params.ChainConfig{HomesteadBlock: new(big.Int), FeeConfig: params.DefaultFeeConfig},
Alloc: types.GenesisAlloc{addr1: {Balance: genesisBalance}},
Config: params.WithExtra(
&params.ChainConfig{HomesteadBlock: new(big.Int)},
&params.ChainConfigExtra{FeeConfig: params.DefaultFeeConfig},
),
Alloc: types.GenesisAlloc{addr1: {Balance: genesisBalance}},
}

blockchain, err := create(chainDB, gspec, common.Hash{})
Expand Down
Loading
Loading