From 69c9c90137338d4001efd97934f2c2dca8481350 Mon Sep 17 00:00:00 2001 From: fyInALT Date: Tue, 2 Apr 2024 18:35:04 +0800 Subject: [PATCH] upgrade eigensdk --- aggregator/README.md | 28 ++++++++++++++++++++++++++++ aggregator/aggregator.go | 5 ++--- core/config/config.go | 2 +- core/message/task.go | 4 ++-- go.mod | 2 +- go.sum | 6 ++++-- operator/operator.go | 4 ++-- operator/rpc_client.go | 6 +++--- 8 files changed, 43 insertions(+), 14 deletions(-) create mode 100644 aggregator/README.md diff --git a/aggregator/README.md b/aggregator/README.md new file mode 100644 index 0000000..c572878 --- /dev/null +++ b/aggregator/README.md @@ -0,0 +1,28 @@ +# Aggregator + +config: + +```yaml +# 'production' only prints info and above. 'development' also prints debug +environment: production + +eth_rpc_url: https://ethereum-holesky-rpc.publicnode.com +eth_ws_url: wss://ethereum-holesky-rpc.publicnode.com + +# address which the aggregator listens on for operator signed messages +aggregator_server_ip_port_address: 0.0.0.0:8090 + +# the layer1 chain id the avs contracts in +layer1_chain_id: 17000 + +# the layer2 chain id +layer2_chain_id: 20240219 + +``` + +envs: + +```bash +AVS_REGISTRY_COORDINATOR_ADDRESS=0x1eA7D160d325B289bF981e0D7aB6Bf3261a0FFf2 +OPERATOR_STATE_RETRIEVER_ADDRESS=0xBE1c904525910fdB49dB33b4960DF9aC9f603dC7 +``` diff --git a/aggregator/aggregator.go b/aggregator/aggregator.go index 09c3ebb..a96df68 100644 --- a/aggregator/aggregator.go +++ b/aggregator/aggregator.go @@ -6,7 +6,6 @@ import ( "sync" "time" - "github.com/Layr-Labs/eigensdk-go/crypto/bls" "github.com/Layr-Labs/eigensdk-go/logging" "github.com/ethereum/go-ethereum/common" @@ -45,8 +44,8 @@ type FinishedTaskStatus struct { } type OperatorStatus struct { - LastTime int64 `json:"lastTime"` - OperatorId bls.OperatorId `json:"operatorId"` + LastTime int64 `json:"lastTime"` + OperatorId sdktypes.OperatorId `json:"operatorId"` } // Aggregator sends tasks (numbers to square) onchain, then listens for operator signed TaskResponses. diff --git a/core/config/config.go b/core/config/config.go index 07f2017..13d3ad3 100644 --- a/core/config/config.go +++ b/core/config/config.go @@ -169,7 +169,7 @@ func NewConfig(ctx *cli.Context) (*Config, error) { if err != nil { return nil, types.WrapError(errors.New("Failed to create transaction sender"), err) } - txMgr := txmgr.NewSimpleTxManager(txSender, ethRpcClient, logger, signerV2, aggregatorAddr) + txMgr := txmgr.NewSimpleTxManager(txSender, ethRpcClient, logger, aggregatorAddr) config := &Config{ Logger: logger, diff --git a/core/message/task.go b/core/message/task.go index 6fa22a9..d526384 100644 --- a/core/message/task.go +++ b/core/message/task.go @@ -97,7 +97,7 @@ func (a AlertTaskInfo) ToIMachServiceManagerAlertHeader() csservicemanager.IMach type InitOperatorRequest struct { Layer1ChainId uint32 ChainId uint32 - OperatorId bls.OperatorId + OperatorId sdktypes.OperatorId OperatorAddress common.Address OperatorStateRetrieverAddr common.Address RegistryCoordinatorAddr common.Address @@ -125,7 +125,7 @@ type ProcessSignedTaskResponseResponse struct { type SignedTaskRespRequest struct { Alert AlertTaskInfo BlsSignature bls.Signature - OperatorId bls.OperatorId + OperatorId sdktypes.OperatorId } type SignedTaskRespResponse struct { diff --git a/go.mod b/go.mod index d1497bd..d67329e 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.21 toolchain go1.21.1 require ( - github.com/Layr-Labs/eigensdk-go v0.1.2 + github.com/Layr-Labs/eigensdk-go v0.1.4-0.20240330002735-c0efcad71d31 github.com/ethereum/go-ethereum v1.13.14 github.com/prometheus/client_golang v1.19.0 github.com/sourcegraph/jsonrpc2 v0.2.0 diff --git a/go.sum b/go.sum index 7373a35..6028e24 100644 --- a/go.sum +++ b/go.sum @@ -7,8 +7,10 @@ github.com/CloudyKit/jet/v3 v3.0.0/go.mod h1:HKQPgSJmdK8hdoAbKUUWajkHyHo4RaU5rMd github.com/DataDog/zstd v1.5.2 h1:vUG4lAyuPCXO0TLbXvPv7EB7cNK1QV/luu55UHLrrn8= github.com/DataDog/zstd v1.5.2/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= github.com/Joker/hpp v1.0.0/go.mod h1:8x5n+M1Hp5hC0g8okX3sR3vFQwynaX/UgSOM9MeBKzY= -github.com/Layr-Labs/eigensdk-go v0.1.2 h1:0CbdLMr9IPWFW3RPfPORFWQYgXMAa/K4tA8rncBQ/YY= -github.com/Layr-Labs/eigensdk-go v0.1.2/go.mod h1:J+d9zxN4VyMtchmsPzGASFcCjpnh1eT4aE2ggiqOz/g= +github.com/Layr-Labs/eigensdk-go v0.1.3 h1:GYRd3CYtPFkLVP07Ml284j9m4igKvPxeAhgSCpRCtpc= +github.com/Layr-Labs/eigensdk-go v0.1.3/go.mod h1:J+d9zxN4VyMtchmsPzGASFcCjpnh1eT4aE2ggiqOz/g= +github.com/Layr-Labs/eigensdk-go v0.1.4-0.20240330002735-c0efcad71d31 h1:edCd/bQIrnlImZe6os35okWDb1I4S/QeQ4voF/xPhok= +github.com/Layr-Labs/eigensdk-go v0.1.4-0.20240330002735-c0efcad71d31/go.mod h1:HOSNuZcwaKbP4cnNk9c1hK2B2RitcMQ36Xj2msBBBpE= 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/Shopify/goreferrer v0.0.0-20181106222321-ec9c9a553398/go.mod h1:a1uqRtAwp2Xwc6WNPJEufxJ7fx3npB4UV/JOLmbu5I0= diff --git a/operator/operator.go b/operator/operator.go index b292d4d..5180fb2 100644 --- a/operator/operator.go +++ b/operator/operator.go @@ -51,7 +51,7 @@ type Operator struct { eigenlayerReader sdkelcontracts.ELReader eigenlayerWriter sdkelcontracts.ELWriter blsKeypair *bls.KeyPair - operatorId bls.OperatorId + operatorId sdktypes.OperatorId operatorAddr common.Address metadataURI string rpcServer RpcServer @@ -290,7 +290,7 @@ func NewOperatorFromConfig(cfg config.NodeConfig) (*Operator, error) { if err != nil { return nil, err } - txMgr := txmgr.NewSimpleTxManager(txSender, ethRpcClient, logger, signerV2, addr) + txMgr := txmgr.NewSimpleTxManager(txSender, ethRpcClient, logger, addr) avsWriter, err := chainio.BuildAvsWriter( txMgr, common.HexToAddress(c.AVSRegistryCoordinatorAddress), diff --git a/operator/rpc_client.go b/operator/rpc_client.go index 69dd894..7b2bfb1 100644 --- a/operator/rpc_client.go +++ b/operator/rpc_client.go @@ -12,8 +12,8 @@ import ( "github.com/alt-research/avs/metrics" "github.com/ethereum/go-ethereum/common" - "github.com/Layr-Labs/eigensdk-go/crypto/bls" "github.com/Layr-Labs/eigensdk-go/logging" + sdktypes "github.com/Layr-Labs/eigensdk-go/types" ) type AggregatorRpcClienter interface { @@ -26,14 +26,14 @@ type AggregatorRpcClient struct { metrics metrics.Metrics logger logging.Logger config config.NodeConfig - operatorId bls.OperatorId + operatorId sdktypes.OperatorId operatorAddr common.Address OperatorStateRetrieverAddr common.Address RegistryCoordinatorAddr common.Address aggregatorIpPortAddr string } -func NewAggregatorRpcClient(config config.NodeConfig, operatorId bls.OperatorId, operatorAddr common.Address, logger logging.Logger, metrics metrics.Metrics) (*AggregatorRpcClient, error) { +func NewAggregatorRpcClient(config config.NodeConfig, operatorId sdktypes.OperatorId, operatorAddr common.Address, logger logging.Logger, metrics metrics.Metrics) (*AggregatorRpcClient, error) { return &AggregatorRpcClient{ // set to nil so that we can create an rpc client even if the aggregator is not running rpcClient: nil,