Skip to content

Commit

Permalink
Update eigensdk to 0.1.7 (#243)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hyodar authored Jun 6, 2024
1 parent 52ec636 commit 50a6bdd
Show file tree
Hide file tree
Showing 7 changed files with 134 additions and 29 deletions.
7 changes: 4 additions & 3 deletions aggregator/aggregator.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"errors"
"math/big"
"strings"
"sync"
"time"

Expand All @@ -14,7 +15,7 @@ import (
"github.com/Layr-Labs/eigensdk-go/metrics"
"github.com/Layr-Labs/eigensdk-go/services/avsregistry"
blsagg "github.com/Layr-Labs/eigensdk-go/services/bls_aggregation"
oppubkeysserv "github.com/Layr-Labs/eigensdk-go/services/operatorpubkeys"
opinfoserv "github.com/Layr-Labs/eigensdk-go/services/operatorsinfo"
"github.com/Layr-Labs/eigensdk-go/signerv2"
eigentypes "github.com/Layr-Labs/eigensdk-go/types"
"github.com/prometheus/client_golang/prometheus"
Expand Down Expand Up @@ -200,7 +201,7 @@ func NewAggregator(ctx context.Context, config *config.Config, logger logging.Lo
return nil, err
}

operatorPubkeysService := oppubkeysserv.NewOperatorPubkeysServiceInMemory(ctx, clients.AvsRegistryChainSubscriber, clients.AvsRegistryChainReader, logger)
operatorPubkeysService := opinfoserv.NewOperatorsInfoServiceInMemory(ctx, clients.AvsRegistryChainSubscriber, clients.AvsRegistryChainReader, logger)
avsRegistryService := avsregistry.NewAvsRegistryServiceChainCaller(avsReader, operatorPubkeysService, logger)
taskBlsAggregationService := blsagg.NewBlsAggregatorService(avsRegistryService, logger)
stateRootUpdateBlsAggregationService := NewMessageBlsAggregatorService(avsRegistryService, clients.EthHttpClient, logger)
Expand Down Expand Up @@ -325,7 +326,7 @@ func (agg *Aggregator) Close() error {
func (agg *Aggregator) sendAggregatedResponseToContract(blsAggServiceResp blsagg.BlsAggregationServiceResponse) {
if blsAggServiceResp.Err != nil {
agg.aggregatorListener.IncErroredSubmissions()
if errors.Is(blsAggServiceResp.Err, blsagg.TaskExpiredError) {
if strings.Contains(blsAggServiceResp.Err.Error(), "expired") {
agg.aggregatorListener.IncExpiredTasks()
}

Expand Down
8 changes: 4 additions & 4 deletions aggregator/message_blsagg.go
Original file line number Diff line number Diff line change
Expand Up @@ -347,14 +347,14 @@ func (mbas *MessageBlsAggregatorService) handleSignedMessageDigest(signedMessage
if !ok {
digestAggregatedOperators = AggregatedOperators{
// we've already verified that the operator is part of the task's quorum, so we don't need checks here
signersApkG2: bls.NewZeroG2Point().Add(validationInfo.operatorsAvsStateDict[signedMessageDigest.OperatorId].Pubkeys.G2Pubkey),
signersApkG2: bls.NewZeroG2Point().Add(validationInfo.operatorsAvsStateDict[signedMessageDigest.OperatorId].OperatorInfo.Pubkeys.G2Pubkey),
signersAggSigG1: signedMessageDigest.BlsSignature,
signersOperatorIdsSet: map[eigentypes.OperatorId]bool{signedMessageDigest.OperatorId: true},
signersTotalStakePerQuorum: validationInfo.operatorsAvsStateDict[signedMessageDigest.OperatorId].StakePerQuorum,
}
} else {
digestAggregatedOperators.signersAggSigG1.Add(signedMessageDigest.BlsSignature)
digestAggregatedOperators.signersApkG2.Add(validationInfo.operatorsAvsStateDict[signedMessageDigest.OperatorId].Pubkeys.G2Pubkey)
digestAggregatedOperators.signersApkG2.Add(validationInfo.operatorsAvsStateDict[signedMessageDigest.OperatorId].OperatorInfo.Pubkeys.G2Pubkey)
digestAggregatedOperators.signersOperatorIdsSet[signedMessageDigest.OperatorId] = true
for quorumNum, stake := range validationInfo.operatorsAvsStateDict[signedMessageDigest.OperatorId].StakePerQuorum {
if _, ok := digestAggregatedOperators.signersTotalStakePerQuorum[quorumNum]; !ok {
Expand Down Expand Up @@ -475,7 +475,7 @@ func (mbas *MessageBlsAggregatorService) verifySignature(
}

// 0. verify that the msg actually came from the correct operator
operatorG2Pubkey := operatorsAvsStateDict[signedMessageDigest.OperatorId].Pubkeys.G2Pubkey
operatorG2Pubkey := operatorsAvsStateDict[signedMessageDigest.OperatorId].OperatorInfo.Pubkeys.G2Pubkey
if operatorG2Pubkey == nil {
mbas.logger.Fatal("Operator G2 pubkey not found")
}
Expand Down Expand Up @@ -527,7 +527,7 @@ func getG1PubkeysOfNonSigners(signersOperatorIdsSet map[eigentypes.OperatorId]bo
nonSignersG1Pubkeys := []*bls.G1Point{}
for operatorId, operator := range operatorAvsStateDict {
if _, operatorSigned := signersOperatorIdsSet[operatorId]; !operatorSigned {
nonSignersG1Pubkeys = append(nonSignersG1Pubkeys, operator.Pubkeys.G1Pubkey)
nonSignersG1Pubkeys = append(nonSignersG1Pubkeys, operator.OperatorInfo.Pubkeys.G1Pubkey)
}
}
return nonSignersG1Pubkeys
Expand Down
15 changes: 15 additions & 0 deletions core/chainio/mocks/avs_reader.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

55 changes: 35 additions & 20 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,52 @@ go 1.21
toolchain go1.21.0

require (
github.com/Layr-Labs/eigensdk-go v0.1.4
github.com/ethereum/go-ethereum v1.13.14
github.com/Layr-Labs/eigensdk-go v0.1.7
github.com/ethereum/go-ethereum v1.14.0
github.com/gorilla/mux v1.8.1
github.com/hashicorp/golang-lru/v2 v2.0.7
github.com/near/borsh-go v0.3.1
github.com/near/rollup-data-availability v0.2.4-0.20240327150603-b004cd803551
github.com/pokt-network/smt v0.9.2
github.com/prometheus/client_golang v1.19.0
github.com/stretchr/testify v1.9.0
github.com/testcontainers/testcontainers-go v0.29.1
github.com/testcontainers/testcontainers-go v0.30.0
github.com/urfave/cli v1.22.14
go.uber.org/mock v0.4.0
golang.org/x/crypto v0.18.0
golang.org/x/crypto v0.22.0
gorm.io/driver/sqlite v1.5.5
gorm.io/gorm v1.25.7
)

require (
github.com/aws/aws-sdk-go-v2 v1.26.1 // indirect
github.com/aws/aws-sdk-go-v2/config v1.27.11 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.17.11 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.1 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.5 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.5 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.2 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.7 // indirect
github.com/aws/aws-sdk-go-v2/service/kms v1.31.0 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.20.5 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.23.4 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.28.6 // indirect
github.com/aws/smithy-go v1.20.2 // indirect
github.com/distribution/reference v0.5.0 // indirect
github.com/felixge/httpsnoop v1.0.3 // indirect
github.com/go-logr/logr v1.2.4 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/golang-jwt/jwt v3.2.2+incompatible // indirect
github.com/jinzhu/inflection v1.0.0 // indirect
github.com/jinzhu/now v1.1.5 // indirect
github.com/lmittmann/tint v1.0.4 // indirect
github.com/mattn/go-sqlite3 v1.14.22 // indirect
github.com/moby/sys/user v0.1.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.45.0 // indirect
go.opentelemetry.io/otel v1.19.0 // indirect
go.opentelemetry.io/otel/metric v1.19.0 // indirect
go.opentelemetry.io/otel/trace v1.19.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect
go.opentelemetry.io/otel v1.24.0 // indirect
go.opentelemetry.io/otel/metric v1.24.0 // indirect
go.opentelemetry.io/otel/trace v1.24.0 // indirect
)

require (
Expand All @@ -54,18 +69,18 @@ require (
github.com/containerd/log v0.1.0 // indirect
github.com/cpuguy83/dockercfg v0.3.1 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.3 // indirect
github.com/crate-crypto/go-kzg-4844 v0.7.0 // indirect
github.com/crate-crypto/go-kzg-4844 v1.0.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/deckarep/golang-set/v2 v2.6.0 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect
github.com/docker/docker v25.0.3+incompatible // indirect
github.com/docker/docker v25.0.5+incompatible // indirect
github.com/docker/go-connections v0.5.0
github.com/docker/go-units v0.5.0 // indirect
github.com/ethereum/c-kzg-4844 v0.4.0 // indirect
github.com/ethereum/c-kzg-4844 v1.0.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/go-ole/go-ole v1.3.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/gorilla/websocket v1.5.1 // indirect
github.com/holiman/uint256 v1.2.4 // indirect
Expand Down Expand Up @@ -99,14 +114,14 @@ require (
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.27.0 // indirect
golang.org/x/exp v0.0.0-20240119083558-1b970713d09a // indirect
golang.org/x/mod v0.16.0 // indirect
golang.org/x/net v0.20.0 // indirect
golang.org/x/sync v0.6.0 // indirect
golang.org/x/sys v0.16.0 // indirect
golang.org/x/tools v0.17.0 // indirect
golang.org/x/mod v0.17.0 // indirect
golang.org/x/net v0.24.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/sys v0.19.0 // indirect
golang.org/x/tools v0.20.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98 // indirect
google.golang.org/grpc v1.58.3 // indirect
google.golang.org/protobuf v1.32.0 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
rsc.io/tmplfunc v0.0.3 // indirect
)
Expand Down
Loading

0 comments on commit 50a6bdd

Please sign in to comment.