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

Deterministically find tip amounts, add meta to stake info, and cleanup pubkey/strings in MEV tips #159

Merged
merged 14 commits into from
Oct 14, 2022
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion runtime/src/stake_account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ impl<T> StakeAccount<T> {
}

#[inline]
pub(crate) fn stake_state(&self) -> &StakeState {
pub fn stake_state(&self) -> &StakeState {
&self.stake_state
}

Expand Down
1 change: 1 addition & 0 deletions tip-distributor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ solana-sdk = { path = "../sdk", version = "=1.15.0" }
solana-stake-program = { path = "../programs/stake", version = "=1.15.0" }
thiserror = "1.0.31"
tip-distribution = { path = "../jito-programs/tip-payment/programs/tip-distribution", features = ["no-entrypoint"] }
tip-payment = { path = "../jito-programs/tip-payment/programs/tip-payment", features = ["no-entrypoint"] }
tokio = { version = "1.12.0", features = ["rt-multi-thread", "macros", "sync", "time", "full"] }

[[bin]]
Expand Down
28 changes: 14 additions & 14 deletions tip-distributor/src/bin/stake-meta-generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use {
clap::Parser,
log::*,
solana_client::rpc_client::RpcClient,
solana_sdk::{clock::Slot, pubkey::Pubkey},
solana_tip_distributor::{self, stake_meta_generator_workflow::run_workflow},
std::{
Expand All @@ -26,17 +25,17 @@ struct Args {
#[clap(long, env)]
tip_distribution_program_id: Pubkey,

/// The tip-payment program id.
#[clap(long, env)]
tip_payment_program_id: Pubkey,

/// Path to JSON file populated with the [StakeMetaCollection] object.
#[clap(long, env)]
out_path: String,

/// The expected snapshot slot.
#[clap(long, env)]
snapshot_slot: Slot,

/// The RPC to fetch lamports from for the tip distribution accounts.
#[clap(long, env)]
rpc_url: String,
}

impl Args {
Expand All @@ -54,14 +53,15 @@ fn main() {

let args: Args = Args::parse();

let rpc_client = RpcClient::new(args.rpc_url);

run_workflow(
if let Err(e) = run_workflow(
&args.ledger_path,
args.snapshot_slot,
args.tip_distribution_program_id,
args.out_path,
rpc_client,
)
.expect("Workflow failed.");
&args.snapshot_slot,
&args.tip_distribution_program_id,
&args.out_path,
&args.tip_payment_program_id,
) {
error!("error producing stake-meta: {:?}", e);
} else {
info!("produced stake meta");
}
}
Loading