Solana Foundation stake bot used on the Solana Testnet and Mainnet-Beta

Overview

Effortlessly Manage Cluster Stakes

The testnet and mainnet-beta clusters currently have a large population of validators that need to be staked by a central authority.

Staking Criteria

  1. All non-delinquent validators receive 50,000 SOL stake
  2. Additionally, non-deliquent validators that have produced a block in 75% of their slots in the previous epoch receive bonus stake of 500,000 SOL

A validator that is delinquent for more than 24 hours will have all stake removed. However stake-o-matic has no memory, so if the same validator resolves their delinquency then they will be re-staked again

Validator Whitelist

To be eligible for staking, a validator's identity pubkey must be added to a YAML whitelist file.

Stake Account Management

Stake-o-matic will split the individual validator stake accounts from a master stake account, and must be given the authorized staker keypair for the master stake account.

Comments
  • Add testnet stake pool to stake-o-matic.sh

    Add testnet stake pool to stake-o-matic.sh

    Problem

    In order to have stake pools run nicely next to not-a-stake-pool, let's reuse a lot of the plumbing.

    Solution

    Add testnet-stake-pool as a cluster option for use with buildkite. Even though the variable RESERVE_ACCOUNT_ADDRESS is poorly named for stake pools, since it actually represents the address of the pool, it seems like it's best to maintain the same name to work with the current setup.

    We'll just need to add another step to run the testnet-stake-pool version of stake-o-matic to buildkite.

    opened by joncinque 8
  • bot: Force refresh the blockhash more often while sending txs

    bot: Force refresh the blockhash more often while sending txs

    While running the stake-o-matic for testnet stake pools, I kept running into the same issue often reported on buildkite:

    [2021-09-10T01:47:00.354078368Z WARN  solana_stake_o_matic::rpc_client_utils] Failed to send transaction: ClientError { request: Some(SendTransaction), kind: RpcError(RpcResponseError { code: -32002, message: "Transaction simulation failed: Blockhash not found", data: SendTransactionPreflightFailure(RpcSimulateTransactionResult { err: Some(BlockhashNotFound), logs: Some([]), accounts: None }) }) }
    

    So as a little patch / Ugly Thing :tm: , this force refreshes the blockhash.

    This is not intended as a replacement for the work happening in #143, but as a band-aid. Note that the number of 100 was chosen based on my local machine. 200 still resulted in some blockhashes expiring, so I went with this safe value, which consistently manages to push all transactions out. We may be able to bump it up for the actual runs.

    opened by joncinque 6
  • Enable notifications from follower builds

    Enable notifications from follower builds

    Problem Logic for making first-in-the-epoch classifications is lumped in with whether or not to push notifications. This prevents follower builds from pushing notifications from existing classifications.

    Solution Break out the booleans.

    opened by danpaul000 6
  • Bot: Fix issue with require_testnet_participation requirement

    Bot: Fix issue with require_testnet_participation requirement

    Issues were:

    • Bot was looking at the wrong testnet epochs (if MB epoch was 200, it checked TN epoch 200 instead of the current TN epoch)
    • If a validator had None stake in all epochs where the bot checked for participation, the validator would not be destaked
    • The most recent epoch was ignore when looking at participation
    opened by alex-at-planetariummusic 5
  • Add bot

    Add bot "export" subcommand

    Adds an "export" subcommand that exports validator info for an epoch/cluster to a postgres database. The database will be used by the solana.foundation website.

    Historical information is pulled from the yml files in the stake-o-matic.wiki files, and where the info is not available in those files it is pulled using RPC calls.

    I currently plan on updating the stake-o-matic bot to export all needed data to the wiki yml files to make the more time-consuming RPC calls unnecessary when running the "export" command.

    opened by alex-at-planetariummusic 5
  • Add stake pool implementation

    Add stake pool implementation

    An actually-a-stake-pool stake-o-matic implementation!

    This mostly follows the lead of stake_pool_v0, and adds a similar this_test_is_too_long implementation, all specialized for stake pools. It's possible to refactor a lot of the math to calculate how much stake to distribute to each validator, but I wanted to keep that separate for now.

    A few differences to note design-wise for this stake pool implementation:

    • the lamports for validator stake accounts come directly from the authorized staker's lamports, which functions as the staker's reserve
    • separately, the stake pool also has a reserve for increasing / decreasing stake on the validators

    Questions / comments / concerns appreciated! This shares a similar weakness to stake_pool_v0, that you can run out of stake from your reserve while trying to increase the validator stake levels. Have there been any issues with that in the wild?

    opened by joncinque 5
  • bot: Separate markdown from classification generation

    bot: Separate markdown from classification generation

    Problem

    Markdown and epoch classification output are tied together, but the stake pool's mainnet run needs the stake pool testnet classification. At the same time, we don't want to clobber the markdown generated by the not-a-stake-pool run.

    Solution

    Add an --epoch-classification flag, which works exactly the same way as the markdown flag, allowing for more fine-grained control over epoch classification output.

    opened by joncinque 3
  • bot: Add retry logic on TpuClient creation

    bot: Add retry logic on TpuClient creation

    Problem

    The mainnet job 429'ed on creation of the TpuClient, which we should be able to recover from.

    Solution

    Recover from any connection error on creation of the TpuClient!

    Little note: I had this match in the loop originally as:

    error @ Err(TpuSenderError::PubsubError(PubsubClientError::ConnectionError(_)))
    

    which then lets us return error; on the last round, but it felt easier to read to just add another attempt at the end after the retries. Happy to be overruled though!

    opened by joncinque 3
  • Error withdraw and re-register new key

    Error withdraw and re-register new key

    I register testnet and mainnet key the same. Now I can't withdraw and re-register new key for mainnet (Error: "Registration already exists") When I try withdraw registration [2021-06-17T12:40:41.908291066Z DEBUG solana_client::rpc_client] -32002 Transaction simulation failed: Error processing Instruction 0: invalid account data for instruction [2021-06-17T12:40:41.908303953Z DEBUG solana_client::rpc_client] 1: Program reg8X1V65CSdmrtEjMgnXZk96b9SUSQrJ8n1rP1ZMg7 invoke [1] [2021-06-17T12:40:41.908305990Z DEBUG solana_client::rpc_client] 2: Program log: Withdraw [2021-06-17T12:40:41.908307218Z DEBUG solana_client::rpc_client] 3: Program log: Error: mainnet and testnet identities must be unique [2021-06-17T12:40:41.908308479Z DEBUG solana_client::rpc_client] 4: Program reg8X1V65CSdmrtEjMgnXZk96b9SUSQrJ8n1rP1ZMg7 consumed 2160 of 200000 compute units [2021-06-17T12:40:41.908309831Z DEBUG solana_client::rpc_client] 5: Program reg8X1V65CSdmrtEjMgnXZk96b9SUSQrJ8n1rP1ZMg7 failed: invalid account data for instruction [2021-06-17T12:40:41.908311228Z DEBUG solana_client::rpc_client] Error: "error: send transaction: RPC response error -32002: Transaction simulation failed: Error processing Instruction 0: invalid account data for instruction [5 log messages]"

    opened by goto5k 3
  • Bump serde from 1.0.137 to 1.0.141

    Bump serde from 1.0.137 to 1.0.141

    Bumps serde from 1.0.137 to 1.0.141.

    Release notes

    Sourced from serde's releases.

    v1.0.141

    • Add no-std category to crates.io metadata

    v1.0.140

    • Invert serde_derive cfgs to convenience non-Cargo builds on a modern toolchain (#2251, thanks @​taiki-e)

    v1.0.139

    • Add new constructor function for all IntoDeserializer impls (#2246)

    v1.0.138

    • Documentation improvements
    Commits
    • d786e75 Release 1.0.141
    • 10e4839 Move Postcard link up to Bincode spot
    • 85e7265 Add categories to crates.io metadata
    • c9cc8a8 Add authors to Cargo.toml
    • a925ce4 Sort package entries in Cargo.toml
    • c5f6338 Release 1.0.140
    • 5185487 Merge pull request #2251 from taiki-e/derive-cfg
    • efaafd4 Invert build.rs cfgs in serde_derive
    • a0eb83a Resolve invalid_utf8_in_unchecked clippy lint in ancient test code
    • 7cc6f7f Ignore new_without_default clippy lint
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 2
  • bot: Use TpuClient to send transactions

    bot: Use TpuClient to send transactions

    Choose your own adventure! #163 or this.

    Problem

    Blockhashes expire too often while running the bot.

    Solution

    Use the TpuClient to send transactions instead of RpcClient. This adapts the work from spl-token-cli to send and check transactions: https://github.com/solana-labs/solana-program-library/blob/21ae18dbd0458f9e5f18b1407a626670f6475438/token/cli/src/rpc_client_utils.rs#L36

    There's a bit of churn to update parameters all over the place, but otherwise the code isn't too different.

    I'll be running tests over the next couple of days to see this performs compared to the other PR, and I'll move it out of draft once the testing is complete. If everything looks good, I'll probably opt for this.

    opened by joncinque 2
Releases(test_stake_movement_limits)
Owner
Solana Foundation
Solana Foundation
🐉 Aggregate of Solana stake pools.

?? aSOL: Aggregate Stake Pool aSOL is an unbiased stake pool aggregator built to tackle one goal: to ensure all SOL on Solana is staked into stake poo

aSOL 36 Sep 3, 2022
Sothis is a tool for replaying historical state on a local testnet node.

sothis Sothis is a tool for replaying historical state on a local anvil/hardhat testnet node. Usage Sothis currently has 2 modes. Live and historic. I

null 22 Jun 15, 2023
Rust bindings to Core Foundation and other low level libraries on Mac OS X and iOS

core-foundation-rs Compatibility Targets macOS 10.7 by default. To enable features added in macOS 10.8, set Cargo feature mac_os_10_8_features. To hav

Servo 685 Jan 2, 2023
Selendra is a multichains interoperable nominated Proof-of-Stake network for developing and running Substrate-based and EVM compatible blockchain applications.

Selendra An interoperable nominated Proof-of-Stake network for developing and running Substrate-based and EVM compatible blockchain applications. Read

Selendra 16 Nov 29, 2022
Rewrite of the Discord Bot used for Managing the Infinity Bot List Servers.

Arcadia Rewrite of the Discord Bot used for Managing the Infinity Bot List Servers. Contributing Always run fmt.sh before making a Pull Request! MacOS

InfinityBotList 3 Dec 15, 2022
Rust implementation of Namada, a sovereign proof-of-stake blockchain that enables asset-agnostic private transfers

Namada Overview Namada is a sovereign proof-of-stake blockchain, using Tendermint BFT consensus, that enables multi-asset private transfers for any na

anoma 144 Jan 2, 2023
Compiler front-end foundation technology.

Lady Deirdre. Compiler front-end foundation technology. If you want to create your own programming language with IDE support from day one, or if you a

Ilya Lakhin 45 Jan 5, 2023
Gh-sql - Query GitHub Projects (beta) with SQL

gh-sql: Query GitHub Projects (beta) with SQL Installation gh extension install KOBA789/gh-sql Features SELECT items DELETE items UPDATE item fields

Hidekazu Kobayashi 108 Dec 7, 2022
Sled - the champagne of beta embedded databases

key value buy a coffee for us to convert into databases documentation chat about databases with us sled - it's all downhill from here!!! An embedded d

Tyler Neely 6.6k Jan 8, 2023
RGB20 Contract Demo based on RGB v0.11.0-beta.6

RGB20 Demo based on RGB v0.11 Pre-request To complete the demo, you need to set up the following toolchains: Git Rust RGB-CLI Bitcoin Local Env RGB-CL

null 18 Jul 9, 2024
Demonstrates Solana data account versioning used in supporting the Solana Cookbook article: Account Data Versioning

versioning-solana This repo demonstrates ONE rudimentary way to upgrade/migrate account data changes with solana program changes. What is data version

Frank V. Castellucci 6 Sep 30, 2022
The fast, light, and robust client for the Ethereum mainnet.

OpenEthereum Fast and feature-rich multi-network Ethereum client. » Download the latest release « Table of Contents Description Technical Overview Bui

OpenEthereum 1.6k Dec 28, 2022
The fast, light, and robust client for the Ethereum mainnet.

OpenEthereum Fast and feature-rich multi-network Ethereum client. » Download the latest release « Table of Contents Description Technical Overview Bui

OpenEthereum 1.6k Jan 8, 2023
The fast, light, and robust client for the Ethereum mainnet.

OpenEthereum Fast and feature-rich multi-network Ethereum client. » Download the latest release « Table of Contents Description Technical Overview Bui

OpenEthereum 1.6k Dec 28, 2022
Marinde Anchor-Based, first on mainnet, liquid-staking-program and mSOL->SOL swap pool

marinade-anchor Marinade-finance liquid staking program for the Solana blockchain Audits & Code Review Kudelski Security: https://marinade.finance/Kud

Marinade.Finance 42 Dec 11, 2022
rust client libraries to deal with the current cardano mainnet (byron / cardano-sl)

Rust implementation of Cardano primitives, helpers, and related applications Cardano Rust is a modular toolbox of Cardano’s cryptographic primitives,

Input Output 275 Oct 9, 2022
rust client libraries to deal with the current cardano mainnet (byron / cardano-sl)

Rust implementation of Cardano primitives, helpers, and related applications Cardano Rust is a modular toolbox of Cardano’s cryptographic primitives,

Input Output 275 Oct 9, 2022
Smart Contracts to be used by terra-bot

CosmWasm Starter Pack This is a template to build smart contracts in Rust to run inside a Cosmos SDK module on all chains that enable it. To understan

João Silvestre 2 Sep 25, 2022
🤖 Discord bot used @okp4 to bridge the Dataverse!

?? Discord bot Discord bot used @okp4 to bridge the Dataverse! ✨ Purpose This project is a Discord bot mainly intended to be used for the OKP4 Discord

OKP4 – Open Knowledge Protocol For 11 Nov 15, 2022
Matrix bot inspired by Shirt Bot.

matrix-openai-bot Matrix bot inspired by Shirt Bot. Usage Run the bot after building it or grabbing the latest release $ matrix-openai-bot Edit the ge

null 5 Oct 26, 2021