Skip to content

Commit

Permalink
Merge branch 'main' into update-go
Browse files Browse the repository at this point in the history
  • Loading branch information
geoff-vball authored Sep 9, 2024
2 parents 2bd9313 + f23da2d commit 085bf7f
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 31 deletions.
14 changes: 7 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ module github.com/ava-labs/teleporter
go 1.22.7

require (
github.com/ava-labs/avalanchego v1.11.10
github.com/ava-labs/avalanchego v1.11.11
github.com/supranational/blst v0.3.11 // indirect
)

require (
github.com/ava-labs/subnet-evm v0.6.8
github.com/ethereum/go-ethereum v1.13.8
github.com/ava-labs/subnet-evm v0.6.9
github.com/ethereum/go-ethereum v1.13.14
github.com/onsi/ginkgo/v2 v2.20.2
github.com/onsi/gomega v1.34.2
github.com/pkg/errors v0.9.1
Expand All @@ -23,7 +23,7 @@ require (
github.com/DataDog/zstd v1.5.2 // indirect
github.com/NYTimes/gziphandler v1.1.1 // indirect
github.com/VictoriaMetrics/fastcache v1.12.1 // indirect
github.com/ava-labs/coreth v0.13.7 // indirect
github.com/ava-labs/coreth v0.13.8-fixed-genesis-upgrade.0.20240815193440-a96bc921e732 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bits-and-blooms/bitset v1.10.0 // indirect
github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect
Expand All @@ -46,15 +46,15 @@ require (
github.com/dlclark/regexp2 v1.7.0 // indirect
github.com/dop251/goja v0.0.0-20230806174421-c933cf95e127 // indirect
github.com/ethereum/c-kzg-4844 v0.4.0 // indirect
github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5 // indirect
github.com/fjl/memsize v0.0.2 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08 // indirect
github.com/gballet/go-verkle v0.1.1-0.20231031103413-a67434b50f46 // indirect
github.com/getsentry/sentry-go v0.18.0 // indirect
github.com/go-cmd/cmd v1.4.1 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
github.com/go-ole/go-ole v1.3.0 // indirect
github.com/go-sourcemap/sourcemap v2.1.3+incompatible // indirect
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
Expand All @@ -73,7 +73,7 @@ require (
github.com/hashicorp/go-bexpr v0.1.10 // indirect
github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/holiman/billy v0.0.0-20230718173358-1c7e68d277a7 // indirect
github.com/holiman/billy v0.0.0-20240216141850-2abb0c79d3c4 // indirect
github.com/holiman/bloomfilter/v2 v2.0.3 // indirect
github.com/holiman/uint256 v1.2.4 // indirect
github.com/huin/goupnp v1.3.0 // indirect
Expand Down
28 changes: 15 additions & 13 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ 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.10 h1:QujciF5OEp5FwAoe/RciFF/i47rxU5rkEr6fVuUBS1Q=
github.com/ava-labs/avalanchego v1.11.10/go.mod h1:POgZPryqe80OeHCDNrXrPOKoFre736iFuMgmUBeKaLc=
github.com/ava-labs/coreth v0.13.7 h1:k8T9u/ROifl8f7oXjHRc1KvSISRl9txvy7gGVmHEz6g=
github.com/ava-labs/coreth v0.13.7/go.mod h1:tXDujonxXFOF6oK5HS2EmgtSXJK3Gy6RpZxb5WzR9rM=
github.com/ava-labs/subnet-evm v0.6.8 h1:IrHGajBYWs692YIYdd5J0oVWWt88Q/XAZQq/dOtkHFw=
github.com/ava-labs/subnet-evm v0.6.8/go.mod h1:qt8DXyGm40CY9yffNOe1+4yUyL9mD3v5RPWqAuGj5u4=
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/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/ava-labs/subnet-evm v0.6.9 h1:0FSPjbysSudOlMD/d0ivkli50d2ixpX3sXCi7XHfPbc=
github.com/ava-labs/subnet-evm v0.6.9/go.mod h1:dw4kg0o58dvYlndj2ZcwB7hioRc1kjg00yXYrcSmnj8=
github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
Expand Down Expand Up @@ -172,12 +172,12 @@ github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7
github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw=
github.com/ethereum/c-kzg-4844 v0.4.0 h1:3MS1s4JtA868KpJxroZoepdV0ZKBp3u/O5HcZ7R3nlY=
github.com/ethereum/c-kzg-4844 v0.4.0/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1aQputP83wc0=
github.com/ethereum/go-ethereum v1.13.8 h1:1od+thJel3tM52ZUNQwvpYOeRHlbkVFZ5S8fhi0Lgsg=
github.com/ethereum/go-ethereum v1.13.8/go.mod h1:sc48XYQxCzH3fG9BcrXCOOgQk2JfZzNAmIKnceogzsA=
github.com/ethereum/go-ethereum v1.13.14 h1:EwiY3FZP94derMCIam1iW4HFVrSgIcpsu0HwTQtm6CQ=
github.com/ethereum/go-ethereum v1.13.14/go.mod h1:TN8ZiHrdJwSe8Cb6x+p0hs5CxhJZPbqB7hHkaUXcmIU=
github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072/go.mod h1:duJ4Jxv5lDcvg4QuQr0oowTf7dz4/CR8NtyCooz9HL8=
github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M=
github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5 h1:FtmdgXiUlNeRsoNMFlKLDt+S+6hbjVMEW6RGQ7aUf7c=
github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0=
github.com/fjl/memsize v0.0.2 h1:27txuSD9or+NZlnOWdKUxeBzTAUkWCVh+4Gf2dWFOzA=
github.com/fjl/memsize v0.0.2/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0=
github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY=
github.com/frankban/quicktest v1.14.4/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
Expand Down Expand Up @@ -210,8 +210,9 @@ github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ4
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
github.com/go-martini/martini v0.0.0-20170121215854-22fa46961aab/go.mod h1:/P9AEU963A2AYjv4d1V5eVL1CQbEJq6aCNHDDjibzu8=
github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY=
github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0=
github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE=
github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78=
github.com/go-sourcemap/sourcemap v2.1.3+incompatible h1:W1iEw64niKVGogNgBN3ePyLFfuisuzeidWPMPWmECqU=
github.com/go-sourcemap/sourcemap v2.1.3+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg=
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE=
Expand Down Expand Up @@ -330,8 +331,8 @@ github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d h1:dg1dEPuW
github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
github.com/holiman/billy v0.0.0-20230718173358-1c7e68d277a7 h1:3JQNjnMRil1yD0IfZKHF9GxxWKDJGj8I0IqOUol//sw=
github.com/holiman/billy v0.0.0-20230718173358-1c7e68d277a7/go.mod h1:5GuXa7vkL8u9FkFuWdVvfR5ix8hRB7DbOAaYULamFpc=
github.com/holiman/billy v0.0.0-20240216141850-2abb0c79d3c4 h1:X4egAf/gcS1zATw6wn4Ej8vjuVGxeHdan+bRb2ebyv4=
github.com/holiman/billy v0.0.0-20240216141850-2abb0c79d3c4/go.mod h1:5GuXa7vkL8u9FkFuWdVvfR5ix8hRB7DbOAaYULamFpc=
github.com/holiman/bloomfilter/v2 v2.0.3 h1:73e0e/V0tCydx14a0SCYS/EWCxgwLZ18CZcZKVu0fao=
github.com/holiman/bloomfilter/v2 v2.0.3/go.mod h1:zpoh+gs7qcpqrHr3dB55AMiJwo0iURXE7ZOP9L9hSkA=
github.com/holiman/uint256 v1.2.4 h1:jUc4Nk8fm9jZabQuqr2JzednajVmBpC+oiTiXZJEApU=
Expand Down Expand Up @@ -807,6 +808,7 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
Expand Down
5 changes: 4 additions & 1 deletion tests/flows/teleporter_registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package flows

import (
"context"
"time"

"github.com/ava-labs/subnet-evm/accounts/abi/bind"
"github.com/ava-labs/teleporter/tests/interfaces"
Expand Down Expand Up @@ -76,7 +77,9 @@ func TeleporterRegistry(network interfaces.LocalNetwork) {

// Restart nodes with new chain config
network.SetChainConfigs(chainConfigs)
network.RestartNodes(ctx, network.GetAllNodeIDs())
restartCtx, cancel := context.WithTimeout(ctx, 30*time.Second)
defer cancel()
network.RestartNodes(restartCtx, network.GetAllNodeIDs())

// Call addProtocolVersion on subnetB to register the new Teleporter version
utils.AddProtocolVersionAndWaitForAcceptance(
Expand Down
5 changes: 4 additions & 1 deletion tests/flows/validator_churn.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ 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 @@ -59,7 +60,9 @@ func ValidatorChurn(network interfaces.LocalNetwork) {
//

// Add new nodes to the validator set
network.AddSubnetValidators(ctx, subnetAInfo.SubnetID, newNodeCount)
addValidatorsCtx, cancel := context.WithTimeout(ctx, 60*time.Second)
defer cancel()
network.AddSubnetValidators(addValidatorsCtx, subnetAInfo.SubnetID, newNodeCount)

// Refresh the subnet info
subnetAInfo, subnetBInfo = utils.GetTwoSubnets(network)
Expand Down
5 changes: 4 additions & 1 deletion tests/flows/validator_set_sig.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package flows
import (
"context"
"math/big"
"time"

"github.com/ava-labs/subnet-evm/accounts/abi/bind"
validatorsetsig "github.com/ava-labs/teleporter/abi-bindings/go/governance/ValidatorSetSig"
Expand Down Expand Up @@ -135,7 +136,9 @@ func ValidatorSetSig(network interfaces.LocalNetwork) {

// Restart nodes with new chain config
network.SetChainConfigs(chainConfigs)
network.RestartNodes(ctx, network.GetAllNodeIDs())
restartCtx, cancel := context.WithTimeout(ctx, time.Second*30)
defer cancel()
network.RestartNodes(restartCtx, network.GetAllNodeIDs())

// ************************************************************************************************
// Test Case 1: validatorChain (subnetB) != targetChain (subnetA)
Expand Down
5 changes: 5 additions & 0 deletions tests/local/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
package local

import (
"context"
"os"
"testing"
"time"

"github.com/ava-labs/teleporter/tests/flows"
deploymentUtils "github.com/ava-labs/teleporter/utils/deployment-utils"
Expand Down Expand Up @@ -49,7 +51,10 @@ var _ = ginkgo.BeforeSuite(func() {
Expect(err).Should(BeNil())

// Create the local network instance
ctx, cancel := context.WithTimeout(context.Background(), 120*time.Second)
defer cancel()
LocalNetworkInstance = NewLocalNetwork(
ctx,
"teleporter-test-local-network",
warpGenesisTemplateFile,
[]SubnetSpec{
Expand Down
14 changes: 6 additions & 8 deletions tests/local/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ const (
"internal-debug","internal-account","internal-personal",
"debug","debug-tracer","debug-file-tracer","debug-handler"]
}`

timeout = 60 * time.Second
)

type SubnetSpec struct {
Expand All @@ -77,12 +75,12 @@ type SubnetSpec struct {
}

func NewLocalNetwork(
ctx context.Context,
name string,
warpGenesisTemplateFile string,
subnetSpecs []SubnetSpec,
extraNodeCount int, // for use by tests, eg to add new subnet validators
) *LocalNetwork {
ctx := context.Background()
var err error

// Create extra nodes to be used to add more validators later
Expand Down Expand Up @@ -128,16 +126,16 @@ func NewLocalNetwork(
avalancheGoBuildPath, ok := os.LookupEnv("AVALANCHEGO_BUILD_PATH")
Expect(ok).Should(Equal(true))

ctxWithTimeout, cancelBootstrap := context.WithTimeout(ctx, timeout)
ctx, cancelBootstrap := context.WithCancel(ctx)
defer cancelBootstrap()
err = tmpnet.BootstrapNewNetwork(
ctxWithTimeout,
ctx,
os.Stdout,
network,
"",
avalancheGoBuildPath+"/avalanchego",
avalancheGoBuildPath+"/plugins",
)
defer cancelBootstrap()
Expect(err).Should(BeNil())

globalFundedKey, err := crypto.HexToECDSA(fundedKeyStr)
Expand Down Expand Up @@ -509,7 +507,7 @@ func (n *LocalNetwork) AddSubnetValidators(ctx context.Context, subnetID ids.ID,
apiURI, err := n.tmpnet.GetURIForNodeID(subnet.ValidatorIDs[0])
Expect(err).Should(BeNil())

ctx, cancel := context.WithTimeout(ctx, timeout)
ctx, cancel := context.WithCancel(ctx)
defer cancel()
err = subnet.AddValidators(
ctx,
Expand Down Expand Up @@ -556,7 +554,7 @@ func (n *LocalNetwork) RestartNodes(ctx context.Context, nodeIDs []ids.NodeID) {
}

for _, node := range nodes {
ctx, cancel := context.WithTimeout(ctx, timeout)
ctx, cancel := context.WithCancel(ctx)
defer cancel()
err := node.SaveAPIPort()
Expect(err).Should(BeNil())
Expand Down

0 comments on commit 085bf7f

Please sign in to comment.