From 43b546402a27a8abcf4ec5415468f17701f06398 Mon Sep 17 00:00:00 2001 From: Jian Xiao <99709935+jianoaix@users.noreply.github.com> Date: Tue, 19 Mar 2024 16:31:15 -0700 Subject: [PATCH] Remove the update-quorums command support (#362) --- node/operator.go | 16 ---------------- node/plugin/cmd/main.go | 8 -------- node/plugin/config.go | 4 ++-- node/plugin/tests/plugin_test.go | 16 ---------------- 4 files changed, 2 insertions(+), 42 deletions(-) diff --git a/node/operator.go b/node/operator.go index 7aa4caa97..23947750c 100644 --- a/node/operator.go +++ b/node/operator.go @@ -103,22 +103,6 @@ func DeregisterOperator(ctx context.Context, KeyPair *core.KeyPair, transactor c return transactor.DeregisterOperator(ctx, KeyPair.GetPubKeyG1(), blockNumber) } -// UpdateOperatorQuorums updates the quorums for the given operator -func UpdateOperatorQuorums( - ctx context.Context, - operator *Operator, - transactor core.Transactor, - churnerUrl string, - useSecureGrpc bool, - logger logging.Logger, -) error { - err := DeregisterOperator(ctx, operator.KeyPair, transactor) - if err != nil { - return fmt.Errorf("failed to deregister operator: %w", err) - } - return RegisterOperator(ctx, operator, transactor, churnerUrl, useSecureGrpc, logger) -} - // UpdateOperatorSocket updates the socket for the given operator func UpdateOperatorSocket(ctx context.Context, transactor core.Transactor, socket string) error { return transactor.UpdateOperatorSocket(ctx, socket) diff --git a/node/plugin/cmd/main.go b/node/plugin/cmd/main.go index ec6656f93..647631894 100644 --- a/node/plugin/cmd/main.go +++ b/node/plugin/cmd/main.go @@ -141,14 +141,6 @@ func pluginOps(ctx *cli.Context) { return } log.Printf("Info: successfully opt-out the EigenDA, for operator ID: %x, operator address: %x", operatorID, sk.Address) - } else if config.Operation == "update-quorums" { - log.Printf("Info: Operator with Operator Address: %x is updating its quorums: %v", sk.Address, config.QuorumIDList) - err = node.UpdateOperatorQuorums(context.Background(), operator, tx, config.ChurnerUrl, true, logger) - if err != nil { - log.Printf("Error: failed to update quorums for operator ID: %x, operator address: %x, quorums: %v, error: %v", operatorID, sk.Address, config.QuorumIDList, err) - return - } - log.Printf("Info: successfully updated quorums, for operator ID: %x, operator address: %x, socket: %s, and quorums: %v", operatorID, sk.Address, config.Socket, config.QuorumIDList) } else if config.Operation == "update-socket" { log.Printf("Info: Operator with Operator Address: %x is updating its socket: %s", sk.Address, config.Socket) err = node.UpdateOperatorSocket(context.Background(), tx, config.Socket) diff --git a/node/plugin/config.go b/node/plugin/config.go index 8da55f71a..1800ff4e6 100644 --- a/node/plugin/config.go +++ b/node/plugin/config.go @@ -25,7 +25,7 @@ var ( OperationFlag = cli.StringFlag{ Name: "operation", Required: true, - Usage: "Supported operations: opt-in, opt-out, update-quorums", + Usage: "Supported operations: opt-in, opt-out", EnvVar: common.PrefixEnvVar(flags.EnvVarPrefix, "OPERATION"), } @@ -133,7 +133,7 @@ func NewConfig(ctx *cli.Context) (*Config, error) { } op := ctx.GlobalString(OperationFlag.Name) - if op != "opt-in" && op != "opt-out" && op != "update-quorums" { + if op != "opt-in" && op != "opt-out" { return nil, errors.New("unsupported operation type") } diff --git a/node/plugin/tests/plugin_test.go b/node/plugin/tests/plugin_test.go index da306a3d6..0bb38c448 100644 --- a/node/plugin/tests/plugin_test.go +++ b/node/plugin/tests/plugin_test.go @@ -147,22 +147,6 @@ func TestPluginOptInAndQuorumUpdate(t *testing.T) { ids, err := tx.GetNumberOfRegisteredOperatorForQuorum(context.Background(), core.QuorumID(0)) assert.NoError(t, err) assert.Equal(t, uint32(1), ids) - - operator.NODE_QUORUM_ID_LIST = "1" - testConfig.RunNodePluginBinary("update-quorums", operator) - - registeredQuorumIds, err = tx.GetRegisteredQuorumIdsForOperator(context.Background(), operatorID) - assert.NoError(t, err) - assert.Equal(t, 1, len(registeredQuorumIds)) - assert.Equal(t, uint8(1), registeredQuorumIds[0]) - - ids, err = tx.GetNumberOfRegisteredOperatorForQuorum(context.Background(), core.QuorumID(0)) - assert.NoError(t, err) - assert.Equal(t, uint32(0), ids) - - ids, err = tx.GetNumberOfRegisteredOperatorForQuorum(context.Background(), core.QuorumID(1)) - assert.NoError(t, err) - assert.Equal(t, uint32(1), ids) } func TestPluginInvalidOperation(t *testing.T) {