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

Upgrade subnet-evm to v0.5.11 #161

Merged
merged 9 commits into from
Feb 1, 2024
Merged
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
14 changes: 6 additions & 8 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ module github.com/ava-labs/awm-relayer
go 1.20

require (
github.com/ava-labs/avalanchego v1.10.17
github.com/ava-labs/coreth v0.12.9-rc.9
github.com/ava-labs/subnet-evm v0.5.10
github.com/ava-labs/teleporter v0.0.0-20240108172200-f03f526e5312
github.com/ava-labs/avalanchego v1.10.18
github.com/ava-labs/coreth v0.12.10-rc.5
github.com/ava-labs/subnet-evm v0.5.11
github.com/ava-labs/teleporter v0.1.1-0.20240201160021-db9b809f0a88
github.com/ethereum/go-ethereum v1.12.0
github.com/onsi/ginkgo/v2 v2.15.0
github.com/onsi/gomega v1.31.1
Expand All @@ -21,7 +21,7 @@ require (

require (
github.com/Microsoft/go-winio v0.5.2 // indirect
github.com/ava-labs/avalanche-network-runner v1.7.4-0.20231127162258-2f3ceed8ae4b // indirect
github.com/ava-labs/avalanche-network-runner v1.7.4-rc.0 // indirect
github.com/cockroachdb/errors v1.9.1 // indirect
github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect
github.com/cockroachdb/pebble v0.0.0-20230209160836-829675f94811 // indirect
Expand Down Expand Up @@ -61,14 +61,13 @@ require (
github.com/pelletier/go-toml/v2 v2.0.8 // indirect
github.com/rogpeppe/go-internal v1.10.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/spaolacci/murmur3 v1.1.0 // indirect
github.com/spf13/afero v1.9.5 // indirect
github.com/spf13/cast v1.5.1 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/subosito/gotenv v1.4.2 // indirect
github.com/urfave/cli/v2 v2.17.2-0.20221006022127-8f469abc00aa // indirect
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df // indirect
golang.org/x/exp v0.0.0-20231127185646-65229373498e // indirect
golang.org/x/mod v0.14.0 // indirect
golang.org/x/tools v0.16.1 // indirect
google.golang.org/genproto v0.0.0-20230803162519-f966b187b2e5 // indirect
Expand Down Expand Up @@ -102,7 +101,6 @@ require (
github.com/gorilla/rpc v1.2.0 // indirect
github.com/gorilla/websocket v1.4.2 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.0 // indirect
github.com/holiman/big v0.0.0-20221017200358-a027dc42d04e // indirect
github.com/holiman/bloomfilter/v2 v2.0.3 // indirect
github.com/holiman/uint256 v1.2.3 // indirect
github.com/mattn/go-runewidth v0.0.9 // indirect
Expand Down
28 changes: 12 additions & 16 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,16 @@ github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156 h1:eMwmnE/GDgah
github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM=
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8=
github.com/ava-labs/avalanche-network-runner v1.7.4-0.20231127162258-2f3ceed8ae4b h1:iH6q+S7dmBOYCXrZx+nNlS1HBp72L2msiVCLs39Ls5A=
github.com/ava-labs/avalanche-network-runner v1.7.4-0.20231127162258-2f3ceed8ae4b/go.mod h1:aeAm8dgJ1xucQKlYoRDMgYjA0UWGwmaICG9wL0WvseU=
github.com/ava-labs/avalanchego v1.10.17 h1:Ri01nU5ukKC38ZCkCh3namaMZtJkSuv1X/vC13uJguc=
github.com/ava-labs/avalanchego v1.10.17/go.mod h1:A6f3877qlq7bePjCU4T0D60bZGecRMCk15pMpJGOb4Q=
github.com/ava-labs/coreth v0.12.9-rc.9 h1:mvYxABdyPByXwwwIxnTBCiNO23dsE1Kfnd5H106lric=
github.com/ava-labs/coreth v0.12.9-rc.9/go.mod h1:yrf2vEah4Fgj6sJ4UpHewo4DLolwdpf2bJuLRT80PGw=
github.com/ava-labs/subnet-evm v0.5.10 h1:ed9BxoiuXRnB/qKakKzYKtZzV/gVjOB2LxuDegpLs9g=
github.com/ava-labs/subnet-evm v0.5.10/go.mod h1:wln8B4siQ1Osch+elW9vW1XJGjj5PYxQETkzFyDEMjk=
github.com/ava-labs/teleporter v0.0.0-20240108172200-f03f526e5312 h1:rG9xkvCXRU4FBi1IBIXPxnTwxRv7mM6j0PX7FQss32g=
github.com/ava-labs/teleporter v0.0.0-20240108172200-f03f526e5312/go.mod h1:qeclhkPTO4R2McXNrXXca4JmiRSgQ0gJ0KtJWzQGGPE=
github.com/ava-labs/avalanche-network-runner v1.7.4-rc.0 h1:xNbCMNqenaDr0bb35j27sqwa+C8t8BgRz51vXd6q0QM=
github.com/ava-labs/avalanche-network-runner v1.7.4-rc.0/go.mod h1:B7Ynk/avkCk49CCIWbM4j1UrPlqIi0IHCPAB2MZNvLw=
github.com/ava-labs/avalanchego v1.10.18 h1:ErJ+SJBtN9tVqk3OPRXffpf+MWeQnNZJlBNWQIgAg8A=
github.com/ava-labs/avalanchego v1.10.18/go.mod h1:wqmokVcLXE+9Nfa8wHdGJtjEW35acVf8rkraSZPVBA4=
github.com/ava-labs/coreth v0.12.10-rc.5 h1:FMVvXHssvMQ3Eade7i85Wsx9tuD3kUOFMG8ktHeDTp8=
github.com/ava-labs/coreth v0.12.10-rc.5/go.mod h1:a58HbIBc9jscGc3aL8e7JuG8RfhBBOm63waq1q0YM+U=
github.com/ava-labs/subnet-evm v0.5.11 h1:82iddT/ahXNpwc3TBhxMDS1g6bt+Fmsb3kCyJr9qpWs=
github.com/ava-labs/subnet-evm v0.5.11/go.mod h1:Uv8eYNjj9Kf8S57yxoQd+IpZH/DRLvbm6yeygUDZuE4=
github.com/ava-labs/teleporter v0.1.1-0.20240201160021-db9b809f0a88 h1:yk4MBz/+betvpCc+iBNvJSxrqYagbvt3k2lkP/a9HG4=
github.com/ava-labs/teleporter v0.1.1-0.20240201160021-db9b809f0a88/go.mod h1:B6bFTJKtR2kD3wHLtAEtWa/EjlrZwLlOgKyvMw3NMNE=
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 @@ -334,8 +334,6 @@ 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/big v0.0.0-20221017200358-a027dc42d04e h1:pIYdhNkDh+YENVNi3gto8n9hAmRxKxoar0iE6BLucjw=
github.com/holiman/big v0.0.0-20221017200358-a027dc42d04e/go.mod h1:j9cQbcqHQujT0oKJ38PylVfqohClLr3CvDC+Qcg+lhU=
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.3 h1:K8UWO1HUJpRMXBxbmaY1Y8IAMZC/RsKB+ArEnnK4l5o=
Expand Down Expand Up @@ -510,8 +508,6 @@ github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI=
github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
github.com/spf13/afero v1.9.5 h1:stMpOSZFs//0Lv29HduCmli3GUfpFoF3Y1Q/aXj/wVM=
github.com/spf13/afero v1.9.5/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ=
Expand Down Expand Up @@ -647,8 +643,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0
golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM=
golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU=
golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df h1:UA2aFVmmsIlefxMk29Dp2juaUSth8Pyn3Tq5Y5mJGME=
golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc=
golang.org/x/exp v0.0.0-20231127185646-65229373498e h1:Gvh4YaCaXNs6dKTlfgismwWZKyjVZXwOPfIyUaqU3No=
golang.org/x/exp v0.0.0-20231127185646-65229373498e/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI=
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
Expand Down
8 changes: 4 additions & 4 deletions messages/teleporter/message_manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ var (
messageIDstring = "2CQw6XkzbDZY87XRomuszWkCBDTUvMaZv3YE2PAf7cicxWWEMF"
validRelayerAddress = common.HexToAddress("0x0123456789abcdef0123456789abcdef01234567")
validTeleporterMessage = teleportermessenger.TeleporterMessage{
MessageNonce: big.NewInt(1),
SenderAddress: common.HexToAddress("0x0123456789abcdef0123456789abcdef01234567"),
DestinationAddress: common.HexToAddress("0x0123456789abcdef0123456789abcdef01234567"),
RequiredGasLimit: big.NewInt(2),
MessageNonce: big.NewInt(1),
OriginSenderAddress: common.HexToAddress("0x0123456789abcdef0123456789abcdef01234567"),
DestinationAddress: common.HexToAddress("0x0123456789abcdef0123456789abcdef01234567"),
RequiredGasLimit: big.NewInt(2),
AllowedRelayerAddresses: []common.Address{
validRelayerAddress,
},
Expand Down
3 changes: 1 addition & 2 deletions peers/app_request_network.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (
)

const (
LocalNetworkID = 1337 // ID used by avalanche-cli for local networks
InboundMessageChannelSize = 1000
DefaultAppRequestTimeout = time.Second * 2

Expand Down Expand Up @@ -207,7 +206,7 @@ func (n *AppRequestNetwork) ConnectPeers(nodeIDs set.Set[ids.NodeID]) (set.Set[i
peers, err := n.infoClient.Peers(context.Background())
if err != nil {
n.logger.Error(
"failed to get peers",
"Failed to get peers",
zap.Error(err),
)
return nil, err
Expand Down
22 changes: 13 additions & 9 deletions peers/external_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (

"github.com/ava-labs/avalanchego/ids"
"github.com/ava-labs/avalanchego/message"
"github.com/ava-labs/avalanchego/snow/engine/common"
"github.com/ava-labs/avalanchego/snow/networking/router"
"github.com/ava-labs/avalanchego/utils/constants"
"github.com/ava-labs/avalanchego/utils/logging"
Expand Down Expand Up @@ -75,11 +76,11 @@ func NewRelayerExternalHandler(
// When a cross-chain message is picked up by a Relayer, HandleInbound routes AppResponses traffic to the appropriate Relayer
func (h *RelayerExternalHandler) HandleInbound(_ context.Context, inboundMessage message.InboundMessage) {
h.log.Debug(
"receiving message",
"Receiving message",
zap.Stringer("op", inboundMessage.Op()),
)
if inboundMessage.Op() == message.AppResponseOp || inboundMessage.Op() == message.AppRequestFailedOp {
h.log.Info("handling app response", zap.Stringer("from", inboundMessage.NodeID()))
if inboundMessage.Op() == message.AppResponseOp || inboundMessage.Op() == message.AppErrorOp {
h.log.Info("Handling app response", zap.Stringer("from", inboundMessage.NodeID()))

// Extract the message fields
m := inboundMessage.Message()
Expand All @@ -90,19 +91,19 @@ func (h *RelayerExternalHandler) HandleInbound(_ context.Context, inboundMessage
// inbound cross-chain app message, then we would get the incorrect chain ID.
blockchainID, err := message.GetChainID(m)
if err != nil {
h.log.Error("could not get blockchainID from message")
h.log.Error("Could not get blockchainID from message")
inboundMessage.OnFinishedHandling()
return
}
sourceBlockchainID, err := message.GetSourceChainID(m)
if err != nil {
h.log.Error("could not get sourceBlockchainID from message")
h.log.Error("Could not get sourceBlockchainID from message")
inboundMessage.OnFinishedHandling()
return
}
requestID, ok := message.GetRequestID(m)
if !ok {
h.log.Error("could not get requestID from message")
h.log.Error("Could not get requestID from message")
inboundMessage.OnFinishedHandling()
return
}
Expand All @@ -125,13 +126,14 @@ func (h *RelayerExternalHandler) HandleInbound(_ context.Context, inboundMessage
h.responseChans[blockchainID] <- inboundMessage
}(inboundMessage, blockchainID)
} else {
h.log.Debug("Ignoring message", zap.Stringer("op", inboundMessage.Op()))
inboundMessage.OnFinishedHandling()
}
}

func (h *RelayerExternalHandler) Connected(nodeID ids.NodeID, version *version.Application, subnetID ids.ID) {
h.log.Info(
"connected",
"Connected",
zap.Stringer("nodeID", nodeID),
zap.Stringer("version", version),
zap.Stringer("subnetID", subnetID),
Expand All @@ -140,7 +142,7 @@ func (h *RelayerExternalHandler) Connected(nodeID ids.NodeID, version *version.A

func (h *RelayerExternalHandler) Disconnected(nodeID ids.NodeID) {
h.log.Info(
"disconnected",
"Disconnected",
zap.Stringer("nodeID", nodeID),
)
}
Expand All @@ -149,10 +151,12 @@ func (h *RelayerExternalHandler) Disconnected(nodeID ids.NodeID) {
// If RegisterResponse is not called before the timeout, HandleInbound is called with
// an internally created AppRequestFailed message.
func (h *RelayerExternalHandler) RegisterRequest(reqID ids.RequestID) {
inMsg := message.InternalAppRequestFailed(
inMsg := message.InboundAppError(
reqID.NodeID,
reqID.SourceChainID,
reqID.RequestID,
common.ErrTimeout.Code,
common.ErrTimeout.Message,
)
h.timeoutManager.Put(reqID, false, func() {
h.HandleInbound(context.Background(), inMsg)
Expand Down
28 changes: 13 additions & 15 deletions relayer/message_relayer.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,15 @@ import (
"github.com/ava-labs/avalanchego/utils/constants"
"github.com/ava-labs/avalanchego/utils/crypto/bls"
"github.com/ava-labs/avalanchego/utils/set"
"github.com/ava-labs/avalanchego/vms/platformvm/warp"
avalancheWarp "github.com/ava-labs/avalanchego/vms/platformvm/warp"
"github.com/ava-labs/awm-relayer/messages"
"github.com/ava-labs/awm-relayer/peers"
"github.com/ava-labs/awm-relayer/utils"
"github.com/ava-labs/awm-relayer/vms/vmtypes"
"github.com/ava-labs/coreth/params"
coreEthMsg "github.com/ava-labs/coreth/plugin/evm/message"
msg "github.com/ava-labs/subnet-evm/plugin/evm/message"
"github.com/ava-labs/subnet-evm/precompile/contracts/warp"
warpBackend "github.com/ava-labs/subnet-evm/warp"

"go.uber.org/zap"
)

Expand All @@ -54,13 +52,13 @@ var (
// Each messageRelayer runs in its own goroutine.
type messageRelayer struct {
relayer *Relayer
warpMessage *warp.UnsignedMessage
warpMessage *avalancheWarp.UnsignedMessage
destinationBlockchainID ids.ID
}

func newMessageRelayer(
relayer *Relayer,
warpMessage *warp.UnsignedMessage,
warpMessage *avalancheWarp.UnsignedMessage,
destinationBlockchainID ids.ID,
) *messageRelayer {
return &messageRelayer{
Expand Down Expand Up @@ -135,7 +133,7 @@ func (r *messageRelayer) relayMessage(warpMessageInfo *vmtypes.WarpMessageInfo,
// createSignedMessage fetches the signed Warp message from the source chain via RPC.
// Each VM may implement their own RPC method to construct the aggregate signature, which
// will need to be accounted for here.
func (r *messageRelayer) createSignedMessage() (*warp.Message, error) {
func (r *messageRelayer) createSignedMessage() (*avalancheWarp.Message, error) {
r.relayer.logger.Info("Fetching aggregate signature from the source chain validators via API")
warpClient, err := warpBackend.NewClient(r.relayer.apiNodeURI, r.relayer.sourceBlockchainID.String())
if err != nil {
Expand Down Expand Up @@ -170,7 +168,7 @@ func (r *messageRelayer) createSignedMessage() (*warp.Message, error) {
signedWarpMessageBytes, err = warpClient.GetMessageAggregateSignature(
context.Background(),
r.warpMessage.ID(),
params.WarpDefaultQuorumNumerator,
warp.WarpDefaultQuorumNumerator,
signingSubnetID.String(),
)
if err == nil {
Expand Down Expand Up @@ -206,7 +204,7 @@ func (r *messageRelayer) createSignedMessage() (*warp.Message, error) {
}

// createSignedMessageAppRequest collects signatures from nodes by directly querying them via AppRequest, then aggregates the signatures, and constructs the signed warp message.
func (r *messageRelayer) createSignedMessageAppRequest(requestID uint32) (*warp.Message, error) {
func (r *messageRelayer) createSignedMessageAppRequest(requestID uint32) (*avalancheWarp.Message, error) {
r.relayer.logger.Info("Fetching aggregate signature from the source chain validators via AppRequest")

// Get the current canonical validator set of the source subnet.
Expand Down Expand Up @@ -353,7 +351,7 @@ func (r *messageRelayer) createSignedMessageAppRequest(requestID uint32) (*warp.
// This anonymous function attempts to create a signed warp message from the accumulated responses
// Returns an error only if a non-recoverable error occurs, otherwise returns (nil, nil) to continue processing responses
// When a non-nil signedMsg is returned, createSignedMessage itself returns
signedMsg, err := func() (*warp.Message, error) {
signedMsg, err := func() (*avalancheWarp.Message, error) {
defer response.OnFinishedHandling()

// Check if this is an expected response.
Expand All @@ -375,7 +373,7 @@ func (r *messageRelayer) createSignedMessageAppRequest(requestID uint32) (*warp.

// If we receive an AppRequestFailed, then the request timed out.
// We still want to increment responseCount, since we are no longer expecting a response from that node.
if response.Op() == message.AppRequestFailedOp {
if response.Op() == message.AppErrorOp {
r.relayer.logger.Debug("Request timed out")
return nil, nil
}
Expand All @@ -398,7 +396,7 @@ func (r *messageRelayer) createSignedMessageAppRequest(requestID uint32) (*warp.
}

// As soon as the signatures exceed the stake weight threshold we try to aggregate and send the transaction.
if utils.CheckStakeWeightExceedsThreshold(accumulatedSignatureWeight, totalValidatorWeight, params.WarpDefaultQuorumNumerator, params.WarpQuorumDenominator) {
if utils.CheckStakeWeightExceedsThreshold(accumulatedSignatureWeight, totalValidatorWeight, warp.WarpDefaultQuorumNumerator, warp.WarpQuorumDenominator) {
aggSig, vdrBitSet, err := r.aggregateSignatures(signatureMap)
if err != nil {
r.relayer.logger.Error(
Expand All @@ -409,7 +407,7 @@ func (r *messageRelayer) createSignedMessageAppRequest(requestID uint32) (*warp.
return nil, err
}

signedMsg, err := warp.NewMessage(r.warpMessage, &warp.BitSetSignature{
signedMsg, err := avalancheWarp.NewMessage(r.warpMessage, &avalancheWarp.BitSetSignature{
Signers: vdrBitSet.Bytes(),
Signature: *(*[bls.SignatureLen]byte)(bls.SignatureToBytes(aggSig)),
})
Expand Down Expand Up @@ -457,7 +455,7 @@ func (r *messageRelayer) createSignedMessageAppRequest(requestID uint32) (*warp.
return nil, errNotEnoughSignatures
}

func (r *messageRelayer) getCurrentCanonicalValidatorSet() ([]*warp.Validator, uint64, error) {
func (r *messageRelayer) getCurrentCanonicalValidatorSet() ([]*avalancheWarp.Validator, uint64, error) {
var (
signingSubnet ids.ID
err error
Expand Down Expand Up @@ -488,7 +486,7 @@ func (r *messageRelayer) getCurrentCanonicalValidatorSet() ([]*warp.Validator, u
}

// Get the current canonical validator set of the source subnet.
canonicalSubnetValidators, totalValidatorWeight, err := warp.GetCanonicalValidatorSet(
canonicalSubnetValidators, totalValidatorWeight, err := avalancheWarp.GetCanonicalValidatorSet(
context.Background(),
r.relayer.canonicalValidatorClient,
height,
Expand All @@ -513,7 +511,7 @@ func (r *messageRelayer) isValidSignatureResponse(
pubKey *bls.PublicKey,
) (blsSignatureBuf, bool) {
// If the handler returned an error response, count the response and continue
if response.Op() == message.AppRequestFailedOp {
if response.Op() == message.AppErrorOp {
r.relayer.logger.Debug(
"Relayer async response failed",
zap.String("nodeID", response.NodeID().String()),
Expand Down
Loading
Loading