Skip to content

Commit

Permalink
fix the last failing test!
Browse files Browse the repository at this point in the history
  • Loading branch information
feuGeneA committed Jul 3, 2024
1 parent a04afd0 commit 12a1185
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 22 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/ava-labs/teleporter
go 1.21.11

require (
github.com/ava-labs/avalanchego v1.11.9-0.20240702143626-fe3f4c0602eb
github.com/ava-labs/avalanchego v1.11.9-0.20240703222923-9d71967ccbba
github.com/supranational/blst v0.3.11 // indirect
)

Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY
github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156 h1:eMwmnE/GDgah4HI848JfFxHt+iPb26b4zyfspmqY0/8=
github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM=
github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8=
github.com/ava-labs/avalanchego v1.11.9-0.20240702143626-fe3f4c0602eb h1:xFCk5bwv/t6NfegF0jYtoLSSx/vYq3avNa0K4jmRNp4=
github.com/ava-labs/avalanchego v1.11.9-0.20240702143626-fe3f4c0602eb/go.mod h1:Nc85yoe/YatXafBLUesyiUrFT3+bpOrd7UFRFBtzn9A=
github.com/ava-labs/avalanchego v1.11.9-0.20240703222923-9d71967ccbba h1:G861YmZfj+m1fSb9TUMojYo7u5pG0jvDL4jHeyLOsG8=
github.com/ava-labs/avalanchego v1.11.9-0.20240703222923-9d71967ccbba/go.mod h1:Nc85yoe/YatXafBLUesyiUrFT3+bpOrd7UFRFBtzn9A=
github.com/ava-labs/coreth v0.13.5-rc.0 h1:PJQbR9o2RrW3j9ba4r1glXnmM2PNAP3xR569+gMcBd0=
github.com/ava-labs/coreth v0.13.5-rc.0/go.mod h1:cm5c12xo5NiTgtbmeduv8i2nYdzgkczz9Wm3yiwwTRU=
github.com/ava-labs/subnet-evm v0.6.6 h1:F2s40f2SE2Yt/e97ZA6jMVaqDW+/1PLewcqOiUWDFd0=
Expand Down
15 changes: 0 additions & 15 deletions tests/flows/validator_churn.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package flows
import (
"context"
"math/big"
"time"

"github.com/ava-labs/subnet-evm/accounts/abi/bind"
subnetEvmUtils "github.com/ava-labs/subnet-evm/tests/utils"
Expand Down Expand Up @@ -72,20 +71,6 @@ func ValidatorChurn(network interfaces.LocalNetwork) {
// We have to update all subnets, not just the ones directly involved in this test to ensure that the
// proposer VM is updated on all subnets.
for _, subnetInfo := range network.GetSubnetsInfo() {
// try to do some other generic transaction (or 10x) instead of this special one, and a ~20s sleep.
// consider also a sleep between transactions so that multiple blocks get created.
log.Info("triggering", "SubnetID", subnetInfo.SubnetID.String())

for range [10]int{} {
log.Info("tx")
transferAmount := big.NewInt(0).Mul(big.NewInt(1e18), big.NewInt(11)) // 11 AVAX
tx := utils.CreateNativeTransferTransaction(
ctx, subnetInfo, fundedKey, common.Address{}, transferAmount,
)
utils.SendTransactionAndWaitForSuccess(ctx, subnetInfo, tx)
time.Sleep(5*time.Second)
}

err = subnetEvmUtils.IssueTxsToActivateProposerVMFork(
ctx, subnetInfo.EVMChainID, fundedKey, subnetInfo.WSClient,
)
Expand Down
2 changes: 1 addition & 1 deletion tests/local/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ var _ = ginkgo.Describe("[Teleporter integration tests]", func() {
func() {
flows.TeleporterRegistry(LocalNetworkInstance)
})
ginkgo.FIt("Validator churn",
ginkgo.It("Validator churn",
ginkgo.Label(teleporterMessengerLabel),
func() {
flows.ValidatorChurn(LocalNetworkInstance)
Expand Down
9 changes: 6 additions & 3 deletions tests/local/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,7 @@ func (n *LocalNetwork) AddSubnetValidators(ctx context.Context, subnetID ids.ID,
Expect(err).Should(BeNil())
for _, node := range nodes {
subnet.ValidatorIDs = append(subnet.ValidatorIDs, node.NodeID)
node.Flags[config.TrackSubnetsKey] = subnetID.String()
}

// do like tmpnet.Boostrap():
Expand All @@ -510,9 +511,11 @@ func (n *LocalNetwork) AddSubnetValidators(ctx context.Context, subnetID ids.ID,
// 3. restart the nodes

tmpnet.WaitForActiveValidators(ctx, os.Stdout, platformvm.NewClient(n.tmpnet.Nodes[0].URI), subnet)
n.tmpnet.Write()
n.tmpnet.WriteSubnets()
n.RestartNodes(ctx, subnet.ValidatorIDs)
nodeIdsToRestart := make([]ids.NodeID, len(nodes))
for i, node := range nodes {
nodeIdsToRestart[i] = node.NodeID
}
n.RestartNodes(ctx, nodeIdsToRestart) // don't need to restart ALL the validators, just the one(s) added here

fmt.Println("finished adding validators")

Expand Down

0 comments on commit 12a1185

Please sign in to comment.