Skip to content

Commit

Permalink
comments addressed
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Krueger authored and Christian Krueger committed Aug 5, 2024
1 parent fd3aa58 commit 3db6bb1
Show file tree
Hide file tree
Showing 6 changed files with 322 additions and 418 deletions.
66 changes: 53 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

Jito StakeNet is a decentralized Solana stake pool manager, blending Validator History and Steward Programs for secure, transparent validator management and autonomous stake operations.

## History Program
## Validator History Program

The Validator History Program, a component of Jito StakeNet, is an on-chain record of verified Solana validator data, storing up to 512 epochs of history per validator. It takes fields accessible to the solana runtime like validator performance history, validator commission, MEV commission, as well as Gossip data like validator IP, version, and client type, and stores them all in a single account. It also contains some fields that currently require permissioned upload but are easily verifiable with a getVoteAccounts call, like total active stake per validator, stake rank, and superminority status. All these fields are stored in a single account per validator, the ValidatorHistory account. This enables all these disparate fields to be easily composed with in on chain programs, with a long lookback period and ease of access through the single account.

Expand All @@ -30,17 +30,16 @@ Note that this is a `zero_copy` account, which allows us to initialize a lot of

Harnessing on-chain validator metrics and network data, the Steward Program employs advanced algorithms to evaluate and rank validators. Automated keepers then execute a state machine to optimally allocate stake, maximizing network security and efficiency.

## Repo
On-chain Steward accounts for JitoSOL:

### Test
| Account | Address |
|-----------------|---------------------------------------------|
| Program | Stewardf95sJbmtcZsyagb2dg4Mo8eVQho8gpECvLx8 |
| Steward Config | jitoVjT9jRUyeXHzvCwzPgHj7yWNRhLcUoXtes4wtjv |
| Steward State | 9BAmGVLGxzqct6bkgjWmKSv3BFB6iKYXNBQp8GWG1LDY|
| Authority | 9eZbWiHsPRsxLSiHxzg2pkXsAuQMwAjQrda7C7e21Fw6|

Tests are in `tests/` written with solana-program-test.

All tests can be run by running ( root directory ):

```shell
./run_tests.sh
```
## Build and Test

### Build

Expand All @@ -53,6 +52,16 @@ Verify with [solana-verifiable-build](https://github.com/Ellipsis-Labs/solana-ve

`solana-verify verify-from-repo -um --program-id HistoryJTGbKQD2mRgLZ3XhqHnN811Qpez8X9kCcGHoa https://github.com/jito-foundation/stakenet`

### Test

Tests are in `tests/` written with solana-program-test.

All tests can be run by running ( root directory ):

```shell
./run_tests.sh
```

## Running Keeper

Check out the [Keeper Bot Quick Start](./keeper-bot-quick-start.md)
Expand All @@ -75,9 +84,40 @@ To see the historical state of a single validator history account:

### Steward

This CLI can be used to see the status of on-chain validator history data.
This CLI can be used to see the status of on-chain steward data.

Build:

```bash
cargo b -r --package steward-cli
```

Build: `cargo b -r --package steward-cli`
To view the config:

```bash
./target/release/steward-cli --program-id Stewardf95sJbmtcZsyagb2dg4Mo8eVQho8gpECvLx8 view-config --steward-config jitoVjT9jRUyeXHzvCwzPgHj7yWNRhLcUoXtes4wtjv
```

To view the state:
(Note: This fetches a lot of accounts, you may want to use your own RPC)

```bash
./target/release/steward-cli --json-rpc-url YOUR_RPC view-state --steward-config jitoVjT9jRUyeXHzvCwzPgHj7yWNRhLcUoXtes4wtjv
```

To see the state of each validator in the context of the steward add `--verbose`

```bash
./target/release/steward-cli --json-rpc-url YOUR_RPC view-state --steward-config jitoVjT9jRUyeXHzvCwzPgHj7yWNRhLcUoXtes4wtjv --verbose
```

> TIP: To use your own RPC configured in your solana config, use the following:
> `--json-rpc-url $(solana config get | grep "RPC URL" | awk '{print $3}')`
To see all of the available commands:
`./target/release/steward-cli -h`

```bash
./target/release/steward-cli -h
```

To see more info on the Steward CLI check out the [CLI notes](./utils/steward-cli/steward_cli_notes.md)
2 changes: 1 addition & 1 deletion keeper-bot-quick-start.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Keeper Bot Quick-start

Below are the steps to configuring and running the Stakenet Keeper Bot. We recommend running the docker container.
Below are the steps to configuring and running the Stakenet Keeper Bot. We recommend running it as a docker container.

## Setup

Expand Down
5 changes: 3 additions & 2 deletions programs/steward/src/state/steward_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -551,9 +551,10 @@ impl StewardState {
.set(num_pool_validators, false)?;

if marked_for_regular_removal {
self.validators_to_remove.set(index, false)?;
self.validators_to_remove.set(num_pool_validators, false)?;
} else {
self.validators_for_immediate_removal.set(index, false)?;
self.validators_for_immediate_removal
.set(num_pool_validators, false)?;
}

Ok(())
Expand Down
Loading

0 comments on commit 3db6bb1

Please sign in to comment.