diff --git a/go.mod b/go.mod index 14c8a0822..46c13bdbc 100644 --- a/go.mod +++ b/go.mod @@ -3,12 +3,12 @@ module github.com/ava-labs/teleporter go 1.22.8 require ( - github.com/ava-labs/avalanchego v1.12.0-fuji + github.com/ava-labs/avalanchego v1.12.0-initial-poc.9.0.20241122192639-7c3ad181c928 github.com/supranational/blst v0.3.13 // indirect ) require ( - github.com/ava-labs/awm-relayer v1.4.1-0.20241121212846-90ad76f595d6 + github.com/ava-labs/awm-relayer v1.4.1-0.20241122202209-75359d908260 github.com/ava-labs/subnet-evm v0.6.12 github.com/ethereum/go-ethereum v1.13.14 github.com/onsi/ginkgo/v2 v2.22.0 diff --git a/go.sum b/go.sum index dea693742..075cebcf9 100644 --- a/go.sum +++ b/go.sum @@ -58,10 +58,10 @@ github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= -github.com/ava-labs/avalanchego v1.12.0-fuji h1:o/GbXrqW9CAXu2jX/a1dZtvFiiSVCWomJZyxF4hCQOA= -github.com/ava-labs/avalanchego v1.12.0-fuji/go.mod h1:yhD5dpZyStIVbxQ550EDi5w5SL7DQ/xGE6TIxosb7U0= -github.com/ava-labs/awm-relayer v1.4.1-0.20241121212846-90ad76f595d6 h1:diUjomjOuTFwk3Z2FUxA94PzLZy+6ONfZVuaRhDrtmA= -github.com/ava-labs/awm-relayer v1.4.1-0.20241121212846-90ad76f595d6/go.mod h1:mNQitNat92izhmMF0++6/REQQI3W+h0oRAnLl3bs/6I= +github.com/ava-labs/avalanchego v1.12.0-initial-poc.9.0.20241122192639-7c3ad181c928 h1:th+K+wWgAYL/NsrFJyO+/sThLRdEDE0+I4vgbPLoWQQ= +github.com/ava-labs/avalanchego v1.12.0-initial-poc.9.0.20241122192639-7c3ad181c928/go.mod h1:yhD5dpZyStIVbxQ550EDi5w5SL7DQ/xGE6TIxosb7U0= +github.com/ava-labs/awm-relayer v1.4.1-0.20241122202209-75359d908260 h1:VRNzoY1xvXHphcXXmuXMrUFp5Gm/eiipVJMmNV+UN9c= +github.com/ava-labs/awm-relayer v1.4.1-0.20241122202209-75359d908260/go.mod h1:/hrQpd8P3BfShbRoDE1vD1WZXBchu7r8CQPTEb5tWOQ= github.com/ava-labs/coreth v0.13.9-rc.1 h1:qIICpC/OZGYUP37QnLgIqqwGmxnLwLpZaUlqJNI85vU= github.com/ava-labs/coreth v0.13.9-rc.1/go.mod h1:7aMsRIo/3GBE44qWZMjnfqdqfcfZ5yShTTm2LObLaYo= github.com/ava-labs/subnet-evm v0.6.12 h1:jL3FmjdFcNfS0qwbehwN6DkAg9y7zexB1riiGBxRsM0= diff --git a/scripts/versions.sh b/scripts/versions.sh index b34659f58..a2fd7cbce 100755 --- a/scripts/versions.sh +++ b/scripts/versions.sh @@ -34,6 +34,8 @@ AWM_RELAYER_VERSION=${AWM_RELAYER_VERSION:-'v1.0.0'} # Don't export them as they're used in the context of other calls AVALANCHEGO_VERSION=${AVALANCHEGO_VERSION:-$(extract_commit "$(getDepVersion github.com/ava-labs/avalanchego)")} +# Temporarily hardcode the Avalanchego version until outbound networking relaxation is available +AVALANCHEGO_VERSION=v1.12.0-fuji GINKGO_VERSION=${GINKGO_VERSION:-$(extract_commit "$(getDepVersion github.com/onsi/ginkgo/v2)")} SUBNET_EVM_VERSION=${SUBNET_EVM_VERSION:-$(extract_commit "$(getDepVersion github.com/ava-labs/subnet-evm)")} diff --git a/tests/flows/governance/validator_set_sig.go b/tests/flows/governance/validator_set_sig.go index 9ff4f3e99..4a8457907 100644 --- a/tests/flows/governance/validator_set_sig.go +++ b/tests/flows/governance/validator_set_sig.go @@ -145,6 +145,9 @@ func ValidatorSetSig(network *localnetwork.LocalNetwork) { // Test Case 1: validatorChain (subnetB) != targetChain (subnetA) // ************************************************************************************************ + aggregator := network.GetSignatureAggregator() + defer aggregator.Shutdown() + // Execute the ValidatorSetSig executeCall and wait for acceptance receipt := utils.ExecuteValidatorSetSigCallAndVerify( ctx, @@ -153,7 +156,7 @@ func ValidatorSetSig(network *localnetwork.LocalNetwork) { validatorSetSigContractAddress, fundedKey, &offchainMessages[0], - network.GetSignatureAggregator(), + aggregator, true, ) diff --git a/tests/flows/ictt/erc20_home_erc20_remote.go b/tests/flows/ictt/erc20_home_erc20_remote.go index 9f996b60b..cfdfc7021 100644 --- a/tests/flows/ictt/erc20_home_erc20_remote.go +++ b/tests/flows/ictt/erc20_home_erc20_remote.go @@ -71,6 +71,9 @@ func ERC20TokenHomeERC20TokenRemote(network *localnetwork.LocalNetwork, teleport tokenDecimals, ) + aggregator := network.GetSignatureAggregator() + defer aggregator.Shutdown() + utils.RegisterERC20TokenRemoteOnHome( ctx, teleporter, @@ -79,7 +82,7 @@ func ERC20TokenHomeERC20TokenRemote(network *localnetwork.LocalNetwork, teleport subnetAInfo, erc20TokenRemoteAddress, fundedKey, - network.GetSignatureAggregator(), + aggregator, ) // Generate new recipient to receive transferred tokens @@ -119,7 +122,7 @@ func ERC20TokenHomeERC20TokenRemote(network *localnetwork.LocalNetwork, teleport true, fundedKey, nil, - network.GetSignatureAggregator(), + aggregator, ) utils.CheckERC20TokenRemoteWithdrawal( @@ -172,7 +175,7 @@ func ERC20TokenHomeERC20TokenRemote(network *localnetwork.LocalNetwork, teleport true, fundedKey, nil, - network.GetSignatureAggregator(), + aggregator, ) utils.CheckERC20TokenHomeWithdrawal( diff --git a/tests/flows/ictt/erc20_home_erc20_remote_multihop.go b/tests/flows/ictt/erc20_home_erc20_remote_multihop.go index 4cfa4abea..8f19fb77c 100644 --- a/tests/flows/ictt/erc20_home_erc20_remote_multihop.go +++ b/tests/flows/ictt/erc20_home_erc20_remote_multihop.go @@ -86,6 +86,9 @@ func ERC20TokenHomeERC20TokenRemoteMultiHop(network *localnetwork.LocalNetwork, tokenDecimals, ) + aggregator := network.GetSignatureAggregator() + defer aggregator.Shutdown() + // Register both ERC20TokenRemote instances on the ERC20TokenHome utils.RegisterERC20TokenRemoteOnHome( ctx, @@ -95,7 +98,7 @@ func ERC20TokenHomeERC20TokenRemoteMultiHop(network *localnetwork.LocalNetwork, subnetAInfo, erc20TokenRemoteAddressA, fundedKey, - network.GetSignatureAggregator(), + aggregator, ) utils.RegisterERC20TokenRemoteOnHome( ctx, @@ -105,7 +108,7 @@ func ERC20TokenHomeERC20TokenRemoteMultiHop(network *localnetwork.LocalNetwork, subnetBInfo, erc20TokenRemoteAddressB, fundedKey, - network.GetSignatureAggregator(), + aggregator, ) // Generate new recipient to receive transferred tokens @@ -145,7 +148,7 @@ func ERC20TokenHomeERC20TokenRemoteMultiHop(network *localnetwork.LocalNetwork, true, fundedKey, nil, - network.GetSignatureAggregator(), + aggregator, ) utils.CheckERC20TokenRemoteWithdrawal( @@ -179,7 +182,7 @@ func ERC20TokenHomeERC20TokenRemoteMultiHop(network *localnetwork.LocalNetwork, cChainInfo, transferredAmount, secondaryFeeAmount, - network.GetSignatureAggregator(), + aggregator, ) // Multi-hop transfer back to Subnet A @@ -200,6 +203,6 @@ func ERC20TokenHomeERC20TokenRemoteMultiHop(network *localnetwork.LocalNetwork, cChainInfo, transferredAmount, secondaryFeeAmount, - network.GetSignatureAggregator(), + aggregator, ) } diff --git a/tests/flows/ictt/erc20_home_erc20_remote_send_and_call.go b/tests/flows/ictt/erc20_home_erc20_remote_send_and_call.go index d76eb4907..ab6c8c78d 100644 --- a/tests/flows/ictt/erc20_home_erc20_remote_send_and_call.go +++ b/tests/flows/ictt/erc20_home_erc20_remote_send_and_call.go @@ -87,6 +87,9 @@ func ERC20TokenHomeERC20TokenRemoteSendAndCall( tokenDecimals, ) + aggregator := network.GetSignatureAggregator() + defer aggregator.Shutdown() + utils.RegisterERC20TokenRemoteOnHome( ctx, teleporter, @@ -95,7 +98,7 @@ func ERC20TokenHomeERC20TokenRemoteSendAndCall( subnetAInfo, erc20TokenRemoteAddress, fundedKey, - network.GetSignatureAggregator(), + aggregator, ) // Generate new recipient to receive transferred tokens @@ -147,7 +150,7 @@ func ERC20TokenHomeERC20TokenRemoteSendAndCall( true, fundedKey, nil, - network.GetSignatureAggregator(), + aggregator, ) event, err := utils.GetEventFromLogs(receipt.Logs, erc20TokenRemote.ParseCallSucceeded) @@ -199,7 +202,7 @@ func ERC20TokenHomeERC20TokenRemoteSendAndCall( true, fundedKey, nil, - network.GetSignatureAggregator(), + aggregator, ) utils.CheckERC20TokenRemoteWithdrawal( @@ -258,7 +261,7 @@ func ERC20TokenHomeERC20TokenRemoteSendAndCall( true, fundedKey, nil, - network.GetSignatureAggregator(), + aggregator, ) homeEvent, err := utils.GetEventFromLogs(receipt.Logs, erc20TokenHome.ParseCallSucceeded) diff --git a/tests/flows/ictt/erc20_home_native_remote.go b/tests/flows/ictt/erc20_home_native_remote.go index 00b4f9e98..ea2cfa19e 100644 --- a/tests/flows/ictt/erc20_home_native_remote.go +++ b/tests/flows/ictt/erc20_home_native_remote.go @@ -74,6 +74,9 @@ func ERC20TokenHomeNativeTokenRemote(network *localnetwork.LocalNetwork, telepor burnedFeesReportingRewardPercentage, ) + aggregator := network.GetSignatureAggregator() + defer aggregator.Shutdown() + collateralAmount := utils.RegisterTokenRemoteOnHome( ctx, teleporter, @@ -85,7 +88,7 @@ func ERC20TokenHomeNativeTokenRemote(network *localnetwork.LocalNetwork, telepor utils.GetTokenMultiplier(decimalsShift), multiplyOnRemote, fundedKey, - network.GetSignatureAggregator(), + aggregator, ) utils.AddCollateralToERC20TokenHome( @@ -138,7 +141,7 @@ func ERC20TokenHomeNativeTokenRemote(network *localnetwork.LocalNetwork, telepor true, fundedKey, nil, - network.GetSignatureAggregator(), + aggregator, ) // Verify the recipient received the tokens @@ -174,7 +177,7 @@ func ERC20TokenHomeNativeTokenRemote(network *localnetwork.LocalNetwork, telepor true, fundedKey, nil, - network.GetSignatureAggregator(), + aggregator, ) // Check that the recipient received the tokens diff --git a/tests/flows/ictt/erc20_home_native_remote_multihop.go b/tests/flows/ictt/erc20_home_native_remote_multihop.go index 03e340c0d..60c06ba35 100644 --- a/tests/flows/ictt/erc20_home_native_remote_multihop.go +++ b/tests/flows/ictt/erc20_home_native_remote_multihop.go @@ -78,6 +78,9 @@ func ERC20TokenHomeNativeTokenRemoteMultiHop(network *localnetwork.LocalNetwork, burnedFeesReportingRewardPercentage, ) + aggregator := network.GetSignatureAggregator() + defer aggregator.Shutdown() + // Register both NativeTokenDestinations on the ERC20TokenHome collateralAmountA := utils.RegisterTokenRemoteOnHome( ctx, @@ -90,7 +93,7 @@ func ERC20TokenHomeNativeTokenRemoteMultiHop(network *localnetwork.LocalNetwork, utils.GetTokenMultiplier(decimalsShift), multiplyOnRemote, fundedKey, - network.GetSignatureAggregator(), + aggregator, ) collateralAmountB := utils.RegisterTokenRemoteOnHome( @@ -104,7 +107,7 @@ func ERC20TokenHomeNativeTokenRemoteMultiHop(network *localnetwork.LocalNetwork, utils.GetTokenMultiplier(decimalsShift), multiplyOnRemote, fundedKey, - network.GetSignatureAggregator(), + aggregator, ) // Add collateral for both NativeTokenDestinations @@ -171,7 +174,7 @@ func ERC20TokenHomeNativeTokenRemoteMultiHop(network *localnetwork.LocalNetwork, true, fundedKey, nil, - network.GetSignatureAggregator(), + aggregator, ) // Verify the recipient received the tokens @@ -208,7 +211,7 @@ func ERC20TokenHomeNativeTokenRemoteMultiHop(network *localnetwork.LocalNetwork, true, fundedKey, nil, - network.GetSignatureAggregator(), + aggregator, ) // Verify the recipient received the tokens @@ -232,7 +235,7 @@ func ERC20TokenHomeNativeTokenRemoteMultiHop(network *localnetwork.LocalNetwork, cChainInfo, amountToSend, big.NewInt(0), - network.GetSignatureAggregator(), + aggregator, ) // Multi-hop transfer back to Subnet A @@ -251,6 +254,6 @@ func ERC20TokenHomeNativeTokenRemoteMultiHop(network *localnetwork.LocalNetwork, cChainInfo, amountToSend, secondaryFeeAmount, - network.GetSignatureAggregator(), + aggregator, ) } diff --git a/tests/flows/ictt/native_home_erc20_remote.go b/tests/flows/ictt/native_home_erc20_remote.go index c52d5c268..ccad64974 100644 --- a/tests/flows/ictt/native_home_erc20_remote.go +++ b/tests/flows/ictt/native_home_erc20_remote.go @@ -67,6 +67,9 @@ func NativeTokenHomeERC20TokenRemote(network *localnetwork.LocalNetwork, telepor tokenDecimals, ) + aggregator := network.GetSignatureAggregator() + defer aggregator.Shutdown() + utils.RegisterERC20TokenRemoteOnHome( ctx, teleporter, @@ -75,7 +78,7 @@ func NativeTokenHomeERC20TokenRemote(network *localnetwork.LocalNetwork, telepor subnetAInfo, erc20TokenRemoteAddress, fundedKey, - network.GetSignatureAggregator(), + aggregator, ) // Generate new recipient to receive transferred tokens @@ -116,7 +119,7 @@ func NativeTokenHomeERC20TokenRemote(network *localnetwork.LocalNetwork, telepor true, fundedKey, nil, - network.GetSignatureAggregator(), + aggregator, ) utils.CheckERC20TokenRemoteWithdrawal( @@ -169,7 +172,7 @@ func NativeTokenHomeERC20TokenRemote(network *localnetwork.LocalNetwork, telepor true, fundedKey, nil, - network.GetSignatureAggregator(), + aggregator, ) // Check that the recipient received the tokens diff --git a/tests/flows/ictt/native_home_erc20_remote_multihop.go b/tests/flows/ictt/native_home_erc20_remote_multihop.go index b8220b7bc..ff957ed04 100644 --- a/tests/flows/ictt/native_home_erc20_remote_multihop.go +++ b/tests/flows/ictt/native_home_erc20_remote_multihop.go @@ -81,6 +81,9 @@ func NativeTokenHomeERC20TokenRemoteMultiHop(network *localnetwork.LocalNetwork, tokenDecimals, ) + aggregator := network.GetSignatureAggregator() + defer aggregator.Shutdown() + // Register both ERC20Destinations on the NativeTokenHome utils.RegisterERC20TokenRemoteOnHome( ctx, @@ -90,7 +93,7 @@ func NativeTokenHomeERC20TokenRemoteMultiHop(network *localnetwork.LocalNetwork, subnetAInfo, erc20TokenRemoteAddressA, fundedKey, - network.GetSignatureAggregator(), + aggregator, ) utils.RegisterERC20TokenRemoteOnHome( @@ -101,7 +104,7 @@ func NativeTokenHomeERC20TokenRemoteMultiHop(network *localnetwork.LocalNetwork, subnetBInfo, erc20TokenRemoteAddressB, fundedKey, - network.GetSignatureAggregator(), + aggregator, ) // Generate new recipient to receive transferred tokens @@ -142,7 +145,7 @@ func NativeTokenHomeERC20TokenRemoteMultiHop(network *localnetwork.LocalNetwork, true, fundedKey, nil, - network.GetSignatureAggregator(), + aggregator, ) utils.CheckERC20TokenRemoteWithdrawal( @@ -175,6 +178,6 @@ func NativeTokenHomeERC20TokenRemoteMultiHop(network *localnetwork.LocalNetwork, cChainInfo, transferredAmount, secondaryFeeAmount, - network.GetSignatureAggregator(), + aggregator, ) } diff --git a/tests/flows/ictt/native_home_native_remote.go b/tests/flows/ictt/native_home_native_remote.go index 37e426b6b..346dbc70b 100644 --- a/tests/flows/ictt/native_home_native_remote.go +++ b/tests/flows/ictt/native_home_native_remote.go @@ -57,6 +57,9 @@ func NativeTokenHomeNativeDestination(network *localnetwork.LocalNetwork, telepo burnedFeesReportingRewardPercentage, ) + aggregator := network.GetSignatureAggregator() + defer aggregator.Shutdown() + // Register the NativeTokenRemote on the NativeTokenHome collateralAmount := utils.RegisterTokenRemoteOnHome( ctx, @@ -69,7 +72,7 @@ func NativeTokenHomeNativeDestination(network *localnetwork.LocalNetwork, telepo big.NewInt(1), multiplyOnRemote, fundedKey, - network.GetSignatureAggregator(), + aggregator, ) utils.AddCollateralToNativeTokenHome( @@ -121,7 +124,7 @@ func NativeTokenHomeNativeDestination(network *localnetwork.LocalNetwork, telepo true, fundedKey, nil, - network.GetSignatureAggregator(), + aggregator, ) utils.CheckBalance( @@ -164,7 +167,7 @@ func NativeTokenHomeNativeDestination(network *localnetwork.LocalNetwork, telepo true, fundedKey, nil, - network.GetSignatureAggregator(), + aggregator, ) // Check that the recipient received the tokens diff --git a/tests/flows/ictt/native_home_native_remote_multihop.go b/tests/flows/ictt/native_home_native_remote_multihop.go index 4569fd727..897568157 100644 --- a/tests/flows/ictt/native_home_native_remote_multihop.go +++ b/tests/flows/ictt/native_home_native_remote_multihop.go @@ -77,6 +77,9 @@ func NativeTokenHomeNativeTokenRemoteMultiHop(network *localnetwork.LocalNetwork burnedFeesReportingRewardPercentage, ) + aggregator := network.GetSignatureAggregator() + defer aggregator.Shutdown() + // Register both NativeTokenDestinations on the NativeTokenHome collateralAmountA := utils.RegisterTokenRemoteOnHome( ctx, @@ -89,7 +92,7 @@ func NativeTokenHomeNativeTokenRemoteMultiHop(network *localnetwork.LocalNetwork utils.GetTokenMultiplier(decimalsShift), multiplyOnRemote, fundedKey, - network.GetSignatureAggregator(), + aggregator, ) collateralAmountB := utils.RegisterTokenRemoteOnHome( @@ -103,7 +106,7 @@ func NativeTokenHomeNativeTokenRemoteMultiHop(network *localnetwork.LocalNetwork utils.GetTokenMultiplier(decimalsShift), multiplyOnRemote, fundedKey, - network.GetSignatureAggregator(), + aggregator, ) // Add collateral for both NativeTokenDestinations @@ -167,7 +170,7 @@ func NativeTokenHomeNativeTokenRemoteMultiHop(network *localnetwork.LocalNetwork true, fundedKey, nil, - network.GetSignatureAggregator(), + aggregator, ) // Verify the recipient received the tokens @@ -203,7 +206,7 @@ func NativeTokenHomeNativeTokenRemoteMultiHop(network *localnetwork.LocalNetwork true, fundedKey, nil, - network.GetSignatureAggregator(), + aggregator, ) // Verify the recipient received the tokens @@ -227,7 +230,7 @@ func NativeTokenHomeNativeTokenRemoteMultiHop(network *localnetwork.LocalNetwork cChainInfo, amountToSendA, big.NewInt(0), - network.GetSignatureAggregator(), + aggregator, ) // Again, send half of the received amount to account for gas expenses @@ -249,6 +252,6 @@ func NativeTokenHomeNativeTokenRemoteMultiHop(network *localnetwork.LocalNetwork cChainInfo, amountToSendB, secondaryFeeAmount, - network.GetSignatureAggregator(), + aggregator, ) } diff --git a/tests/flows/ictt/registration_and_collateral_check.go b/tests/flows/ictt/registration_and_collateral_check.go index 442db7fe5..03cd89ea1 100644 --- a/tests/flows/ictt/registration_and_collateral_check.go +++ b/tests/flows/ictt/registration_and_collateral_check.go @@ -98,6 +98,9 @@ func RegistrationAndCollateralCheck(network *localnetwork.LocalNetwork, teleport Expect(err).Should(BeNil()) utils.ExpectBigEqual(balance, initialBalance) + aggregator := network.GetSignatureAggregator() + defer aggregator.Shutdown() + // Register the NativeTokenRemote to the ERC20TokenHome collateralNeeded := utils.RegisterTokenRemoteOnHome( ctx, @@ -110,7 +113,7 @@ func RegistrationAndCollateralCheck(network *localnetwork.LocalNetwork, teleport utils.GetTokenMultiplier(decimalsShift), multiplyOnRemote, fundedKey, - network.GetSignatureAggregator(), + aggregator, ) // Try sending again and expect failure since remote is not collateralized @@ -190,7 +193,7 @@ func RegistrationAndCollateralCheck(network *localnetwork.LocalNetwork, teleport true, fundedKey, nil, - network.GetSignatureAggregator(), + aggregator, ) // Verify the recipient received the tokens diff --git a/tests/flows/ictt/transparent_proxy_upgradeability.go b/tests/flows/ictt/transparent_proxy_upgradeability.go index 7dc99ee4e..71e6abc9a 100644 --- a/tests/flows/ictt/transparent_proxy_upgradeability.go +++ b/tests/flows/ictt/transparent_proxy_upgradeability.go @@ -97,6 +97,9 @@ func TransparentUpgradeableProxy(network *localnetwork.LocalNetwork, teleporter tokenDecimals, ) + aggregator := network.GetSignatureAggregator() + defer aggregator.Shutdown() + utils.RegisterERC20TokenRemoteOnHome( ctx, teleporter, @@ -105,7 +108,7 @@ func TransparentUpgradeableProxy(network *localnetwork.LocalNetwork, teleporter subnetAInfo, erc20TokenRemoteAddress, fundedKey, - network.GetSignatureAggregator(), + aggregator, ) // Send a transfer from primary network to Subnet A @@ -145,7 +148,7 @@ func TransparentUpgradeableProxy(network *localnetwork.LocalNetwork, teleporter true, fundedKey, nil, - network.GetSignatureAggregator(), + aggregator, ) utils.CheckERC20TokenRemoteWithdrawal( @@ -211,7 +214,7 @@ func TransparentUpgradeableProxy(network *localnetwork.LocalNetwork, teleporter true, fundedKey, nil, - network.GetSignatureAggregator(), + aggregator, ) // Check that the transfer was successful, and expected balances are correct diff --git a/tests/flows/teleporter/basic_send_receive.go b/tests/flows/teleporter/basic_send_receive.go index e01577982..97da8c397 100644 --- a/tests/flows/teleporter/basic_send_receive.go +++ b/tests/flows/teleporter/basic_send_receive.go @@ -22,10 +22,13 @@ func BasicSendReceive(network *localnetwork.LocalNetwork, teleporter utils.Telep // Send a transaction to Subnet A to issue a Warp Message from the Teleporter contract to Subnet B ctx := context.Background() + aggregator := network.GetSignatureAggregator() + defer aggregator.Shutdown() + // Clear the receipt queue from Subnet B -> Subnet A to have a clean slate for the test flow. // This is only done if the test non-external networks because external networks may have // an arbitrarily high number of receipts to be cleared from a given queue from unrelated messages. - teleporter.ClearReceiptQueue(ctx, fundedKey, subnetBInfo, subnetAInfo, network.GetSignatureAggregator()) + teleporter.ClearReceiptQueue(ctx, fundedKey, subnetBInfo, subnetAInfo, aggregator) feeAmount := big.NewInt(1) feeTokenAddress, feeToken := utils.DeployExampleERC20( @@ -74,7 +77,7 @@ func BasicSendReceive(network *localnetwork.LocalNetwork, teleporter utils.Telep true, fundedKey, nil, - network.GetSignatureAggregator(), + aggregator, ) receiveEvent, err := utils.GetEventFromLogs( deliveryReceipt.Logs, @@ -109,7 +112,7 @@ func BasicSendReceive(network *localnetwork.LocalNetwork, teleporter utils.Telep true, fundedKey, nil, - network.GetSignatureAggregator(), + aggregator, ) Expect(utils.CheckReceiptReceived( diff --git a/tests/flows/teleporter/deliver_to_nonexistent_contract.go b/tests/flows/teleporter/deliver_to_nonexistent_contract.go index 2257ba1d6..664310596 100644 --- a/tests/flows/teleporter/deliver_to_nonexistent_contract.go +++ b/tests/flows/teleporter/deliver_to_nonexistent_contract.go @@ -87,6 +87,10 @@ func DeliverToNonExistentContract(network *localnetwork.LocalNetwork, teleporter // // Relay the message to the destination // + + aggregator := network.GetSignatureAggregator() + defer aggregator.Shutdown() + log.Info("Relaying the message to the destination") receipt = teleporter.RelayTeleporterMessage( ctx, @@ -96,7 +100,7 @@ func DeliverToNonExistentContract(network *localnetwork.LocalNetwork, teleporter true, fundedKey, nil, - network.GetSignatureAggregator(), + aggregator, ) receiveEvent, err := utils.GetEventFromLogs(receipt.Logs, teleporter.TeleporterMessenger(subnetAInfo).ParseReceiveCrossChainMessage) diff --git a/tests/flows/teleporter/deliver_to_wrong_chain.go b/tests/flows/teleporter/deliver_to_wrong_chain.go index 22345242b..7a76b5cc9 100644 --- a/tests/flows/teleporter/deliver_to_wrong_chain.go +++ b/tests/flows/teleporter/deliver_to_wrong_chain.go @@ -57,6 +57,9 @@ func DeliverToWrongChain(network *localnetwork.LocalNetwork, teleporter utils.Te fundedKey, ) + aggregator := network.GetSignatureAggregator() + defer aggregator.Shutdown() + teleporter.RelayTeleporterMessage( ctx, receipt, @@ -65,7 +68,7 @@ func DeliverToWrongChain(network *localnetwork.LocalNetwork, teleporter utils.Te false, fundedKey, nil, - network.GetSignatureAggregator(), + aggregator, ) // diff --git a/tests/flows/teleporter/insufficient_gas.go b/tests/flows/teleporter/insufficient_gas.go index 1b593b145..a71c21d7d 100644 --- a/tests/flows/teleporter/insufficient_gas.go +++ b/tests/flows/teleporter/insufficient_gas.go @@ -55,6 +55,9 @@ func InsufficientGas(network *localnetwork.LocalNetwork, teleporter utils.Telepo messageID := event.MessageID + aggregator := network.GetSignatureAggregator() + defer aggregator.Shutdown() + // Relay message from SubnetA to SubnetB receipt = teleporter.RelayTeleporterMessage( ctx, @@ -64,7 +67,7 @@ func InsufficientGas(network *localnetwork.LocalNetwork, teleporter utils.Telepo true, fundedKey, nil, - network.GetSignatureAggregator(), + aggregator, ) // Check Teleporter message received on the destination diff --git a/tests/flows/teleporter/registry/pause_teleporter.go b/tests/flows/teleporter/registry/pause_teleporter.go index 84b713d90..f1815dcf1 100644 --- a/tests/flows/teleporter/registry/pause_teleporter.go +++ b/tests/flows/teleporter/registry/pause_teleporter.go @@ -50,6 +50,9 @@ func PauseTeleporter(network *localnetwork.LocalNetwork, teleporter utils.Telepo Expect(err).Should(BeNil()) Expect(isPaused).Should(BeTrue()) + aggregator := network.GetSignatureAggregator() + defer aggregator.Shutdown() + // Send a message from subnet A to subnet B, which should fail teleporter.SendExampleCrossChainMessageAndVerify( ctx, @@ -60,7 +63,7 @@ func PauseTeleporter(network *localnetwork.LocalNetwork, teleporter utils.Telepo testMessengerB, fundedKey, "message_1", - network.GetSignatureAggregator(), + aggregator, false, ) @@ -87,7 +90,7 @@ func PauseTeleporter(network *localnetwork.LocalNetwork, teleporter utils.Telepo testMessengerB, fundedKey, "message_2", - network.GetSignatureAggregator(), + aggregator, true, ) } diff --git a/tests/flows/teleporter/registry/teleporter_registry.go b/tests/flows/teleporter/registry/teleporter_registry.go index 85d252737..ad81e4980 100644 --- a/tests/flows/teleporter/registry/teleporter_registry.go +++ b/tests/flows/teleporter/registry/teleporter_registry.go @@ -87,6 +87,9 @@ func TeleporterRegistry(network *localnetwork.LocalNetwork, teleporter utils.Tel // Restart nodes with new chain config network.SetChainConfigs(chainConfigs) + aggregator := network.GetSignatureAggregator() + defer aggregator.Shutdown() + // Call addProtocolVersion on subnetB to register the new Teleporter version teleporter.AddProtocolVersionAndWaitForAcceptance( ctx, @@ -94,7 +97,7 @@ func TeleporterRegistry(network *localnetwork.LocalNetwork, teleporter utils.Tel newTeleporterAddress, fundedKey, offchainMessageB, - network.GetSignatureAggregator(), + aggregator, ) // Send a message using old Teleporter version to test messenger using new Teleporter version. @@ -108,7 +111,7 @@ func TeleporterRegistry(network *localnetwork.LocalNetwork, teleporter utils.Tel testMessengerB, fundedKey, "message_1", - network.GetSignatureAggregator(), + aggregator, true, ) @@ -145,7 +148,7 @@ func TeleporterRegistry(network *localnetwork.LocalNetwork, teleporter utils.Tel testMessengerB, fundedKey, "message_2", - network.GetSignatureAggregator(), + aggregator, false, ) @@ -164,7 +167,7 @@ func TeleporterRegistry(network *localnetwork.LocalNetwork, teleporter utils.Tel testMessengerC, fundedKey, "message_3", - network.GetSignatureAggregator(), + aggregator, false, ) @@ -175,7 +178,7 @@ func TeleporterRegistry(network *localnetwork.LocalNetwork, teleporter utils.Tel newTeleporterAddress, fundedKey, offchainMessageC, - network.GetSignatureAggregator(), + aggregator, ) // Send a message from A->B, which previously failed, but now using the new Teleporter version. @@ -189,7 +192,7 @@ func TeleporterRegistry(network *localnetwork.LocalNetwork, teleporter utils.Tel testMessengerC, fundedKey, "message_4", - network.GetSignatureAggregator(), + aggregator, true, ) @@ -201,7 +204,7 @@ func TeleporterRegistry(network *localnetwork.LocalNetwork, teleporter utils.Tel newTeleporterAddress, fundedKey, offchainMessageA, - network.GetSignatureAggregator(), + aggregator, ) latestVersionA, err := teleporter.TeleporterRegistry(subnetAInfo).LatestVersion(&bind.CallOpts{}) diff --git a/tests/flows/teleporter/relay_message_twice.go b/tests/flows/teleporter/relay_message_twice.go index 61e19f568..72677411e 100644 --- a/tests/flows/teleporter/relay_message_twice.go +++ b/tests/flows/teleporter/relay_message_twice.go @@ -49,6 +49,9 @@ func RelayMessageTwice(network *localnetwork.LocalNetwork, teleporter utils.Tele fundedKey, ) + aggregator := network.GetSignatureAggregator() + defer aggregator.Shutdown() + // // Relay the message to the destination // @@ -60,7 +63,7 @@ func RelayMessageTwice(network *localnetwork.LocalNetwork, teleporter utils.Tele true, fundedKey, nil, - network.GetSignatureAggregator(), + aggregator, ) // @@ -85,6 +88,6 @@ func RelayMessageTwice(network *localnetwork.LocalNetwork, teleporter utils.Tele false, fundedKey, nil, - network.GetSignatureAggregator(), + aggregator, ) } diff --git a/tests/flows/teleporter/relayer_modifies_message.go b/tests/flows/teleporter/relayer_modifies_message.go index 366c142f1..fe4441a97 100644 --- a/tests/flows/teleporter/relayer_modifies_message.go +++ b/tests/flows/teleporter/relayer_modifies_message.go @@ -78,13 +78,16 @@ func relayAlteredMessage( ) Expect(err).Should(BeNil()) + aggregator := network.GetSignatureAggregator() + defer aggregator.Shutdown() + signedWarpMessage := utils.ConstructSignedWarpMessage( ctx, sourceReceipt, source, destination, nil, - network.GetSignatureAggregator(), + aggregator, ) // Construct the transaction to send the Warp message to the destination chain diff --git a/tests/flows/teleporter/resubmit_altered_message.go b/tests/flows/teleporter/resubmit_altered_message.go index 869d27273..37f621661 100644 --- a/tests/flows/teleporter/resubmit_altered_message.go +++ b/tests/flows/teleporter/resubmit_altered_message.go @@ -36,6 +36,9 @@ func ResubmitAlteredMessage(network *localnetwork.LocalNetwork, teleporter utils receipt, messageID := utils.SendCrossChainMessageAndWaitForAcceptance( ctx, teleporter.TeleporterMessenger(subnetAInfo), subnetAInfo, subnetBInfo, sendCrossChainMessageInput, fundedKey) + aggregator := network.GetSignatureAggregator() + defer aggregator.Shutdown() + // Relay the message to the destination receipt = teleporter.RelayTeleporterMessage( ctx, @@ -45,7 +48,7 @@ func ResubmitAlteredMessage(network *localnetwork.LocalNetwork, teleporter utils true, fundedKey, nil, - network.GetSignatureAggregator(), + aggregator, ) log.Info("Checking the message was received on the destination") diff --git a/tests/flows/teleporter/retry_successful_execution.go b/tests/flows/teleporter/retry_successful_execution.go index 067ac9adf..b7e2743b4 100644 --- a/tests/flows/teleporter/retry_successful_execution.go +++ b/tests/flows/teleporter/retry_successful_execution.go @@ -65,6 +65,9 @@ func RetrySuccessfulExecution(network *localnetwork.LocalNetwork, teleporter uti teleporterMessageID := event.MessageID + aggregator := network.GetSignatureAggregator() + defer aggregator.Shutdown() + // // Relay the message to the destination // @@ -76,7 +79,7 @@ func RetrySuccessfulExecution(network *localnetwork.LocalNetwork, teleporter uti true, fundedKey, nil, - network.GetSignatureAggregator(), + aggregator, ) receiveEvent, err := utils.GetEventFromLogs(receipt.Logs, teleporter.TeleporterMessenger(subnetBInfo).ParseReceiveCrossChainMessage) diff --git a/tests/flows/teleporter/send_specific_receipts.go b/tests/flows/teleporter/send_specific_receipts.go index 588a4b6a9..f7c8a05c0 100644 --- a/tests/flows/teleporter/send_specific_receipts.go +++ b/tests/flows/teleporter/send_specific_receipts.go @@ -27,8 +27,11 @@ func SendSpecificReceipts(network *localnetwork.LocalNetwork, teleporter utils.T _, fundedKey := network.GetFundedAccountInfo() ctx := context.Background() + aggregator := network.GetSignatureAggregator() + defer aggregator.Shutdown() + // Clear the receipt queue from Subnet B -> Subnet A to have a clean slate for the test flow. - teleporter.ClearReceiptQueue(ctx, fundedKey, subnetBInfo, subnetAInfo, network.GetSignatureAggregator()) + teleporter.ClearReceiptQueue(ctx, fundedKey, subnetBInfo, subnetAInfo, aggregator) // Use mock token as the fee token mockTokenAddress, mockToken := utils.DeployExampleERC20( @@ -74,7 +77,7 @@ func SendSpecificReceipts(network *localnetwork.LocalNetwork, teleporter utils.T true, fundedKey, nil, - network.GetSignatureAggregator(), + aggregator, ) receiveEvent1, err := utils.GetEventFromLogs( deliveryReceipt1.Logs, @@ -102,7 +105,7 @@ func SendSpecificReceipts(network *localnetwork.LocalNetwork, teleporter utils.T true, fundedKey, nil, - network.GetSignatureAggregator(), + aggregator, ) receiveEvent2, err := utils.GetEventFromLogs( deliveryReceipt2.Logs, @@ -141,7 +144,7 @@ func SendSpecificReceipts(network *localnetwork.LocalNetwork, teleporter utils.T true, fundedKey, nil, - network.GetSignatureAggregator(), + aggregator, ) // Check that the message back to Subnet A was delivered @@ -195,7 +198,7 @@ func SendSpecificReceipts(network *localnetwork.LocalNetwork, teleporter utils.T true, fundedKey, nil, - network.GetSignatureAggregator(), + aggregator, ) // Check delivered delivered, err = subnetATeleporterMessenger.MessageReceived( diff --git a/tests/flows/teleporter/unallowed_relayer.go b/tests/flows/teleporter/unallowed_relayer.go index 47ae8c8f9..983b5fabc 100644 --- a/tests/flows/teleporter/unallowed_relayer.go +++ b/tests/flows/teleporter/unallowed_relayer.go @@ -46,6 +46,9 @@ func UnallowedRelayer(network *localnetwork.LocalNetwork, teleporter utils.Telep ctx, teleporter.TeleporterMessenger(subnetAInfo), subnetAInfo, subnetBInfo, sendCrossChainMessageInput, fundedKey, ) + aggregator := network.GetSignatureAggregator() + defer aggregator.Shutdown() + // // Relay the message to the destination // @@ -57,7 +60,7 @@ func UnallowedRelayer(network *localnetwork.LocalNetwork, teleporter utils.Telep false, fundedKey, nil, - network.GetSignatureAggregator(), + aggregator, ) // diff --git a/tests/flows/teleporter/validator_churn.go b/tests/flows/teleporter/validator_churn.go index b0af5f88d..8f00c845d 100644 --- a/tests/flows/teleporter/validator_churn.go +++ b/tests/flows/teleporter/validator_churn.go @@ -61,6 +61,9 @@ func ValidatorChurn(network *localnetwork.LocalNetwork, teleporter utils.Telepor Expect(err).Should(BeNil()) sentTeleporterMessage := sendEvent.Message + aggregator := network.GetSignatureAggregator() + defer aggregator.Shutdown() + // Construct the signed warp message signedWarpMessage := utils.ConstructSignedWarpMessage( ctx, @@ -68,7 +71,7 @@ func ValidatorChurn(network *localnetwork.LocalNetwork, teleporter utils.Telepor subnetAInfo, subnetBInfo, nil, - network.GetSignatureAggregator(), + aggregator, ) // @@ -97,7 +100,7 @@ func ValidatorChurn(network *localnetwork.LocalNetwork, teleporter utils.Telepor } utils.InitializeAndCompletePoAValidatorRegistration( addValidatorsCtx, - network.GetSignatureAggregator(), + aggregator, fundedKey, fundedKey, subnetAInfo, @@ -171,7 +174,7 @@ func ValidatorChurn(network *localnetwork.LocalNetwork, teleporter utils.Telepor true, fundedKey, nil, - network.GetSignatureAggregator(), + aggregator, ) // Verify the message was delivered diff --git a/tests/flows/validator-manager/erc20_token_staking.go b/tests/flows/validator-manager/erc20_token_staking.go index fa7c33b54..f88857f0f 100644 --- a/tests/flows/validator-manager/erc20_token_staking.go +++ b/tests/flows/validator-manager/erc20_token_staking.go @@ -145,6 +145,9 @@ func ERC20TokenStakingManager(network *localnetwork.LocalNetwork) { Expect(err).Should(BeNil()) delegationID = initRegistrationEvent.DelegationID + aggregator := network.GetSignatureAggregator() + defer aggregator.Shutdown() + // Gather subnet-evm Warp signatures for the SubnetValidatorWeightUpdateMessage & relay to the P-Chain signedWarpMessage := utils.ConstructSignedWarpMessage( context.Background(), @@ -152,7 +155,7 @@ func ERC20TokenStakingManager(network *localnetwork.LocalNetwork) { subnetAInfo, pChainInfo, nil, - network.GetSignatureAggregator(), + aggregator, ) // Issue a tx to update the validator's weight on the P-Chain @@ -211,6 +214,9 @@ func ERC20TokenStakingManager(network *localnetwork.LocalNetwork) { Expect(delegatorRemovalEvent.ValidationID[:]).Should(Equal(validationID[:])) Expect(delegatorRemovalEvent.DelegationID[:]).Should(Equal(delegationID[:])) + aggregator := network.GetSignatureAggregator() + defer aggregator.Shutdown() + // Gather subnet-evm Warp signatures for the SetSubnetValidatorWeightMessage & relay to the P-Chain // (Sending to the P-Chain will be skipped for now) signedWarpMessage := utils.ConstructSignedWarpMessage( @@ -219,7 +225,7 @@ func ERC20TokenStakingManager(network *localnetwork.LocalNetwork) { subnetAInfo, pChainInfo, nil, - network.GetSignatureAggregator(), + aggregator, ) Expect(err).Should(BeNil()) diff --git a/tests/flows/validator-manager/native_token_staking.go b/tests/flows/validator-manager/native_token_staking.go index 593bc41a1..d3e90453d 100644 --- a/tests/flows/validator-manager/native_token_staking.go +++ b/tests/flows/validator-manager/native_token_staking.go @@ -139,6 +139,9 @@ func NativeTokenStakingManager(network *localnetwork.LocalNetwork) { Expect(err).Should(BeNil()) delegationID = initRegistrationEvent.DelegationID + aggregator := network.GetSignatureAggregator() + defer aggregator.Shutdown() + // Gather subnet-evm Warp signatures for the SubnetValidatorWeightUpdateMessage & relay to the P-Chain signedWarpMessage := utils.ConstructSignedWarpMessage( context.Background(), @@ -146,7 +149,7 @@ func NativeTokenStakingManager(network *localnetwork.LocalNetwork) { subnetAInfo, pChainInfo, nil, - network.GetSignatureAggregator(), + aggregator, ) // Issue a tx to update the validator's weight on the P-Chain @@ -204,6 +207,9 @@ func NativeTokenStakingManager(network *localnetwork.LocalNetwork) { Expect(delegatorRemovalEvent.ValidationID[:]).Should(Equal(validationID[:])) Expect(delegatorRemovalEvent.DelegationID[:]).Should(Equal(delegationID[:])) + aggregator := network.GetSignatureAggregator() + defer aggregator.Shutdown() + // Gather subnet-evm Warp signatures for the SetSubnetValidatorWeightMessage & relay to the P-Chain // (Sending to the P-Chain will be skipped for now) signedWarpMessage := utils.ConstructSignedWarpMessage( @@ -212,7 +218,7 @@ func NativeTokenStakingManager(network *localnetwork.LocalNetwork) { subnetAInfo, pChainInfo, nil, - network.GetSignatureAggregator(), + aggregator, ) Expect(err).Should(BeNil()) diff --git a/tests/network/network.go b/tests/network/network.go index 6e59d888d..d0c406c36 100644 --- a/tests/network/network.go +++ b/tests/network/network.go @@ -3,7 +3,6 @@ package network import ( "context" "crypto/ecdsa" - "encoding/base64" "encoding/hex" "encoding/json" goLog "log" @@ -16,7 +15,6 @@ import ( "github.com/ava-labs/avalanchego/genesis" "github.com/ava-labs/avalanchego/ids" "github.com/ava-labs/avalanchego/tests/fixture/tmpnet" - "github.com/ava-labs/avalanchego/upgrade" "github.com/ava-labs/avalanchego/utils/crypto/secp256k1" "github.com/ava-labs/avalanchego/utils/formatting/address" "github.com/ava-labs/avalanchego/utils/units" @@ -44,7 +42,7 @@ type LocalNetwork struct { tmpnet.Network extraNodes []*tmpnet.Node // to add as more subnet validators in the tests - primaryNetworkValidators []ids.NodeID + primaryNetworkValidators []*tmpnet.Node globalFundedKey *secp256k1.PrivateKey validatorManagers map[ids.ID]common.Address } @@ -121,17 +119,6 @@ func NewLocalNetwork( ) Expect(network).ShouldNot(BeNil()) - // Activate Etna - upgrades := upgrade.Default - upgrades.EtnaTime = time.Now().Add(-1 * time.Minute) - upgradeJSON, err := json.Marshal(upgrades) - Expect(err).Should(BeNil()) - - upgradeBase64 := base64.StdEncoding.EncodeToString(upgradeJSON) - network.DefaultFlags.SetDefaults(tmpnet.FlagsMap{ - config.UpgradeFileContentKey: upgradeBase64, - }) - avalancheGoBuildPath, ok := os.LookupEnv("AVALANCHEGO_BUILD_PATH") Expect(ok).Should(Equal(true)) @@ -165,10 +152,8 @@ func NewLocalNetwork( } // All nodes are specified as bootstrap validators - var primaryNetworkValidators []ids.NodeID - for _, node := range network.Nodes { - primaryNetworkValidators = append(primaryNetworkValidators, node.NodeID) - } + var primaryNetworkValidators []*tmpnet.Node + primaryNetworkValidators = append(primaryNetworkValidators, network.Nodes...) localNetwork := &LocalNetwork{ Network: *network, @@ -189,6 +174,7 @@ func (n *LocalNetwork) ConvertSubnet( senderKey *ecdsa.PrivateKey, proxy bool, ) ([]utils.Node, []ids.ID, *proxyadmin.ProxyAdmin) { + goLog.Println("Converting subnet", subnet.SubnetID) cChainInfo := n.GetPrimaryNetworkInfo() pClient := platformvm.NewClient(cChainInfo.NodeURIs[0]) currentValidators, err := pClient.GetCurrentValidators(ctx, subnet.SubnetID, nil) @@ -250,6 +236,8 @@ func (n *LocalNetwork) ConvertSubnet( utils.PChainProposerVMWorkaround(pChainWallet) utils.AdvanceProposerVM(ctx, subnet, senderKey, 5) + aggregator := n.GetSignatureAggregator() + defer aggregator.Shutdown() validationIDs := utils.InitializeValidatorSet( ctx, senderKey, @@ -257,7 +245,7 @@ func (n *LocalNetwork) ConvertSubnet( utils.GetPChainInfo(cChainInfo), vdrManagerAddress, n.GetNetworkID(), - n.GetSignatureAggregator(), + aggregator, nodes, ) @@ -265,7 +253,15 @@ func (n *LocalNetwork) ConvertSubnet( for _, vdr := range currentValidators { _, err := pChainWallet.IssueRemoveSubnetValidatorTx(vdr.NodeID, subnet.SubnetID) Expect(err).Should(BeNil()) + for _, node := range n.Network.Nodes { + if node.NodeID == vdr.NodeID { + goLog.Println("Restarting bootstrap node", node.NodeID) + n.Network.RestartNode(ctx, os.Stdout, node) + } + } } + utils.PChainProposerVMWorkaround(pChainWallet) + utils.AdvanceProposerVM(ctx, subnet, senderKey, 5) return nodes, validationIDs, proxyAdmin } @@ -288,7 +284,8 @@ func (n *LocalNetwork) AddSubnetValidators( // Add the node to the network n.Network.Nodes = append(n.Network.Nodes, node) } - n.Network.StartNodes(context.Background(), os.Stdout, nodes...) + err := n.Network.StartNodes(context.Background(), os.Stdout, nodes...) + Expect(err).Should(BeNil()) // Update the tmpnet Subnet struct for _, tmpnetSubnet := range n.Network.Subnets { @@ -328,13 +325,14 @@ func (n *LocalNetwork) GetExtraNodes(count int) []*tmpnet.Node { return nodes } +func (n *LocalNetwork) GetPrimaryNetworkValidators() []*tmpnet.Node { + return n.primaryNetworkValidators +} + func (n *LocalNetwork) GetPrimaryNetworkInfo() interfaces.SubnetTestInfo { var nodeURIs []string - for _, nodeID := range n.primaryNetworkValidators { - uri, err := n.Network.GetURIForNodeID(nodeID) - Expect(err).Should(BeNil()) - - nodeURIs = append(nodeURIs, uri) + for _, node := range n.primaryNetworkValidators { + nodeURIs = append(nodeURIs, node.URI) } infoClient := info.NewClient(nodeURIs[0]) cChainBlockchainID, err := infoClient.GetBlockchainID(context.Background(), "C") diff --git a/tests/suites/teleporter/teleporter_suite_test.go b/tests/suites/teleporter/teleporter_suite_test.go index bf37d4a96..52d6662b9 100644 --- a/tests/suites/teleporter/teleporter_suite_test.go +++ b/tests/suites/teleporter/teleporter_suite_test.go @@ -12,7 +12,7 @@ import ( "github.com/ava-labs/avalanchego/utils/units" teleporterFlows "github.com/ava-labs/teleporter/tests/flows/teleporter" registryFlows "github.com/ava-labs/teleporter/tests/flows/teleporter/registry" - localnetwork "github.com/ava-labs/teleporter/tests/network" + "github.com/ava-labs/teleporter/tests/network" "github.com/ava-labs/teleporter/tests/utils" deploymentUtils "github.com/ava-labs/teleporter/utils/deployment-utils" "github.com/ethereum/go-ethereum/log" @@ -30,7 +30,7 @@ const ( ) var ( - LocalNetworkInstance *localnetwork.LocalNetwork + LocalNetworkInstance *network.LocalNetwork TeleporterInfo utils.TeleporterTestInfo ) @@ -58,14 +58,14 @@ var _ = ginkgo.BeforeSuite(func() { Expect(err).Should(BeNil()) // Create the local network instance - ctx, cancel := context.WithTimeout(context.Background(), 120*2*time.Second) + ctx, cancel := context.WithTimeout(context.Background(), 240*2*time.Second) defer cancel() - LocalNetworkInstance = localnetwork.NewLocalNetwork( + LocalNetworkInstance = network.NewLocalNetwork( ctx, "teleporter-test-local-network", warpGenesisTemplateFile, - []localnetwork.SubnetSpec{ + []network.SubnetSpec{ { Name: "A", EVMChainID: 12345, diff --git a/tests/suites/validator-manager/validator_manager_suite_test.go b/tests/suites/validator-manager/validator_manager_suite_test.go index 4e0d251fc..65d6126f0 100644 --- a/tests/suites/validator-manager/validator_manager_suite_test.go +++ b/tests/suites/validator-manager/validator_manager_suite_test.go @@ -34,7 +34,7 @@ func TestValidatorManager(t *testing.T) { // Define the before and after suite functions. var _ = ginkgo.BeforeEach(func() { // Create the local network instance - ctx, cancel := context.WithTimeout(context.Background(), 120*time.Second) + ctx, cancel := context.WithTimeout(context.Background(), 240*time.Second) defer cancel() LocalNetworkInstance = localnetwork.NewLocalNetwork( ctx, diff --git a/tests/utils/chain.go b/tests/utils/chain.go index 96418ddf3..a859939cb 100644 --- a/tests/utils/chain.go +++ b/tests/utils/chain.go @@ -540,10 +540,7 @@ func InstantiateGenesisTemplate( return subnetGenesisFile.Name() } -// // Aggregator utils -// - func NewSignatureAggregator(apiUri string, subnets []ids.ID) *aggregator.SignatureAggregator { cfg := sigAggConfig.Config{ PChainAPI: &relayerConfig.APIConfig{ @@ -556,8 +553,16 @@ func NewSignatureAggregator(apiUri string, subnets []ids.ID) *aggregator.Signatu trackedSubnets := set.NewSet[ids.ID](len(subnets)) trackedSubnets.Add(subnets...) registry := prometheus.NewRegistry() + messageCreator, err := message.NewCreator( + logging.NoLog{}, + registry, + constants.DefaultNetworkCompressionType, + constants.DefaultNetworkMaximumInboundTimeout, + ) + Expect(err).Should(BeNil()) + appRequestNetwork, err := peers.NewNetwork( - logging.Info, + logging.Error, registry, trackedSubnets, nil, @@ -565,19 +570,12 @@ func NewSignatureAggregator(apiUri string, subnets []ids.ID) *aggregator.Signatu ) Expect(err).Should(BeNil()) - messageCreator, err := message.NewCreator( - logging.NoLog{}, - registry, - constants.DefaultNetworkCompressionType, - constants.DefaultNetworkMaximumInboundTimeout, - ) - Expect(err).Should(BeNil()) agg, err := aggregator.NewSignatureAggregator( appRequestNetwork, logging.NoLog{}, + messageCreator, 1024, metrics.NewSignatureAggregatorMetrics(prometheus.NewRegistry()), - messageCreator, // Setting the etnaTime to a minute ago so that the post-etna code path is used in the test time.Now().Add(-1*time.Minute), ) diff --git a/tests/utils/validator_manager.go b/tests/utils/validator_manager.go index 84f5c2185..de525829e 100644 --- a/tests/utils/validator_manager.go +++ b/tests/utils/validator_manager.go @@ -276,7 +276,7 @@ func InitializeValidatorSet( signatureAggregator *aggregator.SignatureAggregator, nodes []Node, ) []ids.ID { - log.Println("Initializing validator set") + log.Println("Initializing validator set", "subnet", subnetInfo.SubnetID) initialValidators := make([]warpMessage.SubnetToL1ConverstionValidatorData, len(nodes)) initialValidatorsABI := make([]ivalidatormanager.InitialValidator, len(nodes)) for i, node := range nodes {