-
Notifications
You must be signed in to change notification settings - Fork 276
Coreth 0.12.4 x apply #720
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
Changes from all commits
72e686e
8bc5df0
faea3b4
d9ef710
783606c
9f83a66
917b292
80bdf9f
6b133d0
799f5c1
5d60780
f79fced
b0d3c4c
eb7d162
d574e75
e883922
aa54388
47c2bee
821e3f8
a10a185
c5a2ea0
d1c41a2
4f4a6fd
a8fe9ff
c0c694f
af0c33f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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: ¶ms.ChainConfig{HomesteadBlock: new(big.Int), FeeConfig: params.DefaultFeeConfig}, | ||
Alloc: GenesisAlloc{addr1: {Balance: genesisBalance}}, | ||
GasLimit: params.DefaultFeeConfig.GasLimit.Uint64(), | ||
Config: ¶ms.ChainConfig{HomesteadBlock: new(big.Int)}, | ||
Alloc: GenesisAlloc{addr1: {Balance: genesisBalance}}, | ||
} | ||
|
||
blockchain, err := create(chainDB, gspec, common.Hash{}) | ||
|
@@ -639,9 +638,8 @@ func TestTransactionIndices(t *testing.T) { | |
addr2 = crypto.PubkeyToAddress(key2.PublicKey) | ||
funds = big.NewInt(10000000000000) | ||
gspec = &Genesis{ | ||
Config: ¶ms.ChainConfig{HomesteadBlock: new(big.Int), FeeConfig: params.DefaultFeeConfig}, | ||
Alloc: GenesisAlloc{addr1: {Balance: funds}}, | ||
GasLimit: params.DefaultFeeConfig.GasLimit.Uint64(), | ||
Config: ¶ms.ChainConfig{HomesteadBlock: new(big.Int)}, | ||
Alloc: GenesisAlloc{addr1: {Balance: funds}}, | ||
} | ||
signer = types.LatestSigner(gspec.Config) | ||
) | ||
|
@@ -1077,8 +1075,7 @@ func TestEIP3651(t *testing.T) { | |
addr2 = crypto.PubkeyToAddress(key2.PublicKey) | ||
funds = new(big.Int).Mul(common.Big1, big.NewInt(params.Ether)) | ||
gspec = &Genesis{ | ||
Config: params.TestChainConfig, | ||
GasLimit: params.TestChainConfig.FeeConfig.GasLimit.Uint64(), | ||
Config: params.TestChainConfig, | ||
Alloc: GenesisAlloc{ | ||
addr1: {Balance: funds}, | ||
addr2: {Balance: funds}, | ||
|
@@ -1110,6 +1107,7 @@ func TestEIP3651(t *testing.T) { | |
Balance: big.NewInt(0), | ||
}, | ||
}, | ||
GasLimit: params.TestChainConfig.FeeConfig.GasLimit.Uint64(), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we should keep the consistent order, Config, Alloc, GasLimit |
||
} | ||
) | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -126,8 +126,7 @@ func TestSetupGenesis(t *testing.T) { | |
// Advance to block #4, past the SubnetEVM transition block of customg. | ||
genesis := oldcustomg.MustCommit(db) | ||
|
||
bc, err := NewBlockChain(db, DefaultCacheConfig, &oldcustomg, dummy.NewFullFaker(), vm.Config{}, genesis.Hash(), false) | ||
require.NoError(t, err) | ||
bc, _ := NewBlockChain(db, DefaultCacheConfig, &oldcustomg, dummy.NewFullFaker(), vm.Config{}, genesis.Hash(), false) | ||
ceyonur marked this conversation as resolved.
Show resolved
Hide resolved
|
||
defer bc.Stop() | ||
|
||
blocks, _, _ := GenerateChain(oldcustomg.Config, genesis, dummy.NewFullFaker(), db, 4, 25, nil) | ||
|
@@ -238,23 +237,21 @@ func TestStatefulPrecompilesConfigure(t *testing.T) { | |
// regression test for precompile activation after header block | ||
func TestPrecompileActivationAfterHeaderBlock(t *testing.T) { | ||
db := rawdb.NewMemoryDatabase() | ||
copyCfg := *params.TestChainConfig | ||
customg := Genesis{ | ||
Config: ©Cfg, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this copy seems unnecessary |
||
Config: params.TestChainConfig, | ||
Alloc: GenesisAlloc{ | ||
{1}: {Balance: big.NewInt(1), Storage: map[common.Hash]common.Hash{{1}: {1}}}, | ||
}, | ||
GasLimit: params.TestChainConfig.FeeConfig.GasLimit.Uint64(), | ||
} | ||
bc, err := NewBlockChain(db, DefaultCacheConfig, &customg, dummy.NewFullFaker(), vm.Config{}, common.Hash{}, false) | ||
require.NoError(t, err) | ||
ceyonur marked this conversation as resolved.
Show resolved
Hide resolved
|
||
bc, _ := NewBlockChain(db, DefaultCacheConfig, &customg, dummy.NewFullFaker(), vm.Config{}, common.Hash{}, false) | ||
defer bc.Stop() | ||
|
||
// Advance header to block #4, past the ContractDeployerAllowListConfig. | ||
_, blocks, _, _ := GenerateChainWithGenesis(&customg, dummy.NewFullFaker(), 4, 25, nil) | ||
|
||
require := require.New(t) | ||
_, err = bc.InsertChain(blocks) | ||
_, err := bc.InsertChain(blocks) | ||
require.NoError(err) | ||
|
||
// accept up to block #2 | ||
|
@@ -267,24 +264,24 @@ func TestPrecompileActivationAfterHeaderBlock(t *testing.T) { | |
// header must be bigger than last accepted | ||
require.Greater(block.Time, bc.lastAccepted.Time()) | ||
|
||
activatedGenesis := customg | ||
contractDeployerTimestamp := utils.NewUint64(51) | ||
contractDeployerConfig := deployerallowlist.NewConfig(contractDeployerTimestamp, nil, nil) | ||
activatedGenesis.Config.UpgradeConfig.PrecompileUpgrades = []params.PrecompileUpgrade{ | ||
activatedGenesisConfig := *customg.Config | ||
contractDeployerConfig := deployerallowlist.NewConfig(utils.NewUint64(51), nil, nil) | ||
activatedGenesisConfig.UpgradeConfig.PrecompileUpgrades = []params.PrecompileUpgrade{ | ||
{ | ||
Config: contractDeployerConfig, | ||
}, | ||
} | ||
customg.Config = &activatedGenesisConfig | ||
|
||
// assert block is after the activation block | ||
require.Greater(block.Time, *contractDeployerTimestamp) | ||
require.Greater(block.Time, *contractDeployerConfig.Timestamp()) | ||
// assert last accepted block is before the activation block | ||
require.Less(bc.lastAccepted.Time(), *contractDeployerTimestamp) | ||
require.Less(bc.lastAccepted.Time(), *contractDeployerConfig.Timestamp()) | ||
|
||
// This should not return any error since the last accepted block is before the activation block. | ||
config, _, err := setupGenesisBlock(db, trie.NewDatabase(db), &activatedGenesis, bc.lastAccepted.Hash()) | ||
config, _, err := setupGenesisBlock(db, trie.NewDatabase(db), &customg, bc.lastAccepted.Hash()) | ||
require.NoError(err) | ||
if !reflect.DeepEqual(config, activatedGenesis.Config) { | ||
t.Errorf("returned %v\nwant %v", config, activatedGenesis.Config) | ||
if !reflect.DeepEqual(config, customg.Config) { | ||
t.Errorf("returned %v\nwant %v", config, customg.Config) | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,9 +50,8 @@ func getBlock(transactions int, uncles int, dataSize int) *types.Block { | |
address = crypto.PubkeyToAddress(key.PublicKey) | ||
funds = big.NewInt(50000 * 225000000000 * 200) | ||
gspec = &Genesis{ | ||
Config: params.TestChainConfig, | ||
Alloc: GenesisAlloc{address: {Balance: funds}}, | ||
GasLimit: params.TestChainConfig.FeeConfig.GasLimit.Uint64(), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We probably need this gas limit There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the tests are passing without it I don't know why we should specify it? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hmm seems we never actually run those checks. this still seems wrong to not specify GasLimit. but let's skip this until this starts failing. |
||
Config: params.TestChainConfig, | ||
Alloc: GenesisAlloc{address: {Balance: funds}}, | ||
} | ||
) | ||
// We need to generate as many blocks +1 as uncles | ||
|
Uh oh!
There was an error while loading. Please reload this page.