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

Add option to subscribe multiple validators at once #83

Open
3 of 4 tasks
alrevuelta opened this issue Jul 9, 2023 · 1 comment
Open
3 of 4 tasks

Add option to subscribe multiple validators at once #83

alrevuelta opened this issue Jul 9, 2023 · 1 comment
Assignees

Comments

@alrevuelta
Copy link

alrevuelta commented Jul 9, 2023

Context:

  • Currently validators can only be subscribed one by one. Meaning that someone with 50, would need to send 50 different txs, which implies: click Subscribe button, sign tx, wait, repeat. Not the best UX.

Feture:

  • Add new button with Subscribe All that allows to subscribe all validators that are in notsubscribed or untracked state.

Tasks:

  • Update the abi to the latest. Latest can be found here. Its important to have this latest abi because it adds the subscribeValidators function.
  • Create new button named Subscribe All. No opinion where it should be placed.
  • When Subscribe All button is clicked, get all validators belonging to the connected wallet /memory/validators/0x_wallet (note that this is already being done) and filter all validators so that we get the ones in notsubscribed or untracked state. This is very important as it wouldn't make sense to subscribe an already subscribed validator. Then, get their validator_index eg: validator_index(es)=5, 10, 40, 60.
  • Call the function subscribeValidators with said indexes and payable amount equal to collateral_in_wei * length(indexes). As a reminder collateral_in_wei is already used by the contract and can be fetched from :7300/config

Note: subscribeValidators function is very similar to subscribeValidator with the only difference that it takes an array of validators, and that the collateral amount has to be x times the amount of validators, where x is the amount of validators one wants to subscribe.

@Pol-Lanski
Copy link

Would it be crazy to also be able to choose validators with a checkbox next to every validator pubkey? I'm thinking about the use case that someone has 3 validators for themselves and 2 validators that they run for other people that want to keep their fee recipient. Multiply numbers by 10 if you want.

@mateodaza mateodaza self-assigned this Jul 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants