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: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
shell: bash
- uses: actions/setup-go@v3
with:
go-version: "1.20"
go-version: "1.19"
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
Expand All @@ -33,7 +33,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: "1.20"
go-version: "1.19"
- run: go mod download
shell: bash
- run: ./scripts/build.sh ./build/subnetevm
Expand Down Expand Up @@ -64,7 +64,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: "1.20"
go-version: "1.19"
- name: Use Node.js
uses: actions/setup-node@v3
with:
Expand Down
10 changes: 4 additions & 6 deletions core/blockchain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,8 @@ func TestTrieCleanJournal(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: GenesisAlloc{addr1: {Balance: genesisBalance}},
GasLimit: params.DefaultFeeConfig.GasLimit.Uint64(),
Config: &params.ChainConfig{HomesteadBlock: new(big.Int)},
Alloc: GenesisAlloc{addr1: {Balance: genesisBalance}},
}

blockchain, err := create(chainDB, gspec, common.Hash{})
Expand Down Expand Up @@ -639,9 +638,8 @@ func TestTransactionIndices(t *testing.T) {
addr2 = crypto.PubkeyToAddress(key2.PublicKey)
funds = big.NewInt(10000000000000)
gspec = &Genesis{
Config: &params.ChainConfig{HomesteadBlock: new(big.Int), FeeConfig: params.DefaultFeeConfig},
Alloc: GenesisAlloc{addr1: {Balance: funds}},
GasLimit: params.DefaultFeeConfig.GasLimit.Uint64(),
Config: &params.ChainConfig{HomesteadBlock: new(big.Int)},
Alloc: GenesisAlloc{addr1: {Balance: funds}},
}
signer = types.LatestSigner(gspec.Config)
)
Expand Down
4 changes: 1 addition & 3 deletions core/state_processor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,6 @@ func TestStateProcessorErrors(t *testing.T) {
gspec = &Genesis{
Config: &params.ChainConfig{
ChainID: big.NewInt(1),
FeeConfig: params.DefaultFeeConfig,
HomesteadBlock: big.NewInt(0),
EIP150Block: big.NewInt(0),
EIP150Hash: common.Hash{},
Expand All @@ -236,7 +235,6 @@ func TestStateProcessorErrors(t *testing.T) {
Nonce: 0,
},
},
GasLimit: params.TestChainConfig.FeeConfig.GasLimit.Uint64(),
}
blockchain, _ = NewBlockChain(db, DefaultCacheConfig, gspec, dummy.NewCoinbaseFaker(), vm.Config{}, common.Hash{}, false)
)
Expand Down Expand Up @@ -407,7 +405,7 @@ func TestBadTxAllowListBlock(t *testing.T) {
Nonce: 0,
},
},
GasLimit: params.TestChainConfig.FeeConfig.GasLimit.Uint64(),
GasLimit: config.FeeConfig.GasLimit.Uint64(),
}
blockchain, _ = NewBlockChain(db, DefaultCacheConfig, gspec, dummy.NewCoinbaseFaker(), vm.Config{}, common.Hash{}, false)
)
Expand Down
30 changes: 7 additions & 23 deletions core/test_blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,8 @@ func TestInsertChainAcceptSingleBlock(t *testing.T, create func(db ethdb.Databas
gspec := &Genesis{
Config: &params.ChainConfig{
HomesteadBlock: new(big.Int),
FeeConfig: params.DefaultFeeConfig,
},
Alloc: GenesisAlloc{addr1: {Balance: genesisBalance}},
GasLimit: params.DefaultFeeConfig.GasLimit.Uint64(),
Alloc: GenesisAlloc{addr1: {Balance: genesisBalance}},
}
blockchain, err := create(chainDB, gspec, common.Hash{})
if err != nil {
Expand Down Expand Up @@ -272,10 +270,8 @@ func TestInsertLongForkedChain(t *testing.T, create func(db ethdb.Database, gspe
gspec := &Genesis{
Config: &params.ChainConfig{
HomesteadBlock: new(big.Int),
FeeConfig: params.DefaultFeeConfig,
},
Alloc: GenesisAlloc{addr1: {Balance: genesisBalance}},
GasLimit: params.DefaultFeeConfig.GasLimit.Uint64(),
Alloc: GenesisAlloc{addr1: {Balance: genesisBalance}},
}

blockchain, err := create(chainDB, gspec, common.Hash{})
Expand Down Expand Up @@ -439,10 +435,8 @@ func TestAcceptNonCanonicalBlock(t *testing.T, create func(db ethdb.Database, gs
gspec := &Genesis{
Config: &params.ChainConfig{
HomesteadBlock: new(big.Int),
FeeConfig: params.DefaultFeeConfig,
},
Alloc: GenesisAlloc{addr1: {Balance: genesisBalance}},
GasLimit: params.DefaultFeeConfig.GasLimit.Uint64(),
Alloc: GenesisAlloc{addr1: {Balance: genesisBalance}},
}

blockchain, err := create(chainDB, gspec, common.Hash{})
Expand Down Expand Up @@ -550,10 +544,8 @@ func TestSetPreferenceRewind(t *testing.T, create func(db ethdb.Database, gspec
gspec := &Genesis{
Config: &params.ChainConfig{
HomesteadBlock: new(big.Int),
FeeConfig: params.DefaultFeeConfig,
},
Alloc: GenesisAlloc{addr1: {Balance: genesisBalance}},
GasLimit: params.DefaultFeeConfig.GasLimit.Uint64(),
Alloc: GenesisAlloc{addr1: {Balance: genesisBalance}},
}

blockchain, err := create(chainDB, gspec, common.Hash{})
Expand Down Expand Up @@ -686,13 +678,11 @@ func TestBuildOnVariousStages(t *testing.T, create func(db ethdb.Database, gspec
gspec := &Genesis{
Config: &params.ChainConfig{
HomesteadBlock: new(big.Int),
FeeConfig: params.DefaultFeeConfig,
},
Alloc: GenesisAlloc{
addr1: {Balance: genesisBalance},
addr3: {Balance: genesisBalance},
},
GasLimit: params.DefaultFeeConfig.GasLimit.Uint64(),
}

blockchain, err := create(chainDB, gspec, common.Hash{})
Expand Down Expand Up @@ -846,10 +836,8 @@ func TestEmptyBlocks(t *testing.T, create func(db ethdb.Database, gspec *Genesis
gspec := &Genesis{
Config: &params.ChainConfig{
HomesteadBlock: new(big.Int),
FeeConfig: params.DefaultFeeConfig,
},
Alloc: GenesisAlloc{},
GasLimit: params.DefaultFeeConfig.GasLimit.Uint64(),
Alloc: GenesisAlloc{},
}

blockchain, err := create(chainDB, gspec, common.Hash{})
Expand Down Expand Up @@ -1005,10 +993,8 @@ func TestAcceptBlockIdenticalStateRoot(t *testing.T, create func(db ethdb.Databa
gspec := &Genesis{
Config: &params.ChainConfig{
HomesteadBlock: new(big.Int),
FeeConfig: params.DefaultFeeConfig,
},
Alloc: GenesisAlloc{addr1: {Balance: genesisBalance}},
GasLimit: params.DefaultFeeConfig.GasLimit.Uint64(),
Alloc: GenesisAlloc{addr1: {Balance: genesisBalance}},
}

blockchain, err := create(chainDB, gspec, common.Hash{})
Expand Down Expand Up @@ -1152,10 +1138,8 @@ func TestReprocessAcceptBlockIdenticalStateRoot(t *testing.T, create func(db eth
gspec := &Genesis{
Config: &params.ChainConfig{
HomesteadBlock: new(big.Int),
FeeConfig: params.DefaultFeeConfig,
},
Alloc: GenesisAlloc{addr1: {Balance: genesisBalance}},
GasLimit: params.DefaultFeeConfig.GasLimit.Uint64(),
Alloc: GenesisAlloc{addr1: {Balance: genesisBalance}},
}

blockchain, err := create(chainDB, gspec, common.Hash{})
Expand Down
4 changes: 2 additions & 2 deletions eth/tracers/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,13 +211,13 @@ func TestTraceCall(t *testing.T) {
// Initialize test accounts
accounts := newAccounts(3)
genesis := &core.Genesis{
Config: params.SubnetEVMDefaultChainConfig, // TODO: go-ethereum has not enabled Shanghai yet, so we use SubnetEVM here so tests pass.
Config: params.TestSubnetEVMConfig, // TODO: go-ethereum has not enabled Shanghai yet, so we use SubnetEVM here so tests pass.
Alloc: core.GenesisAlloc{
accounts[0].addr: {Balance: big.NewInt(params.Ether)},
accounts[1].addr: {Balance: big.NewInt(params.Ether)},
accounts[2].addr: {Balance: big.NewInt(params.Ether)},
},
GasLimit: params.SubnetEVMDefaultChainConfig.FeeConfig.GasLimit.Uint64(),
GasLimit: params.TestSubnetEVMConfig.FeeConfig.GasLimit.Uint64(),
}
genBlocks := 10
signer := types.HomesteadSigner{}
Expand Down
36 changes: 34 additions & 2 deletions params/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,40 @@ func (c *ChainConfig) Description() string {
banner += fmt.Sprintf(" - Muir Glacier: #%-8v (https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/muir-glacier.md)\n", c.MuirGlacierBlock)
}
banner += "Mandatory Upgrades:\n"
banner += fmt.Sprintf(" - SubnetEVM Timestamp: #%-8v (https://github.com/ava-labs/avalanchego/releases/tag/v1.10.0)\n", c.SubnetEVMTimestamp)
banner += fmt.Sprintf(" - DUpgrade Timestamp: #%-8v (https://github.com/ava-labs/avalanchego/releases/tag/v1.11.0)\n", c.DUpgradeTimestamp)
banner += fmt.Sprintf(" - SubnetEVM Timestamp: #%-8d (https://github.com/ava-labs/avalanchego/releases/tag/v1.10.0)\n", c.SubnetEVMTimestamp)
banner += fmt.Sprintf(" - DUpgrade Timestamp: #%-8d (https://github.com/ava-labs/avalanchego/releases/tag/v1.11.0)\n", c.DUpgradeTimestamp)
banner += "\n"

// Add Subnet-EVM custom fields
optionalNetworkUpgradeBytes, err := json.Marshal(c.OptionalNetworkUpgrades)
if err != nil {
optionalNetworkUpgradeBytes = []byte("cannot marshal OptionalNetworkUpgrades")
}
banner += fmt.Sprintf("Optional Network Upgrades: %s", string(optionalNetworkUpgradeBytes))
banner += "\n"

precompileUpgradeBytes, err := json.Marshal(c.GenesisPrecompiles)
if err != nil {
precompileUpgradeBytes = []byte("cannot marshal PrecompileUpgrade")
}
banner += fmt.Sprintf("Precompile Upgrades: %s", string(precompileUpgradeBytes))
banner += "\n"

upgradeConfigBytes, err := json.Marshal(c.UpgradeConfig)
if err != nil {
upgradeConfigBytes = []byte("cannot marshal UpgradeConfig")
}
banner += fmt.Sprintf("Upgrade Config: %s", string(upgradeConfigBytes))
banner += "\n"

feeBytes, err := json.Marshal(c.FeeConfig)
if err != nil {
feeBytes = []byte("cannot marshal FeeConfig")
}
banner += fmt.Sprintf("Fee Config: %s", string(feeBytes))
banner += "\n"

banner += fmt.Sprintf("Allow Fee Recipients: %v", c.AllowFeeRecipients)
banner += "\n"
return banner
}
Expand Down