jito-solana

repository·master·Indexed 20 days ago

https://github.com/jito-foundation/jito-solana

A high-performance fork of the Solana validator optimized for Maximum Extractable Value (MEV) and specialized validator workloads. It includes support for the Block Assembly Marketplace (BAM), tools for configuring local clusters, methods for baking validator accounts into genesis, and the Geyser Plugin Interface for extending the validator runtime.

Tokens
93.6K
Snippets
333
Records
464
Agent score
73%

What's inside jito-solana

  1. Monitor cluster health with agave-watchtower

    master

    The agave-watchtower program monitors cluster health by periodically polling an RPC API. It verifies that:

    • Transaction counts are advancing.
    • New blockhashes are available.
    • No validators are delinquent.

    If the Validator Admission Ticket (VAT) feature is active, it also alerts if a monitored validator's vote account balance falls below the bank-side VAT balance threshold (as visible via RPC).

    Configuration Options:

    • RPC URLs: Use --url to provide a single RPC URL or --urls to provide up to 3 URLs. If 3 URLs are provided, at least 2 must confirm cluster health for the check to pass. Providing exactly 2 URLs is not supported.
    • Validator Filtering: Use --validator-identity to restrict failure notifications to a specific set of validators.
  2. Use the Solana Virtual Machine (SVM) as a standalone library

    master

    The Solana Virtual Machine (SVM) can be used as a standalone library outside of the standard Solana Validator. This is useful for applications such as:

    • SVM Rollups: Reducing hardware requirements for rollups by executing blocks without the full validator stack.
    • SVM Fraud Proofs: Generating succinct proofs of invalid state transitions.
    • Validator Sidecars: Separating JSON-RPC workloads (like simulateTransaction) from the main validator.
    • Custom Environments: Running SVM within other consensus frameworks (e.g., Avalanche subnets) or creating modified versions (SVM+).
  3. Understand SVMTransaction and TransactionCheckResult

    master

    SVMTransaction

    A trait representing a transaction that has already passed protocol rule checks (e.g., signature verification and account index validation). It provides access to:

    • signatures: Encrypted transaction message hashes.
    • static_account_keys: Slice of Pubkey used in the transaction.
    • account_keys: All account pubkeys (including address table lookups).
    • recent_blockhash: The recent block hash.
    • instructions_iter: Iterator over instructions.
    • message_address_table_lookups: Iterator over address table lookups (for V0 transactions).

    TransactionCheckResult

    A data structure that stores transaction details, such as whether it contains a nonce, the nonce value, and the lamports per signature required for fees.

  4. How the Solana Geyser Plugin Interface works

    master

    The Geyser Plugin Interface allows you to extend the Solana Validator runtime by injecting a plugin that reacts to real-time events, such as account updates, block processing, or transaction processing. This is commonly used to stream validator state to external storage, like a PostgreSQL database.

    To create a plugin, you must:

    1. Implement the GeyserPlugin trait defined in geyser_plugin_interface.rs.
    2. Compile your plugin as a cdylib dynamic library.
    3. Expose a C function named _create_plugin() that returns an instance of your GeyserPlugin implementation.
  5. Understand the SVM Functional Model and Transaction Lifecycle

    master

    The Solana Virtual Machine (SVM) manages the control flow for transaction execution. At a high level, the process involves loading program accounts, verifying them, creating an invocation context, and invoking the Runtime Berkeley Packet Filter (RBPF) on programs.

    Key components include:

    • Account Database & Sysvar Cache: The SVM interacts with these via traits provided by the caller.
    • Program Loader: A helper module providing utilities like load_program_with_pubkey to load programs from on-chain.
    • MessageProcessor: Contained in the solana-program-runtime crate, this component is responsible for the actual execution of the transaction message.
    • LogCollector: Defined in solana-program-runtime, used to capture execution logs.

    Note that while the bank (in a Solana Validator context) consumes the results of execution, the bank structure itself is not part of the SVM specification.