Skip to content

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

Closed
digithrone wants to merge 3 commits intoava-labs:mainfrom
digithrone:changeWeightFixes
Closed

Added bls-proof-of-possession cli option to blockchain changeWeight command#2759
digithrone wants to merge 3 commits intoava-labs:mainfrom
digithrone:changeWeightFixes

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

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

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"

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.

@felipemadero
Copy link
Collaborator

Thank you for the contribution! We've included your change in #2994 with a minor typo fix ("possession" instead of "possesion").

Appreciate you taking the time to contribute!

@github-project-automation github-project-automation bot moved this from Backlog 🧊 to Done 🎉 in avalanchego Dec 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants