Skip to content
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

update avalanchego dep branch #1348

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft
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
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.21.12
require (
github.com/VictoriaMetrics/fastcache v1.12.1
github.com/antithesishq/antithesis-sdk-go v0.3.8
github.com/ava-labs/avalanchego v1.11.11
github.com/ava-labs/avalanchego v1.11.12-rc.2.0.20240916220401-1753950304a4
github.com/cespare/cp v0.1.0
github.com/crate-crypto/go-ipa v0.0.0-20231025140028-3c0104f4b233
github.com/davecgh/go-spew v1.1.1
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,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/avalanchego v1.11.11 h1:MIQq8xRavRj4ZXHA4G+aMiymig7SOScGOG1SApmMvBc=
github.com/ava-labs/avalanchego v1.11.11/go.mod h1:yFx3V31Jy9NFa8GZlgGnwiVf8KGjeF2+Uc99l9Scd/8=
github.com/ava-labs/avalanchego v1.11.12-rc.2.0.20240916220401-1753950304a4 h1:07qWIUU3C/nAVBJK5orGZKoEVodQE8OsfnpPZ8cTnSQ=
github.com/ava-labs/avalanchego v1.11.12-rc.2.0.20240916220401-1753950304a4/go.mod h1:yFx3V31Jy9NFa8GZlgGnwiVf8KGjeF2+Uc99l9Scd/8=
github.com/ava-labs/coreth v0.13.8-fixed-genesis-upgrade.0.20240815193440-a96bc921e732 h1:wlhGJbmb7s3bU2QWtxKjscGjfHknQiq+cVhhUjONsB8=
github.com/ava-labs/coreth v0.13.8-fixed-genesis-upgrade.0.20240815193440-a96bc921e732/go.mod h1:RkQLaQ961Xe/sUb3ycn4Qi18vPPuEetTqDf2eDcquAs=
github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g=
Expand Down
40 changes: 14 additions & 26 deletions params/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,24 +48,6 @@ var (
FeeConfig: DefaultFeeConfig,
AllowFeeRecipients: false,

HomesteadBlock: big.NewInt(0),
EIP150Block: big.NewInt(0),
EIP155Block: big.NewInt(0),
EIP158Block: big.NewInt(0),
ByzantiumBlock: big.NewInt(0),
ConstantinopleBlock: big.NewInt(0),
PetersburgBlock: big.NewInt(0),
IstanbulBlock: big.NewInt(0),
MuirGlacierBlock: big.NewInt(0),
NetworkUpgrades: getDefaultNetworkUpgrades(upgrade.GetConfig(constants.MainnetID)), // This can be changed to correct network (local, test) via VM.
GenesisPrecompiles: Precompiles{},
}

TestChainConfig = &ChainConfig{
AvalancheContext: AvalancheContext{utils.TestSnowContext()},
ChainID: big.NewInt(1),
FeeConfig: DefaultFeeConfig,
AllowFeeRecipients: false,
HomesteadBlock: big.NewInt(0),
EIP150Block: big.NewInt(0),
EIP155Block: big.NewInt(0),
Expand All @@ -77,11 +59,8 @@ var (
MuirGlacierBlock: big.NewInt(0),
BerlinBlock: big.NewInt(0),
LondonBlock: big.NewInt(0),
ShanghaiTime: utils.TimeToNewUint64(upgrade.GetConfig(constants.UnitTestID).DurangoTime),
CancunTime: utils.TimeToNewUint64(upgrade.GetConfig(constants.UnitTestID).EtnaTime),
NetworkUpgrades: getDefaultNetworkUpgrades(upgrade.GetConfig(constants.UnitTestID)), // This can be changed to correct network (local, test) via VM.
NetworkUpgrades: getDefaultNetworkUpgrades(upgrade.GetConfig(constants.MainnetID)), // This can be changed to correct network (local, test) via VM.
GenesisPrecompiles: Precompiles{},
UpgradeConfig: UpgradeConfig{},
}

TestPreSubnetEVMChainConfig = &ChainConfig{
Expand Down Expand Up @@ -146,9 +125,12 @@ var (
PetersburgBlock: big.NewInt(0),
IstanbulBlock: big.NewInt(0),
MuirGlacierBlock: big.NewInt(0),
BerlinBlock: big.NewInt(0),
LondonBlock: big.NewInt(0),
ShanghaiTime: utils.TimeToNewUint64(upgrade.InitiallyActiveTime),
NetworkUpgrades: NetworkUpgrades{
SubnetEVMTimestamp: utils.NewUint64(0),
DurangoTimestamp: utils.NewUint64(0),
DurangoTimestamp: utils.TimeToNewUint64(upgrade.InitiallyActiveTime),
EtnaTimestamp: utils.TimeToNewUint64(upgrade.UnscheduledActivationTime),
},
GenesisPrecompiles: Precompiles{},
Expand All @@ -169,15 +151,21 @@ var (
PetersburgBlock: big.NewInt(0),
IstanbulBlock: big.NewInt(0),
MuirGlacierBlock: big.NewInt(0),
BerlinBlock: big.NewInt(0),
LondonBlock: big.NewInt(0),
ShanghaiTime: utils.TimeToNewUint64(upgrade.InitiallyActiveTime),
CancunTime: utils.TimeToNewUint64(upgrade.InitiallyActiveTime),
NetworkUpgrades: NetworkUpgrades{
SubnetEVMTimestamp: utils.NewUint64(0),
DurangoTimestamp: utils.NewUint64(0),
EtnaTimestamp: utils.NewUint64(0),
DurangoTimestamp: utils.TimeToNewUint64(upgrade.InitiallyActiveTime),
EtnaTimestamp: utils.TimeToNewUint64(upgrade.InitiallyActiveTime),
},
GenesisPrecompiles: Precompiles{},
UpgradeConfig: UpgradeConfig{},
}
TestRules = TestChainConfig.Rules(new(big.Int), 0)

TestChainConfig = TestEtnaChainConfig
TestRules = TestChainConfig.Rules(new(big.Int), 0)
)

// ChainConfig is the core config which determines the blockchain settings.
Expand Down
5 changes: 3 additions & 2 deletions params/network_upgrades_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"testing"

"github.com/ava-labs/avalanchego/upgrade"
"github.com/ava-labs/avalanchego/upgrade/upgradetest"
"github.com/ava-labs/avalanchego/utils/constants"
"github.com/ava-labs/subnet-evm/utils"
"github.com/stretchr/testify/require"
Expand Down Expand Up @@ -179,13 +180,13 @@ func TestVerifyNetworkUpgrades(t *testing.T) {
expected bool
}{
{
name: "ValidNetworkUpgrades for custom network",
name: "ValidNetworkUpgrades for latest network",
upgrades: &NetworkUpgrades{
SubnetEVMTimestamp: utils.NewUint64(0),
DurangoTimestamp: utils.NewUint64(1607144400),
EtnaTimestamp: utils.NewUint64(1607144400),
},
avagoUpgrades: upgrade.GetConfig(1111),
avagoUpgrades: upgradetest.GetConfig(upgradetest.Latest),
expected: true,
},
{
Expand Down
1 change: 0 additions & 1 deletion plugin/evm/vm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ func NewContext() *snow.Context {
ctx.ChainID = testCChainID
ctx.AVAXAssetID = testAvaxAssetID
ctx.XChainID = testXChainID
ctx.NetworkUpgrades = upgrade.GetConfig(testNetworkID)
aliaser := ctx.BCLookup.(ids.Aliaser)
_ = aliaser.Alias(testCChainID, "C")
_ = aliaser.Alias(testCChainID, testCChainID.String())
Expand Down
2 changes: 1 addition & 1 deletion scripts/versions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# shellcheck disable=SC2034

# Don't export them as they're used in the context of other calls
AVALANCHE_VERSION=${AVALANCHE_VERSION:-'v1.11.11'}
AVALANCHE_VERSION=${AVALANCHE_VERSION:-'17539503'}
GINKGO_VERSION=${GINKGO_VERSION:-'v2.2.0'}

# This won't be used, but it's here to make code syncs easier
Expand Down
4 changes: 2 additions & 2 deletions utils/snow.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/ava-labs/avalanchego/ids"
"github.com/ava-labs/avalanchego/snow"
"github.com/ava-labs/avalanchego/snow/validators/validatorstest"
"github.com/ava-labs/avalanchego/upgrade"
"github.com/ava-labs/avalanchego/upgrade/upgradetest"
"github.com/ava-labs/avalanchego/utils/crypto/bls"
"github.com/ava-labs/avalanchego/utils/logging"
)
Expand All @@ -24,7 +24,7 @@ func TestSnowContext() *snow.Context {
SubnetID: ids.Empty,
ChainID: ids.Empty,
NodeID: ids.EmptyNodeID,
NetworkUpgrades: upgrade.Default,
NetworkUpgrades: upgradetest.GetConfig(upgradetest.Latest),
PublicKey: pk,
Log: logging.NoLog{},
BCLookup: ids.NewAliaser(),
Expand Down
Loading