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

Use fixed version of sdk #103

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open
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: 14 additions & 0 deletions aggregator/aggregator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,20 @@ func (mr *MockBlsAggregationServiceMockRecorder) InitializeNewTask(arg0, arg1, a
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InitializeNewTask", reflect.TypeOf((*MockBlsAggregationService)(nil).InitializeNewTask), arg0, arg1, arg2, arg3, arg4)
}

// InitializeNewTask mocks base method.
func (m *MockBlsAggregationService) InitializeNewTaskWithWindow(arg0, arg1 uint32, arg2 sdktypes.QuorumNums, arg3 sdktypes.QuorumThresholdPercentages, arg4 time.Duration, window_duration time.Duration) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "InitializeNewTask", arg0, arg1, arg2, arg3, arg4)
ret0, _ := ret[0].(error)
return ret0
}

// InitializeNewTask indicates an expected call of InitializeNewTask.
func (mr *MockBlsAggregationServiceMockRecorder) InitializeNewTaskWithWindow(arg0, arg1, arg2, arg3, arg4 any, window_duration time.Duration) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InitializeNewTask", reflect.TypeOf((*MockBlsAggregationService)(nil).InitializeNewTask), arg0, arg1, arg2, arg3, arg4)
}

// ProcessNewSignature mocks base method.
func (m *MockBlsAggregationService) ProcessNewSignature(arg0 context.Context, arg1 uint32, arg2 interface{}, arg3 *bls.Signature, arg4 sdktypes.Bytes32) error {
m.ctrl.T.Helper()
Expand Down
4 changes: 2 additions & 2 deletions cli/actions/deposit_into_strategy.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"log"
"math/big"

sdkutils "github.com/Layr-Labs/eigensdk-go/utils"
commonincredible "github.com/Layr-Labs/incredible-squaring-avs/common"
"github.com/Layr-Labs/incredible-squaring-avs/core/config"
"github.com/Layr-Labs/incredible-squaring-avs/operator"
"github.com/Layr-Labs/incredible-squaring-avs/types"
Expand All @@ -18,7 +18,7 @@ func DepositIntoStrategy(ctx *cli.Context) error {

configPath := ctx.GlobalString(config.ConfigFileFlag.Name)
nodeConfig := types.NodeConfig{}
err := sdkutils.ReadYamlConfig(configPath, &nodeConfig)
err := commonincredible.ReadYamlConfig(configPath, &nodeConfig)
if err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions cli/actions/print_operator_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"encoding/json"
"log"

sdkutils "github.com/Layr-Labs/eigensdk-go/utils"
commonincredible "github.com/Layr-Labs/incredible-squaring-avs/common"
"github.com/Layr-Labs/incredible-squaring-avs/core/config"
"github.com/Layr-Labs/incredible-squaring-avs/operator"
"github.com/Layr-Labs/incredible-squaring-avs/types"
Expand All @@ -15,7 +15,7 @@ func PrintOperatorStatus(ctx *cli.Context) error {

configPath := ctx.GlobalString(config.ConfigFileFlag.Name)
nodeConfig := types.NodeConfig{}
err := sdkutils.ReadYamlConfig(configPath, &nodeConfig)
err := commonincredible.ReadYamlConfig(configPath, &nodeConfig)
if err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions cli/actions/register_operator_with_avs.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"os"

sdkecdsa "github.com/Layr-Labs/eigensdk-go/crypto/ecdsa"
sdkutils "github.com/Layr-Labs/eigensdk-go/utils"
commonincredible "github.com/Layr-Labs/incredible-squaring-avs/common"
"github.com/Layr-Labs/incredible-squaring-avs/core/config"
"github.com/Layr-Labs/incredible-squaring-avs/operator"
"github.com/Layr-Labs/incredible-squaring-avs/types"
Expand All @@ -17,7 +17,7 @@ func RegisterOperatorWithAvs(ctx *cli.Context) error {

configPath := ctx.GlobalString(config.ConfigFileFlag.Name)
nodeConfig := types.NodeConfig{}
err := sdkutils.ReadYamlConfig(configPath, &nodeConfig)
err := commonincredible.ReadYamlConfig(configPath, &nodeConfig)
if err != nil {
return err
}
Expand Down
7 changes: 4 additions & 3 deletions cli/actions/register_operator_with_eigenlayer.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ package actions

import (
"encoding/json"
"github.com/urfave/cli"
"log"

sdkutils "github.com/Layr-Labs/eigensdk-go/utils"
"github.com/urfave/cli"

commonincredible "github.com/Layr-Labs/incredible-squaring-avs/common"
"github.com/Layr-Labs/incredible-squaring-avs/core/config"
"github.com/Layr-Labs/incredible-squaring-avs/operator"
"github.com/Layr-Labs/incredible-squaring-avs/types"
Expand All @@ -15,7 +16,7 @@ func RegisterOperatorWithEigenlayer(ctx *cli.Context) error {

configPath := ctx.GlobalString(config.ConfigFileFlag.Name)
nodeConfig := types.NodeConfig{}
err := sdkutils.ReadYamlConfig(configPath, &nodeConfig)
err := commonincredible.ReadYamlConfig(configPath, &nodeConfig)
if err != nil {
return err
}
Expand Down
50 changes: 50 additions & 0 deletions common/read_config.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
package common

import (
"encoding/json"
"errors"
"log"
"os"
"path/filepath"

"gopkg.in/yaml.v3"
)

func ReadYamlConfig(path string, o interface{}) error {
if _, err := os.Stat(path); errors.Is(err, os.ErrNotExist) {
log.Fatal("Path ", path, " does not exist")
}
b, err := ReadFile(path)
if err != nil {
return err
}

err = yaml.Unmarshal(b, o)
if err != nil {
log.Fatalf("unable to parse file with error %#v", err)
}

return nil
}

func ReadFile(path string) ([]byte, error) {
b, err := os.ReadFile(filepath.Clean(path))
if err != nil {
return nil, err
}
return b, nil
}

func ReadJsonConfig(path string, o interface{}) error {
b, err := ReadFile(path)
if err != nil {
return err
}

err = json.Unmarshal(b, o)
if err != nil {
log.Fatalf("unable to parse file with error %#v", err)
}

return nil
}
5 changes: 3 additions & 2 deletions core/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"github.com/Layr-Labs/eigensdk-go/crypto/bls"
sdklogging "github.com/Layr-Labs/eigensdk-go/logging"
"github.com/Layr-Labs/eigensdk-go/signerv2"
commonincredible "github.com/Layr-Labs/incredible-squaring-avs/common"
"github.com/ethereum/go-ethereum/ethclient"

sdkutils "github.com/Layr-Labs/eigensdk-go/utils"
Expand Down Expand Up @@ -69,15 +70,15 @@ func NewConfig(ctx *cli.Context) (*Config, error) {
var configRaw ConfigRaw
configFilePath := ctx.GlobalString(ConfigFileFlag.Name)
if configFilePath != "" {
sdkutils.ReadYamlConfig(configFilePath, &configRaw)
commonincredible.ReadYamlConfig(configFilePath, &configRaw)
}

var credibleSquaringDeploymentRaw IncredibleSquaringDeploymentRaw
credibleSquaringDeploymentFilePath := ctx.GlobalString(CredibleSquaringDeploymentFileFlag.Name)
if _, err := os.Stat(credibleSquaringDeploymentFilePath); errors.Is(err, os.ErrNotExist) {
panic("Path " + credibleSquaringDeploymentFilePath + " does not exist")
}
sdkutils.ReadJsonConfig(credibleSquaringDeploymentFilePath, &credibleSquaringDeploymentRaw)
commonincredible.ReadJsonConfig(credibleSquaringDeploymentFilePath, &credibleSquaringDeploymentRaw)

logger, err := sdklogging.NewZapLogger(configRaw.Environment)
if err != nil {
Expand Down
54 changes: 24 additions & 30 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
module github.com/Layr-Labs/incredible-squaring-avs

go 1.21
go 1.22

toolchain go1.21.0
toolchain go1.23.4

require (
github.com/Layr-Labs/eigensdk-go v0.1.12
github.com/ethereum/go-ethereum v1.14.0
github.com/Layr-Labs/eigensdk-go v0.2.0-beta.1
github.com/ethereum/go-ethereum v1.14.12
github.com/prometheus/client_golang v1.19.0
github.com/stretchr/testify v1.9.0
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.22.0
gopkg.in/yaml.v3 v3.0.1
)

require (
dario.cat/mergo v1.0.0 // indirect
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
github.com/DataDog/zstd v1.5.2 // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/Microsoft/hcsshim v0.11.4 // indirect
github.com/StackExchange/wmi v1.2.1 // indirect
github.com/VictoriaMetrics/fastcache v1.12.1 // indirect
github.com/VictoriaMetrics/fastcache v1.12.2 // indirect
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
Expand All @@ -38,13 +39,13 @@ require (
github.com/aws/aws-sdk-go-v2/service/sts v1.28.6 // indirect
github.com/aws/smithy-go v1.20.2 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bits-and-blooms/bitset v1.10.0 // indirect
github.com/btcsuite/btcd/btcec/v2 v2.2.0 // indirect
github.com/bits-and-blooms/bitset v1.13.0 // indirect
github.com/cenkalti/backoff/v4 v4.2.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/cockroachdb/errors v1.11.1 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/cockroachdb/errors v1.11.3 // indirect
github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce // indirect
github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect
github.com/cockroachdb/pebble v1.1.0 // indirect
github.com/cockroachdb/pebble v1.1.2 // indirect
github.com/cockroachdb/redact v1.1.5 // indirect
github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect
github.com/consensys/bavard v0.1.13 // indirect
Expand All @@ -53,37 +54,35 @@ 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.2 // indirect
github.com/crate-crypto/go-ipa v0.0.0-20231025140028-3c0104f4b233 // indirect
github.com/crate-crypto/go-ipa v0.0.0-20240223125850-b1e8a79f509c // 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.1.0 // indirect
github.com/deckarep/golang-set/v2 v2.6.0 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect
github.com/distribution/reference v0.5.0 // indirect
github.com/docker/docker v25.0.5+incompatible // indirect
github.com/docker/docker v25.0.6+incompatible // indirect
github.com/docker/go-connections v0.5.0 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/ethereum/c-kzg-4844 v1.0.0 // indirect
github.com/ethereum/go-verkle v0.1.1-0.20240829091221-dffa7562dbe9 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/fjl/memsize v0.0.2 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff // indirect
github.com/gballet/go-verkle v0.1.1-0.20231031103413-a67434b50f46 // indirect
github.com/getsentry/sentry-go v0.18.0 // indirect
github.com/getsentry/sentry-go v0.27.0 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-ole/go-ole v1.3.0 // indirect
github.com/gofrs/flock v0.8.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-jwt/jwt v3.2.2+incompatible // indirect
github.com/golang-jwt/jwt/v4 v4.5.0 // indirect
github.com/golang-jwt/jwt/v4 v4.5.1 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/gorilla/websocket v1.4.2 // indirect
github.com/hashicorp/go-bexpr v0.1.10 // indirect
github.com/holiman/billy v0.0.0-20240216141850-2abb0c79d3c4 // indirect
github.com/holiman/bloomfilter/v2 v2.0.3 // indirect
github.com/holiman/uint256 v1.2.4 // indirect
github.com/holiman/uint256 v1.3.1 // indirect
github.com/huin/goupnp v1.3.0 // indirect
github.com/jackpal/go-nat-pmp v1.0.2 // indirect
github.com/klauspost/compress v1.16.0 // indirect
Expand All @@ -93,7 +92,7 @@ require (
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.17 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.13 // indirect
github.com/mitchellh/mapstructure v1.4.1 // indirect
github.com/mitchellh/pointerstructure v1.2.0 // indirect
Expand Down Expand Up @@ -121,12 +120,10 @@ require (
github.com/shoenig/go-m1cpu v0.1.6 // indirect
github.com/shurcooL/graphql v0.0.0-20230722043721-ed46e5a46466 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/status-im/keycard-go v0.2.0 // indirect
github.com/supranational/blst v0.3.11 // indirect
github.com/supranational/blst v0.3.13 // indirect
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect
github.com/tklauser/go-sysconf v0.3.12 // indirect
github.com/tklauser/numcpus v0.6.1 // indirect
github.com/tyler-smith/go-bip39 v1.1.0 // indirect
github.com/urfave/cli/v2 v2.27.1 // indirect
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
github.com/yusufpapurcu/wmi v1.2.3 // indirect
Expand All @@ -137,17 +134,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-20231110203233-9a3e6036ecaa // indirect
golang.org/x/mod v0.17.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/sys v0.19.0 // indirect
golang.org/x/sys v0.22.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/time v0.5.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.33.0 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
google.golang.org/protobuf v1.34.2 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
rsc.io/tmplfunc v0.0.3 // indirect
)

Expand Down
Loading
Loading