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

Remove the update-quorums command support #362

Merged
merged 2 commits into from
Mar 19, 2024
Merged
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
16 changes: 0 additions & 16 deletions node/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 0 additions & 8 deletions node/plugin/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions node/plugin/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
}

Expand Down Expand Up @@ -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")
}

Expand Down
16 changes: 0 additions & 16 deletions node/plugin/tests/plugin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Loading