Skip to content

Commit

Permalink
upgrade eigensdk
Browse files Browse the repository at this point in the history
  • Loading branch information
fyInALT committed Apr 2, 2024
1 parent 3c120d2 commit 69c9c90
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 14 deletions.
28 changes: 28 additions & 0 deletions aggregator/README.md
Original file line number Diff line number Diff line change
@@ -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
```
5 changes: 2 additions & 3 deletions aggregator/aggregator.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion core/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions core/message/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -125,7 +125,7 @@ type ProcessSignedTaskResponseResponse struct {
type SignedTaskRespRequest struct {
Alert AlertTaskInfo
BlsSignature bls.Signature
OperatorId bls.OperatorId
OperatorId sdktypes.OperatorId
}

type SignedTaskRespResponse struct {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
4 changes: 2 additions & 2 deletions operator/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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),
Expand Down
6 changes: 3 additions & 3 deletions operator/rpc_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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,
Expand Down

0 comments on commit 69c9c90

Please sign in to comment.