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

integrate ACP-118 #408

Merged
merged 48 commits into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from 46 commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
c46fc41
go.mod: use latest subnet-evm commit
feuGeneA Aug 5, 2024
650c987
integrate w/ACP-118 protobuf SignatureRequest
feuGeneA Aug 5, 2024
a9c7768
test relayer & aggregator: log debug by default
feuGeneA Aug 5, 2024
9db9153
Merge branch 'signature-aggregation-api' into signature-aggregation-a…
feuGeneA Aug 5, 2024
557262a
add justification, rename message to drop Unsigned
feuGeneA Aug 6, 2024
b56e5d3
Merge remote-tracking branch 'origin/signature-aggregation-api' into …
feuGeneA Aug 6, 2024
adb8fb2
Merge remote-tracking branch 'origin/signature-aggregation-api' into …
feuGeneA Aug 7, 2024
f399cff
re-pin dependencies
feuGeneA Aug 7, 2024
fa3dbc0
Merge remote-tracking branch 'origin/signature-aggregation-api' into …
feuGeneA Aug 7, 2024
c771ca9
sync teleporter git submodule to go.mod version
feuGeneA Aug 7, 2024
fa60e03
version bumps, logging and handlerid packing hacks
iansuvak Aug 8, 2024
0108081
Update signature-aggregator/README.md
iansuvak Aug 8, 2024
cf689e5
Update signature-aggregator/README.md
iansuvak Aug 8, 2024
b186d1c
address review feedback
iansuvak Aug 8, 2024
95797af
invert utils.CheckStakeWeightPercentageExceedsThreshold
iansuvak Aug 8, 2024
b8735b0
Fix bugs in api and remove old testing code
iansuvak Aug 8, 2024
0be46eb
bump teleporter submodule
iansuvak Aug 9, 2024
e3cefff
Merge remote-tracking branch 'origin/main' into isuvak/sig-agg-acp-118
iansuvak Aug 9, 2024
79132a1
actually fix versions
iansuvak Aug 9, 2024
b5cff9e
Merge branch 'main' into signature-aggregation-api-acp-118
iansuvak Aug 9, 2024
2f337c9
Merge branch 'signature-aggregation-api-acp-118' into isuvak/sig-agg-…
iansuvak Aug 9, 2024
bce634d
replace feature branch commit references with default branch ones
iansuvak Aug 19, 2024
811c97a
add explicit check for signature length
iansuvak Aug 21, 2024
30a718d
Merge pull request #422 from ava-labs/isuvak/sig-agg-acp-118
iansuvak Aug 21, 2024
9f81123
Merge remote-tracking branch 'origin/main' into signature-aggregation…
feuGeneA Aug 20, 2024
e9eea93
Merge remote-tracking branch 'origin/main' into signature-aggregation…
feuGeneA Aug 21, 2024
29cac30
relay justification from handled request to AppReq
feuGeneA Aug 21, 2024
7fd79dc
Merge branch 'main' into signature-aggregation-api-acp-118
feuGeneA Aug 22, 2024
58af3de
Update signature-aggregator/api/api.go
feuGeneA Aug 23, 2024
e1edf7e
Merge branch 'main' into signature-aggregation-api-acp-118
feuGeneA Aug 23, 2024
70666da
Merge branch 'main' into signature-aggregation-api-acp-118
iansuvak Aug 27, 2024
77262bc
Etna timestamp switch
iansuvak Aug 27, 2024
ec5b830
Fix implementation and add E2E test
iansuvak Aug 28, 2024
0498f4a
update sample workflow docs for sig-agg
iansuvak Aug 28, 2024
440a52d
use PrefixMessage function to construct request bytes
iansuvak Aug 28, 2024
91c5016
make etna upgrade test just test the post-etna case
iansuvak Aug 28, 2024
47cfef6
use extract_commit instead of manually synced references in versions.sh
iansuvak Aug 28, 2024
b87bcc1
Revert "use extract_commit instead of manually synced references in v…
iansuvak Aug 29, 2024
5852f6c
Merge remote-tracking branch 'origin/main' into etna-time
iansuvak Aug 30, 2024
7f9488c
Add TODO to cleanup after Etna release
iansuvak Aug 30, 2024
0648123
Merge pull request #463 from ava-labs/etna-time
iansuvak Aug 30, 2024
ae43d72
Merge branch 'main' into signature-aggregation-api-acp-118
iansuvak Sep 4, 2024
ca06934
adapt to latest changes in `main`
feuGeneA Sep 4, 2024
6cd8245
pass nil, not empty slice
feuGeneA Sep 4, 2024
b04df21
Merge branch 'main' into signature-aggregation-api-acp-118
feuGeneA Sep 4, 2024
3d7707d
address review feedback
iansuvak Sep 5, 2024
2ba7b61
Merge remote-tracking branch 'origin/main' into signature-aggregation…
iansuvak Sep 5, 2024
576a375
address review feedback
iansuvak Sep 5, 2024
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
3 changes: 3 additions & 0 deletions config/api_config.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (C) 2024, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.

package config

import (
Expand Down
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ module github.com/ava-labs/awm-relayer
go 1.22.6

require (
github.com/ava-labs/avalanchego v1.11.10
github.com/ava-labs/coreth v0.13.7
github.com/ava-labs/subnet-evm v0.6.8
github.com/ava-labs/avalanchego v1.11.11-0.20240813203340-ab83fb41528d
github.com/ava-labs/subnet-evm v0.6.9-0.20240816202746-18633729a0cd
github.com/ava-labs/teleporter v1.0.5
github.com/aws/aws-sdk-go-v2 v1.30.5
github.com/aws/aws-sdk-go-v2/config v1.27.9
Expand All @@ -31,6 +30,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.8-fixed-genesis-upgrade.0.20240813194342-7635a96aa180 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.17.9 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.0 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.17 // indirect
Expand Down
12 changes: 6 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ github.com/alexliesenfeld/health v0.8.0/go.mod h1:TfNP0f+9WQVWMQRzvMUjlws4ceXKEL
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-0.20240813203340-ab83fb41528d h1:LyrKJL9avIIxBY3uTcS2dFtUMBFmI2QpAgG6qYTdA6s=
github.com/ava-labs/avalanchego v1.11.11-0.20240813203340-ab83fb41528d/go.mod h1:UkyrRDXK2E15Lq2abyae2Pt+JsWvgsg1pe0/AtoMyAM=
github.com/ava-labs/coreth v0.13.8-fixed-genesis-upgrade.0.20240813194342-7635a96aa180 h1:6aIHp7wbyGVYdhHVQUbG7BEcbCMEQ5SYopPPJyipyvk=
github.com/ava-labs/coreth v0.13.8-fixed-genesis-upgrade.0.20240813194342-7635a96aa180/go.mod h1:/wNBVq7J7wlC2Kbov7kk6LV5xZvau7VF9zwTVOeyAjY=
github.com/ava-labs/subnet-evm v0.6.9-0.20240816202746-18633729a0cd h1:5kJTOhmIhIiobseQ+RYuLg4UyodN+CSAdW1c0hx1R2Y=
github.com/ava-labs/subnet-evm v0.6.9-0.20240816202746-18633729a0cd/go.mod h1:QfIzh7YxKj97jbendOHQbaAxM7SMj5MWdV13o1VLn70=
github.com/ava-labs/teleporter v1.0.5 h1:51fRzvo7eo9VotYq6cldx+yoAkEk5o9yCXOJ6q3tSEo=
github.com/ava-labs/teleporter v1.0.5/go.mod h1:C5/ETmPQh/MxZOCARrhPV+J40y4R3TOeT0lvQrjz/RE=
github.com/aws/aws-sdk-go-v2 v1.30.5 h1:mWSRTwQAb0aLE17dSzztCVJWI9+cRMgqebndjwDyK0g=
Expand Down
3 changes: 3 additions & 0 deletions peers/external_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ func (h *RelayerExternalHandler) HandleInbound(_ context.Context, inboundMessage
zap.Stringer("from", inboundMessage.NodeID()),
)
if inboundMessage.Op() == message.AppResponseOp || inboundMessage.Op() == message.AppErrorOp {
if inboundMessage.Op() == message.AppErrorOp {
h.log.Debug("Received AppError message", zap.Stringer("message", inboundMessage.Message()))
}
h.registerAppResponse(inboundMessage)
} else {
h.log.Debug("Ignoring message", zap.Stringer("op", inboundMessage.Op()))
Expand Down
1 change: 1 addition & 0 deletions relayer/application_relayer.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ func (r *ApplicationRelayer) ProcessMessage(handler messages.MessageHandler) (co
if r.sourceWarpSignatureClient == nil {
signedMessage, err = r.signatureAggregator.CreateSignedMessage(
unsignedMessage,
nil,
r.signingSubnetID,
r.warpQuorum.QuorumNumerator,
)
Expand Down
4 changes: 4 additions & 0 deletions relayer/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"errors"
"fmt"
"net/url"
"time"

basecfg "github.com/ava-labs/awm-relayer/config"
"github.com/ava-labs/awm-relayer/peers"
Expand Down Expand Up @@ -67,6 +68,9 @@ type Config struct {
DeciderURL string `mapstructure:"decider-url" json:"decider-url"`
SignatureCacheSize uint64 `mapstructure:"signature-cache-size" json:"signature-cache-size"`

// mapstructure doesn't handle time.Time out of the box so handle it manually
EtnaTime time.Time `json:"etna-time"`

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we could take in a string as well and use time.Parse in a date foramt

Copy link
Contributor

@iansuvak iansuvak Sep 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like that the v.GetTime() call will handle both RFC3339 format as well as UNIX timestamps cleanly and output it unambiguously when being written out.

With time.Parse we would need to manually handle conversion when writing it out to disk and reading it separately.


// convenience field to fetch a blockchain's subnet ID
blockchainIDToSubnetID map[ids.ID]ids.ID
overwrittenOptions []string
Expand Down
1 change: 1 addition & 0 deletions relayer/config/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ const (
ManualWarpMessagesKey = "manual-warp-messages"
DBWriteIntervalSecondsKey = "db-write-interval-seconds"
SignatureCacheSizeKey = "signature-cache-size"
EtnaTimeKey = "etna-time"
)
3 changes: 3 additions & 0 deletions relayer/config/viper.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ func BuildConfig(v *viper.Viper) (Config, error) {
return cfg, fmt.Errorf("failed to unmarshal viper config: %w", err)
}

// Manually set EtnaTime field since it's not automatically parseable using mapstructure
cfg.EtnaTime = v.GetTime(EtnaTimeKey)

// Explicitly overwrite the configured account private key
// If account-private-key is set as a flag or environment variable,
// overwrite all destination subnet configurations to use that key
Expand Down
1 change: 1 addition & 0 deletions relayer/main/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ func main() {
prometheus.DefaultRegisterer,
),
messageCreator,
cfg.EtnaTime,
)
if err != nil {
logger.Fatal("Failed to create signature aggregator", zap.Error(err))
Expand Down
6 changes: 4 additions & 2 deletions scripts/versions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@ function getDepVersion() {
export GO_VERSION=${GO_VERSION:-$(getDepVersion go)}

# Don't export them as they're used in the context of other calls
AVALANCHEGO_VERSION=${AVALANCHEGO_VERSION:-$(getDepVersion github.com/ava-labs/avalanchego)}
# TODO: undo this hack once go.mod is referring to a tag rather than a commit
#AVALANCHEGO_VERSION=${AVALANCHEGO_VERSION:-$(getDepVersion github.com/ava-labs/avalanchego)}
AVALANCHEGO_VERSION=${AVALANCHEGO_VERSION:-ab83fb41528de93c1790301cdd67a07dda9299f0}
cam-schultz marked this conversation as resolved.
Show resolved Hide resolved
GINKGO_VERSION=${GINKGO_VERSION:-$(getDepVersion github.com/onsi/ginkgo/v2)}

# TODO: undo this hack once go.mod is referring to a tag rather than a commit
#SUBNET_EVM_VERSION=${SUBNET_EVM_VERSION:-$(getDepVersion github.com/ava-labs/subnet-evm)}
SUBNET_EVM_VERSION=${SUBNET_EVM_VERSION:-update-avago-teleporter}
SUBNET_EVM_VERSION=${SUBNET_EVM_VERSION:-18633729a0cde7d695616e14b77873957a2b59c2}

# Set golangci-lint version
GOLANGCI_LINT_VERSION=${GOLANGCI_LINT_VERSION:-'v1.60'}
Expand Down
4 changes: 2 additions & 2 deletions signature-aggregator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ curl --location 'https://api.avax-test.network/ext/bc/C/rpc' \
The topic of the message will be `0x56600c567728a800c0aa927500f831cb451df66a7af570eb4df4dfbf4674887d` which is the output of`cast keccak "SendWarpMessage(address,bytes32,bytes)"`
4. Use the data field of the log message found in step 2 and send it to the locally running service via curl.
```bash
curl --location 'http://localhost:8080/aggregate-signatures/by-raw-message' \
curl --location 'http://localhost:8080/aggregate-signatures' \
--header 'Content-Type: application/json' \
--data '{
"data": "<hex encoded unsigned message bytes retrieved from the logs>",
"message": "<hex encoded unsigned message bytes retrieved from the logs>"
}'
```
99 changes: 80 additions & 19 deletions signature-aggregator/aggregator/aggregator.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ import (

"github.com/ava-labs/avalanchego/ids"
"github.com/ava-labs/avalanchego/message"
networkP2P "github.com/ava-labs/avalanchego/network/p2p"
"github.com/ava-labs/avalanchego/proto/pb/p2p"
"github.com/ava-labs/avalanchego/proto/pb/sdk"
"github.com/ava-labs/avalanchego/subnets"
"github.com/ava-labs/avalanchego/utils/constants"
"github.com/ava-labs/avalanchego/utils/crypto/bls"
Expand All @@ -26,9 +28,10 @@ import (
"github.com/ava-labs/awm-relayer/signature-aggregator/aggregator/cache"
"github.com/ava-labs/awm-relayer/signature-aggregator/metrics"
"github.com/ava-labs/awm-relayer/utils"
coreEthMsg "github.com/ava-labs/coreth/plugin/evm/message"
corethMsg "github.com/ava-labs/coreth/plugin/evm/message"
msg "github.com/ava-labs/subnet-evm/plugin/evm/message"
"go.uber.org/zap"
"google.golang.org/protobuf/proto"
)

type blsSignatureBuf [bls.SignatureLen]byte
Expand All @@ -42,8 +45,8 @@ const (
)

var (
codec = msg.Codec
coreEthCodec = coreEthMsg.Codec
codec = msg.Codec
corethCodec = corethMsg.Codec

// Errors
errNotEnoughSignatures = errors.New("failed to collect a threshold of signatures")
Expand All @@ -60,6 +63,7 @@ type SignatureAggregator struct {
subnetsMapLock sync.RWMutex
metrics *metrics.SignatureAggregatorMetrics
cache *cache.Cache
etnaTime time.Time
}

func NewSignatureAggregator(
Expand All @@ -68,6 +72,7 @@ func NewSignatureAggregator(
signatureCacheSize uint64,
metrics *metrics.SignatureAggregatorMetrics,
messageCreator message.Creator,
etnaTime time.Time,
) (*SignatureAggregator, error) {
cache, err := cache.NewCache(signatureCacheSize, logger)
if err != nil {
Expand All @@ -84,13 +89,15 @@ func NewSignatureAggregator(
messageCreator: messageCreator,
currentRequestID: atomic.Uint32{},
cache: cache,
etnaTime: etnaTime,
}
sa.currentRequestID.Store(rand.Uint32())
return &sa, nil
}

func (s *SignatureAggregator) CreateSignedMessage(
unsignedMessage *avalancheWarp.UnsignedMessage,
justification []byte,
inputSigningSubnet ids.ID,
quorumPercentage uint64,
) (*avalancheWarp.Message, error) {
Expand Down Expand Up @@ -176,19 +183,7 @@ func (s *SignatureAggregator) CreateSignedMessage(
))
}

// TODO: remove this special handling and replace with ACP-118 interface once available
var reqBytes []byte
if sourceSubnet == constants.PrimaryNetworkID {
req := coreEthMsg.MessageSignatureRequest{
MessageID: unsignedMessage.ID(),
}
reqBytes, err = coreEthMsg.RequestToBytes(coreEthCodec, req)
} else {
req := msg.MessageSignatureRequest{
MessageID: unsignedMessage.ID(),
}
reqBytes, err = msg.RequestToBytes(codec, req)
}
reqBytes, err := s.marshalRequest(unsignedMessage, justification, sourceSubnet)
if err != nil {
msg := "Failed to marshal request bytes"
s.logger.Error(
Expand Down Expand Up @@ -524,14 +519,13 @@ func (s *SignatureAggregator) isValidSignatureResponse(
return blsSignatureBuf{}, false
}

var sigResponse msg.SignatureResponse
if _, err := msg.Codec.Unmarshal(appResponse.AppBytes, &sigResponse); err != nil {
signature, err := s.unmarshalResponse(appResponse.AppBytes)
if err != nil {
s.logger.Error(
"Error unmarshaling signature response",
zap.Error(err),
)
}
signature := sigResponse.Signature

// If the node returned an empty signature, then it has not yet seen the warp message. Retry later.
emptySignature := blsSignatureBuf{}
Expand All @@ -543,6 +537,15 @@ func (s *SignatureAggregator) isValidSignatureResponse(
return blsSignatureBuf{}, false
}

if len(signature) != bls.SignatureLen {
s.logger.Debug(
"Response signature has incorrect length",
zap.Int("actual", len(signature)),
zap.Int("expected", bls.SignatureLen),
)
return blsSignatureBuf{}, false
}

sig, err := bls.SignatureFromBytes(signature[:])
if err != nil {
s.logger.Debug(
Expand Down Expand Up @@ -590,3 +593,61 @@ func (s *SignatureAggregator) aggregateSignatures(
}
return aggSig, vdrBitSet, nil
}

// TODO: refactor this to remove special handling based on etnaTime
minghinmatthewlam marked this conversation as resolved.
Show resolved Hide resolved
// after Etna release, along with related config and testing code
func (s *SignatureAggregator) marshalRequest(
unsignedMessage *avalancheWarp.UnsignedMessage,
justification []byte,
sourceSubnet ids.ID,
) ([]byte, error) {
if !s.etnaTime.IsZero() && s.etnaTime.Before(time.Now()) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to combine these two conditions into a helper s.EtnaActivated()

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 576a375

// Post-Etna case
messageBytes, err := proto.Marshal(
&sdk.SignatureRequest{
Message: unsignedMessage.Bytes(),
Justification: justification,
},
)
if err != nil {
return nil, err
}
return networkP2P.PrefixMessage(
networkP2P.ProtocolPrefix(networkP2P.SignatureRequestHandlerID),
messageBytes,
), nil
} else {
// Pre-Etna case
if sourceSubnet == constants.PrimaryNetworkID {
req := corethMsg.MessageSignatureRequest{
MessageID: unsignedMessage.ID(),
}
return corethMsg.RequestToBytes(corethCodec, req)
} else {
req := msg.MessageSignatureRequest{
MessageID: unsignedMessage.ID(),
}
return msg.RequestToBytes(codec, req)
}
}
}

func (s *SignatureAggregator) unmarshalResponse(responseBytes []byte) (blsSignatureBuf, error) {
if !s.etnaTime.IsZero() && s.etnaTime.Before(time.Now()) {
// Post-Etna case
var sigResponse sdk.SignatureResponse
err := proto.Unmarshal(responseBytes, &sigResponse)
if err != nil {
return blsSignatureBuf{}, err
}
return blsSignatureBuf(sigResponse.Signature), nil
} else {
// Pre-Etna case
var sigResponse msg.SignatureResponse
_, err := msg.Codec.Unmarshal(responseBytes, &sigResponse)
if err != nil {
return blsSignatureBuf{}, err
}
return sigResponse.Signature, nil
}
}
7 changes: 5 additions & 2 deletions signature-aggregator/aggregator/aggregator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package aggregator

import (
"testing"
"time"

"github.com/ava-labs/avalanchego/ids"
"github.com/ava-labs/avalanchego/message"
Expand Down Expand Up @@ -43,6 +44,8 @@ func instantiateAggregator(t *testing.T) (
1024,
sigAggMetrics,
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),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the purpose of the -1 minute?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the etnaTime parameter. This would make the aggregator in this test run using the post-etna code paths since in this case Etna was activated a minute ago

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A comment clarifying this would be helpful

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

)
require.Equal(t, err, nil)
return aggregator, mockNetwork
Expand All @@ -61,7 +64,7 @@ func TestCreateSignedMessageFailsWithNoValidators(t *testing.T) {
},
nil,
)
_, err = aggregator.CreateSignedMessage(msg, ids.Empty, 80)
_, err = aggregator.CreateSignedMessage(msg, nil, ids.Empty, 80)
require.ErrorContains(t, err, "no signatures")
}

Expand All @@ -78,7 +81,7 @@ func TestCreateSignedMessageFailsWithoutSufficientConnectedStake(t *testing.T) {
},
nil,
)
_, err = aggregator.CreateSignedMessage(msg, ids.Empty, 80)
_, err = aggregator.CreateSignedMessage(msg, nil, ids.Empty, 80)
require.ErrorContains(
t,
err,
Expand Down
Loading