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

feat: draft geyser plugin support #33

Merged
merged 3 commits into from
Feb 12, 2025
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ jobs:

# set up rust for all envs
- name: Install Rust toolchain
run: rustup toolchain install 1.79 --profile minimal --target ${{ matrix.target }}
run: rustup toolchain install 1.84.0 --profile minimal --target ${{ matrix.target }}

- name: Install Rust Target
run: rustup target add ${{ matrix.target }}
Expand Down
149 changes: 124 additions & 25 deletions Cargo.lock

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

4 changes: 2 additions & 2 deletions crates/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ surfpool-core = { workspace = true }
# surfpool-core = { version = "0.1" }
# txtx-core = { path = "../../../txtx/crates/txtx-core" }
# txtx-addon-network-svm = { package = "txtx-addon-network-svm", path = "../../../txtx/addons/svm" }
txtx-core = { version = "0.2.1" }
txtx-addon-network-svm = { version = "0.1.2" }
txtx-core = { version = "0.2.2" }
txtx-addon-network-svm = { version = "0.1.3" }
hiro-system-kit = "0.3.1"
atty = "0.2.13"
ansi_term = "0.12.1"
Expand Down
3 changes: 3 additions & 0 deletions crates/cli/src/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ pub struct StartSimnet {
/// Disable explorer (default: false)
#[clap(long = "no-explorer")]
pub no_explorer: bool,
/// List of geyser plugins to load
#[arg(long = "geyser-plugin-config", short = 'g')]
pub plugin_config_path: Vec<String>,
}

#[derive(Parser, PartialEq, Clone, Debug)]
Expand Down
7 changes: 6 additions & 1 deletion crates/cli/src/cli/simnet/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ pub async fn handle_start_simnet_command(cmd: &StartSimnet, ctx: &Context) -> Re
airdrop_addresses,
airdrop_token_amount: cmd.airdrop_token_amount,
},
plugin_config_path: cmd
.plugin_config_path
.iter()
.map(|f| PathBuf::from(f))
.collect::<Vec<_>>(),
};
let remote_rpc_url = config.rpc.remote_rpc_url.clone();
let local_rpc_url = config.rpc.get_socket_address();
Expand All @@ -80,7 +85,7 @@ pub async fn handle_start_simnet_command(cmd: &StartSimnet, ctx: &Context) -> Re
let ctx_cloned = ctx.clone();
let _handle = hiro_system_kit::thread_named("simnet")
.spawn(move || {
let future = start_simnet(&config, simnet_events_tx, simnet_commands_rx);
let future = start_simnet(config, simnet_events_tx, simnet_commands_rx);
if let Err(e) = hiro_system_kit::nestable_block_on(future) {
error!(ctx_cloned.expect_logger(), "{e}");
sleep(Duration::from_millis(500));
Expand Down
10 changes: 6 additions & 4 deletions crates/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ base64 = "0.22.1"
bincode = "1.3.3"
crossbeam-channel = "0.5.14"
log = "0.4.22"
clap = "4.5.27"
serde = "1.0.217"
serde_derive = "1.0.217" # must match the serde version, see https://github.com/serde-rs/serde/issues/2584#issuecomment-1685252251
serde_json = "1.0.135"
Expand All @@ -37,9 +36,8 @@ jsonrpc-http-server = "18.0.0"
libc = "0.2.169"
regex = "1.11.1"
litesvm = { version = "0.5.0", features = ["nodejs-internal"] }
crossbeam = "0.8.4"
# litesvm = { path = "../../../litesvm/crates/litesvm" }

crossbeam = "0.8.4"
solana-sdk = "=2.1.10"
solana-program-test = "2.1.10"
solana-rpc-client = "2.1.10"
Expand Down Expand Up @@ -68,7 +66,11 @@ solana-version = "2.1.10"
solana-poh = "2.1.10"
solana-svm = "2.1.10"
solana-program-runtime = "2.1.10"
spl-token-2022 = "4.0.0"
spl-token-2022 = "6.0.0"
spl-token = "7.0.0"
solana-streamer = "2.1.10"
zstd = "0.13.2"
agave-geyser-plugin-interface = "2.1.10"
solana-geyser-plugin-manager = "2.1.10"
libloading = "0.7.4"
json5 = "0.4.1"
2 changes: 1 addition & 1 deletion crates/core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pub use solana_sdk;
use types::SurfpoolConfig;

pub async fn start_simnet(
config: &SurfpoolConfig,
config: SurfpoolConfig,
simnet_events_tx: Sender<SimnetEvent>,
simnet_commands_rx: Receiver<SimnetCommand>,
) -> Result<(), Box<dyn std::error::Error>> {
Expand Down
8 changes: 4 additions & 4 deletions crates/core/src/rpc/full.rs
Original file line number Diff line number Diff line change
Expand Up @@ -344,14 +344,14 @@ impl Full for SurfpoolFullRpc {
.send((ctx.id.clone(), unsanitized_tx, status_update_tx));
loop {
match (status_uptate_rx.recv(), config.preflight_commitment) {
(
Ok(TransactionConfirmationStatus::Confirmed),
Some(CommitmentLevel::Confirmed),
) => break,
(
Ok(TransactionConfirmationStatus::Processed),
Some(CommitmentLevel::Processed),
) => break,
(
Ok(TransactionConfirmationStatus::Confirmed),
None | Some(CommitmentLevel::Confirmed),
) => break,
(
Ok(TransactionConfirmationStatus::Finalized),
Some(CommitmentLevel::Finalized),
Expand Down
Loading