From 602771d243f713adfc577eea8a5aa7b06675c80d Mon Sep 17 00:00:00 2001 From: Darioush Jalali Date: Wed, 7 Aug 2024 09:35:00 -0700 Subject: [PATCH 01/10] bump coreth past upgrade schedule refactor --- go.mod | 6 ++-- go.sum | 4 +++ version/constants.go | 75 -------------------------------------------- 3 files changed, 7 insertions(+), 78 deletions(-) diff --git a/go.mod b/go.mod index f440ad419e1e..26310f6aeba5 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/DataDog/zstd v1.5.2 github.com/NYTimes/gziphandler v1.1.1 github.com/antithesishq/antithesis-sdk-go v0.3.8 - github.com/ava-labs/coreth v0.13.8-0.20240802110637-b3e5088d062d + github.com/ava-labs/coreth v0.13.8-0.20240807162845-015611b6e6e5 github.com/ava-labs/ledger-avalanche/go v0.0.0-20240610153809-9c955cc90a95 github.com/btcsuite/btcd/btcutil v1.1.3 github.com/cockroachdb/pebble v0.0.0-20230928194634-aa077af62593 @@ -34,7 +34,7 @@ require ( github.com/nbutton23/zxcvbn-go v0.0.0-20180912185939-ae427f1e4c1d github.com/onsi/ginkgo/v2 v2.13.1 github.com/pires/go-proxyproto v0.6.2 - github.com/prometheus/client_golang v1.14.0 + github.com/prometheus/client_golang v1.16.0 github.com/prometheus/client_model v0.3.0 github.com/prometheus/common v0.42.0 github.com/rs/cors v1.7.0 @@ -156,7 +156,7 @@ require ( github.com/zondax/ledger-go v0.14.3 // indirect go.opentelemetry.io/otel/metric v1.22.0 // indirect go.opentelemetry.io/proto/otlp v1.0.0 // indirect - go.uber.org/multierr v1.10.0 // indirect + go.uber.org/multierr v1.11.0 // indirect golang.org/x/sys v0.18.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/tools v0.17.0 // indirect diff --git a/go.sum b/go.sum index 4f50be7c1b7c..d19a97c5c825 100644 --- a/go.sum +++ b/go.sum @@ -64,6 +64,8 @@ github.com/antithesishq/antithesis-sdk-go v0.3.8/go.mod h1:IUpT2DPAKh6i/YhSbt6Gl github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/ava-labs/coreth v0.13.8-0.20240802110637-b3e5088d062d h1:klPTcKVvqfA2KSKaRvQAO56Pd4XAqGhwgMTQ6/W+w7w= github.com/ava-labs/coreth v0.13.8-0.20240802110637-b3e5088d062d/go.mod h1:tXDujonxXFOF6oK5HS2EmgtSXJK3Gy6RpZxb5WzR9rM= +github.com/ava-labs/coreth v0.13.8-0.20240807162845-015611b6e6e5 h1:gS7mgN4o9QPwlSZnHqv+KzPSh3jmXmhkcOtE3WYiFc0= +github.com/ava-labs/coreth v0.13.8-0.20240807162845-015611b6e6e5/go.mod h1:Ouul9dJouniUIJVX1gDqx8CrHyGvmwZkK28mrgKb/4I= github.com/ava-labs/ledger-avalanche/go v0.0.0-20240610153809-9c955cc90a95 h1:dOVbtdnZL++pENdTCNZ1nu41eYDQkTML4sWebDnnq8c= github.com/ava-labs/ledger-avalanche/go v0.0.0-20240610153809-9c955cc90a95/go.mod h1:pJxaT9bUgeRNVmNRgtCHb7sFDIRKy7CzTQVi8gGNT6g= github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g= @@ -500,6 +502,7 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_golang v1.14.0 h1:nJdhIvne2eSX/XRAFV9PcvFFRbrjbcTUj0VP62TMhnw= github.com/prometheus/client_golang v1.14.0/go.mod h1:8vpkKitgIVNcqrRBWh1C4TIUQgYNtG/XQE4E/Zae36Y= +github.com/prometheus/client_golang v1.16.0/go.mod h1:Zsulrv/L9oM40tJ7T815tM89lFEugiJ9HzIqaAx4LKc= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= @@ -646,6 +649,7 @@ go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU= go.uber.org/mock v0.4.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc= go.uber.org/multierr v1.10.0 h1:S0h4aNzvfcFsC3dRF1jLoaov7oRaKqRGC/pUEJ2yvPQ= go.uber.org/multierr v1.10.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= +go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= golang.org/x/crypto v0.0.0-20170613210332-850760c427c5/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= diff --git a/version/constants.go b/version/constants.go index 3742f7ffe61f..a2ef3ced40c4 100644 --- a/version/constants.go +++ b/version/constants.go @@ -8,9 +8,6 @@ import ( "time" _ "embed" - - "github.com/ava-labs/avalanchego/upgrade" - "github.com/ava-labs/avalanchego/utils/constants" ) const ( @@ -67,78 +64,6 @@ var ( // set of avalanchego versions that supported that version. This is not used // by avalanchego, but is useful for downstream libraries. RPCChainVMProtocolCompatibility map[uint][]*Semantic - - // Deprecated: This will be removed once coreth no longer uses it. - ApricotPhase1Times = map[uint32]time.Time{ - constants.MainnetID: upgrade.Mainnet.ApricotPhase1Time, - constants.FujiID: upgrade.Fuji.ApricotPhase1Time, - } - - // Deprecated: This will be removed once coreth no longer uses it. - ApricotPhase2Times = map[uint32]time.Time{ - constants.MainnetID: upgrade.Mainnet.ApricotPhase2Time, - constants.FujiID: upgrade.Fuji.ApricotPhase2Time, - } - - // Deprecated: This will be removed once coreth no longer uses it. - ApricotPhase3Times = map[uint32]time.Time{ - constants.MainnetID: upgrade.Mainnet.ApricotPhase3Time, - constants.FujiID: upgrade.Fuji.ApricotPhase3Time, - } - - // Deprecated: This will be removed once coreth no longer uses it. - ApricotPhase4Times = map[uint32]time.Time{ - constants.MainnetID: upgrade.Mainnet.ApricotPhase4Time, - constants.FujiID: upgrade.Fuji.ApricotPhase4Time, - } - - // Deprecated: This will be removed once coreth no longer uses it. - ApricotPhase5Times = map[uint32]time.Time{ - constants.MainnetID: upgrade.Mainnet.ApricotPhase5Time, - constants.FujiID: upgrade.Fuji.ApricotPhase5Time, - } - - // Deprecated: This will be removed once coreth no longer uses it. - ApricotPhasePre6Times = map[uint32]time.Time{ - constants.MainnetID: upgrade.Mainnet.ApricotPhasePre6Time, - constants.FujiID: upgrade.Fuji.ApricotPhasePre6Time, - } - - // Deprecated: This will be removed once coreth no longer uses it. - ApricotPhase6Times = map[uint32]time.Time{ - constants.MainnetID: upgrade.Mainnet.ApricotPhase6Time, - constants.FujiID: upgrade.Fuji.ApricotPhase6Time, - } - - // Deprecated: This will be removed once coreth no longer uses it. - ApricotPhasePost6Times = map[uint32]time.Time{ - constants.MainnetID: upgrade.Mainnet.ApricotPhasePost6Time, - constants.FujiID: upgrade.Fuji.ApricotPhasePost6Time, - } - - // Deprecated: This will be removed once coreth no longer uses it. - BanffTimes = map[uint32]time.Time{ - constants.MainnetID: upgrade.Mainnet.BanffTime, - constants.FujiID: upgrade.Fuji.BanffTime, - } - - // Deprecated: This will be removed once coreth no longer uses it. - CortinaTimes = map[uint32]time.Time{ - constants.MainnetID: upgrade.Mainnet.CortinaTime, - constants.FujiID: upgrade.Fuji.CortinaTime, - } - - // Deprecated: This will be removed once coreth no longer uses it. - DurangoTimes = map[uint32]time.Time{ - constants.MainnetID: upgrade.Mainnet.DurangoTime, - constants.FujiID: upgrade.Fuji.DurangoTime, - } - - // Deprecated: This will be removed once coreth no longer uses it. - EUpgradeTimes = map[uint32]time.Time{ - constants.MainnetID: upgrade.Mainnet.EtnaTime, - constants.FujiID: upgrade.Fuji.EtnaTime, - } ) func init() { From 2635b2d239d65765b370cb894b2a16a9ce9a78cc Mon Sep 17 00:00:00 2001 From: Darioush Jalali Date: Wed, 7 Aug 2024 09:36:47 -0700 Subject: [PATCH 02/10] go mod tidy --- go.sum | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/go.sum b/go.sum index d19a97c5c825..67566bc8999e 100644 --- a/go.sum +++ b/go.sum @@ -62,8 +62,6 @@ github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax github.com/antithesishq/antithesis-sdk-go v0.3.8 h1:OvGoHxIcOXFJLyn9IJQ5DzByZ3YVAWNBc394ObzDRb8= github.com/antithesishq/antithesis-sdk-go v0.3.8/go.mod h1:IUpT2DPAKh6i/YhSbt6Gl3v2yvUZjmKncl7U91fup7E= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= -github.com/ava-labs/coreth v0.13.8-0.20240802110637-b3e5088d062d h1:klPTcKVvqfA2KSKaRvQAO56Pd4XAqGhwgMTQ6/W+w7w= -github.com/ava-labs/coreth v0.13.8-0.20240802110637-b3e5088d062d/go.mod h1:tXDujonxXFOF6oK5HS2EmgtSXJK3Gy6RpZxb5WzR9rM= github.com/ava-labs/coreth v0.13.8-0.20240807162845-015611b6e6e5 h1:gS7mgN4o9QPwlSZnHqv+KzPSh3jmXmhkcOtE3WYiFc0= github.com/ava-labs/coreth v0.13.8-0.20240807162845-015611b6e6e5/go.mod h1:Ouul9dJouniUIJVX1gDqx8CrHyGvmwZkK28mrgKb/4I= github.com/ava-labs/ledger-avalanche/go v0.0.0-20240610153809-9c955cc90a95 h1:dOVbtdnZL++pENdTCNZ1nu41eYDQkTML4sWebDnnq8c= @@ -500,8 +498,7 @@ github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qR github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.14.0 h1:nJdhIvne2eSX/XRAFV9PcvFFRbrjbcTUj0VP62TMhnw= -github.com/prometheus/client_golang v1.14.0/go.mod h1:8vpkKitgIVNcqrRBWh1C4TIUQgYNtG/XQE4E/Zae36Y= +github.com/prometheus/client_golang v1.16.0 h1:yk/hx9hDbrGHovbci4BY+pRMfSuuat626eFsHb7tmT8= github.com/prometheus/client_golang v1.16.0/go.mod h1:Zsulrv/L9oM40tJ7T815tM89lFEugiJ9HzIqaAx4LKc= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= @@ -647,8 +644,7 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU= go.uber.org/mock v0.4.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc= -go.uber.org/multierr v1.10.0 h1:S0h4aNzvfcFsC3dRF1jLoaov7oRaKqRGC/pUEJ2yvPQ= -go.uber.org/multierr v1.10.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= +go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= From c9a9ffbb7e744f40890760c18ff5d920c239deda Mon Sep 17 00:00:00 2001 From: Darioush Jalali Date: Wed, 7 Aug 2024 12:25:28 -0700 Subject: [PATCH 03/10] delay activating Etna in upgrade test --- tests/upgrade/upgrade_test.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/upgrade/upgrade_test.go b/tests/upgrade/upgrade_test.go index 32c76fd6dd0f..937cf0c4ca96 100644 --- a/tests/upgrade/upgrade_test.go +++ b/tests/upgrade/upgrade_test.go @@ -4,6 +4,7 @@ package upgrade import ( + "encoding/json" "flag" "fmt" "testing" @@ -13,6 +14,8 @@ import ( "github.com/ava-labs/avalanchego/tests/fixture/e2e" "github.com/ava-labs/avalanchego/tests/fixture/tmpnet" + "github.com/ava-labs/avalanchego/upgrade" + "github.com/ava-labs/coreth/core" ) func TestUpgrade(t *testing.T) { @@ -45,6 +48,21 @@ var _ = ginkgo.Describe("[Upgrade]", func() { ginkgo.It("can upgrade versions", func() { network := tmpnet.NewDefaultNetwork("avalanchego-upgrade") + + { + // Etna enables Cancun which modifies the outcome of the C-Chain genesis + // This is because of new header fields that modify the genesis block hash. + // This code can be removed once the Etna upgrade is activated. + cChainGenesis := new(core.Genesis) + cChainGenesisStr := network.Genesis.CChainGenesis + require.NoError(json.Unmarshal([]byte(cChainGenesisStr), cChainGenesis)) + unscheduledActivationTime := uint64(upgrade.UnscheduledActivationTime.Unix()) + cChainGenesis.Config.EUpgradeTime = &unscheduledActivationTime + cChainGenesisBytes, err := json.Marshal(cChainGenesis) + require.NoError(err) + network.Genesis.CChainGenesis = string(cChainGenesisBytes) + } + e2e.StartNetwork(tc, network, avalancheGoExecPath, "" /* pluginDir */, 0 /* shutdownDelay */, false /* reuseNetwork */) tc.By(fmt.Sprintf("restarting all nodes with %q binary", avalancheGoExecPathToUpgradeTo)) From fdbdf16fe9e2eb0d5ef3a17df03aa11725a42b48 Mon Sep 17 00:00:00 2001 From: Darioush Jalali Date: Wed, 7 Aug 2024 12:42:10 -0700 Subject: [PATCH 04/10] expose DefaultGenesis --- tests/fixture/tmpnet/network.go | 28 ++++++++++++++++------------ tests/upgrade/upgrade_test.go | 4 ++++ 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/tests/fixture/tmpnet/network.go b/tests/fixture/tmpnet/network.go index 695017c0620c..5230d2f22f0c 100644 --- a/tests/fixture/tmpnet/network.go +++ b/tests/fixture/tmpnet/network.go @@ -295,18 +295,7 @@ func (n *Network) Create(rootDir string) error { } if n.NetworkID == 0 && n.Genesis == nil { - // Pre-fund known legacy keys to support ad-hoc testing. Usage of a legacy key will - // require knowing the key beforehand rather than retrieving it from the set of pre-funded - // keys exposed by a network. Since allocation will not be exclusive, a test using a - // legacy key is unlikely to be a good candidate for parallel execution. - keysToFund := []*secp256k1.PrivateKey{ - genesis.VMRQKey, - genesis.EWOQKey, - HardhatKey, - } - keysToFund = append(keysToFund, n.PreFundedKeys...) - - genesis, err := NewTestGenesis(defaultNetworkID, n.Nodes, keysToFund) + genesis, err := n.DefaultGenesis() if err != nil { return err } @@ -325,6 +314,21 @@ func (n *Network) Create(rootDir string) error { return n.Write() } +func (n *Network) DefaultGenesis() (*genesis.UnparsedConfig, error) { + // Pre-fund known legacy keys to support ad-hoc testing. Usage of a legacy key will + // require knowing the key beforehand rather than retrieving it from the set of pre-funded + // keys exposed by a network. Since allocation will not be exclusive, a test using a + // legacy key is unlikely to be a good candidate for parallel execution. + keysToFund := []*secp256k1.PrivateKey{ + genesis.VMRQKey, + genesis.EWOQKey, + HardhatKey, + } + keysToFund = append(keysToFund, n.PreFundedKeys...) + + return NewTestGenesis(defaultNetworkID, n.Nodes, keysToFund) +} + // Starts the specified nodes func (n *Network) StartNodes(ctx context.Context, w io.Writer, nodesToStart ...*Node) error { if len(nodesToStart) == 0 { diff --git a/tests/upgrade/upgrade_test.go b/tests/upgrade/upgrade_test.go index 937cf0c4ca96..85b99def1432 100644 --- a/tests/upgrade/upgrade_test.go +++ b/tests/upgrade/upgrade_test.go @@ -50,6 +50,10 @@ var _ = ginkgo.Describe("[Upgrade]", func() { network := tmpnet.NewDefaultNetwork("avalanchego-upgrade") { + // Get the default genesis so we can modify it + genesis, err := network.DefaultGenesis() + require.NoError(err) + network.Genesis = genesis // Etna enables Cancun which modifies the outcome of the C-Chain genesis // This is because of new header fields that modify the genesis block hash. // This code can be removed once the Etna upgrade is activated. From 9b7f5f01eef914a573cd372ae53d0d1f9a8e687c Mon Sep 17 00:00:00 2001 From: Darioush Jalali Date: Wed, 7 Aug 2024 13:03:10 -0700 Subject: [PATCH 05/10] try nil --- tests/upgrade/upgrade_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/upgrade/upgrade_test.go b/tests/upgrade/upgrade_test.go index 85b99def1432..e4e3e574fee2 100644 --- a/tests/upgrade/upgrade_test.go +++ b/tests/upgrade/upgrade_test.go @@ -14,7 +14,6 @@ import ( "github.com/ava-labs/avalanchego/tests/fixture/e2e" "github.com/ava-labs/avalanchego/tests/fixture/tmpnet" - "github.com/ava-labs/avalanchego/upgrade" "github.com/ava-labs/coreth/core" ) @@ -60,11 +59,12 @@ var _ = ginkgo.Describe("[Upgrade]", func() { cChainGenesis := new(core.Genesis) cChainGenesisStr := network.Genesis.CChainGenesis require.NoError(json.Unmarshal([]byte(cChainGenesisStr), cChainGenesis)) - unscheduledActivationTime := uint64(upgrade.UnscheduledActivationTime.Unix()) - cChainGenesis.Config.EUpgradeTime = &unscheduledActivationTime + // unscheduledActivationTime := uint64(upgrade.UnscheduledActivationTime.Unix()) + cChainGenesis.Config.EUpgradeTime = nil // &unscheduledActivationTime cChainGenesisBytes, err := json.Marshal(cChainGenesis) require.NoError(err) network.Genesis.CChainGenesis = string(cChainGenesisBytes) + require.NoError(network.Write()) } e2e.StartNetwork(tc, network, avalancheGoExecPath, "" /* pluginDir */, 0 /* shutdownDelay */, false /* reuseNetwork */) From f87e2da956d4b3ed46fa2ce39b2bc8955e3f8e39 Mon Sep 17 00:00:00 2001 From: Darioush Jalali Date: Wed, 7 Aug 2024 14:33:20 -0700 Subject: [PATCH 06/10] fixes --- go.mod | 2 +- go.sum | 4 ++-- tests/fixture/tmpnet/genesis.go | 4 +++- tests/upgrade/upgrade_test.go | 7 ++++--- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index 26310f6aeba5..197ba60878be 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/DataDog/zstd v1.5.2 github.com/NYTimes/gziphandler v1.1.1 github.com/antithesishq/antithesis-sdk-go v0.3.8 - github.com/ava-labs/coreth v0.13.8-0.20240807162845-015611b6e6e5 + github.com/ava-labs/coreth v0.13.8-0.20240807212152-f7acfafec094 github.com/ava-labs/ledger-avalanche/go v0.0.0-20240610153809-9c955cc90a95 github.com/btcsuite/btcd/btcutil v1.1.3 github.com/cockroachdb/pebble v0.0.0-20230928194634-aa077af62593 diff --git a/go.sum b/go.sum index 67566bc8999e..de529da2191e 100644 --- a/go.sum +++ b/go.sum @@ -62,8 +62,8 @@ github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax github.com/antithesishq/antithesis-sdk-go v0.3.8 h1:OvGoHxIcOXFJLyn9IJQ5DzByZ3YVAWNBc394ObzDRb8= github.com/antithesishq/antithesis-sdk-go v0.3.8/go.mod h1:IUpT2DPAKh6i/YhSbt6Gl3v2yvUZjmKncl7U91fup7E= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= -github.com/ava-labs/coreth v0.13.8-0.20240807162845-015611b6e6e5 h1:gS7mgN4o9QPwlSZnHqv+KzPSh3jmXmhkcOtE3WYiFc0= -github.com/ava-labs/coreth v0.13.8-0.20240807162845-015611b6e6e5/go.mod h1:Ouul9dJouniUIJVX1gDqx8CrHyGvmwZkK28mrgKb/4I= +github.com/ava-labs/coreth v0.13.8-0.20240807212152-f7acfafec094 h1:e7TvIKDGzsMsKU3Y4HreRcK7f16EcEPUO04UwSCFtng= +github.com/ava-labs/coreth v0.13.8-0.20240807212152-f7acfafec094/go.mod h1:Ouul9dJouniUIJVX1gDqx8CrHyGvmwZkK28mrgKb/4I= github.com/ava-labs/ledger-avalanche/go v0.0.0-20240610153809-9c955cc90a95 h1:dOVbtdnZL++pENdTCNZ1nu41eYDQkTML4sWebDnnq8c= github.com/ava-labs/ledger-avalanche/go v0.0.0-20240610153809-9c955cc90a95/go.mod h1:pJxaT9bUgeRNVmNRgtCHb7sFDIRKy7CzTQVi8gGNT6g= github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g= diff --git a/tests/fixture/tmpnet/genesis.go b/tests/fixture/tmpnet/genesis.go index a9c85fe8b441..aa308be6ee71 100644 --- a/tests/fixture/tmpnet/genesis.go +++ b/tests/fixture/tmpnet/genesis.go @@ -16,6 +16,7 @@ import ( "github.com/ava-labs/avalanchego/genesis" "github.com/ava-labs/avalanchego/ids" + "github.com/ava-labs/avalanchego/upgrade" "github.com/ava-labs/avalanchego/utils/constants" "github.com/ava-labs/avalanchego/utils/crypto/secp256k1" "github.com/ava-labs/avalanchego/utils/formatting/address" @@ -149,7 +150,8 @@ func NewTestGenesis( // Define C-Chain genesis cChainGenesis := &core.Genesis{ Config: params.AvalancheLocalChainConfig, - Difficulty: big.NewInt(0), // Difficulty is a mandatory field + Difficulty: big.NewInt(0), // Difficulty is a mandatory field + Timestamp: uint64(upgrade.InitiallyActiveTime.Unix()), // This time enables Avalanche upgrades by default GasLimit: defaultGasLimit, Alloc: cChainBalances, } diff --git a/tests/upgrade/upgrade_test.go b/tests/upgrade/upgrade_test.go index e4e3e574fee2..1c1bec5559cd 100644 --- a/tests/upgrade/upgrade_test.go +++ b/tests/upgrade/upgrade_test.go @@ -14,6 +14,8 @@ import ( "github.com/ava-labs/avalanchego/tests/fixture/e2e" "github.com/ava-labs/avalanchego/tests/fixture/tmpnet" + "github.com/ava-labs/avalanchego/upgrade" + "github.com/ava-labs/coreth/core" ) @@ -59,12 +61,11 @@ var _ = ginkgo.Describe("[Upgrade]", func() { cChainGenesis := new(core.Genesis) cChainGenesisStr := network.Genesis.CChainGenesis require.NoError(json.Unmarshal([]byte(cChainGenesisStr), cChainGenesis)) - // unscheduledActivationTime := uint64(upgrade.UnscheduledActivationTime.Unix()) - cChainGenesis.Config.EUpgradeTime = nil // &unscheduledActivationTime + unscheduledActivationTime := uint64(upgrade.UnscheduledActivationTime.Unix()) + cChainGenesis.Config.EUpgradeTime = &unscheduledActivationTime cChainGenesisBytes, err := json.Marshal(cChainGenesis) require.NoError(err) network.Genesis.CChainGenesis = string(cChainGenesisBytes) - require.NoError(network.Write()) } e2e.StartNetwork(tc, network, avalancheGoExecPath, "" /* pluginDir */, 0 /* shutdownDelay */, false /* reuseNetwork */) From 376688b4912bf1b3c988167cfabf4ebedc27dc16 Mon Sep 17 00:00:00 2001 From: Darioush Jalali Date: Wed, 7 Aug 2024 14:44:27 -0700 Subject: [PATCH 07/10] lint --- tests/upgrade/upgrade_test.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/upgrade/upgrade_test.go b/tests/upgrade/upgrade_test.go index 1c1bec5559cd..374af3385f83 100644 --- a/tests/upgrade/upgrade_test.go +++ b/tests/upgrade/upgrade_test.go @@ -9,14 +9,13 @@ import ( "fmt" "testing" + "github.com/ava-labs/coreth/core" "github.com/onsi/ginkgo/v2" "github.com/stretchr/testify/require" "github.com/ava-labs/avalanchego/tests/fixture/e2e" "github.com/ava-labs/avalanchego/tests/fixture/tmpnet" "github.com/ava-labs/avalanchego/upgrade" - - "github.com/ava-labs/coreth/core" ) func TestUpgrade(t *testing.T) { From d058ae84c96face1653b2128e5e3a71b7f85b47a Mon Sep 17 00:00:00 2001 From: Darioush Jalali Date: Thu, 8 Aug 2024 08:17:38 -0700 Subject: [PATCH 08/10] bump coreth to tag on master --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 197ba60878be..ba0a3379f547 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/DataDog/zstd v1.5.2 github.com/NYTimes/gziphandler v1.1.1 github.com/antithesishq/antithesis-sdk-go v0.3.8 - github.com/ava-labs/coreth v0.13.8-0.20240807212152-f7acfafec094 + github.com/ava-labs/coreth v0.13.7-fixed-genesis-upgrade github.com/ava-labs/ledger-avalanche/go v0.0.0-20240610153809-9c955cc90a95 github.com/btcsuite/btcd/btcutil v1.1.3 github.com/cockroachdb/pebble v0.0.0-20230928194634-aa077af62593 diff --git a/go.sum b/go.sum index de529da2191e..a7143e0c8935 100644 --- a/go.sum +++ b/go.sum @@ -62,8 +62,8 @@ github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax github.com/antithesishq/antithesis-sdk-go v0.3.8 h1:OvGoHxIcOXFJLyn9IJQ5DzByZ3YVAWNBc394ObzDRb8= github.com/antithesishq/antithesis-sdk-go v0.3.8/go.mod h1:IUpT2DPAKh6i/YhSbt6Gl3v2yvUZjmKncl7U91fup7E= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= -github.com/ava-labs/coreth v0.13.8-0.20240807212152-f7acfafec094 h1:e7TvIKDGzsMsKU3Y4HreRcK7f16EcEPUO04UwSCFtng= -github.com/ava-labs/coreth v0.13.8-0.20240807212152-f7acfafec094/go.mod h1:Ouul9dJouniUIJVX1gDqx8CrHyGvmwZkK28mrgKb/4I= +github.com/ava-labs/coreth v0.13.7-fixed-genesis-upgrade h1:shO1Mf/OJ6IHo8ddezgX+8024M2QWawCixCaCLXjpqY= +github.com/ava-labs/coreth v0.13.7-fixed-genesis-upgrade/go.mod h1:cm5c12xo5NiTgtbmeduv8i2nYdzgkczz9Wm3yiwwTRU= github.com/ava-labs/ledger-avalanche/go v0.0.0-20240610153809-9c955cc90a95 h1:dOVbtdnZL++pENdTCNZ1nu41eYDQkTML4sWebDnnq8c= github.com/ava-labs/ledger-avalanche/go v0.0.0-20240610153809-9c955cc90a95/go.mod h1:pJxaT9bUgeRNVmNRgtCHb7sFDIRKy7CzTQVi8gGNT6g= github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g= From ddd1adc3ed0ac6015b71d7a7235fe97fa1b458d6 Mon Sep 17 00:00:00 2001 From: Darioush Jalali Date: Thu, 8 Aug 2024 08:23:18 -0700 Subject: [PATCH 09/10] use tag with 0.13.8 version --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index ba0a3379f547..d32038a431f0 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/DataDog/zstd v1.5.2 github.com/NYTimes/gziphandler v1.1.1 github.com/antithesishq/antithesis-sdk-go v0.3.8 - github.com/ava-labs/coreth v0.13.7-fixed-genesis-upgrade + github.com/ava-labs/coreth v0.13.8-fixed-genesis-upgrade github.com/ava-labs/ledger-avalanche/go v0.0.0-20240610153809-9c955cc90a95 github.com/btcsuite/btcd/btcutil v1.1.3 github.com/cockroachdb/pebble v0.0.0-20230928194634-aa077af62593 diff --git a/go.sum b/go.sum index a7143e0c8935..1c432ad35b38 100644 --- a/go.sum +++ b/go.sum @@ -62,8 +62,8 @@ github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax github.com/antithesishq/antithesis-sdk-go v0.3.8 h1:OvGoHxIcOXFJLyn9IJQ5DzByZ3YVAWNBc394ObzDRb8= github.com/antithesishq/antithesis-sdk-go v0.3.8/go.mod h1:IUpT2DPAKh6i/YhSbt6Gl3v2yvUZjmKncl7U91fup7E= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= -github.com/ava-labs/coreth v0.13.7-fixed-genesis-upgrade h1:shO1Mf/OJ6IHo8ddezgX+8024M2QWawCixCaCLXjpqY= -github.com/ava-labs/coreth v0.13.7-fixed-genesis-upgrade/go.mod h1:cm5c12xo5NiTgtbmeduv8i2nYdzgkczz9Wm3yiwwTRU= +github.com/ava-labs/coreth v0.13.8-fixed-genesis-upgrade h1:HYR7GSyVypZIhtl9t3Vqo5fiR+yThNWNH3O9sehdBDQ= +github.com/ava-labs/coreth v0.13.8-fixed-genesis-upgrade/go.mod h1:cm5c12xo5NiTgtbmeduv8i2nYdzgkczz9Wm3yiwwTRU= github.com/ava-labs/ledger-avalanche/go v0.0.0-20240610153809-9c955cc90a95 h1:dOVbtdnZL++pENdTCNZ1nu41eYDQkTML4sWebDnnq8c= github.com/ava-labs/ledger-avalanche/go v0.0.0-20240610153809-9c955cc90a95/go.mod h1:pJxaT9bUgeRNVmNRgtCHb7sFDIRKy7CzTQVi8gGNT6g= github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g= From 486b7d3f710460d9f736fdc76872f0115966a451 Mon Sep 17 00:00:00 2001 From: Darioush Jalali Date: Thu, 8 Aug 2024 08:31:00 -0700 Subject: [PATCH 10/10] fix tag --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index d32038a431f0..bc1e96772e80 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/DataDog/zstd v1.5.2 github.com/NYTimes/gziphandler v1.1.1 github.com/antithesishq/antithesis-sdk-go v0.3.8 - github.com/ava-labs/coreth v0.13.8-fixed-genesis-upgrade + github.com/ava-labs/coreth v0.13.8-fix-genesis-upgrade github.com/ava-labs/ledger-avalanche/go v0.0.0-20240610153809-9c955cc90a95 github.com/btcsuite/btcd/btcutil v1.1.3 github.com/cockroachdb/pebble v0.0.0-20230928194634-aa077af62593 diff --git a/go.sum b/go.sum index 1c432ad35b38..1f06a819fe3a 100644 --- a/go.sum +++ b/go.sum @@ -62,8 +62,8 @@ github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax github.com/antithesishq/antithesis-sdk-go v0.3.8 h1:OvGoHxIcOXFJLyn9IJQ5DzByZ3YVAWNBc394ObzDRb8= github.com/antithesishq/antithesis-sdk-go v0.3.8/go.mod h1:IUpT2DPAKh6i/YhSbt6Gl3v2yvUZjmKncl7U91fup7E= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= -github.com/ava-labs/coreth v0.13.8-fixed-genesis-upgrade h1:HYR7GSyVypZIhtl9t3Vqo5fiR+yThNWNH3O9sehdBDQ= -github.com/ava-labs/coreth v0.13.8-fixed-genesis-upgrade/go.mod h1:cm5c12xo5NiTgtbmeduv8i2nYdzgkczz9Wm3yiwwTRU= +github.com/ava-labs/coreth v0.13.8-fix-genesis-upgrade h1:xWsvSGtZcGna3B2BLU2BvK3qskbcc9ZNtgC0ck91CkI= +github.com/ava-labs/coreth v0.13.8-fix-genesis-upgrade/go.mod h1:Ouul9dJouniUIJVX1gDqx8CrHyGvmwZkK28mrgKb/4I= github.com/ava-labs/ledger-avalanche/go v0.0.0-20240610153809-9c955cc90a95 h1:dOVbtdnZL++pENdTCNZ1nu41eYDQkTML4sWebDnnq8c= github.com/ava-labs/ledger-avalanche/go v0.0.0-20240610153809-9c955cc90a95/go.mod h1:pJxaT9bUgeRNVmNRgtCHb7sFDIRKy7CzTQVi8gGNT6g= github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g=