Skip to content

Added bls-proof-of-possession cli option to blockchain changeWeight command #2759

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

digithrone
Copy link

@digithrone digithrone commented Apr 22, 2025

avalanche blockchain changeWeight added option to bls proof of possession via cli arg.

Why this should be merged

It allows to automatically execute command without the additional prompt.

How this works

How this was tested

I have performed a rebalancing of testnet environment for the client with single 100 weight node and rebalanced to 5 validator nodes all of weight 100 by using addValidator, changeWeight and removeValidator.

How is this documented

The fixes are trivial so no additional documentation is needed.

Copy link
Collaborator

@felipemadero felipemadero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

currently it is possible to avoid the node to have open http api, CLI asks for pop on
change weight, and remove validator asks for node id or receive it from flags (remove validator does not use bls info).
but change weight was not having a flag for pop, which this PR adds

@@ -64,6 +64,8 @@ The L1 has to be a Proof of Authority L1.`,
cmd.Flags().Uint64Var(&newWeight, "weight", 0, "set the new staking weight of the validator")
cmd.Flags().BoolVarP(&useEwoq, "ewoq", "e", false, "use ewoq key [fuji/devnet only]")
cmd.Flags().StringVar(&nodeIDStr, "node-id", "", "node-id of the validator")
cmd.Flags().StringVar(&publicKey, "bls-public-key", "", "set the BLS public key of the validator to add")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is anyway overwritten during the flow. not needed as it is taken from PChain

@@ -64,6 +64,8 @@ The L1 has to be a Proof of Authority L1.`,
cmd.Flags().Uint64Var(&newWeight, "weight", 0, "set the new staking weight of the validator")
cmd.Flags().BoolVarP(&useEwoq, "ewoq", "e", false, "use ewoq key [fuji/devnet only]")
cmd.Flags().StringVar(&nodeIDStr, "node-id", "", "node-id of the validator")
cmd.Flags().StringVar(&publicKey, "bls-public-key", "", "set the BLS public key of the validator to add")
cmd.Flags().StringVar(&pop, "bls-proof-of-possession", "", "set the BLS proof of possession of the validator to add")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pls change the description to something related to the change weight command, eg "BLS proof of possession of the validator that is to change weight"

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pls change the description to something related to the change weight command, eg "BLS proof of possession of the validator that is to change weight"

@@ -68,6 +68,8 @@ these prompts by providing the values with flags.`,
cmd.Flags().BoolVarP(&useLedger, "ledger", "g", false, "use ledger instead of key (always true on mainnet, defaults to false on fuji)")
cmd.Flags().StringSliceVar(&ledgerAddresses, "ledger-addrs", []string{}, "use the given ledger addresses")
cmd.Flags().StringVar(&nodeIDStr, "node-id", "", "node-id of the validator")
cmd.Flags().StringVar(&publicKey, "bls-public-key", "", "set the BLS public key of the validator to add")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this command does not use this variables at all

@digithrone digithrone changed the title Added bls-public-key and bls-proof-of-possession cli options to blockchain changeWeight and removeValidator Added bls-proof-of-possession cli option to blockchain changeWeight Apr 22, 2025
@digithrone digithrone changed the title Added bls-proof-of-possession cli option to blockchain changeWeight Added bls-proof-of-possession cli option to blockchain changeWeight command Apr 22, 2025
@digithrone
Copy link
Author

I removed unnecessary change in removeValidator and also removed public key options so only pop is added to changeWeight command. Also updated PR title and description to properly reflect code changes.

@felipemadero
Copy link
Collaborator

I removed unnecessary change in removeValidator and also removed public key options so only pop is added to changeWeight command. Also updated PR title and description to properly reflect code changes.

Please also consider #2759 (comment)

@digithrone
Copy link
Author

I changed the description so it is compatible with node-id description.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog 🧊
Development

Successfully merging this pull request may close these issues.

3 participants