Skip to content

Commit c0c694f

Browse files
authored
Coreth 0.12.4 x apply rev (#736)
1 parent a8fe9ff commit c0c694f

File tree

6 files changed

+51
-39
lines changed

6 files changed

+51
-39
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
shell: bash
1919
- uses: actions/setup-go@v3
2020
with:
21-
go-version: "1.20"
21+
go-version: "1.19"
2222
- name: golangci-lint
2323
uses: golangci/golangci-lint-action@v3
2424
with:
@@ -33,7 +33,7 @@ jobs:
3333
- uses: actions/checkout@v3
3434
- uses: actions/setup-go@v3
3535
with:
36-
go-version: "1.20"
36+
go-version: "1.19"
3737
- run: go mod download
3838
shell: bash
3939
- run: ./scripts/build.sh ./build/subnetevm
@@ -64,7 +64,7 @@ jobs:
6464
- name: Set up Go
6565
uses: actions/setup-go@v3
6666
with:
67-
go-version: "1.20"
67+
go-version: "1.19"
6868
- name: Use Node.js
6969
uses: actions/setup-node@v3
7070
with:

core/blockchain_test.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,8 @@ func TestTrieCleanJournal(t *testing.T) {
143143
// Ensure that key1 has some funds in the genesis block.
144144
genesisBalance := big.NewInt(1000000)
145145
gspec := &Genesis{
146-
Config: &params.ChainConfig{HomesteadBlock: new(big.Int), FeeConfig: params.DefaultFeeConfig},
147-
Alloc: GenesisAlloc{addr1: {Balance: genesisBalance}},
148-
GasLimit: params.DefaultFeeConfig.GasLimit.Uint64(),
146+
Config: &params.ChainConfig{HomesteadBlock: new(big.Int)},
147+
Alloc: GenesisAlloc{addr1: {Balance: genesisBalance}},
149148
}
150149

151150
blockchain, err := create(chainDB, gspec, common.Hash{})
@@ -639,9 +638,8 @@ func TestTransactionIndices(t *testing.T) {
639638
addr2 = crypto.PubkeyToAddress(key2.PublicKey)
640639
funds = big.NewInt(10000000000000)
641640
gspec = &Genesis{
642-
Config: &params.ChainConfig{HomesteadBlock: new(big.Int), FeeConfig: params.DefaultFeeConfig},
643-
Alloc: GenesisAlloc{addr1: {Balance: funds}},
644-
GasLimit: params.DefaultFeeConfig.GasLimit.Uint64(),
641+
Config: &params.ChainConfig{HomesteadBlock: new(big.Int)},
642+
Alloc: GenesisAlloc{addr1: {Balance: funds}},
645643
}
646644
signer = types.LatestSigner(gspec.Config)
647645
)

core/state_processor_test.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,6 @@ func TestStateProcessorErrors(t *testing.T) {
218218
gspec = &Genesis{
219219
Config: &params.ChainConfig{
220220
ChainID: big.NewInt(1),
221-
FeeConfig: params.DefaultFeeConfig,
222221
HomesteadBlock: big.NewInt(0),
223222
EIP150Block: big.NewInt(0),
224223
EIP150Hash: common.Hash{},
@@ -236,7 +235,6 @@ func TestStateProcessorErrors(t *testing.T) {
236235
Nonce: 0,
237236
},
238237
},
239-
GasLimit: params.TestChainConfig.FeeConfig.GasLimit.Uint64(),
240238
}
241239
blockchain, _ = NewBlockChain(db, DefaultCacheConfig, gspec, dummy.NewCoinbaseFaker(), vm.Config{}, common.Hash{}, false)
242240
)
@@ -407,7 +405,7 @@ func TestBadTxAllowListBlock(t *testing.T) {
407405
Nonce: 0,
408406
},
409407
},
410-
GasLimit: params.TestChainConfig.FeeConfig.GasLimit.Uint64(),
408+
GasLimit: config.FeeConfig.GasLimit.Uint64(),
411409
}
412410
blockchain, _ = NewBlockChain(db, DefaultCacheConfig, gspec, dummy.NewCoinbaseFaker(), vm.Config{}, common.Hash{}, false)
413411
)

core/test_blockchain.go

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -199,10 +199,8 @@ func TestInsertChainAcceptSingleBlock(t *testing.T, create func(db ethdb.Databas
199199
gspec := &Genesis{
200200
Config: &params.ChainConfig{
201201
HomesteadBlock: new(big.Int),
202-
FeeConfig: params.DefaultFeeConfig,
203202
},
204-
Alloc: GenesisAlloc{addr1: {Balance: genesisBalance}},
205-
GasLimit: params.DefaultFeeConfig.GasLimit.Uint64(),
203+
Alloc: GenesisAlloc{addr1: {Balance: genesisBalance}},
206204
}
207205
blockchain, err := create(chainDB, gspec, common.Hash{})
208206
if err != nil {
@@ -272,10 +270,8 @@ func TestInsertLongForkedChain(t *testing.T, create func(db ethdb.Database, gspe
272270
gspec := &Genesis{
273271
Config: &params.ChainConfig{
274272
HomesteadBlock: new(big.Int),
275-
FeeConfig: params.DefaultFeeConfig,
276273
},
277-
Alloc: GenesisAlloc{addr1: {Balance: genesisBalance}},
278-
GasLimit: params.DefaultFeeConfig.GasLimit.Uint64(),
274+
Alloc: GenesisAlloc{addr1: {Balance: genesisBalance}},
279275
}
280276

281277
blockchain, err := create(chainDB, gspec, common.Hash{})
@@ -439,10 +435,8 @@ func TestAcceptNonCanonicalBlock(t *testing.T, create func(db ethdb.Database, gs
439435
gspec := &Genesis{
440436
Config: &params.ChainConfig{
441437
HomesteadBlock: new(big.Int),
442-
FeeConfig: params.DefaultFeeConfig,
443438
},
444-
Alloc: GenesisAlloc{addr1: {Balance: genesisBalance}},
445-
GasLimit: params.DefaultFeeConfig.GasLimit.Uint64(),
439+
Alloc: GenesisAlloc{addr1: {Balance: genesisBalance}},
446440
}
447441

448442
blockchain, err := create(chainDB, gspec, common.Hash{})
@@ -550,10 +544,8 @@ func TestSetPreferenceRewind(t *testing.T, create func(db ethdb.Database, gspec
550544
gspec := &Genesis{
551545
Config: &params.ChainConfig{
552546
HomesteadBlock: new(big.Int),
553-
FeeConfig: params.DefaultFeeConfig,
554547
},
555-
Alloc: GenesisAlloc{addr1: {Balance: genesisBalance}},
556-
GasLimit: params.DefaultFeeConfig.GasLimit.Uint64(),
548+
Alloc: GenesisAlloc{addr1: {Balance: genesisBalance}},
557549
}
558550

559551
blockchain, err := create(chainDB, gspec, common.Hash{})
@@ -686,13 +678,11 @@ func TestBuildOnVariousStages(t *testing.T, create func(db ethdb.Database, gspec
686678
gspec := &Genesis{
687679
Config: &params.ChainConfig{
688680
HomesteadBlock: new(big.Int),
689-
FeeConfig: params.DefaultFeeConfig,
690681
},
691682
Alloc: GenesisAlloc{
692683
addr1: {Balance: genesisBalance},
693684
addr3: {Balance: genesisBalance},
694685
},
695-
GasLimit: params.DefaultFeeConfig.GasLimit.Uint64(),
696686
}
697687

698688
blockchain, err := create(chainDB, gspec, common.Hash{})
@@ -846,10 +836,8 @@ func TestEmptyBlocks(t *testing.T, create func(db ethdb.Database, gspec *Genesis
846836
gspec := &Genesis{
847837
Config: &params.ChainConfig{
848838
HomesteadBlock: new(big.Int),
849-
FeeConfig: params.DefaultFeeConfig,
850839
},
851-
Alloc: GenesisAlloc{},
852-
GasLimit: params.DefaultFeeConfig.GasLimit.Uint64(),
840+
Alloc: GenesisAlloc{},
853841
}
854842

855843
blockchain, err := create(chainDB, gspec, common.Hash{})
@@ -1005,10 +993,8 @@ func TestAcceptBlockIdenticalStateRoot(t *testing.T, create func(db ethdb.Databa
1005993
gspec := &Genesis{
1006994
Config: &params.ChainConfig{
1007995
HomesteadBlock: new(big.Int),
1008-
FeeConfig: params.DefaultFeeConfig,
1009996
},
1010-
Alloc: GenesisAlloc{addr1: {Balance: genesisBalance}},
1011-
GasLimit: params.DefaultFeeConfig.GasLimit.Uint64(),
997+
Alloc: GenesisAlloc{addr1: {Balance: genesisBalance}},
1012998
}
1013999

10141000
blockchain, err := create(chainDB, gspec, common.Hash{})
@@ -1152,10 +1138,8 @@ func TestReprocessAcceptBlockIdenticalStateRoot(t *testing.T, create func(db eth
11521138
gspec := &Genesis{
11531139
Config: &params.ChainConfig{
11541140
HomesteadBlock: new(big.Int),
1155-
FeeConfig: params.DefaultFeeConfig,
11561141
},
1157-
Alloc: GenesisAlloc{addr1: {Balance: genesisBalance}},
1158-
GasLimit: params.DefaultFeeConfig.GasLimit.Uint64(),
1142+
Alloc: GenesisAlloc{addr1: {Balance: genesisBalance}},
11591143
}
11601144

11611145
blockchain, err := create(chainDB, gspec, common.Hash{})

eth/tracers/api_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,13 +211,13 @@ func TestTraceCall(t *testing.T) {
211211
// Initialize test accounts
212212
accounts := newAccounts(3)
213213
genesis := &core.Genesis{
214-
Config: params.SubnetEVMDefaultChainConfig, // TODO: go-ethereum has not enabled Shanghai yet, so we use SubnetEVM here so tests pass.
214+
Config: params.TestSubnetEVMConfig, // TODO: go-ethereum has not enabled Shanghai yet, so we use SubnetEVM here so tests pass.
215215
Alloc: core.GenesisAlloc{
216216
accounts[0].addr: {Balance: big.NewInt(params.Ether)},
217217
accounts[1].addr: {Balance: big.NewInt(params.Ether)},
218218
accounts[2].addr: {Balance: big.NewInt(params.Ether)},
219219
},
220-
GasLimit: params.SubnetEVMDefaultChainConfig.FeeConfig.GasLimit.Uint64(),
220+
GasLimit: params.TestSubnetEVMConfig.FeeConfig.GasLimit.Uint64(),
221221
}
222222
genBlocks := 10
223223
signer := types.HomesteadSigner{}

params/config.go

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,8 +284,40 @@ func (c *ChainConfig) Description() string {
284284
banner += fmt.Sprintf(" - Muir Glacier: #%-8v (https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/muir-glacier.md)\n", c.MuirGlacierBlock)
285285
}
286286
banner += "Mandatory Upgrades:\n"
287-
banner += fmt.Sprintf(" - SubnetEVM Timestamp: #%-8v (https://github.com/ava-labs/avalanchego/releases/tag/v1.10.0)\n", c.SubnetEVMTimestamp)
288-
banner += fmt.Sprintf(" - DUpgrade Timestamp: #%-8v (https://github.com/ava-labs/avalanchego/releases/tag/v1.11.0)\n", c.DUpgradeTimestamp)
287+
banner += fmt.Sprintf(" - SubnetEVM Timestamp: #%-8d (https://github.com/ava-labs/avalanchego/releases/tag/v1.10.0)\n", c.SubnetEVMTimestamp)
288+
banner += fmt.Sprintf(" - DUpgrade Timestamp: #%-8d (https://github.com/ava-labs/avalanchego/releases/tag/v1.11.0)\n", c.DUpgradeTimestamp)
289+
banner += "\n"
290+
291+
// Add Subnet-EVM custom fields
292+
optionalNetworkUpgradeBytes, err := json.Marshal(c.OptionalNetworkUpgrades)
293+
if err != nil {
294+
optionalNetworkUpgradeBytes = []byte("cannot marshal OptionalNetworkUpgrades")
295+
}
296+
banner += fmt.Sprintf("Optional Network Upgrades: %s", string(optionalNetworkUpgradeBytes))
297+
banner += "\n"
298+
299+
precompileUpgradeBytes, err := json.Marshal(c.GenesisPrecompiles)
300+
if err != nil {
301+
precompileUpgradeBytes = []byte("cannot marshal PrecompileUpgrade")
302+
}
303+
banner += fmt.Sprintf("Precompile Upgrades: %s", string(precompileUpgradeBytes))
304+
banner += "\n"
305+
306+
upgradeConfigBytes, err := json.Marshal(c.UpgradeConfig)
307+
if err != nil {
308+
upgradeConfigBytes = []byte("cannot marshal UpgradeConfig")
309+
}
310+
banner += fmt.Sprintf("Upgrade Config: %s", string(upgradeConfigBytes))
311+
banner += "\n"
312+
313+
feeBytes, err := json.Marshal(c.FeeConfig)
314+
if err != nil {
315+
feeBytes = []byte("cannot marshal FeeConfig")
316+
}
317+
banner += fmt.Sprintf("Fee Config: %s", string(feeBytes))
318+
banner += "\n"
319+
320+
banner += fmt.Sprintf("Allow Fee Recipients: %v", c.AllowFeeRecipients)
289321
banner += "\n"
290322
return banner
291323
}

0 commit comments

Comments
 (0)