mirror of
https://github.com/luxfi/evm.git
synced 2026-09-24 00:27:44 +00:00
rename: Etna → Quasar Edition
Wire-level renames in EVM:
- extras.NetworkUpgrades.EtnaTimestamp → QuasarTimestamp
json tag etnaTimestamp → quasarTimestamp
- extras.NetworkUpgrades.IsEtna() → IsQuasar()
- extras.LuxRules.IsEtna → IsQuasar
- params.RulesExtra.IsEtna → IsQuasar
- extras.TestEtnaChainConfig → TestQuasarChainConfig
- params.TestEtnaChainConfig → TestQuasarChainConfig
- upgradetest.Etna fork enum → Quasar (luxfi/upgrade dep)
Test JSON fixtures (mainnet_upgrade_v46, testnet_upgrade_v47, embedded
genesis_skippostmerge_test, precompile_upgrade_rollout_test) flipped from
"etnaTimestamp" → "quasarTimestamp".
Also patched .disabled test files for grep cleanliness so future grep -rn
'Etna' returns 0 outside historical RELEASES.md.
Bumps luxfi/upgrade@main + luxfi/constants@main with their renamed symbols.
No backcompat aliases — forwards-only.
This commit is contained in:
@@ -63,7 +63,7 @@ func TestSkipPostMergeFieldsGenesisHash(t *testing.T) {
|
||||
"shanghaiTime": 0,
|
||||
"terminalTotalDifficulty": 0,
|
||||
"durangoTimestamp": 0,
|
||||
"etnaTimestamp": 0,
|
||||
"quasarTimestamp": 0,
|
||||
"fortunaTimestamp": 0,
|
||||
"graniteTimestamp": 0
|
||||
},
|
||||
@@ -143,7 +143,7 @@ func TestPostMergeFieldsActiveWhenFlagFalse(t *testing.T) {
|
||||
"shanghaiTime": 0,
|
||||
"terminalTotalDifficulty": 0,
|
||||
"durangoTimestamp": 0,
|
||||
"etnaTimestamp": 0,
|
||||
"quasarTimestamp": 0,
|
||||
"fortunaTimestamp": 0,
|
||||
"graniteTimestamp": 0
|
||||
},
|
||||
|
||||
@@ -1195,8 +1195,8 @@ func overrideConfig(original *params.ChainConfig, override *params.ChainConfig)
|
||||
params.GetExtra(copy).DurangoTimestamp = timestamp
|
||||
canon = false
|
||||
}
|
||||
if timestamp := overrideExtra.EtnaTimestamp; timestamp != nil {
|
||||
params.GetExtra(copy).EtnaTimestamp = timestamp
|
||||
if timestamp := overrideExtra.QuasarTimestamp; timestamp != nil {
|
||||
params.GetExtra(copy).QuasarTimestamp = timestamp
|
||||
canon = false
|
||||
}
|
||||
if timestamp := overrideExtra.FortunaTimestamp; timestamp != nil {
|
||||
|
||||
@@ -18,7 +18,7 @@ require (
|
||||
github.com/luxfi/cache v1.2.1
|
||||
github.com/luxfi/codec v1.1.4
|
||||
github.com/luxfi/consensus v1.24.0
|
||||
github.com/luxfi/constants v1.5.7
|
||||
github.com/luxfi/constants v1.5.8-0.20260603055356-93c2c2ceb9ca
|
||||
github.com/luxfi/crypto v1.19.15
|
||||
github.com/luxfi/database v1.19.0
|
||||
github.com/luxfi/filesystem v0.0.1
|
||||
@@ -38,7 +38,7 @@ require (
|
||||
github.com/luxfi/sys v0.0.0-20260110090042-50187ec5ffd8
|
||||
github.com/luxfi/timer v1.0.2
|
||||
github.com/luxfi/trace v0.1.4
|
||||
github.com/luxfi/upgrade v1.0.0
|
||||
github.com/luxfi/upgrade v1.0.1-0.20260603055252-f51810805436
|
||||
github.com/luxfi/utils v1.1.4
|
||||
github.com/luxfi/validators v1.2.0
|
||||
github.com/luxfi/version v1.0.1
|
||||
|
||||
@@ -220,6 +220,8 @@ github.com/luxfi/consensus v1.24.0 h1:vyBPYPeZbbZutUCMxKBW7Ief9+8OZB7cu3MfNc87xY
|
||||
github.com/luxfi/consensus v1.24.0/go.mod h1:eFknd+fzTmGEa/FzxgoL6unccnHGVxxOrZUZdReWII0=
|
||||
github.com/luxfi/constants v1.5.7 h1:a1tCMdxd+pClPMIPOaI9vcYGNy6cQIc2rubac2Trc0k=
|
||||
github.com/luxfi/constants v1.5.7/go.mod h1:z+Wc7skybZAA+xuBWNcmtv402S/BFqixL+FiSQXPg8U=
|
||||
github.com/luxfi/constants v1.5.8-0.20260603055356-93c2c2ceb9ca h1:N2lM2gMJ2Hk5yZ6GqURWtg6nIVtodsjqMe+MGNiuCNw=
|
||||
github.com/luxfi/constants v1.5.8-0.20260603055356-93c2c2ceb9ca/go.mod h1:z+Wc7skybZAA+xuBWNcmtv402S/BFqixL+FiSQXPg8U=
|
||||
github.com/luxfi/container v0.0.4 h1:BXhF82WyfqVP5mjlNcr7tP0Fcnvl0Ap1rkiu+rq5XuM=
|
||||
github.com/luxfi/container v0.0.4/go.mod h1:Z3SpmMF5d4t77MM0nHYXURpn+EMVaeu1fhbd/3BGaek=
|
||||
github.com/luxfi/corona v0.4.1 h1:DGMdZMrENl6vmJf9CgiQMD8c5ORSTMymL0z9KgcZstk=
|
||||
@@ -284,6 +286,8 @@ github.com/luxfi/trace v0.1.4 h1:ttCRyXGwWuz232se+lIUqhWHBoTuvPLhHH/hLWyqtaM=
|
||||
github.com/luxfi/trace v0.1.4/go.mod h1:Az7HWh+PCuPftXjQu+ssjv51nKauaFu+q2un7bmZYBA=
|
||||
github.com/luxfi/upgrade v1.0.0 h1:mM6YXvU8VzoclA7IdtuE5bmnMuFquYxjKUUW84LJz54=
|
||||
github.com/luxfi/upgrade v1.0.0/go.mod h1:DZF7dO4erhUEKf907B2e65k4/vGkCPkUngpvIEUS3eI=
|
||||
github.com/luxfi/upgrade v1.0.1-0.20260603055252-f51810805436 h1:0VTZNA1+rXh9Tr0OpGmkwg+mYC6xgLv+XymMlZvLH/E=
|
||||
github.com/luxfi/upgrade v1.0.1-0.20260603055252-f51810805436/go.mod h1:zBBG2VkZmWLr6u6DxzI/4DSFYjHizHrr7MqCDZkMSJc=
|
||||
github.com/luxfi/utils v1.1.4 h1:8OY0jXCkpp6OotN1Y++6DATJkvtEwzq2k0p56imJlAk=
|
||||
github.com/luxfi/utils v1.1.4/go.mod h1:c3yz1RjzrB+cs5GZm+q1T3/2cCKElO9vxm9yRRtgSEM=
|
||||
github.com/luxfi/validators v1.2.0 h1:VygpiBqBAdGrfkb7xzE2yrVmnXaqE+hm8FLWdGXO7G8=
|
||||
|
||||
+2
-2
@@ -172,7 +172,7 @@ var (
|
||||
extras.TestDurangoChainConfig,
|
||||
)
|
||||
|
||||
TestEtnaChainConfig = WithExtra(
|
||||
TestQuasarChainConfig = WithExtra(
|
||||
&ChainConfig{
|
||||
ChainID: big.NewInt(1337),
|
||||
HomesteadBlock: big.NewInt(0),
|
||||
@@ -196,7 +196,7 @@ var (
|
||||
},
|
||||
},
|
||||
},
|
||||
extras.TestEtnaChainConfig,
|
||||
extras.TestQuasarChainConfig,
|
||||
)
|
||||
|
||||
TestFortunaChainConfig = WithExtra(
|
||||
|
||||
@@ -66,7 +66,7 @@ func getPrecompileAddress(config precompileconfig.Config) common.Address {
|
||||
type RulesExtra struct {
|
||||
IsEVM bool
|
||||
IsDurango bool
|
||||
IsEtna bool
|
||||
IsQuasar bool
|
||||
IsFortuna bool
|
||||
IsGranite bool
|
||||
|
||||
@@ -138,8 +138,8 @@ func SetEthUpgrades(c *ChainConfig) error {
|
||||
c.ShanghaiTime = utils.NewUint64(*durango)
|
||||
}
|
||||
|
||||
if etna := extra.EtnaTimestamp; etna != nil && *etna < unscheduledActivation {
|
||||
c.CancunTime = utils.NewUint64(*etna)
|
||||
if quasar := extra.QuasarTimestamp; quasar != nil && *quasar < unscheduledActivation {
|
||||
c.CancunTime = utils.NewUint64(*quasar)
|
||||
// Cancun requires BlobScheduleConfig for CalcExcessBlobGas in block building.
|
||||
// Without this, latestBlobConfig() returns nil causing a nil pointer panic.
|
||||
if c.BlobScheduleConfig == nil {
|
||||
@@ -330,7 +330,7 @@ func GetRulesExtra(rules Rules) RulesExtra {
|
||||
rulesExtra := RulesExtra{
|
||||
IsEVM: true,
|
||||
IsDurango: true,
|
||||
IsEtna: true,
|
||||
IsQuasar: true,
|
||||
IsFortuna: true,
|
||||
IsGranite: true,
|
||||
PredicatersExist: false,
|
||||
@@ -339,7 +339,7 @@ func GetRulesExtra(rules Rules) RulesExtra {
|
||||
rulesExtra.LuxRules = extras.LuxRules{
|
||||
IsEVM: true,
|
||||
IsDurango: true,
|
||||
IsEtna: true,
|
||||
IsQuasar: true,
|
||||
IsFortuna: true,
|
||||
IsGranite: true,
|
||||
}
|
||||
@@ -354,7 +354,7 @@ func GetRulesExtra(rules Rules) RulesExtra {
|
||||
rulesExtra := RulesExtra{
|
||||
IsEVM: extrasRules.IsEVM,
|
||||
IsDurango: extrasRules.IsDurango,
|
||||
IsEtna: extrasRules.IsEtna,
|
||||
IsQuasar: extrasRules.IsQuasar,
|
||||
IsFortuna: extrasRules.IsFortuna,
|
||||
IsGranite: extrasRules.IsGranite,
|
||||
PredicatersExist: len(extrasRules.Predicaters) > 0,
|
||||
|
||||
@@ -57,7 +57,7 @@ func TestSetEthUpgrades(t *testing.T) {
|
||||
// },
|
||||
// },
|
||||
// {
|
||||
// fork: upgradetest.Etna,
|
||||
// fork: upgradetest.Quasar,
|
||||
// expected: &ChainConfig{
|
||||
// HomesteadBlock: genesisBlock,
|
||||
// EIP150Block: genesisBlock,
|
||||
|
||||
@@ -12,7 +12,7 @@ func TestLocalNetworkChainID(t *testing.T) {
|
||||
"TestPreEVMChainConfig": TestPreEVMChainConfig,
|
||||
"TestEVMChainConfig": TestEVMChainConfig,
|
||||
"TestDurangoChainConfig": TestDurangoChainConfig,
|
||||
"TestEtnaChainConfig": TestEtnaChainConfig,
|
||||
"TestQuasarChainConfig": TestQuasarChainConfig,
|
||||
"TestFortunaChainConfig": TestFortunaChainConfig,
|
||||
"TestGraniteChainConfig": TestGraniteChainConfig,
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ var (
|
||||
c.NetworkUpgrades = NetworkUpgrades{
|
||||
EVMTimestamp: utils.TimeToNewUint64(UnscheduledActivationTime),
|
||||
DurangoTimestamp: utils.TimeToNewUint64(UnscheduledActivationTime),
|
||||
EtnaTimestamp: utils.TimeToNewUint64(UnscheduledActivationTime),
|
||||
QuasarTimestamp: utils.TimeToNewUint64(UnscheduledActivationTime),
|
||||
FortunaTimestamp: utils.TimeToNewUint64(UnscheduledActivationTime),
|
||||
}
|
||||
})
|
||||
@@ -84,7 +84,7 @@ var (
|
||||
c.NetworkUpgrades = NetworkUpgrades{
|
||||
EVMTimestamp: utils.NewUint64(0),
|
||||
DurangoTimestamp: utils.TimeToNewUint64(UnscheduledActivationTime),
|
||||
EtnaTimestamp: utils.TimeToNewUint64(UnscheduledActivationTime),
|
||||
QuasarTimestamp: utils.TimeToNewUint64(UnscheduledActivationTime),
|
||||
FortunaTimestamp: utils.TimeToNewUint64(UnscheduledActivationTime),
|
||||
}
|
||||
})
|
||||
@@ -93,16 +93,16 @@ var (
|
||||
c.NetworkUpgrades = NetworkUpgrades{
|
||||
EVMTimestamp: utils.NewUint64(0),
|
||||
DurangoTimestamp: utils.TimeToNewUint64(InitiallyActiveTime),
|
||||
EtnaTimestamp: utils.TimeToNewUint64(UnscheduledActivationTime),
|
||||
QuasarTimestamp: utils.TimeToNewUint64(UnscheduledActivationTime),
|
||||
FortunaTimestamp: utils.TimeToNewUint64(UnscheduledActivationTime),
|
||||
}
|
||||
})
|
||||
|
||||
TestEtnaChainConfig = copyAndSet(TestChainConfig, func(c *ChainConfig) {
|
||||
TestQuasarChainConfig = copyAndSet(TestChainConfig, func(c *ChainConfig) {
|
||||
c.NetworkUpgrades = NetworkUpgrades{
|
||||
EVMTimestamp: utils.NewUint64(0),
|
||||
DurangoTimestamp: utils.TimeToNewUint64(InitiallyActiveTime),
|
||||
EtnaTimestamp: utils.TimeToNewUint64(InitiallyActiveTime),
|
||||
QuasarTimestamp: utils.TimeToNewUint64(InitiallyActiveTime),
|
||||
FortunaTimestamp: utils.TimeToNewUint64(UnscheduledActivationTime),
|
||||
}
|
||||
})
|
||||
@@ -111,7 +111,7 @@ var (
|
||||
c.NetworkUpgrades = NetworkUpgrades{
|
||||
EVMTimestamp: utils.NewUint64(0),
|
||||
DurangoTimestamp: utils.TimeToNewUint64(InitiallyActiveTime),
|
||||
EtnaTimestamp: utils.TimeToNewUint64(InitiallyActiveTime),
|
||||
QuasarTimestamp: utils.TimeToNewUint64(InitiallyActiveTime),
|
||||
FortunaTimestamp: utils.TimeToNewUint64(InitiallyActiveTime),
|
||||
}
|
||||
})
|
||||
@@ -120,7 +120,7 @@ var (
|
||||
c.NetworkUpgrades = NetworkUpgrades{
|
||||
EVMTimestamp: utils.NewUint64(0),
|
||||
DurangoTimestamp: utils.TimeToNewUint64(InitiallyActiveTime),
|
||||
EtnaTimestamp: utils.TimeToNewUint64(InitiallyActiveTime),
|
||||
QuasarTimestamp: utils.TimeToNewUint64(InitiallyActiveTime),
|
||||
FortunaTimestamp: utils.TimeToNewUint64(InitiallyActiveTime),
|
||||
GraniteTimestamp: utils.TimeToNewUint64(InitiallyActiveTime),
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ $`,
|
||||
NetworkUpgrades: NetworkUpgrades{
|
||||
EVMTimestamp: pointer(uint64(1)),
|
||||
DurangoTimestamp: pointer(uint64(2)),
|
||||
EtnaTimestamp: pointer(uint64(3)),
|
||||
QuasarTimestamp: pointer(uint64(3)),
|
||||
FortunaTimestamp: pointer(uint64(4)),
|
||||
},
|
||||
FeeConfig: commontype.FeeConfig{
|
||||
@@ -157,7 +157,7 @@ func TestChainConfigVerify(t *testing.T) {
|
||||
NetworkUpgrades: NetworkUpgrades{
|
||||
EVMTimestamp: pointer(uint64(0)), // Must be 0 (genesis activation)
|
||||
DurangoTimestamp: pointer(uint64(0)), // Must be 0 for default
|
||||
EtnaTimestamp: nil, // Optional
|
||||
QuasarTimestamp: nil, // Optional
|
||||
FortunaTimestamp: nil, // Optional
|
||||
},
|
||||
LuxContext: LuxContext{ConsensusCtx: utilstest.NewTestConsensusContext(t)},
|
||||
|
||||
@@ -48,8 +48,8 @@ type NetworkUpgrades struct {
|
||||
// and Lux Warp Messaging.
|
||||
// Note: EIP-4895 is excluded since withdrawals are not relevant to the Lux C-Chain or Chains running the EVM.
|
||||
DurangoTimestamp *uint64 `json:"durangoTimestamp,omitempty"`
|
||||
// Placeholder for EtnaTimestamp
|
||||
EtnaTimestamp *uint64 `json:"etnaTimestamp,omitempty"`
|
||||
// Placeholder for QuasarTimestamp
|
||||
QuasarTimestamp *uint64 `json:"quasarTimestamp,omitempty"`
|
||||
// Fortuna has no effect on EVM by itself, but is included for completeness.
|
||||
FortunaTimestamp *uint64 `json:"fortunaTimestamp,omitempty"`
|
||||
// Granite is a placeholder for the next upgrade.
|
||||
@@ -73,8 +73,8 @@ func (n *NetworkUpgrades) checkNetworkUpgradesCompatible(newcfg *NetworkUpgrades
|
||||
if isForkTimestampIncompatible(n.DurangoTimestamp, newcfg.DurangoTimestamp, time) {
|
||||
return newTimestampCompatError("Durango fork block timestamp", n.DurangoTimestamp, newcfg.DurangoTimestamp)
|
||||
}
|
||||
if isForkTimestampIncompatible(n.EtnaTimestamp, newcfg.EtnaTimestamp, time) {
|
||||
return newTimestampCompatError("Etna fork block timestamp", n.EtnaTimestamp, newcfg.EtnaTimestamp)
|
||||
if isForkTimestampIncompatible(n.QuasarTimestamp, newcfg.QuasarTimestamp, time) {
|
||||
return newTimestampCompatError("Quasar fork block timestamp", n.QuasarTimestamp, newcfg.QuasarTimestamp)
|
||||
}
|
||||
// Fortuna is optional, so allow nil values even after the fork time
|
||||
// Only check incompatibility if both values are non-nil
|
||||
@@ -94,7 +94,7 @@ func (n *NetworkUpgrades) forkOrder() []fork {
|
||||
return []fork{
|
||||
{name: "evmTimestamp", timestamp: n.EVMTimestamp},
|
||||
{name: "durangoTimestamp", timestamp: n.DurangoTimestamp},
|
||||
{name: "etnaTimestamp", timestamp: n.EtnaTimestamp},
|
||||
{name: "quasarTimestamp", timestamp: n.QuasarTimestamp},
|
||||
{name: "fortunaTimestamp", timestamp: n.FortunaTimestamp, optional: true},
|
||||
{name: "graniteTimestamp", timestamp: n.GraniteTimestamp},
|
||||
}
|
||||
@@ -111,8 +111,8 @@ func (n *NetworkUpgrades) SetDefaults(agoUpgrades upgrade.Config) {
|
||||
if n.DurangoTimestamp == nil {
|
||||
n.DurangoTimestamp = defaults.DurangoTimestamp
|
||||
}
|
||||
if n.EtnaTimestamp == nil {
|
||||
n.EtnaTimestamp = defaults.EtnaTimestamp
|
||||
if n.QuasarTimestamp == nil {
|
||||
n.QuasarTimestamp = defaults.QuasarTimestamp
|
||||
}
|
||||
if n.FortunaTimestamp == nil {
|
||||
n.FortunaTimestamp = defaults.FortunaTimestamp
|
||||
@@ -152,14 +152,14 @@ func (n *NetworkUpgrades) verifyNetworkUpgrades(agoUpgrades upgrade.Config) erro
|
||||
}
|
||||
}
|
||||
|
||||
// EtnaTimestamp — when the default is set (non-nil), the config must
|
||||
// QuasarTimestamp — when the default is set (non-nil), the config must
|
||||
// also set it and must not be earlier than the default.
|
||||
if defaults.EtnaTimestamp != nil {
|
||||
if n.EtnaTimestamp == nil {
|
||||
return fmt.Errorf("Etna fork block timestamp is invalid: %w", errCannotBeNil)
|
||||
if defaults.QuasarTimestamp != nil {
|
||||
if n.QuasarTimestamp == nil {
|
||||
return fmt.Errorf("Quasar fork block timestamp is invalid: %w", errCannotBeNil)
|
||||
}
|
||||
if err := verifyWithDefault(n.EtnaTimestamp, defaults.EtnaTimestamp); err != nil {
|
||||
return fmt.Errorf("Etna fork block timestamp is invalid: %w", err)
|
||||
if err := verifyWithDefault(n.QuasarTimestamp, defaults.QuasarTimestamp); err != nil {
|
||||
return fmt.Errorf("Quasar fork block timestamp is invalid: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -198,8 +198,8 @@ func (n *NetworkUpgrades) Override(o *NetworkUpgrades) {
|
||||
if o.DurangoTimestamp != nil {
|
||||
n.DurangoTimestamp = o.DurangoTimestamp
|
||||
}
|
||||
if o.EtnaTimestamp != nil {
|
||||
n.EtnaTimestamp = o.EtnaTimestamp
|
||||
if o.QuasarTimestamp != nil {
|
||||
n.QuasarTimestamp = o.QuasarTimestamp
|
||||
}
|
||||
if o.FortunaTimestamp != nil {
|
||||
n.FortunaTimestamp = o.FortunaTimestamp
|
||||
@@ -224,10 +224,10 @@ func (n NetworkUpgrades) IsDurango(time uint64) bool {
|
||||
return isTimestampForked(n.DurangoTimestamp, time)
|
||||
}
|
||||
|
||||
// IsEtna returns whether [time] represents a block
|
||||
// with a timestamp after the Etna upgrade time.
|
||||
func (n NetworkUpgrades) IsEtna(time uint64) bool {
|
||||
return isTimestampForked(n.EtnaTimestamp, time)
|
||||
// IsQuasar returns whether [time] represents a block
|
||||
// with a timestamp after the Quasar Edition upgrade time.
|
||||
func (n NetworkUpgrades) IsQuasar(time uint64) bool {
|
||||
return isTimestampForked(n.QuasarTimestamp, time)
|
||||
}
|
||||
|
||||
// IsFortuna returns whether [time] represents a block
|
||||
@@ -254,7 +254,7 @@ func (n *NetworkUpgrades) Description() string {
|
||||
var banner string
|
||||
banner += fmt.Sprintf(" - EVM Timestamp: @%-10v (https://github.com/luxfi/node/releases/tag/v1.10.0)\n", ptrToString(n.EVMTimestamp))
|
||||
banner += fmt.Sprintf(" - Durango Timestamp: @%-10v (https://github.com/luxfi/node/releases/tag/v1.11.0)\n", ptrToString(n.DurangoTimestamp))
|
||||
banner += fmt.Sprintf(" - Etna Timestamp: @%-10v (https://github.com/luxfi/node/releases/tag/v1.12.0)\n", ptrToString(n.EtnaTimestamp))
|
||||
banner += fmt.Sprintf(" - Quasar Timestamp: @%-10v (https://github.com/luxfi/node/releases/tag/v1.12.0)\n", ptrToString(n.QuasarTimestamp))
|
||||
banner += fmt.Sprintf(" - Fortuna Timestamp: @%-10v (https://github.com/luxfi/node/releases/tag/v1.13.0)\n", ptrToString(n.FortunaTimestamp))
|
||||
banner += fmt.Sprintf(" - Granite Timestamp: @%-10v (https://github.com/luxfi/node/releases/tag/v1.14.0)\n", ptrToString(n.GraniteTimestamp))
|
||||
return banner
|
||||
@@ -263,7 +263,7 @@ func (n *NetworkUpgrades) Description() string {
|
||||
type LuxRules struct {
|
||||
IsEVM bool
|
||||
IsDurango bool
|
||||
IsEtna bool
|
||||
IsQuasar bool
|
||||
IsFortuna bool
|
||||
IsGranite bool
|
||||
}
|
||||
@@ -272,7 +272,7 @@ func (n *NetworkUpgrades) GetLuxRules(time uint64) LuxRules {
|
||||
return LuxRules{
|
||||
IsEVM: n.IsEVM(time),
|
||||
IsDurango: n.IsDurango(time),
|
||||
IsEtna: n.IsEtna(time),
|
||||
IsQuasar: n.IsQuasar(time),
|
||||
IsFortuna: n.IsFortuna(time),
|
||||
IsGranite: n.IsGranite(time),
|
||||
}
|
||||
@@ -318,8 +318,8 @@ func GetNetworkUpgrades(agoUpgrade upgrade.Config) NetworkUpgrades {
|
||||
// Check DurangoTime
|
||||
result.DurangoTimestamp = toEVMTimestamp(agoUpgrade.DurangoTime)
|
||||
|
||||
// Check EtnaTime
|
||||
result.EtnaTimestamp = toEVMTimestamp(agoUpgrade.EtnaTime)
|
||||
// Check QuasarTime
|
||||
result.QuasarTimestamp = toEVMTimestamp(agoUpgrade.QuasarTime)
|
||||
|
||||
// Check FortunaTime
|
||||
result.FortunaTimestamp = toEVMTimestamp(agoUpgrade.FortunaTime)
|
||||
@@ -338,7 +338,7 @@ func GetDefaultNetworkUpgrades() NetworkUpgrades {
|
||||
return NetworkUpgrades{
|
||||
EVMTimestamp: utils.NewUint64(0),
|
||||
DurangoTimestamp: utils.NewUint64(0),
|
||||
EtnaTimestamp: utils.NewUint64(0),
|
||||
QuasarTimestamp: utils.NewUint64(0),
|
||||
FortunaTimestamp: utils.NewUint64(0),
|
||||
GraniteTimestamp: utils.NewUint64(0),
|
||||
}
|
||||
|
||||
@@ -12,13 +12,13 @@ import (
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
// getTestFujiUpgrades returns a test network upgrades config with EtnaTimestamp set
|
||||
// getTestFujiUpgrades returns a test network upgrades config with QuasarTimestamp set
|
||||
// This is used for testing upgrade compatibility scenarios
|
||||
func getTestFujiUpgrades() NetworkUpgrades {
|
||||
return NetworkUpgrades{
|
||||
EVMTimestamp: utils.NewUint64(0),
|
||||
DurangoTimestamp: utils.NewUint64(0),
|
||||
EtnaTimestamp: utils.NewUint64(100), // Set for testing
|
||||
QuasarTimestamp: utils.NewUint64(100), // Set for testing
|
||||
FortunaTimestamp: utils.NewUint64(1000),
|
||||
GraniteTimestamp: nil,
|
||||
}
|
||||
@@ -188,10 +188,10 @@ func TestCheckNetworkUpgradesCompatible(t *testing.T) {
|
||||
}(),
|
||||
upgrades2: func() *NetworkUpgrades {
|
||||
upgrades := getTestFujiUpgrades()
|
||||
upgrades.EtnaTimestamp = nil
|
||||
upgrades.QuasarTimestamp = nil
|
||||
return &upgrades
|
||||
}(),
|
||||
time: 500, // Time past Etna (100), so setting Etna to nil is incompatible
|
||||
time: 500, // Time past Quasar (100), so setting Quasar to nil is incompatible
|
||||
valid: false,
|
||||
},
|
||||
{
|
||||
@@ -233,7 +233,7 @@ func TestVerifyNetworkUpgrades(t *testing.T) {
|
||||
upgrades: &NetworkUpgrades{
|
||||
EVMTimestamp: utils.NewUint64(0),
|
||||
DurangoTimestamp: utils.NewUint64(0), // Must be 0 since default is 0
|
||||
EtnaTimestamp: utils.NewUint64(0), // Must be 0 for Latest
|
||||
QuasarTimestamp: utils.NewUint64(0), // Must be 0 for Latest
|
||||
FortunaTimestamp: utils.NewUint64(0), // Must be 0 for Latest
|
||||
GraniteTimestamp: utils.NewUint64(0), // Must be 0 for Latest
|
||||
},
|
||||
@@ -286,21 +286,21 @@ func TestVerifyNetworkUpgrades(t *testing.T) {
|
||||
valid: false,
|
||||
},
|
||||
{
|
||||
name: "Valid_Etna_nil_when_unscheduled",
|
||||
name: "Valid_Quasar_nil_when_unscheduled",
|
||||
upgrades: &NetworkUpgrades{
|
||||
EVMTimestamp: utils.NewUint64(0),
|
||||
DurangoTimestamp: utils.NewUint64(0), // Genesis
|
||||
EtnaTimestamp: nil, // Valid when Etna is unscheduled
|
||||
QuasarTimestamp: nil, // Valid when Quasar is unscheduled
|
||||
},
|
||||
luxdUpgrades: getTestMainnetConfig(), // Durango is active, Etna is not
|
||||
luxdUpgrades: getTestMainnetConfig(), // Durango is active, Quasar is not
|
||||
valid: true,
|
||||
},
|
||||
{
|
||||
name: "Invalid_Etna_before_Durango",
|
||||
name: "Invalid_Quasar_before_Durango",
|
||||
upgrades: &NetworkUpgrades{
|
||||
EVMTimestamp: utils.NewUint64(0),
|
||||
DurangoTimestamp: utils.NewUint64(100),
|
||||
EtnaTimestamp: utils.NewUint64(99),
|
||||
QuasarTimestamp: utils.NewUint64(99),
|
||||
},
|
||||
luxdUpgrades: getTestMainnetConfig(),
|
||||
valid: false,
|
||||
@@ -310,7 +310,7 @@ func TestVerifyNetworkUpgrades(t *testing.T) {
|
||||
upgrades: &NetworkUpgrades{
|
||||
EVMTimestamp: utils.NewUint64(0),
|
||||
DurangoTimestamp: utils.NewUint64(0), // Genesis
|
||||
EtnaTimestamp: utils.NewUint64(500), // Test timestamp
|
||||
QuasarTimestamp: utils.NewUint64(500), // Test timestamp
|
||||
FortunaTimestamp: nil,
|
||||
},
|
||||
luxdUpgrades: getTestFujiConfig(),
|
||||
|
||||
@@ -36,7 +36,7 @@ import (
|
||||
const luxMainnetLiveUpgradeJSON = `{
|
||||
"networkUpgradeOverrides": {
|
||||
"durangoTimestamp": 0,
|
||||
"etnaTimestamp": 0,
|
||||
"quasarTimestamp": 0,
|
||||
"fortunaTimestamp": 0,
|
||||
"graniteTimestamp": 0
|
||||
},
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"networkUpgradeOverrides": {
|
||||
"evmTimestamp": 0,
|
||||
"durangoTimestamp": 0,
|
||||
"etnaTimestamp": 0,
|
||||
"quasarTimestamp": 0,
|
||||
"fortunaTimestamp": 0,
|
||||
"graniteTimestamp": 0,
|
||||
"strictPQTimestamp": 1766708400
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"networkUpgradeOverrides": {
|
||||
"evmTimestamp": 0,
|
||||
"durangoTimestamp": 0,
|
||||
"etnaTimestamp": 0,
|
||||
"quasarTimestamp": 0,
|
||||
"fortunaTimestamp": 0,
|
||||
"graniteTimestamp": 0,
|
||||
"strictPQTimestamp": 1766708400
|
||||
|
||||
@@ -14,7 +14,7 @@ var ForkToChainConfig = map[upgradetest.Fork]*params.ChainConfig{
|
||||
upgradetest.ApricotPhase5: params.TestPreEVMChainConfig,
|
||||
upgradetest.ApricotPhase6: params.TestEVMChainConfig,
|
||||
upgradetest.Durango: params.TestDurangoChainConfig,
|
||||
upgradetest.Etna: params.TestEtnaChainConfig,
|
||||
upgradetest.Quasar: params.TestQuasarChainConfig,
|
||||
upgradetest.Fortuna: params.TestFortunaChainConfig,
|
||||
upgradetest.Granite: params.TestGraniteChainConfig,
|
||||
}
|
||||
|
||||
@@ -71,8 +71,8 @@ func fundAddressByGenesis(addrs []common.Address) (string, error) {
|
||||
if extra.DurangoTimestamp != nil {
|
||||
configMap["durangoTimestamp"] = *extra.DurangoTimestamp
|
||||
}
|
||||
if extra.EtnaTimestamp != nil {
|
||||
configMap["etnaTimestamp"] = *extra.EtnaTimestamp
|
||||
if extra.QuasarTimestamp != nil {
|
||||
configMap["quasarTimestamp"] = *extra.QuasarTimestamp
|
||||
}
|
||||
if extra.FortunaTimestamp != nil {
|
||||
configMap["fortunaTimestamp"] = *extra.FortunaTimestamp
|
||||
|
||||
+2
-2
@@ -805,9 +805,9 @@ func parseGenesis(ctx context.Context, genesisBytes []byte, upgradeBytes []byte,
|
||||
log.Info("DEBUG: durangoTimestamp NOT found in genesis config, defaulting to 0")
|
||||
configExtra.DurangoTimestamp = utils.NewUint64(0)
|
||||
}
|
||||
if val, ok := configData["etnaTimestamp"]; ok {
|
||||
if val, ok := configData["quasarTimestamp"]; ok {
|
||||
if ts, ok := val.(float64); ok {
|
||||
configExtra.EtnaTimestamp = utils.NewUint64(uint64(ts))
|
||||
configExtra.QuasarTimestamp = utils.NewUint64(uint64(ts))
|
||||
}
|
||||
}
|
||||
if val, ok := configData["fortunaTimestamp"]; ok {
|
||||
|
||||
@@ -134,8 +134,8 @@ var (
|
||||
if extra.DurangoTimestamp != nil {
|
||||
configMap["durangoTimestamp"] = *extra.DurangoTimestamp
|
||||
}
|
||||
if extra.EtnaTimestamp != nil {
|
||||
configMap["etnaTimestamp"] = *extra.EtnaTimestamp
|
||||
if extra.QuasarTimestamp != nil {
|
||||
configMap["quasarTimestamp"] = *extra.QuasarTimestamp
|
||||
}
|
||||
if extra.FortunaTimestamp != nil {
|
||||
configMap["fortunaTimestamp"] = *extra.FortunaTimestamp
|
||||
@@ -190,8 +190,8 @@ var (
|
||||
if extra.DurangoTimestamp != nil {
|
||||
configMap["durangoTimestamp"] = *extra.DurangoTimestamp
|
||||
}
|
||||
if extra.EtnaTimestamp != nil {
|
||||
configMap["etnaTimestamp"] = *extra.EtnaTimestamp
|
||||
if extra.QuasarTimestamp != nil {
|
||||
configMap["quasarTimestamp"] = *extra.QuasarTimestamp
|
||||
}
|
||||
if extra.FortunaTimestamp != nil {
|
||||
configMap["fortunaTimestamp"] = *extra.FortunaTimestamp
|
||||
@@ -249,7 +249,7 @@ var (
|
||||
// forkToChainConfig maps a fork name to a chain config
|
||||
forkToChainConfig = map[string]*params.ChainConfig{
|
||||
"Durango": params.TestDurangoChainConfig,
|
||||
"Etna": params.TestEtnaChainConfig,
|
||||
"Quasar": params.TestQuasarChainConfig,
|
||||
"Granite": params.TestGraniteChainConfig,
|
||||
"Latest": params.TestGraniteChainConfig,
|
||||
}
|
||||
@@ -3777,8 +3777,8 @@ func TestSkipChainConfigCheckCompatible(t *testing.T) {
|
||||
var genesisMap map[string]interface{}
|
||||
require.NoError(t, json.Unmarshal([]byte(genesisJSON), &genesisMap))
|
||||
configMap := genesisMap["config"].(map[string]interface{})
|
||||
// Set EtnaTimestamp to the block's timestamp to trigger the compatibility check error
|
||||
configMap["etnaTimestamp"] = blk.Timestamp().Unix()
|
||||
// Set QuasarTimestamp to the block's timestamp to trigger the compatibility check error
|
||||
configMap["quasarTimestamp"] = blk.Timestamp().Unix()
|
||||
// Ensure DurangoTimestamp is set (required for validation)
|
||||
if _, ok := configMap["durangoTimestamp"]; !ok {
|
||||
configMap["durangoTimestamp"] = uint64(0)
|
||||
@@ -3842,20 +3842,20 @@ func TestParentBeaconRootBlock(t *testing.T) {
|
||||
},
|
||||
{
|
||||
name: "non-empty parent beacon root in E-Upgrade (Cancun)",
|
||||
genesisJSON: toGenesisJSON(forkToChainConfig["Etna"]),
|
||||
genesisJSON: toGenesisJSON(forkToChainConfig["Quasar"]),
|
||||
beaconRoot: &common.Hash{0x01},
|
||||
expectedError: true,
|
||||
errString: "expected empty hash",
|
||||
},
|
||||
{
|
||||
name: "empty parent beacon root in E-Upgrade (Cancun)",
|
||||
genesisJSON: toGenesisJSON(forkToChainConfig["Etna"]),
|
||||
genesisJSON: toGenesisJSON(forkToChainConfig["Quasar"]),
|
||||
beaconRoot: &common.Hash{},
|
||||
expectedError: false,
|
||||
},
|
||||
{
|
||||
name: "nil parent beacon root in E-Upgrade (Cancun)",
|
||||
genesisJSON: toGenesisJSON(forkToChainConfig["Etna"]),
|
||||
genesisJSON: toGenesisJSON(forkToChainConfig["Quasar"]),
|
||||
beaconRoot: nil,
|
||||
expectedError: true,
|
||||
errString: "header is missing parentBeaconRoot",
|
||||
|
||||
@@ -36,7 +36,7 @@ import (
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
var DefaultEtnaTime = uint64(0) // Use genesis time as default
|
||||
var DefaultQuasarTime = uint64(0) // Use genesis time as default
|
||||
|
||||
// getEthBlockFromConsensusBlock safely extracts the Ethereum block from a consensus block interface
|
||||
func getEthBlockFromConsensusBlock(t *testing.T, blk consensusInterfaces.Block) *types.Block {
|
||||
@@ -399,20 +399,20 @@ func TestVMEupgradeActivatesCancun(t *testing.T) {
|
||||
check func(*testing.T, *VM) // function to check the VM state
|
||||
}{
|
||||
{
|
||||
name: "Etna activates Cancun",
|
||||
name: "Quasar activates Cancun",
|
||||
genesisJSON: toGenesisJSON(forkToChainConfig["Latest"]),
|
||||
check: func(t *testing.T, vm *VM) {
|
||||
require.True(t, vm.chainConfig.IsCancun(common.Big0, DefaultEtnaTime))
|
||||
require.True(t, vm.chainConfig.IsCancun(common.Big0, DefaultQuasarTime))
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "Later Etna activates Cancun",
|
||||
// Use "Etna" fork (not "Latest") to avoid Fortuna/Granite fork conflicts
|
||||
genesisJSON: toGenesisJSON(forkToChainConfig["Etna"]),
|
||||
name: "Later Quasar activates Cancun",
|
||||
// Use "Quasar" fork (not "Latest") to avoid Fortuna/Granite fork conflicts
|
||||
genesisJSON: toGenesisJSON(forkToChainConfig["Quasar"]),
|
||||
upgradeJSON: func() string {
|
||||
upgrade := &extras.UpgradeConfig{
|
||||
NetworkUpgradeOverrides: &extras.NetworkUpgrades{
|
||||
EtnaTimestamp: utils.NewUint64(DefaultEtnaTime + 2),
|
||||
QuasarTimestamp: utils.NewUint64(DefaultQuasarTime + 2),
|
||||
},
|
||||
}
|
||||
b, err := json.Marshal(upgrade)
|
||||
@@ -420,18 +420,18 @@ func TestVMEupgradeActivatesCancun(t *testing.T) {
|
||||
return string(b)
|
||||
}(),
|
||||
check: func(t *testing.T, vm *VM) {
|
||||
require.False(t, vm.chainConfig.IsCancun(common.Big0, DefaultEtnaTime))
|
||||
require.True(t, vm.chainConfig.IsCancun(common.Big0, DefaultEtnaTime+2))
|
||||
require.False(t, vm.chainConfig.IsCancun(common.Big0, DefaultQuasarTime))
|
||||
require.True(t, vm.chainConfig.IsCancun(common.Big0, DefaultQuasarTime+2))
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "Changed Etna changes Cancun",
|
||||
// Use "Etna" fork (not "Latest") to avoid Fortuna/Granite fork conflicts
|
||||
genesisJSON: toGenesisJSON(forkToChainConfig["Etna"]),
|
||||
name: "Changed Quasar changes Cancun",
|
||||
// Use "Quasar" fork (not "Latest") to avoid Fortuna/Granite fork conflicts
|
||||
genesisJSON: toGenesisJSON(forkToChainConfig["Quasar"]),
|
||||
upgradeJSON: func() string {
|
||||
upgrade := &extras.UpgradeConfig{
|
||||
NetworkUpgradeOverrides: &extras.NetworkUpgrades{
|
||||
EtnaTimestamp: utils.NewUint64(DefaultEtnaTime + 2),
|
||||
QuasarTimestamp: utils.NewUint64(DefaultQuasarTime + 2),
|
||||
},
|
||||
}
|
||||
b, err := json.Marshal(upgrade)
|
||||
@@ -439,8 +439,8 @@ func TestVMEupgradeActivatesCancun(t *testing.T) {
|
||||
return string(b)
|
||||
}(),
|
||||
check: func(t *testing.T, vm *VM) {
|
||||
require.False(t, vm.chainConfig.IsCancun(common.Big0, DefaultEtnaTime))
|
||||
require.True(t, vm.chainConfig.IsCancun(common.Big0, DefaultEtnaTime+2))
|
||||
require.False(t, vm.chainConfig.IsCancun(common.Big0, DefaultQuasarTime))
|
||||
require.True(t, vm.chainConfig.IsCancun(common.Big0, DefaultQuasarTime+2))
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user