Skip to content

Commit 59faec7

Browse files
authored
Merge branch 'main' into bump-version
2 parents 6fc181b + 90c2a0e commit 59faec7

File tree

8 files changed

+25
-147
lines changed

8 files changed

+25
-147
lines changed

go.mod

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ go 1.21.12
55
toolchain go1.22.3
66

77
require (
8-
github.com/ava-labs/avalanchego v1.11.11-0.20240814014627-2eef64141457
9-
github.com/ava-labs/coreth v0.13.8-fixed-genesis-upgrade.0.20240813194342-7635a96aa180
8+
github.com/ava-labs/avalanchego v1.11.11
9+
github.com/ava-labs/coreth v0.13.8-fixed-genesis-upgrade.0.20240815193440-a96bc921e732
1010
github.com/ethereum/go-ethereum v1.13.8
1111
github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0
1212
github.com/onsi/ginkgo/v2 v2.13.1

go.sum

+4-4
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY
5656
github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156 h1:eMwmnE/GDgah4HI848JfFxHt+iPb26b4zyfspmqY0/8=
5757
github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM=
5858
github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8=
59-
github.com/ava-labs/avalanchego v1.11.11-0.20240814014627-2eef64141457 h1:yT27Bn/2+SnJR1YPIscqznSlvpnR3TEGfbS7wdB1Gmg=
60-
github.com/ava-labs/avalanchego v1.11.11-0.20240814014627-2eef64141457/go.mod h1:UkyrRDXK2E15Lq2abyae2Pt+JsWvgsg1pe0/AtoMyAM=
61-
github.com/ava-labs/coreth v0.13.8-fixed-genesis-upgrade.0.20240813194342-7635a96aa180 h1:6aIHp7wbyGVYdhHVQUbG7BEcbCMEQ5SYopPPJyipyvk=
62-
github.com/ava-labs/coreth v0.13.8-fixed-genesis-upgrade.0.20240813194342-7635a96aa180/go.mod h1:/wNBVq7J7wlC2Kbov7kk6LV5xZvau7VF9zwTVOeyAjY=
59+
github.com/ava-labs/avalanchego v1.11.11 h1:MIQq8xRavRj4ZXHA4G+aMiymig7SOScGOG1SApmMvBc=
60+
github.com/ava-labs/avalanchego v1.11.11/go.mod h1:yFx3V31Jy9NFa8GZlgGnwiVf8KGjeF2+Uc99l9Scd/8=
61+
github.com/ava-labs/coreth v0.13.8-fixed-genesis-upgrade.0.20240815193440-a96bc921e732 h1:wlhGJbmb7s3bU2QWtxKjscGjfHknQiq+cVhhUjONsB8=
62+
github.com/ava-labs/coreth v0.13.8-fixed-genesis-upgrade.0.20240815193440-a96bc921e732/go.mod h1:RkQLaQ961Xe/sUb3ycn4Qi18vPPuEetTqDf2eDcquAs=
6363
github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g=
6464
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
6565
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=

local/blockchain.go

+6-5
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ import (
4343
"github.com/ava-labs/avalanchego/wallet/chain/p"
4444
pbuilder "github.com/ava-labs/avalanchego/wallet/chain/p/builder"
4545
psigner "github.com/ava-labs/avalanchego/wallet/chain/p/signer"
46+
pwallet "github.com/ava-labs/avalanchego/wallet/chain/p/wallet"
4647
"github.com/ava-labs/avalanchego/wallet/subnet/primary"
4748
"github.com/ava-labs/avalanchego/wallet/subnet/primary/common"
4849
"go.uber.org/zap"
@@ -826,8 +827,8 @@ func (ln *localNetwork) restartNodes(
826827
type wallet struct {
827828
addr ids.ShortID
828829
pCTX *pbuilder.Context
829-
pWallet p.Wallet
830-
pBackend p.Backend
830+
pWallet pwallet.Wallet
831+
pBackend pwallet.Backend
831832
pBuilder pbuilder.Builder
832833
pSigner psigner.Signer
833834
xCTX *xbuilder.Context
@@ -879,10 +880,10 @@ func newWallet(
879880
var w wallet
880881
w.addr = privateKey.PublicKey().Address()
881882
w.pCTX = pCTX
882-
w.pBackend = p.NewBackend(pCTX, pUTXOs, subnetOwners)
883+
w.pBackend = pwallet.NewBackend(pCTX, pUTXOs, subnetOwners)
883884
w.pBuilder = pbuilder.New(kc.Addresses(), pCTX, w.pBackend)
884885
w.pSigner = psigner.New(kc, w.pBackend)
885-
w.pWallet = p.NewWallet(w.pBuilder, w.pSigner, pClient, w.pBackend)
886+
w.pWallet = pwallet.New(p.NewClient(pClient, w.pBackend), w.pBuilder, w.pSigner)
886887

887888
xBackend := x.NewBackend(xCTX, xUTXOs)
888889
xBuilder := xbuilder.New(kc.Addresses(), xCTX, xBackend)
@@ -895,7 +896,7 @@ func newWallet(
895896

896897
func (w *wallet) reload(uri string) {
897898
pClient := platformvm.NewClient(uri)
898-
w.pWallet = p.NewWallet(w.pBuilder, w.pSigner, pClient, w.pBackend)
899+
w.pWallet = pwallet.New(p.NewClient(pClient, w.pBackend), w.pBuilder, w.pSigner)
899900
}
900901

901902
// add all nodes as validators of the primary network, in case they are not

local/default/flags.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
"health-check-frequency":"2s",
55
"api-admin-enabled":true,
66
"index-enabled":true,
7-
"log-display-level":"ERROR",
8-
"log-level": "ERROR"
7+
"log-display-level":"INFO",
8+
"log-level": "INFO"
99
}

local/node_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ func verifyProtocol(
112112
[]uint32{},
113113
knownPeersFilter,
114114
knownPeersSalt,
115+
false,
115116
)
116117
if err != nil {
117118
errCh <- err

scripts/tests.e2e.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ fi
1313
ANR_PATH=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)
1414

1515
# this avago and subnet-evm versions must have compatibility at rpc protocol level
16-
DEFAULT_VERSION_1=v1.11.5
17-
DEFAULT_SUBNET_EVM_VERSION=v0.6.4
16+
DEFAULT_VERSION_1=v1.11.11
17+
DEFAULT_SUBNET_EVM_VERSION=v0.6.9
1818

1919
# used standalone, without interaction with subnet-evm, no compatibility needed
20-
DEFAULT_VERSION_2=v1.11.4
20+
DEFAULT_VERSION_2=v1.11.11
2121

2222
if [ $# == 0 ]; then
2323
VERSION_1=$DEFAULT_VERSION_1

tests/e2e/e2e_test.go

+2-129
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@ var (
5858
newNode2NodeID = ""
5959
pausedNodeURI = ""
6060
pausedNodeName = "node1"
61-
createdSubnetID = ""
62-
elasticAssetID = ""
6361
newSubnetID = ""
6462
customNodeConfigs = map[string]string{
6563
"node1": `{"api-admin-enabled":true}`,
@@ -73,36 +71,12 @@ var (
7371
numNodes = uint32(5)
7472
subnetParticipants = []string{"node1", "node2", "node3"}
7573
newParticipantNode = "new_participant_node"
76-
delegateeNode = "permissionlessNode"
7774
subnetParticipants2 = []string{"node1", "node2", newParticipantNode}
7875
existingNodes = []string{"node1", "node2", "node3", "node4", "node5"}
7976
disjointNewSubnetParticipants = [][]string{
8077
{"n0", "n1", "n2", "n3", "n4"},
8178
{"n5", "n6", "n7", "n8", "n9"},
8279
}
83-
testElasticSubnetConfig = rpcpb.ElasticSubnetSpec{
84-
SubnetId: "",
85-
AssetName: "BLIZZARD",
86-
AssetSymbol: "BRRR",
87-
InitialSupply: 240000000,
88-
MaxSupply: 720000000,
89-
MinConsumptionRate: 100000,
90-
MaxConsumptionRate: 120000,
91-
MinValidatorStake: 2000,
92-
MaxValidatorStake: 3000000,
93-
MinStakeDuration: 14 * 24,
94-
MaxStakeDuration: 365 * 24,
95-
MinDelegationFee: 20000,
96-
MinDelegatorStake: 25,
97-
MaxValidatorWeightFactor: 5,
98-
UptimeRequirement: 0.8 * 1_000_000,
99-
}
100-
101-
testValidatorConfig = rpcpb.PermissionlessStakerSpec{
102-
StakedTokenAmount: 2000,
103-
StartTime: time.Now().Add(1 * time.Hour).UTC().Format(server.TimeParseLayout),
104-
StakeDuration: 336,
105-
}
10680
)
10781

10882
func init() {
@@ -927,107 +901,6 @@ var _ = ginkgo.Describe("[Start/Remove/Restart/Add/Stop]", func() {
927901
})
928902
})
929903

930-
ginkgo.It("transform subnet to elastic subnets", func() {
931-
var elasticSubnetID string
932-
ginkgo.By("add 1 subnet", func() {
933-
ctx, cancel := context.WithTimeout(context.Background(), 2*time.Minute)
934-
resp, err := cli.CreateSubnets(ctx, []*rpcpb.SubnetSpec{{}})
935-
cancel()
936-
gomega.Ω(err).Should(gomega.BeNil())
937-
gomega.Ω(len(resp.SubnetIds)).Should(gomega.Equal(1))
938-
gomega.Ω(len(resp.ClusterInfo.Subnets)).Should(gomega.Equal(5))
939-
createdSubnetID = resp.SubnetIds[0]
940-
})
941-
ginkgo.By("check expected non elastic status", func() {
942-
ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)
943-
status, err := cli.Status(ctx)
944-
cancel()
945-
gomega.Ω(err).Should(gomega.BeNil())
946-
subnetInfo := status.ClusterInfo.Subnets[createdSubnetID]
947-
gomega.Ω(subnetInfo.IsElastic).Should(gomega.Equal(false))
948-
gomega.Ω(subnetInfo.ElasticSubnetId).Should(gomega.Equal(ids.Empty.String()))
949-
})
950-
ginkgo.By("transform 1 subnet to elastic subnet", func() {
951-
ctx, cancel := context.WithTimeout(context.Background(), 2*time.Minute)
952-
defer cancel()
953-
testElasticSubnetConfig.SubnetId = createdSubnetID
954-
response, err := cli.TransformElasticSubnets(ctx, []*rpcpb.ElasticSubnetSpec{&testElasticSubnetConfig})
955-
gomega.Ω(err).Should(gomega.BeNil())
956-
gomega.Ω(len(response.TxIds)).Should(gomega.Equal(1))
957-
gomega.Ω(len(response.AssetIds)).Should(gomega.Equal(1))
958-
elasticAssetID = response.AssetIds[0]
959-
})
960-
ginkgo.By("check expected elastic status", func() {
961-
ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)
962-
status, err := cli.Status(ctx)
963-
cancel()
964-
gomega.Ω(err).Should(gomega.BeNil())
965-
subnetInfo := status.ClusterInfo.Subnets[createdSubnetID]
966-
gomega.Ω(subnetInfo.IsElastic).Should(gomega.Equal(true))
967-
gomega.Ω(subnetInfo.ElasticSubnetId).ShouldNot(gomega.Equal(ids.Empty.String()))
968-
elasticSubnetID = subnetInfo.ElasticSubnetId
969-
})
970-
ginkgo.By("transforming a subnet with same subnetID to elastic subnet will fail", func() {
971-
ctx, cancel := context.WithTimeout(context.Background(), 2*time.Minute)
972-
defer cancel()
973-
testElasticSubnetConfig.SubnetId = createdSubnetID
974-
_, err := cli.TransformElasticSubnets(ctx, []*rpcpb.ElasticSubnetSpec{&testElasticSubnetConfig})
975-
gomega.Ω(err).Should(gomega.HaveOccurred())
976-
})
977-
ginkgo.By("save snapshot with elastic info", func() {
978-
ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)
979-
_, err := cli.SaveSnapshot(ctx, "elastic_snapshot", false)
980-
cancel()
981-
gomega.Ω(err).Should(gomega.BeNil())
982-
})
983-
ginkgo.By("load snapshot with elastic info", func() {
984-
ctx, cancel := context.WithTimeout(context.Background(), 2*time.Minute)
985-
_, err := cli.LoadSnapshot(ctx, "elastic_snapshot", false)
986-
cancel()
987-
gomega.Ω(err).Should(gomega.BeNil())
988-
})
989-
ginkgo.By("check expected elastic status", func() {
990-
ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)
991-
status, err := cli.Status(ctx)
992-
cancel()
993-
gomega.Ω(err).Should(gomega.BeNil())
994-
subnetInfo := status.ClusterInfo.Subnets[createdSubnetID]
995-
gomega.Ω(subnetInfo.IsElastic).Should(gomega.Equal(true))
996-
gomega.Ω(subnetInfo.ElasticSubnetId).Should(gomega.Equal(elasticSubnetID))
997-
})
998-
ginkgo.By("remove snapshot with elastic info", func() {
999-
ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)
1000-
_, err := cli.RemoveSnapshot(ctx, "elastic_snapshot")
1001-
cancel()
1002-
gomega.Ω(err).Should(gomega.BeNil())
1003-
})
1004-
})
1005-
1006-
ginkgo.It("add permissionless validator to elastic subnets", func() {
1007-
ginkgo.By("adding a permissionless validator to elastic subnet", func() {
1008-
ctx, cancel := context.WithTimeout(context.Background(), 2*time.Minute)
1009-
defer cancel()
1010-
testValidatorConfig.SubnetId = createdSubnetID
1011-
testValidatorConfig.AssetId = elasticAssetID
1012-
testValidatorConfig.NodeName = delegateeNode
1013-
_, err := cli.AddPermissionlessValidator(ctx, []*rpcpb.PermissionlessStakerSpec{&testValidatorConfig})
1014-
gomega.Ω(err).Should(gomega.BeNil())
1015-
})
1016-
})
1017-
1018-
ginkgo.It("add permissionless delegator to elastic subnets", func() {
1019-
ginkgo.By("adding a permissionless delegator to permissionless validator", func() {
1020-
ctx, cancel := context.WithTimeout(context.Background(), 2*time.Minute)
1021-
defer cancel()
1022-
testValidatorConfig.SubnetId = createdSubnetID
1023-
testValidatorConfig.AssetId = elasticAssetID
1024-
testValidatorConfig.NodeName = delegateeNode
1025-
testValidatorConfig.StakedTokenAmount = 35
1026-
_, err := cli.AddPermissionlessDelegator(ctx, []*rpcpb.PermissionlessStakerSpec{&testValidatorConfig})
1027-
gomega.Ω(err).Should(gomega.BeNil())
1028-
})
1029-
})
1030-
1031904
ginkgo.It("snapshots + blockchain creation", func() {
1032905
var originalUris []string
1033906
var originalSubnets []string
@@ -1037,15 +910,15 @@ var _ = ginkgo.Describe("[Start/Remove/Restart/Add/Stop]", func() {
1037910
originalUris, err = cli.URIs(ctx)
1038911
cancel()
1039912
gomega.Ω(err).Should(gomega.BeNil())
1040-
gomega.Ω(len(originalUris)).Should(gomega.Equal(8))
913+
gomega.Ω(len(originalUris)).Should(gomega.Equal(7))
1041914
})
1042915
ginkgo.By("get original subnets", func() {
1043916
ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)
1044917
status, err := cli.Status(ctx)
1045918
cancel()
1046919
gomega.Ω(err).Should(gomega.BeNil())
1047920
numSubnets := len(status.ClusterInfo.Subnets)
1048-
gomega.Ω(numSubnets).Should(gomega.Equal(5))
921+
gomega.Ω(numSubnets).Should(gomega.Equal(4))
1049922
originalSubnets = maps.Keys(status.ClusterInfo.Subnets)
1050923
})
1051924
ginkgo.By("check there are no snapshots", func() {

utils/genesis.go

+5-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"fmt"
88
"time"
99

10+
"github.com/ava-labs/avalanchego/upgrade"
1011
"github.com/ava-labs/avalanchego/utils/crypto/bls"
1112
"github.com/ava-labs/avalanchego/utils/formatting"
1213
"github.com/ava-labs/avalanchego/vms/platformvm/signer"
@@ -26,9 +27,11 @@ const (
2627

2728
func generateCchainGenesis() ([]byte, error) {
2829
cChainGenesisMap := map[string]interface{}{}
29-
cChainGenesisMap["config"] = coreth_params.AvalancheLocalChainConfig
30+
chainConfig := *coreth_params.TestChainConfig
31+
chainConfig.ChainID = coreth_params.AvalancheLocalChainID
32+
cChainGenesisMap["config"] = chainConfig
33+
cChainGenesisMap["timestamp"] = upgrade.InitiallyActiveTime.Unix()
3034
cChainGenesisMap["nonce"] = hexa0Str
31-
cChainGenesisMap["timestamp"] = hexa0Str
3235
cChainGenesisMap["extraData"] = "0x00"
3336
cChainGenesisMap["gasLimit"] = "0x5f5e100"
3437
cChainGenesisMap["difficulty"] = hexa0Str

0 commit comments

Comments
 (0)