diff --git a/aggregator/aggregator.go b/aggregator/aggregator.go index 0b5d2605..e3f3116a 100644 --- a/aggregator/aggregator.go +++ b/aggregator/aggregator.go @@ -7,11 +7,14 @@ import ( "time" "github.com/Layr-Labs/eigensdk-go/logging" + "github.com/ethereum/go-ethereum/accounts/abi" + "golang.org/x/crypto/sha3" "github.com/Layr-Labs/eigensdk-go/chainio/clients" sdkclients "github.com/Layr-Labs/eigensdk-go/chainio/clients" "github.com/Layr-Labs/eigensdk-go/services/avsregistry" blsagg "github.com/Layr-Labs/eigensdk-go/services/bls_aggregation" + "github.com/Layr-Labs/eigensdk-go/services/operatorsinfo" oprsinfoserv "github.com/Layr-Labs/eigensdk-go/services/operatorsinfo" sdktypes "github.com/Layr-Labs/eigensdk-go/types" "github.com/Layr-Labs/incredible-squaring-avs/aggregator/types" @@ -105,9 +108,47 @@ func NewAggregator(c *config.Config) (*Aggregator, error) { return nil, err } - operatorPubkeysService := oprsinfoserv.NewOperatorsInfoServiceInMemory(context.Background(), clients.AvsRegistryChainSubscriber, clients.AvsRegistryChainReader, c.Logger) + operatorPubkeysService := oprsinfoserv.NewOperatorsInfoServiceInMemory(context.Background(), clients.AvsRegistryChainSubscriber, clients.AvsRegistryChainReader, nil, operatorsinfo.Opts{}, c.Logger) + + // This is the same hash function used by the operator to hash the task response before signing it. + hashFunction := func(taskResponse sdktypes.TaskResponse) (sdktypes.TaskResponseDigest, error) { + // The order here has to match the field ordering of cstaskmanager.IIncredibleSquaringTaskManagerTaskResponse + taskResponseType, err := abi.NewType("tuple", "", []abi.ArgumentMarshaling{ + { + Name: "referenceTaskIndex", + Type: "uint32", + }, + { + Name: "numberSquared", + Type: "uint256", + }, + }) + if err != nil { + c.Logger.Error("Error creating taskResponseType") + return sdktypes.TaskResponseDigest{}, err + } + arguments := abi.Arguments{ + { + Type: taskResponseType, + }, + } + + encodeTaskResponseByte, err := arguments.Pack(taskResponse) + if err != nil { + c.Logger.Error("Error Packing taskResponse", err) + return sdktypes.TaskResponseDigest{}, err + } + + var taskResponseDigest [32]byte + hasher := sha3.NewLegacyKeccak256() + hasher.Write(encodeTaskResponseByte) + copy(taskResponseDigest[:], hasher.Sum(nil)[:32]) + + return taskResponseDigest, nil + } + avsRegistryService := avsregistry.NewAvsRegistryServiceChainCaller(avsReader, operatorPubkeysService, c.Logger) - blsAggregationService := blsagg.NewBlsAggregatorService(avsRegistryService, c.Logger) + blsAggregationService := blsagg.NewBlsAggregatorService(avsRegistryService, hashFunction, c.Logger) return &Aggregator{ logger: c.Logger, diff --git a/aggregator/aggregator_test.go b/aggregator/aggregator_test.go index 8f5bae63..b97b42f1 100644 --- a/aggregator/aggregator_test.go +++ b/aggregator/aggregator_test.go @@ -3,6 +3,7 @@ package aggregator import ( "context" "math/big" + "reflect" "testing" "time" @@ -13,8 +14,9 @@ import ( "go.uber.org/mock/gomock" "github.com/Layr-Labs/eigensdk-go/crypto/bls" - sdklogging "github.com/Layr-Labs/eigensdk-go/logging" - blsaggservmock "github.com/Layr-Labs/eigensdk-go/services/mocks/blsagg" + blsagg "github.com/Layr-Labs/eigensdk-go/services/bls_aggregation" + + "github.com/Layr-Labs/eigensdk-go/testutils" sdktypes "github.com/Layr-Labs/eigensdk-go/types" "github.com/Layr-Labs/incredible-squaring-avs/aggregator/mocks" @@ -27,6 +29,71 @@ var MOCK_OPERATOR_ID = [32]byte{207, 73, 226, 221, 104, 100, 123, 41, 192, 3, 9, var MOCK_OPERATOR_STAKE = big.NewInt(100) var MOCK_OPERATOR_BLS_PRIVATE_KEY_STRING = "50" +// MockBlsAggregationService is a mock of BlsAggregationService interface. +type MockBlsAggregationService struct { + ctrl *gomock.Controller + recorder *MockBlsAggregationServiceMockRecorder +} + +// MockBlsAggregationServiceMockRecorder is the mock recorder for MockBlsAggregationService. +type MockBlsAggregationServiceMockRecorder struct { + mock *MockBlsAggregationService +} + +// NewMockBlsAggregationService creates a new mock instance. +func NewMockBlsAggregationService(ctrl *gomock.Controller) *MockBlsAggregationService { + mock := &MockBlsAggregationService{ctrl: ctrl} + mock.recorder = &MockBlsAggregationServiceMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockBlsAggregationService) EXPECT() *MockBlsAggregationServiceMockRecorder { + return m.recorder +} + +// GetResponseChannel mocks base method. +func (m *MockBlsAggregationService) GetResponseChannel() <-chan blsagg.BlsAggregationServiceResponse { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetResponseChannel") + ret0, _ := ret[0].(<-chan blsagg.BlsAggregationServiceResponse) + return ret0 +} + +// GetResponseChannel indicates an expected call of GetResponseChannel. +func (mr *MockBlsAggregationServiceMockRecorder) GetResponseChannel() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetResponseChannel", reflect.TypeOf((*MockBlsAggregationService)(nil).GetResponseChannel)) +} + +// InitializeNewTask mocks base method. +func (m *MockBlsAggregationService) InitializeNewTask(arg0, arg1 uint32, arg2 sdktypes.QuorumNums, arg3 sdktypes.QuorumThresholdPercentages, arg4 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) InitializeNewTask(arg0, arg1, arg2, arg3, arg4 any) *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() + ret := m.ctrl.Call(m, "ProcessNewSignature", arg0, arg1, arg2, arg3, arg4) + ret0, _ := ret[0].(error) + return ret0 +} + +// ProcessNewSignature indicates an expected call of ProcessNewSignature. +func (mr *MockBlsAggregationServiceMockRecorder) ProcessNewSignature(arg0, arg1, arg2, arg3, arg4 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ProcessNewSignature", reflect.TypeOf((*MockBlsAggregationService)(nil).ProcessNewSignature), arg0, arg1, arg2, arg3, arg4) +} + type MockTask struct { TaskNum uint32 BlockNumber uint32 @@ -78,10 +145,10 @@ func TestSendNewTask(t *testing.T) { func createMockAggregator( mockCtrl *gomock.Controller, operatorPubkeyDict map[sdktypes.OperatorId]types.OperatorInfo, -) (*Aggregator, *chainiomocks.MockAvsWriterer, *blsaggservmock.MockBlsAggregationService, error) { - logger := sdklogging.NewNoopLogger() +) (*Aggregator, *chainiomocks.MockAvsWriterer, *MockBlsAggregationService, error) { + logger := testutils.GetTestLogger() mockAvsWriter := chainiomocks.NewMockAvsWriterer(mockCtrl) - mockBlsAggregationService := blsaggservmock.NewMockBlsAggregationService(mockCtrl) + mockBlsAggregationService := NewMockBlsAggregationService(mockCtrl) aggregator := &Aggregator{ logger: logger, diff --git a/aggregator/rpc_server.go b/aggregator/rpc_server.go index c7027bbe..a07f5e81 100644 --- a/aggregator/rpc_server.go +++ b/aggregator/rpc_server.go @@ -65,7 +65,7 @@ func (agg *Aggregator) ProcessSignedTaskResponse(signedTaskResponse *SignedTaskR agg.taskResponsesMu.Unlock() err = agg.blsAggregationService.ProcessNewSignature( - context.Background(), taskIndex, taskResponseDigest, + context.Background(), taskIndex, signedTaskResponse.TaskResponse, &signedTaskResponse.BlsSignature, signedTaskResponse.OperatorId, ) return err diff --git a/aggregator/rpc_server_test.go b/aggregator/rpc_server_test.go index 6de6c99f..5997a1ef 100644 --- a/aggregator/rpc_server_test.go +++ b/aggregator/rpc_server_test.go @@ -48,13 +48,11 @@ func TestProcessSignedTaskResponse(t *testing.T) { NumberToSquare: NUMBER_TO_SQUARE, }, *MOCK_OPERATOR_KEYPAIR) assert.Nil(t, err) - signedTaskResponseDigest, err := core.GetTaskResponseDigest(&signedTaskResponse.TaskResponse) - assert.Nil(t, err) // TODO(samlaf): is this the right way to test writing to external service? // or is there some wisdom to "don't mock 3rd party code"? // see https://hynek.me/articles/what-to-mock-in-5-mins/ - mockBlsAggServ.EXPECT().ProcessNewSignature(context.Background(), TASK_INDEX, signedTaskResponseDigest, + mockBlsAggServ.EXPECT().ProcessNewSignature(context.Background(), TASK_INDEX, signedTaskResponse.TaskResponse, &signedTaskResponse.BlsSignature, signedTaskResponse.OperatorId) err = aggregator.ProcessSignedTaskResponse(signedTaskResponse, nil) assert.Nil(t, err) diff --git a/challenger/challenger.go b/challenger/challenger.go index 0812e915..f11dfd37 100644 --- a/challenger/challenger.go +++ b/challenger/challenger.go @@ -5,20 +5,25 @@ import ( "context" "math/big" - ethclient "github.com/Layr-Labs/eigensdk-go/chainio/clients/eth" "github.com/Layr-Labs/eigensdk-go/logging" "github.com/Layr-Labs/incredible-squaring-avs/common" "github.com/Layr-Labs/incredible-squaring-avs/core/config" "github.com/ethereum/go-ethereum/accounts/abi" + commoneth "github.com/ethereum/go-ethereum/common" + typeseth "github.com/ethereum/go-ethereum/core/types" "github.com/Layr-Labs/incredible-squaring-avs/challenger/types" cstaskmanager "github.com/Layr-Labs/incredible-squaring-avs/contracts/bindings/IncredibleSquaringTaskManager" "github.com/Layr-Labs/incredible-squaring-avs/core/chainio" ) +type ChallengerClient interface { + TransactionByHash(ctx context.Context, hash commoneth.Hash) (tx *typeseth.Transaction, isPending bool, err error) +} + type Challenger struct { logger logging.Logger - ethClient ethclient.Client + ethClient ChallengerClient avsReader chainio.AvsReaderer avsWriter chainio.AvsWriterer avsSubscriber chainio.AvsSubscriberer @@ -47,10 +52,10 @@ func NewChallenger(c *config.Config) (*Challenger, error) { } challenger := &Challenger{ - ethClient: c.EthHttpClient, logger: c.Logger, - avsWriter: avsWriter, + ethClient: &c.EthHttpClient, avsReader: avsReader, + avsWriter: avsWriter, avsSubscriber: avsSubscriber, tasks: make(map[uint32]cstaskmanager.IIncredibleSquaringTaskManagerTask), taskResponses: make(map[uint32]types.TaskResponseData), diff --git a/challenger/challenger_test.go b/challenger/challenger_test.go index e1447d73..e3f6db6d 100644 --- a/challenger/challenger_test.go +++ b/challenger/challenger_test.go @@ -3,16 +3,17 @@ package challenger import ( "context" "math/big" + "reflect" "testing" - mockethclient "github.com/Layr-Labs/eigensdk-go/chainio/mocks" - sdklogging "github.com/Layr-Labs/eigensdk-go/logging" + "github.com/Layr-Labs/eigensdk-go/testutils" aggtypes "github.com/Layr-Labs/incredible-squaring-avs/aggregator/types" "github.com/Layr-Labs/incredible-squaring-avs/challenger/mocks" chtypes "github.com/Layr-Labs/incredible-squaring-avs/challenger/types" cstaskmanager "github.com/Layr-Labs/incredible-squaring-avs/contracts/bindings/IncredibleSquaringTaskManager" chainiomocks "github.com/Layr-Labs/incredible-squaring-avs/core/chainio/mocks" "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" gethtypes "github.com/ethereum/go-ethereum/core/types" "github.com/stretchr/testify/assert" "go.uber.org/mock/gomock" @@ -22,6 +23,66 @@ var MOCK_OPERATOR_ID = [32]byte{207, 73, 226, 221, 104, 100, 123, 41, 192, 3, 9, var MOCK_OPERATOR_STAKE = big.NewInt(100) var MOCK_OPERATOR_BLS_PRIVATE_KEY_STRING = "50" +const ( + TransactionHash = "0x0000000000000000000000000000000000000000000000000000000000001234" + TransactionNashNotInFake = "0xabcd" + BlockNumber = 1234 +) + +// MockEthClient is a mock of Client interface. +type MockEthClient struct { + ctrl *gomock.Controller + recorder *MockEthClientMockRecorder +} + +// MockEthClientMockRecorder is the mock recorder for MockEthClient. +type MockEthClientMockRecorder struct { + mock *MockEthClient +} + +// NewMockEthClient creates a new mock instance. +func NewMockEthClient(ctrl *gomock.Controller) *MockEthClient { + mock := &MockEthClient{ctrl: ctrl} + mock.recorder = &MockEthClientMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockEthClient) EXPECT() *MockEthClientMockRecorder { + return m.recorder +} + +// BalanceAt mocks base method. +func (m *MockEthClient) BalanceAt(arg0 context.Context, arg1 common.Address, arg2 *big.Int) (*big.Int, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "BalanceAt", arg0, arg1, arg2) + ret0, _ := ret[0].(*big.Int) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// BalanceAt indicates an expected call of BalanceAt. +func (mr *MockEthClientMockRecorder) BalanceAt(arg0, arg1, arg2 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BalanceAt", reflect.TypeOf((*MockEthClient)(nil).BalanceAt), arg0, arg1, arg2) +} + +// TransactionByHash indicates an expected call of TransactionByHash. +func (mr *MockEthClientMockRecorder) TransactionByHash(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TransactionByHash", reflect.TypeOf((*MockEthClient)(nil).TransactionByHash), arg0, arg1) +} + +// TransactionByHash mocks base method. +func (m *MockEthClient) TransactionByHash(arg0 context.Context, arg1 common.Hash) (*types.Transaction, bool, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "TransactionByHash", arg0, arg1) + ret0, _ := ret[0].(*types.Transaction) + ret1, _ := ret[1].(bool) + ret2, _ := ret[2].(error) + return ret0, ret1, ret2 +} + // @samlaf I tried pulling the MockTask struct froma ggregator_test but getting error: "undefined: aggregator.MockTask" type MockTask struct { TaskNum uint32 @@ -170,12 +231,13 @@ func TestProcessTaskResponseLog(t *testing.T) { } -func createMockChallenger(mockCtrl *gomock.Controller) (*Challenger, *chainiomocks.MockAvsWriterer, *chainiomocks.MockAvsReaderer, *chainiomocks.MockAvsSubscriberer, *mockethclient.MockEthClient, error) { - logger := sdklogging.NewNoopLogger() +func createMockChallenger(mockCtrl *gomock.Controller) (*Challenger, *chainiomocks.MockAvsWriterer, *chainiomocks.MockAvsReaderer, *chainiomocks.MockAvsSubscriberer, *MockEthClient, error) { + logger := testutils.GetTestLogger() mockAvsWriter := chainiomocks.NewMockAvsWriterer(mockCtrl) mockAvsReader := chainiomocks.NewMockAvsReaderer(mockCtrl) mockAvsSubscriber := chainiomocks.NewMockAvsSubscriberer(mockCtrl) - mockEthClient := mockethclient.NewMockEthClient(mockCtrl) + mockEthClient := NewMockEthClient(mockCtrl) + challenger := &Challenger{ logger: logger, avsWriter: mockAvsWriter, diff --git a/common/abi.go b/common/abi.go index c93fe157..3e048272 100644 --- a/common/abi.go +++ b/common/abi.go @@ -1,8 +1,34 @@ package common import ( + "context" _ "embed" + "math/big" + + "github.com/Layr-Labs/eigensdk-go/chainio/clients/wallet" + "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" ) //go:embed abis/IncredibleSquaringTaskManager.json var IncredibleSquaringTaskManagerAbi []byte + +type EthClientInterface interface { + wallet.EthBackend + TransactionByHash(context.Context, common.Hash) (*types.Transaction, bool, error) + ChainID(ctx context.Context) (*big.Int, error) + + SuggestGasTipCap(ctx context.Context) (*big.Int, error) + HeaderByNumber(ctx context.Context, number *big.Int) (*types.Header, error) + EstimateGas(ctx context.Context, call ethereum.CallMsg) (uint64, error) + CallContract(ctx context.Context, call ethereum.CallMsg, blockNumber *big.Int) ([]byte, error) + BlockByNumber(ctx context.Context, number *big.Int) (*types.Block, error) + BlockNumber(ctx context.Context) (uint64, error) + CodeAt(ctx context.Context, contract common.Address, blockNumber *big.Int) ([]byte, error) + PendingCodeAt(ctx context.Context, account common.Address) ([]byte, error) + FilterLogs(ctx context.Context, query ethereum.FilterQuery) ([]types.Log, error) + PendingNonceAt(ctx context.Context, account common.Address) (uint64, error) + SubscribeFilterLogs(ctx context.Context, query ethereum.FilterQuery, ch chan<- types.Log) (ethereum.Subscription, error) + SuggestGasPrice(ctx context.Context) (*big.Int, error) +} diff --git a/core/chainio/avs_reader.go b/core/chainio/avs_reader.go index 55bcc48f..19d4d1f1 100644 --- a/core/chainio/avs_reader.go +++ b/core/chainio/avs_reader.go @@ -4,38 +4,47 @@ import ( "context" "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" gethcommon "github.com/ethereum/go-ethereum/common" sdkavsregistry "github.com/Layr-Labs/eigensdk-go/chainio/clients/avsregistry" - "github.com/Layr-Labs/eigensdk-go/chainio/clients/eth" logging "github.com/Layr-Labs/eigensdk-go/logging" + sdkcommon "github.com/Layr-Labs/incredible-squaring-avs/common" erc20mock "github.com/Layr-Labs/incredible-squaring-avs/contracts/bindings/ERC20Mock" cstaskmanager "github.com/Layr-Labs/incredible-squaring-avs/contracts/bindings/IncredibleSquaringTaskManager" "github.com/Layr-Labs/incredible-squaring-avs/core/config" ) type AvsReaderer interface { - sdkavsregistry.AvsRegistryReader + //sdkavsregistry.ChainReader CheckSignatures( ctx context.Context, msgHash [32]byte, quorumNumbers []byte, referenceBlockNumber uint32, nonSignerStakesAndSignature cstaskmanager.IBLSSignatureCheckerNonSignerStakesAndSignature, ) (cstaskmanager.IBLSSignatureCheckerQuorumStakeTotals, error) GetErc20Mock(ctx context.Context, tokenAddr gethcommon.Address) (*erc20mock.ContractERC20Mock, error) + GetOperatorId( + opts *bind.CallOpts, + operatorAddress common.Address, + ) ([32]byte, error) + IsOperatorRegistered( + opts *bind.CallOpts, + operatorAddress common.Address, + ) (bool, error) } type AvsReader struct { - sdkavsregistry.AvsRegistryReader + sdkavsregistry.ChainReader AvsServiceBindings *AvsManagersBindings logger logging.Logger } -var _ AvsReaderer = (*AvsReader)(nil) +//var _ AvsReaderer = (*AvsReader)(nil) func BuildAvsReaderFromConfig(c *config.Config) (*AvsReader, error) { - return BuildAvsReader(c.IncredibleSquaringRegistryCoordinatorAddr, c.OperatorStateRetrieverAddr, c.EthHttpClient, c.Logger) + return BuildAvsReader(c.IncredibleSquaringRegistryCoordinatorAddr, c.OperatorStateRetrieverAddr, &c.EthHttpClient, c.Logger) } -func BuildAvsReader(registryCoordinatorAddr, operatorStateRetrieverAddr gethcommon.Address, ethHttpClient eth.Client, logger logging.Logger) (*AvsReader, error) { +func BuildAvsReader(registryCoordinatorAddr, operatorStateRetrieverAddr gethcommon.Address, ethHttpClient sdkcommon.EthClientInterface, logger logging.Logger) (*AvsReader, error) { avsManagersBindings, err := NewAvsManagersBindings(registryCoordinatorAddr, operatorStateRetrieverAddr, ethHttpClient, logger) if err != nil { return nil, err @@ -44,11 +53,11 @@ func BuildAvsReader(registryCoordinatorAddr, operatorStateRetrieverAddr gethcomm if err != nil { return nil, err } - return NewAvsReader(avsRegistryReader, avsManagersBindings, logger) + return NewAvsReader(*avsRegistryReader, avsManagersBindings, logger) } -func NewAvsReader(avsRegistryReader sdkavsregistry.AvsRegistryReader, avsServiceBindings *AvsManagersBindings, logger logging.Logger) (*AvsReader, error) { +func NewAvsReader(avsRegistryReader sdkavsregistry.ChainReader, avsServiceBindings *AvsManagersBindings, logger logging.Logger) (*AvsReader, error) { return &AvsReader{ - AvsRegistryReader: avsRegistryReader, + ChainReader: avsRegistryReader, AvsServiceBindings: avsServiceBindings, logger: logger, }, nil diff --git a/core/chainio/avs_subscriber.go b/core/chainio/avs_subscriber.go index fcf7db1d..d0c6a488 100644 --- a/core/chainio/avs_subscriber.go +++ b/core/chainio/avs_subscriber.go @@ -6,9 +6,9 @@ import ( "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/event" - "github.com/Layr-Labs/eigensdk-go/chainio/clients/eth" sdklogging "github.com/Layr-Labs/eigensdk-go/logging" + sdkcommon "github.com/Layr-Labs/incredible-squaring-avs/common" cstaskmanager "github.com/Layr-Labs/incredible-squaring-avs/contracts/bindings/IncredibleSquaringTaskManager" "github.com/Layr-Labs/incredible-squaring-avs/core/config" ) @@ -32,12 +32,12 @@ func BuildAvsSubscriberFromConfig(config *config.Config) (*AvsSubscriber, error) return BuildAvsSubscriber( config.IncredibleSquaringRegistryCoordinatorAddr, config.OperatorStateRetrieverAddr, - config.EthWsClient, + &config.EthWsClient, config.Logger, ) } -func BuildAvsSubscriber(registryCoordinatorAddr, blsOperatorStateRetrieverAddr gethcommon.Address, ethclient eth.Client, logger sdklogging.Logger) (*AvsSubscriber, error) { +func BuildAvsSubscriber(registryCoordinatorAddr, blsOperatorStateRetrieverAddr gethcommon.Address, ethclient sdkcommon.EthClientInterface, logger sdklogging.Logger) (*AvsSubscriber, error) { avsContractBindings, err := NewAvsManagersBindings(registryCoordinatorAddr, blsOperatorStateRetrieverAddr, ethclient, logger) if err != nil { logger.Errorf("Failed to create contract bindings", "err", err) diff --git a/core/chainio/avs_writer.go b/core/chainio/avs_writer.go index 1a19f23e..8ccf7b91 100644 --- a/core/chainio/avs_writer.go +++ b/core/chainio/avs_writer.go @@ -4,6 +4,7 @@ import ( "context" "math/big" + sdkcommon "github.com/Layr-Labs/incredible-squaring-avs/common" gethcommon "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" @@ -18,7 +19,7 @@ import ( ) type AvsWriterer interface { - avsregistry.AvsRegistryWriter + //avsregistry.ChainWriter SendNewTaskNumberToSquare( ctx context.Context, @@ -41,20 +42,20 @@ type AvsWriterer interface { } type AvsWriter struct { - avsregistry.AvsRegistryWriter + avsregistry.ChainWriter AvsContractBindings *AvsManagersBindings logger logging.Logger TxMgr txmgr.TxManager - client eth.Client + client eth.HttpBackend } var _ AvsWriterer = (*AvsWriter)(nil) func BuildAvsWriterFromConfig(c *config.Config) (*AvsWriter, error) { - return BuildAvsWriter(c.TxMgr, c.IncredibleSquaringRegistryCoordinatorAddr, c.OperatorStateRetrieverAddr, c.EthHttpClient, c.Logger) + return BuildAvsWriter(c.TxMgr, c.IncredibleSquaringRegistryCoordinatorAddr, c.OperatorStateRetrieverAddr, &c.EthHttpClient, c.Logger) } -func BuildAvsWriter(txMgr txmgr.TxManager, registryCoordinatorAddr, operatorStateRetrieverAddr gethcommon.Address, ethHttpClient eth.Client, logger logging.Logger) (*AvsWriter, error) { +func BuildAvsWriter(txMgr txmgr.TxManager, registryCoordinatorAddr, operatorStateRetrieverAddr gethcommon.Address, ethHttpClient sdkcommon.EthClientInterface, logger logging.Logger) (*AvsWriter, error) { avsServiceBindings, err := NewAvsManagersBindings(registryCoordinatorAddr, operatorStateRetrieverAddr, ethHttpClient, logger) if err != nil { logger.Error("Failed to create contract bindings", "err", err) @@ -64,11 +65,11 @@ func BuildAvsWriter(txMgr txmgr.TxManager, registryCoordinatorAddr, operatorStat if err != nil { return nil, err } - return NewAvsWriter(avsRegistryWriter, avsServiceBindings, logger, txMgr), nil + return NewAvsWriter(*avsRegistryWriter, avsServiceBindings, logger, txMgr), nil } -func NewAvsWriter(avsRegistryWriter avsregistry.AvsRegistryWriter, avsServiceBindings *AvsManagersBindings, logger logging.Logger, txMgr txmgr.TxManager) *AvsWriter { +func NewAvsWriter(avsRegistryWriter avsregistry.ChainWriter, avsServiceBindings *AvsManagersBindings, logger logging.Logger, txMgr txmgr.TxManager) *AvsWriter { return &AvsWriter{ - AvsRegistryWriter: avsRegistryWriter, + ChainWriter: avsRegistryWriter, AvsContractBindings: avsServiceBindings, logger: logger, TxMgr: txMgr, @@ -87,7 +88,7 @@ func (w *AvsWriter) SendNewTaskNumberToSquare(ctx context.Context, numToSquare * w.logger.Errorf("Error assembling CreateNewTask tx") return cstaskmanager.IIncredibleSquaringTaskManagerTask{}, 0, err } - receipt, err := w.TxMgr.Send(ctx, tx) + receipt, err := w.TxMgr.Send(ctx, tx, true) if err != nil { w.logger.Errorf("Error submitting CreateNewTask tx") return cstaskmanager.IIncredibleSquaringTaskManagerTask{}, 0, err @@ -115,7 +116,7 @@ func (w *AvsWriter) SendAggregatedResponse( w.logger.Error("Error submitting SubmitTaskResponse tx while calling respondToTask", "err", err) return nil, err } - receipt, err := w.TxMgr.Send(ctx, tx) + receipt, err := w.TxMgr.Send(ctx, tx, true) if err != nil { w.logger.Errorf("Error submitting respondToTask tx") return nil, err @@ -140,7 +141,7 @@ func (w *AvsWriter) RaiseChallenge( w.logger.Errorf("Error assembling RaiseChallenge tx") return nil, err } - receipt, err := w.TxMgr.Send(ctx, tx) + receipt, err := w.TxMgr.Send(ctx, tx, true) if err != nil { w.logger.Errorf("Error submitting RaiseChallenge tx") return nil, err diff --git a/core/chainio/bindings.go b/core/chainio/bindings.go index c9c53da0..617b6a3b 100644 --- a/core/chainio/bindings.go +++ b/core/chainio/bindings.go @@ -9,6 +9,7 @@ import ( gethcommon "github.com/ethereum/go-ethereum/common" regcoord "github.com/Layr-Labs/eigensdk-go/contracts/bindings/RegistryCoordinator" + sdkcommon "github.com/Layr-Labs/incredible-squaring-avs/common" erc20mock "github.com/Layr-Labs/incredible-squaring-avs/contracts/bindings/ERC20Mock" csservicemanager "github.com/Layr-Labs/incredible-squaring-avs/contracts/bindings/IncredibleSquaringServiceManager" cstaskmanager "github.com/Layr-Labs/incredible-squaring-avs/contracts/bindings/IncredibleSquaringTaskManager" @@ -17,11 +18,11 @@ import ( type AvsManagersBindings struct { TaskManager *cstaskmanager.ContractIncredibleSquaringTaskManager ServiceManager *csservicemanager.ContractIncredibleSquaringServiceManager - ethClient eth.Client + ethClient eth.HttpBackend logger logging.Logger } -func NewAvsManagersBindings(registryCoordinatorAddr, operatorStateRetrieverAddr gethcommon.Address, ethclient eth.Client, logger logging.Logger) (*AvsManagersBindings, error) { +func NewAvsManagersBindings(registryCoordinatorAddr, operatorStateRetrieverAddr gethcommon.Address, ethclient sdkcommon.EthClientInterface, logger logging.Logger) (*AvsManagersBindings, error) { contractRegistryCoordinator, err := regcoord.NewContractRegistryCoordinator(registryCoordinatorAddr, ethclient) if err != nil { return nil, err diff --git a/core/config/config.go b/core/config/config.go index 70f54548..56058a2d 100644 --- a/core/config/config.go +++ b/core/config/config.go @@ -10,12 +10,12 @@ import ( "github.com/ethereum/go-ethereum/crypto" "github.com/urfave/cli" - "github.com/Layr-Labs/eigensdk-go/chainio/clients/eth" "github.com/Layr-Labs/eigensdk-go/chainio/clients/wallet" "github.com/Layr-Labs/eigensdk-go/chainio/txmgr" "github.com/Layr-Labs/eigensdk-go/crypto/bls" sdklogging "github.com/Layr-Labs/eigensdk-go/logging" "github.com/Layr-Labs/eigensdk-go/signerv2" + "github.com/ethereum/go-ethereum/ethclient" sdkutils "github.com/Layr-Labs/eigensdk-go/utils" ) @@ -31,8 +31,8 @@ type Config struct { // only take an ethclient or an rpcUrl (and build the ethclient at each constructor site) EthHttpRpcUrl string EthWsRpcUrl string - EthHttpClient eth.Client - EthWsClient eth.Client + EthHttpClient ethclient.Client + EthWsClient ethclient.Client OperatorStateRetrieverAddr common.Address IncredibleSquaringRegistryCoordinatorAddr common.Address AggregatorServerIpPortAddr string @@ -84,13 +84,13 @@ func NewConfig(ctx *cli.Context) (*Config, error) { return nil, err } - ethRpcClient, err := eth.NewClient(configRaw.EthRpcUrl) + ethRpcClient, err := ethclient.Dial(configRaw.EthRpcUrl) if err != nil { logger.Errorf("Cannot create http ethclient", "err", err) return nil, err } - ethWsClient, err := eth.NewClient(configRaw.EthWsUrl) + ethWsClient, err := ethclient.Dial(configRaw.EthWsUrl) if err != nil { logger.Errorf("Cannot create ws ethclient", "err", err) return nil, err @@ -133,8 +133,8 @@ func NewConfig(ctx *cli.Context) (*Config, error) { Logger: logger, EthWsRpcUrl: configRaw.EthWsUrl, EthHttpRpcUrl: configRaw.EthRpcUrl, - EthHttpClient: ethRpcClient, - EthWsClient: ethWsClient, + EthHttpClient: *ethRpcClient, + EthWsClient: *ethWsClient, OperatorStateRetrieverAddr: common.HexToAddress(credibleSquaringDeploymentRaw.Addresses.OperatorStateRetrieverAddr), IncredibleSquaringRegistryCoordinatorAddr: common.HexToAddress(credibleSquaringDeploymentRaw.Addresses.RegistryCoordinatorAddr), AggregatorServerIpPortAddr: configRaw.AggregatorServerIpPortAddr, diff --git a/go.mod b/go.mod index 476190da..f250db6f 100644 --- a/go.mod +++ b/go.mod @@ -5,14 +5,14 @@ go 1.21 toolchain go1.21.0 require ( - github.com/Layr-Labs/eigensdk-go v0.1.7-0.20240425202952-954cd7661775 - github.com/ethereum/go-ethereum v1.13.14 + github.com/Layr-Labs/eigensdk-go v0.1.12 + github.com/ethereum/go-ethereum v1.14.0 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 ) require ( @@ -23,15 +23,29 @@ require ( 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/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/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/cenkalti/backoff/v4 v4.2.1 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect - github.com/cockroachdb/errors v1.9.1 // indirect + github.com/cockroachdb/errors v1.11.1 // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect - github.com/cockroachdb/pebble v0.0.0-20230928194634-aa077af62593 // indirect - github.com/cockroachdb/redact v1.1.3 // indirect + github.com/cockroachdb/pebble v1.1.0 // 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 github.com/consensys/gnark-crypto v0.12.1 // indirect @@ -40,29 +54,29 @@ require ( 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-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.1.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.3+incompatible // indirect + github.com/docker/docker v25.0.5+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 v0.4.0 // indirect - github.com/felixge/httpsnoop v1.0.3 // indirect + github.com/ethereum/c-kzg-4844 v1.0.0 // 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/go-logr/logr v1.2.4 // 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/protobuf v1.5.3 // 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 @@ -105,6 +119,7 @@ require ( github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible // indirect github.com/shirou/gopsutil/v3 v3.23.12 // indirect 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 @@ -115,22 +130,22 @@ require ( 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 - 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 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.16.0 // indirect - golang.org/x/sync v0.5.0 // indirect - golang.org/x/sys v0.16.0 // 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/text v0.14.0 // indirect - golang.org/x/time v0.3.0 // indirect - golang.org/x/tools v0.15.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.32.0 // 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 rsc.io/tmplfunc v0.0.3 // indirect diff --git a/go.sum b/go.sum index a6a98f47..435f6b31 100644 --- a/go.sum +++ b/go.sum @@ -16,6 +16,8 @@ github.com/DataDog/zstd v1.5.2/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwS github.com/Joker/hpp v1.0.0/go.mod h1:8x5n+M1Hp5hC0g8okX3sR3vFQwynaX/UgSOM9MeBKzY= github.com/Layr-Labs/eigensdk-go v0.1.7-0.20240425202952-954cd7661775 h1:xQQ4xnlzO1n0nU2HPizd00H2N3zacJjbSPwLhOHxZEo= github.com/Layr-Labs/eigensdk-go v0.1.7-0.20240425202952-954cd7661775/go.mod h1:ECU8/Ocsf+dGcN2rs8I1PScq4dOkQqY+vgwnq30Ov4M= +github.com/Layr-Labs/eigensdk-go v0.1.12 h1:Drf59iJLvnTm2Om9AwAyUMiZeJaTI8ZameIrnhjopSY= +github.com/Layr-Labs/eigensdk-go v0.1.12/go.mod h1:XcLVDtlB1vOPj63D236b451+SC75B8gwgkpNhYHSxNs= github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= github.com/Microsoft/hcsshim v0.11.4 h1:68vKo2VN8DE9AdN4tnkWnmdhqdbpUFM8OF3Airm7fz8= @@ -29,6 +31,34 @@ github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY 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/aws/aws-sdk-go-v2 v1.26.1 h1:5554eUqIYVWpU0YmeeYZ0wU64H2VLBs8TlhRB2L+EkA= +github.com/aws/aws-sdk-go-v2 v1.26.1/go.mod h1:ffIFB97e2yNsv4aTSGkqtHnppsIJzw7G7BReUZ3jCXM= +github.com/aws/aws-sdk-go-v2/config v1.27.11 h1:f47rANd2LQEYHda2ddSCKYId18/8BhSRM4BULGmfgNA= +github.com/aws/aws-sdk-go-v2/config v1.27.11/go.mod h1:SMsV78RIOYdve1vf36z8LmnszlRWkwMQtomCAI0/mIE= +github.com/aws/aws-sdk-go-v2/credentials v1.17.11 h1:YuIB1dJNf1Re822rriUOTxopaHHvIq0l/pX3fwO+Tzs= +github.com/aws/aws-sdk-go-v2/credentials v1.17.11/go.mod h1:AQtFPsDH9bI2O+71anW6EKL+NcD7LG3dpKGMV4SShgo= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.1 h1:FVJ0r5XTHSmIHJV6KuDmdYhEpvlHpiSd38RQWhut5J4= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.1/go.mod h1:zusuAeqezXzAB24LGuzuekqMAEgWkVYukBec3kr3jUg= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.5 h1:aw39xVGeRWlWx9EzGVnhOR4yOjQDHPQ6o6NmBlscyQg= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.5/go.mod h1:FSaRudD0dXiMPK2UjknVwwTYyZMRsHv3TtkabsZih5I= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.5 h1:PG1F3OD1szkuQPzDw3CIQsRIrtTlUC3lP84taWzHlq0= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.5/go.mod h1:jU1li6RFryMz+so64PpKtudI+QzbKoIEivqdf6LNpOc= +github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 h1:hT8rVHwugYE2lEfdFE0QWVo81lF7jMrYJVDWI+f+VxU= +github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0/go.mod h1:8tu/lYfQfFe6IGnaOdrpVgEL2IrrDOf6/m9RQum4NkY= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.2 h1:Ji0DY1xUsUr3I8cHps0G+XM3WWU16lP6yG8qu1GAZAs= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.2/go.mod h1:5CsjAbs3NlGQyZNFACh+zztPDI7fU6eW9QsxjfnuBKg= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.7 h1:ogRAwT1/gxJBcSWDMZlgyFUM962F51A5CRhDLbxLdmo= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.7/go.mod h1:YCsIZhXfRPLFFCl5xxY+1T9RKzOKjCut+28JSX2DnAk= +github.com/aws/aws-sdk-go-v2/service/kms v1.31.0 h1:yl7wcqbisxPzknJVfWTLnK83McUvXba+pz2+tPbIUmQ= +github.com/aws/aws-sdk-go-v2/service/kms v1.31.0/go.mod h1:2snWQJQUKsbN66vAawJuOGX7dr37pfOq9hb0tZDGIqQ= +github.com/aws/aws-sdk-go-v2/service/sso v1.20.5 h1:vN8hEbpRnL7+Hopy9dzmRle1xmDc7o8tmY0klsr175w= +github.com/aws/aws-sdk-go-v2/service/sso v1.20.5/go.mod h1:qGzynb/msuZIE8I75DVRCUXw3o3ZyBmUvMwQ2t/BrGM= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.23.4 h1:Jux+gDDyi1Lruk+KHF91tK2KCuY61kzoCpvtvJJBtOE= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.23.4/go.mod h1:mUYPBhaF2lGiukDEjJX2BLRRKTmoUSitGDUgM4tRxak= +github.com/aws/aws-sdk-go-v2/service/sts v1.28.6 h1:cwIxeBttqPN3qkaAjcEcsh8NYr8n2HZPkcKgPAi1phU= +github.com/aws/aws-sdk-go-v2/service/sts v1.28.6/go.mod h1:FZf1/nKNEkHdGGJP/cI2MoIMquumuRK6ol3QQJNDxmw= +github.com/aws/smithy-go v1.20.2 h1:tbp628ireGtzcHDDmLT/6ADHidqnwgF57XOXZe6tp4Q= +github.com/aws/smithy-go v1.20.2/go.mod h1:krry+ya/rV9RDcV/Q16kpu6ypI4K2czasz0NC3qS14E= 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= @@ -52,13 +82,19 @@ github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaY github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= github.com/cockroachdb/errors v1.9.1 h1:yFVvsI0VxmRShfawbt/laCIDy/mtTqqnvoNgiy5bEV8= github.com/cockroachdb/errors v1.9.1/go.mod h1:2sxOtL2WIc096WSZqZ5h8fa17rdDq9HZOZLBCor4mBk= +github.com/cockroachdb/errors v1.11.1 h1:xSEW75zKaKCWzR3OfxXUxgrk/NtT4G1MiOv5lWZazG8= +github.com/cockroachdb/errors v1.11.1/go.mod h1:8MUxA3Gi6b25tYlFEBGLf+D8aISL+M4MIpiWMSNRfxw= github.com/cockroachdb/logtags v0.0.0-20211118104740-dabe8e521a4f/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= github.com/cockroachdb/pebble v0.0.0-20230928194634-aa077af62593 h1:aPEJyR4rPBvDmeyi+l/FS/VtA00IWvjeFvjen1m1l1A= github.com/cockroachdb/pebble v0.0.0-20230928194634-aa077af62593/go.mod h1:6hk1eMY/u5t+Cf18q5lFMUA1Rc+Sm5I6Ra1QuPyxXCo= +github.com/cockroachdb/pebble v1.1.0 h1:pcFh8CdCIt2kmEpK0OIatq67Ln9uGDYY3d5XnE0LJG4= +github.com/cockroachdb/pebble v1.1.0/go.mod h1:sEHm5NOXxyiAoKWhoFxT8xMgd/f3RA6qUqQ1BXKrh2E= github.com/cockroachdb/redact v1.1.3 h1:AKZds10rFSIj7qADf0g46UixK8NNLwWTNdCIGS5wfSQ= github.com/cockroachdb/redact v1.1.3/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= +github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= +github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcjuz89kmFXt9morQgcfYZAYZ5n8WHjt81YYWIwtTM= @@ -82,6 +118,8 @@ github.com/crate-crypto/go-ipa v0.0.0-20231025140028-3c0104f4b233 h1:d28BXYi+wUp github.com/crate-crypto/go-ipa v0.0.0-20231025140028-3c0104f4b233/go.mod h1:geZJZH3SzKCqnz5VT0q/DyIG/tvu/dZk+VIfXicupJs= github.com/crate-crypto/go-kzg-4844 v0.7.0 h1:C0vgZRk4q4EZ/JgPfzuSoxdCq3C3mOZMBShovmncxvA= github.com/crate-crypto/go-kzg-4844 v0.7.0/go.mod h1:1kMhvPgI0Ky3yIa+9lFySEBUBXkYxeOi8ZF1sYioxhc= +github.com/crate-crypto/go-kzg-4844 v1.0.0 h1:TsSgHwrkTKecKJ4kadtHi4b3xHW5dCFUDFnUp1TsawI= +github.com/crate-crypto/go-kzg-4844 v1.0.0/go.mod h1:1kMhvPgI0Ky3yIa+9lFySEBUBXkYxeOi8ZF1sYioxhc= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY= github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4= @@ -100,6 +138,8 @@ github.com/distribution/reference v0.5.0 h1:/FUIFXtfc/x2gpa5/VGfiGLuOIdYa1t65IKK github.com/distribution/reference v0.5.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= github.com/docker/docker v25.0.3+incompatible h1:D5fy/lYmY7bvZa0XTZ5/UJPljor41F+vdyJG5luQLfQ= github.com/docker/docker v25.0.3+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v25.0.5+incompatible h1:UmQydMduGkrD5nQde1mecF/YnSbTOaPeFIeP5C4W+DE= +github.com/docker/docker v25.0.5+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj1Br63c= github.com/docker/go-connections v0.5.0/go.mod h1:ov60Kzw0kKElRwhNs9UlUHAE/F9Fe6GLaXnqyDdmEXc= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= @@ -113,12 +153,18 @@ github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7 github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= github.com/ethereum/c-kzg-4844 v0.4.0 h1:3MS1s4JtA868KpJxroZoepdV0ZKBp3u/O5HcZ7R3nlY= github.com/ethereum/c-kzg-4844 v0.4.0/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1aQputP83wc0= +github.com/ethereum/c-kzg-4844 v1.0.0 h1:0X1LBXxaEtYD9xsyj9B9ctQEZIpnvVDeoBx8aHEwTNA= +github.com/ethereum/c-kzg-4844 v1.0.0/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1aQputP83wc0= github.com/ethereum/go-ethereum v1.13.14 h1:EwiY3FZP94derMCIam1iW4HFVrSgIcpsu0HwTQtm6CQ= github.com/ethereum/go-ethereum v1.13.14/go.mod h1:TN8ZiHrdJwSe8Cb6x+p0hs5CxhJZPbqB7hHkaUXcmIU= +github.com/ethereum/go-ethereum v1.14.0 h1:xRWC5NlB6g1x7vNy4HDBLuqVNbtLrc7v8S6+Uxim1LU= +github.com/ethereum/go-ethereum v1.14.0/go.mod h1:1STrq471D0BQbCX9He0hUj4bHxX2k6mt5nOQJhDNOJ8= github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072/go.mod h1:duJ4Jxv5lDcvg4QuQr0oowTf7dz4/CR8NtyCooz9HL8= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/felixge/httpsnoop v1.0.3 h1:s/nj+GCswXYzN5v2DpNMuMQYe+0DDwt5WVCU6CWBdXk= github.com/felixge/httpsnoop v1.0.3/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= +github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/fjl/memsize v0.0.2 h1:27txuSD9or+NZlnOWdKUxeBzTAUkWCVh+4Gf2dWFOzA= github.com/fjl/memsize v0.0.2/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= @@ -142,6 +188,8 @@ github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3Bop github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= +github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-martini/martini v0.0.0-20170121215854-22fa46961aab/go.mod h1:/P9AEU963A2AYjv4d1V5eVL1CQbEJq6aCNHDDjibzu8= @@ -180,6 +228,8 @@ github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaS github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb h1:PBC98N2aIaM3XXiurYmW7fx4GZkL8feAMVq7nEjURHk= github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= @@ -374,6 +424,8 @@ github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFt github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= github.com/shoenig/test v0.6.4 h1:kVTaSd7WLz5WZ2IaoM0RSzRsUD+m8wRR+5qvntpn4LU= github.com/shoenig/test v0.6.4/go.mod h1:byHiCGXqrVaflBLAMq/srcZIHynQPQgeyvkvXnjqq0k= +github.com/shurcooL/graphql v0.0.0-20230722043721-ed46e5a46466 h1:17JxqqJY66GmZVHkmAsGEkcIu0oCe3AM420QDgGwZx0= +github.com/shurcooL/graphql v0.0.0-20230722043721-ed46e5a46466/go.mod h1:9dIRpgIY7hVhoqfe0/FcYp0bpInZaT7dc3BYOprrIUE= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= @@ -406,6 +458,8 @@ github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70 github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= github.com/testcontainers/testcontainers-go v0.29.1 h1:z8kxdFlovA2y97RWx98v/TQ+tR+SXZm6p35M+xB92zk= github.com/testcontainers/testcontainers-go v0.29.1/go.mod h1:SnKnKQav8UcgtKqjp/AD8bE1MqZm+3TDb/B8crE3XnI= +github.com/testcontainers/testcontainers-go v0.30.0 h1:jmn/XS22q4YRrcMwWg0pAwlClzs/abopbsBzrepyc4E= +github.com/testcontainers/testcontainers-go v0.30.0/go.mod h1:K+kHNGiM5zjklKjgTtcrEetF3uhWbMUyqAQoyoh8Pf0= github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+Fk= @@ -443,18 +497,26 @@ github.com/yusufpapurcu/wmi v1.2.3 h1:E1ctvB7uKFMOJw3fdOW32DwGE9I7t++CRUEMKvFoFi github.com/yusufpapurcu/wmi v1.2.3/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.45.0 h1:x8Z78aZx8cOF0+Kkazoc7lwUNMGy0LrzEMxTm4BbTxg= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.45.0/go.mod h1:62CPTSry9QZtOaSsE3tOzhx6LzDhHnXJ6xHeMNNiM6Q= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 h1:jq9TW8u3so/bN+JPT166wjOI6/vQPF6Xe7nMNIltagk= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0/go.mod h1:p8pYQP+m5XfbZm9fxtSKAbM6oIllS7s2AfxrChvc7iw= go.opentelemetry.io/otel v1.19.0 h1:MuS/TNf4/j4IXsZuJegVzI1cwut7Qc00344rgH7p8bs= go.opentelemetry.io/otel v1.19.0/go.mod h1:i0QyjOq3UPoTzff0PJB2N66fb4S0+rSbSB15/oyH9fY= +go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo= +go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.19.0 h1:Mne5On7VWdx7omSrSSZvM4Kw7cS7NQkOOmLcgscI51U= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.19.0/go.mod h1:IPtUMKL4O3tH5y+iXVyAXqpAwMuzC1IrxVS81rummfE= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.19.0 h1:IeMeyr1aBvBiPVYihXIaeIZba6b8E1bYp7lbdxK8CQg= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.19.0/go.mod h1:oVdCUtjq9MK9BlS7TtucsQwUcXcymNiEDjgDD2jMtZU= go.opentelemetry.io/otel/metric v1.19.0 h1:aTzpGtV0ar9wlV4Sna9sdJyII5jTVJEvKETPiOKwvpE= go.opentelemetry.io/otel/metric v1.19.0/go.mod h1:L5rUsV9kM1IxCj1MmSdS+JQAcVm319EUrDVLrt7jqt8= +go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI= +go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco= go.opentelemetry.io/otel/sdk v1.19.0 h1:6USY6zH+L8uMH8L3t1enZPR3WFEmSTADlqldyHtJi3o= go.opentelemetry.io/otel/sdk v1.19.0/go.mod h1:NedEbbS4w3C6zElbLdPJKOpJQOrGUJ+GfzpjUvI0v1A= go.opentelemetry.io/otel/trace v1.19.0 h1:DFVQmlVbfVeOuBRrwdtaehRrWiL1JoVs9CPIQ1Dzxpg= go.opentelemetry.io/otel/trace v1.19.0/go.mod h1:mfaSyvGyEJEI0nyV2I4qhNQnbBOUUmYZpYojqMnX2vo= +go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI= +go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU= go.opentelemetry.io/proto/otlp v1.0.0 h1:T0TX0tmXU8a3CbNXzEKGeU5mIVOdf0oykP+u2lIVU/I= go.opentelemetry.io/proto/otlp v1.0.0/go.mod h1:Sy6pihPLfYHkr3NkUbEhGHFhINUSI/v80hjKIs5JXpM= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= @@ -475,6 +537,8 @@ golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.18.0 h1:PGVlW0xEltQnzFZ55hkuX5+KLyrMYhHld1YHO4AKcdc= golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= +golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= +golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa h1:FRnLl4eNAQl8hwxVVC17teOw8kdjVDVAiFMtgUdTSRQ= golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa/go.mod h1:zk2irFbV9DP96SEBUUAy67IdHUaZuSnrz1n472HUCLE= @@ -488,6 +552,8 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.16.0 h1:QX4fJ0Rr5cPQCF7O9lh9Se4pmwfwskqZfq5moyldzic= golang.org/x/mod v0.16.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= +golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -519,6 +585,8 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -559,6 +627,8 @@ golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU= golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= +golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= @@ -571,6 +641,8 @@ golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= +golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181221001348-537d06c36207/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -586,6 +658,8 @@ golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.15.0 h1:zdAyfUGbYmuVokhzVmghFl2ZJh5QhcfebBgmVPFYA+8= golang.org/x/tools v0.15.0/go.mod h1:hpksKq4dtpQWS1uQ61JkdqWM3LscIS6Slf+VVkm+wQk= +golang.org/x/tools v0.20.0 h1:hz/CVckiOxybQvFw6h7b/q80NTr9IUQb4s1IIzW7KNY= +golang.org/x/tools v0.20.0/go.mod h1:WvitBU7JJf6A4jOdg4S1tviW9bhUxkgeCui/0JHctQg= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -624,6 +698,8 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= +google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/operator/operator.go b/operator/operator.go index 4296f169..b415cbf8 100644 --- a/operator/operator.go +++ b/operator/operator.go @@ -8,9 +8,11 @@ import ( "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/ethclient" "github.com/prometheus/client_golang/prometheus" "github.com/Layr-Labs/incredible-squaring-avs/aggregator" + sdkcommon "github.com/Layr-Labs/incredible-squaring-avs/common" cstaskmanager "github.com/Layr-Labs/incredible-squaring-avs/contracts/bindings/IncredibleSquaringTaskManager" "github.com/Layr-Labs/incredible-squaring-avs/core" "github.com/Layr-Labs/incredible-squaring-avs/core/chainio" @@ -40,7 +42,7 @@ const SEM_VER = "0.0.1" type Operator struct { config types.NodeConfig logger logging.Logger - ethClient eth.Client + ethClient sdkcommon.EthClientInterface // TODO(samlaf): remove both avsWriter and eigenlayerWrite from operator // they are only used for registration, so we should make a special registration package // this way, auditing this operator code makes it obvious that operators don't need to @@ -52,8 +54,8 @@ type Operator struct { avsWriter *chainio.AvsWriter avsReader chainio.AvsReaderer avsSubscriber chainio.AvsSubscriberer - eigenlayerReader sdkelcontracts.ELReader - eigenlayerWriter sdkelcontracts.ELWriter + eigenlayerReader sdkelcontracts.ChainReader + eigenlayerWriter sdkelcontracts.ChainWriter blsKeypair *bls.KeyPair operatorId sdktypes.OperatorId operatorAddr common.Address @@ -88,7 +90,7 @@ func NewOperatorFromConfig(c types.NodeConfig) (*Operator, error) { // Setup Node Api nodeApi := nodeapi.NewNodeApi(AVS_NAME, SEM_VER, c.NodeApiIpPortAddress, logger) - var ethRpcClient, ethWsClient eth.Client + var ethRpcClient, ethWsClient sdkcommon.EthClientInterface if c.EnableMetrics { rpcCallsCollector := rpccalls.NewCollector(AVS_NAME, reg) ethRpcClient, err = eth.NewInstrumentedClient(c.EthRpcUrl, rpcCallsCollector) @@ -102,12 +104,12 @@ func NewOperatorFromConfig(c types.NodeConfig) (*Operator, error) { return nil, err } } else { - ethRpcClient, err = eth.NewClient(c.EthRpcUrl) + ethRpcClient, err = ethclient.Dial(c.EthRpcUrl) if err != nil { logger.Errorf("Cannot create http ethclient", "err", err) return nil, err } - ethWsClient, err = eth.NewClient(c.EthWsUrl) + ethWsClient, err = ethclient.Dial(c.EthWsUrl) if err != nil { logger.Errorf("Cannot create ws ethclient", "err", err) return nil, err @@ -220,8 +222,8 @@ func NewOperatorFromConfig(c types.NodeConfig) (*Operator, error) { avsWriter: avsWriter, avsReader: avsReader, avsSubscriber: avsSubscriber, - eigenlayerReader: sdkClients.ElChainReader, - eigenlayerWriter: sdkClients.ElChainWriter, + eigenlayerReader: *sdkClients.ElChainReader, + eigenlayerWriter: *sdkClients.ElChainWriter, blsKeypair: blsKeyPair, operatorAddr: common.HexToAddress(c.OperatorAddress), aggregatorServerIpPortAddr: c.AggregatorServerIpPortAddress, diff --git a/operator/registration.go b/operator/registration.go index 3299e480..a1ddcbb9 100644 --- a/operator/registration.go +++ b/operator/registration.go @@ -51,10 +51,10 @@ func (o *Operator) registerOperatorOnStartup( func (o *Operator) RegisterOperatorWithEigenlayer() error { op := eigenSdkTypes.Operator{ - Address: o.operatorAddr.String(), - EarningsReceiverAddress: o.operatorAddr.String(), + Address: o.operatorAddr.String(), + DelegationApproverAddress: o.operatorAddr.String(), } - _, err := o.eigenlayerWriter.RegisterAsOperator(context.Background(), op) + _, err := o.eigenlayerWriter.RegisterAsOperator(context.Background(), op, true) if err != nil { o.logger.Error("Error registering operator with eigenlayer", "err", err) return err @@ -79,13 +79,13 @@ func (o *Operator) DepositIntoStrategy(strategyAddr common.Address, amount *big. o.logger.Errorf("Error assembling Mint tx") return err } - _, err = o.avsWriter.TxMgr.Send(context.Background(), tx) + _, err = o.avsWriter.TxMgr.Send(context.Background(), tx, true) if err != nil { o.logger.Errorf("Error submitting Mint tx") return err } - _, err = o.eigenlayerWriter.DepositERC20IntoStrategy(context.Background(), strategyAddr, amount) + _, err = o.eigenlayerWriter.DepositERC20IntoStrategy(context.Background(), strategyAddr, amount, true) if err != nil { o.logger.Errorf("Error depositing into strategy", "err", err) return err @@ -116,8 +116,9 @@ func (o *Operator) RegisterOperatorWithAvs( _, err = o.avsWriter.RegisterOperatorInQuorumWithAVSRegistryCoordinator( context.Background(), operatorEcdsaKeyPair, operatorToAvsRegistrationSigSalt, operatorToAvsRegistrationSigExpiry, - o.blsKeypair, quorumNumbers, socket, + o.blsKeypair, quorumNumbers, socket, true, ) + if err != nil { o.logger.Errorf("Unable to register operator with avs registry coordinator") return err diff --git a/operator/registration_test.go b/operator/registration_test.go index ec5e3afe..00984f2b 100644 --- a/operator/registration_test.go +++ b/operator/registration_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/Layr-Labs/eigensdk-go/crypto/bls" - sdklogging "github.com/Layr-Labs/eigensdk-go/logging" + "github.com/Layr-Labs/eigensdk-go/testutils" cstaskmanager "github.com/Layr-Labs/incredible-squaring-avs/contracts/bindings/IncredibleSquaringTaskManager" "github.com/Layr-Labs/incredible-squaring-avs/metrics" @@ -32,7 +32,7 @@ func IntegrationTestOperatorRegistration(t *testing.T) { } func createMockOperator() (*Operator, error) { - logger := sdklogging.NewNoopLogger() + logger := testutils.GetTestLogger() reg := prometheus.NewRegistry() noopMetrics := metrics.NewNoopMetrics() diff --git a/plugin/cmd/main.go b/plugin/cmd/main.go index b0b7a60f..f441ed7d 100644 --- a/plugin/cmd/main.go +++ b/plugin/cmd/main.go @@ -9,7 +9,6 @@ import ( "time" sdkclients "github.com/Layr-Labs/eigensdk-go/chainio/clients" - "github.com/Layr-Labs/eigensdk-go/chainio/clients/eth" "github.com/Layr-Labs/eigensdk-go/chainio/clients/wallet" "github.com/Layr-Labs/eigensdk-go/chainio/txmgr" regcoord "github.com/Layr-Labs/eigensdk-go/contracts/bindings/RegistryCoordinator" @@ -23,6 +22,7 @@ import ( "github.com/Layr-Labs/incredible-squaring-avs/types" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/ethclient" "github.com/urfave/cli" ) @@ -104,7 +104,7 @@ func plugin(ctx *cli.Context) { PromMetricsIpPortAddress: avsConfig.EigenMetricsIpPortAddress, } logger, _ := logging.NewZapLogger(logging.Development) - ethHttpClient, err := eth.NewClient(avsConfig.EthRpcUrl) + ethHttpClient, err := ethclient.Dial(avsConfig.EthRpcUrl) if err != nil { fmt.Println("can't connect to eth client") fmt.Println(err) @@ -184,7 +184,7 @@ func plugin(ctx *cli.Context) { r, err := clients.AvsRegistryChainWriter.RegisterOperatorInQuorumWithAVSRegistryCoordinator( goCtx, operatorEcdsaPrivateKey, operatorToAvsRegistrationSigSalt, operatorToAvsRegistrationSigExpiry, - blsKeypair, quorumNumbers, socket, + blsKeypair, quorumNumbers, socket, true, ) if err != nil { logger.Errorf("Error assembling CreateNewTask tx") @@ -222,13 +222,13 @@ func plugin(ctx *cli.Context) { logger.Errorf("Error assembling Mint tx") return } - _, err = avsWriter.TxMgr.Send(context.Background(), tx) + _, err = avsWriter.TxMgr.Send(context.Background(), tx, true) if err != nil { logger.Errorf("Error submitting Mint tx") return } - _, err = clients.ElChainWriter.DepositERC20IntoStrategy(context.Background(), strategyAddr, amount) + _, err = clients.ElChainWriter.DepositERC20IntoStrategy(context.Background(), strategyAddr, amount, true) if err != nil { logger.Errorf("Error depositing into strategy") return diff --git a/tests/integration/integration_test.go b/tests/integration/integration_test.go index 963cc173..7f22fa3e 100644 --- a/tests/integration/integration_test.go +++ b/tests/integration/integration_test.go @@ -11,7 +11,6 @@ import ( "time" "github.com/Layr-Labs/eigensdk-go/chainio/clients" - "github.com/Layr-Labs/eigensdk-go/chainio/clients/eth" "github.com/Layr-Labs/eigensdk-go/chainio/clients/wallet" "github.com/Layr-Labs/eigensdk-go/chainio/txmgr" sdklogging "github.com/Layr-Labs/eigensdk-go/logging" @@ -25,6 +24,7 @@ import ( "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/ethclient" "github.com/testcontainers/testcontainers-go" "github.com/testcontainers/testcontainers-go/wait" ) @@ -60,11 +60,11 @@ func TestIntegration(t *testing.T) { if err != nil { t.Fatalf("Failed to create logger: %s", err.Error()) } - ethRpcClient, err := eth.NewClient(aggConfigRaw.EthRpcUrl) + ethRpcClient, err := ethclient.Dial(aggConfigRaw.EthRpcUrl) if err != nil { t.Fatalf("Failed to create eth client: %s", err.Error()) } - ethWsClient, err := eth.NewClient(aggConfigRaw.EthWsUrl) + ethWsClient, err := ethclient.Dial(aggConfigRaw.EthWsUrl) if err != nil { t.Fatalf("Failed to create eth client: %s", err.Error()) } @@ -101,9 +101,9 @@ func TestIntegration(t *testing.T) { EcdsaPrivateKey: aggregatorEcdsaPrivateKey, Logger: logger, EthHttpRpcUrl: aggConfigRaw.EthRpcUrl, - EthHttpClient: ethRpcClient, + EthHttpClient: *ethRpcClient, EthWsRpcUrl: aggConfigRaw.EthWsUrl, - EthWsClient: ethWsClient, + EthWsClient: *ethWsClient, OperatorStateRetrieverAddr: common.HexToAddress(credibleSquaringDeploymentRaw.Addresses.OperatorStateRetrieverAddr), IncredibleSquaringRegistryCoordinatorAddr: common.HexToAddress(credibleSquaringDeploymentRaw.Addresses.RegistryCoordinatorAddr), AggregatorServerIpPortAddr: aggConfigRaw.AggregatorServerIpPortAddr, @@ -175,16 +175,24 @@ func TestIntegration(t *testing.T) { t.Fatalf("Task hash is empty") } - // check if the task response is recorded in the contract for task index 1 - taskResponseHash, err := avsReader.AvsServiceBindings.TaskManager.AllTaskResponses(&bind.CallOpts{}, 1) - log.Printf("taskResponseHash: %v", taskResponseHash) - if err != nil { - t.Fatalf("Cannot get task response hash: %s", err.Error()) + received := false + for i := 0; i < 3; i++ { + // check if the task response is recorded in the contract for task index 1 + taskResponseHash, err := avsReader.AvsServiceBindings.TaskManager.AllTaskResponses(&bind.CallOpts{}, 1) + log.Printf("taskResponseHash: %v", taskResponseHash) + if err != nil { + t.Fatalf("Cannot get task response hash: %s", err.Error()) + } + + if taskResponseHash != [32]byte{} { + received = true + break + } } - if taskResponseHash == [32]byte{} { + + if !received { t.Fatalf("Task response hash is empty") } - } // TODO(samlaf): have to advance chain to a block where the task is answered @@ -196,7 +204,7 @@ func startAnvilTestContainer() testcontainers.Container { ctx := context.Background() req := testcontainers.ContainerRequest{ - Image: "ghcr.io/foundry-rs/foundry:latest", + Image: "ghcr.io/foundry-rs/foundry:nightly-3abac322efdb69e27b6fe8748b72754ae878f64d@sha256:871b66957335636a02c6c324c969db9adb1d6d64f148753c4a986cf32a40dc3c", Mounts: testcontainers.ContainerMounts{ testcontainers.ContainerMount{ Source: testcontainers.GenericBindMountSource{