Skip to content

Commit

Permalink
updates based on better understanding
Browse files Browse the repository at this point in the history
  • Loading branch information
shrimalmadhur committed Jun 12, 2024
1 parent f682192 commit 17ea040
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 15 deletions.
31 changes: 26 additions & 5 deletions pkg/flags/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,28 @@ var (
Name: "avs-addresses",
Usage: "Comma separated list of AVS addresses",
Required: false,
Aliases: []string{"as"},
}

AvsAddressFlag = cli.StringSliceFlag{
Name: "avs-address",
Usage: "an AVS address",
Required: true,
Aliases: []string{"a"},
}

OperatorSetsFlag = cli.StringSliceFlag{
Name: "operator-sets",
Usage: "Comma separated list of operator sets",
Required: false,
Aliases: []string{"os"},
Aliases: []string{"ops"},
}

OperatorSetFlag = cli.StringFlag{
Name: "operator-set",
Usage: "Operator set identifier",
Required: true,
Aliases: []string{"o"},
Aliases: []string{"op"},
}

NumberOfDaysFlag = cli.IntFlag{
Expand All @@ -53,11 +60,11 @@ var (
Aliases: []string{"b"},
}

AllocationPercentageFlag = cli.StringFlag{
Name: "allocation-percentage",
AllocationBipsFlag = cli.StringFlag{
Name: "allocation-bips",
Usage: "Allocation to update",
Required: true,
Aliases: []string{"a"},
Aliases: []string{"ap"},
}

StakeSourceFlag = cli.StringFlag{
Expand All @@ -82,4 +89,18 @@ var (
Required: true,
Aliases: []string{"r"},
}

StrategyAddressFlag = cli.StringFlag{
Name: "strategy-address",
Usage: "Address of the strategy contract",
Required: true,
Aliases: []string{"sa"},
}

OutputFilePathFlag = cli.StringFlag{
Name: "output-file-path",
Usage: "Path to the output file. It will be in a CSV format",
Required: false,
Aliases: []string{"o"},
}
)
2 changes: 1 addition & 1 deletion pkg/operator/keys/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func GetOperatorIdFromBLSPubKey(pubKey string) (string, error) {
// ```
//
// This code just parser this string:
// E([498211989701534593628498974128726712526336918939770789545660245177948853517,19434346619705907282579203143605058653932187676054178921788041096426532277474])
// E([498211989701534593628498974128726712526336918939770789545660245177948853517,19434346619705907282579203143605058653932187676054178921788041096426532277474])

if pubKey == "O" {
return "", fmt.Errorf("pubKey is Infinity")
Expand Down
1 change: 1 addition & 0 deletions pkg/operator/rewards/show.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ func ShowCmd(p utils.Prompter) *cli.Command {
&flags.NumberOfDaysFlag,
&flags.OperatorSetsFlag,
&flags.AvsAddressesFlag,
&flags.OutputFilePathFlag,
},
}
}
Expand Down
14 changes: 8 additions & 6 deletions pkg/operator/stakeallocation/rebalance.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,21 @@ func RebalanceCmd(p utils.Prompter) *cli.Command {
Description: `
Rebalance the stake allocation for the operator for a particular strategy.
This CSV file requires the following columns for only one stragegy:
operator_set,allocation percentage
Example
1,10
2,15
avs address,operator set,allocation bips
Example:
0xabcd,1,10
0x1234,2,15
`,
Action: rebalanceStakeAllocation,
After: telemetry.AfterRunAction(),
Flags: []cli.Flag{
&flags.ConfigurationFileFlag,
&flags.DryRunFlag,
&flags.BroadcastFlag,
&flags.StrategyAddressFlag,
&flags.ShowMagnitudesFlag,
&flags.RebalanceFilePathFlag,
&flags.DryRunFlag,
&flags.BroadcastFlag,
&flags.OutputFilePathFlag,
},
}
}
Expand Down
1 change: 1 addition & 0 deletions pkg/operator/stakeallocation/show.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ func ShowCmd(p utils.Prompter) *cli.Command {
&flags.ConfigurationFileFlag,
&flags.AvsAddressesFlag,
&flags.OperatorSetsFlag,
&flags.OutputFilePathFlag,
},
}
}
Expand Down
9 changes: 6 additions & 3 deletions pkg/operator/stakeallocation/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,15 @@ func UpdateCmd(p utils.Prompter) *cli.Command {
After: telemetry.AfterRunAction(),
Flags: []cli.Flag{
&flags.ConfigurationFileFlag,
&flags.AvsAddressFlag,
&flags.OperatorSetFlag,
&flags.DryRunFlag,
&flags.BroadcastFlag,
&flags.AllocationPercentageFlag,
&flags.StrategyAddressFlag,
&flags.AllocationBipsFlag,
&flags.StakeSourceFlag,
&flags.ShowMagnitudesFlag,
&flags.DryRunFlag,
&flags.BroadcastFlag,
&flags.OutputFilePathFlag,
},
}
}
Expand Down

0 comments on commit 17ea040

Please sign in to comment.