-
Notifications
You must be signed in to change notification settings - Fork 375
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
Voting bot for stake off #2327
Voting bot for stake off #2327
Conversation
…. set it to 1 for baklava
…le value. set it to 1 for baklava" This reverts commit 3beee57.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice to observe how the bots would vote on Baklava before turning them loose.
Should we start them with a small amount of gold and analyze their actions before giving them more?
const validators = await kit.contracts.getValidators() | ||
|
||
const validatorSigners = await election.getCurrentValidatorSigners() | ||
const validatorAccounts = ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we use validators.getRegisteredValidators()
here? Do we want to include previously elected (but currently unelected) validators?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I understand it, the only validators that have a score are ones that are currently elected. If I am mistaken about that, then sure, this can be changed. This function could probably remain intact otherwise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that when incumbent validators lose election, their validator score remains whatever it was for the last epoch they were elected.
celocli validator:list | grep 0\\. | wc -l
Fetching Validators... done
120
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, you're right. They seem to preserve the score from when they were last elected.
However, that, in itself, does not lead to a decision on what should happen with this line of code.
# Number of gold-holding bots that vote for validator groups | ||
VOTING_BOTS=100 | ||
# 10,000 CG | ||
VOTING_BOT_BALANCE=10000000000000000000000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With only 10k Celo Gold, will the bots have enough impact?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is what @timmoreton suggested. At this amount, each bot has slightly less than each validator. (Each validator gets 12k, and each group gets 12k).
Tim - what was your rationale for that amount? Is this still in line with the level of impact we want each bot to have?
I think it's fine to have this as a starting point. We can adjust if we want more impact - either by adding more bots, or giving each bot more gold. Given the current setup function, adding more bot accounts is a bit easier than increasing the locked gold for existing ones.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, right. I think I forgot that essentially all the validator groups would be tied.
|
||
// Handle the case where the group the bot is currently voting for does not have a score | ||
if ( | ||
!currentGroup || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm concerned the bots first votes could decimate the incumbency. (At least if they're run with enough gold, say 25k. Otherwise I'm concerned there will be little impact.)
To avoid maybe:
- Run bots once with VOTING_BOT_EXPLORE_PROBABILITY=0, long enough that all of the bots are voting for the incumbency.
- Restart bots with VOTING_BOT_EXPLORE_PROBABILITY=1, so that any displacement of incumbency is based on score.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That could work. I'm not sure setting VOTING_BOT_EXPLORE_PROBABILITY=1
is the best idea. I think having some bots voting based on good performance is useful. Maybe like.... 0.8?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code LGTM!
* master: (25 commits) Add react-testing-utils + Fix Analytics (#2437) collect coverage on web (#2415) Add callouts to serve text messages in regions (#2458) [Wallet] Historical currency conversions in the transaction feed (#2446) CLI relock fix (#2464) Update copyright year + inline button (#2468) Voting bot for stake off (#2327) Change order of profile info (#2454) [Wallet] Fix type check regression for components wrapped by our custom `withTranslation` (#2457) Unfreeze rewards by default (#2452) Baklava and baklavastaging deploys (#2421) Fix coin colors (#2441) Make governance CLI more usable (#2428) Slashing params for stake off phase 2 (#2418) [Wallet] Rollback zeroSync toggle in case it was not successful (#2434) [Wallet] Cleanup unused StateProps references (#2439) Add unit tests and cli checks for validator hotfix interaction (#2340) Add proper Spanish translations (#2427) Catch exceptions during polling (#2432) Add unfreeze-contracts command to celotool (#2433) ... # Conflicts: # packages/web/src/brandkit/common/MobileMenu.test.tsx # yarn.lock
* master: Add react-testing-utils + Fix Analytics (#2437) collect coverage on web (#2415) Add callouts to serve text messages in regions (#2458) [Wallet] Historical currency conversions in the transaction feed (#2446) CLI relock fix (#2464) Update copyright year + inline button (#2468) Voting bot for stake off (#2327) Change order of profile info (#2454) [Wallet] Fix type check regression for components wrapped by our custom `withTranslation` (#2457) Unfreeze rewards by default (#2452) # Conflicts: # packages/web/src/analytics/analytics.test.ts # packages/web/src/brandkit/common/MobileMenu.test.tsx # yarn.lock
* master: add celo.org/about#contributors id (#2488) [Wallet] Fix integration build firebase db url on Android (#2495) Fixes governance CLI bugs encountered while running election contract upgrade (#2482) Add validator:signed-blocks command and fix validator:status bug (#2456) Bump @celo/celocli version to 0.0.34 (#2420) Fix Logo + backers number change (#2453) Improve election efficiency by short circuiting (#2475) Page for Experience / BrandKit / Composition (#2462) Configure the time to wait for text messages (#2450) Add react-testing-utils + Fix Analytics (#2437) collect coverage on web (#2415) Add callouts to serve text messages in regions (#2458) [Wallet] Historical currency conversions in the transaction feed (#2446) CLI relock fix (#2464) Update copyright year + inline button (#2468) Voting bot for stake off (#2327)
Description
This implements a voting bot, that runs roughly once an epoch and votes on validator groups. For each voting bot account, it does this process:
Tested
I ran the following celotool command, pointed at baklava staging, and confirmed that voting occurred.
celotool bots auto-vote --celoProvider https://baklavastaging-forno.celo-testnet.org
I confirmed that the cronjob gets deployed and then voting happens on schedule with this command:
celotool deploy initial voting-bot -e baklavastaging
Other changes
fixed a typo or two
Related issues