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

grpc multiplexing integrate #255

Merged
merged 31 commits into from
Dec 22, 2023
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
8d12688
log obfuscated RPC
grooviegermanikus Nov 29, 2023
0767d00
add block inspector
grooviegermanikus Dec 13, 2023
dbf2bc6
WIP: multiplex starts
grooviegermanikus Dec 13, 2023
de89476
works
grooviegermanikus Dec 14, 2023
978faae
move mapping out
grooviegermanikus Dec 14, 2023
54d2773
use filters
grooviegermanikus Dec 15, 2023
d057c4e
Cargo: point to git
grooviegermanikus Dec 15, 2023
331d90e
lock
grooviegermanikus Dec 15, 2023
c3bbd3f
add this branch to fly-deploy-staging.yml
grooviegermanikus Dec 15, 2023
9d377aa
move logging
grooviegermanikus Dec 15, 2023
b8ad4e3
ping
grooviegermanikus Dec 18, 2023
6e8dfb3
remove main branch
grooviegermanikus Dec 18, 2023
086d8ae
finalized -> confirmed
grooviegermanikus Dec 19, 2023
b17a43e
grpc confirmed+finalized
grooviegermanikus Dec 19, 2023
ee6ceb9
update to new api
grooviegermanikus Dec 19, 2023
23e170a
use channelizer from lib
grooviegermanikus Dec 19, 2023
d1be66d
update grpc connector version
grooviegermanikus Dec 19, 2023
817ffd2
move blocks_notifier
grooviegermanikus Dec 19, 2023
6ef2c8d
fix args
grooviegermanikus Dec 19, 2023
319940f
debug stream, check for parent slot relateion
grooviegermanikus Dec 19, 2023
38e10d0
move channelizer
grooviegermanikus Dec 20, 2023
ce278b7
use published version of geyser-grpc-connector lib
grooviegermanikus Dec 20, 2023
6fffe18
allow more grpc sources
grooviegermanikus Dec 21, 2023
ad15855
WIP. try to get slot notifictions
grooviegermanikus Dec 21, 2023
f91e932
slot notifications
grooviegermanikus Dec 21, 2023
7cc9757
slot notifications
grooviegermanikus Dec 21, 2023
4911425
cargo.lock
grooviegermanikus Dec 21, 2023
8683338
revert cd
grooviegermanikus Dec 21, 2023
021b36b
revert cd
grooviegermanikus Dec 21, 2023
62bd200
remove wrong comment
grooviegermanikus Dec 21, 2023
7837647
clippy
grooviegermanikus Dec 22, 2023
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
4 changes: 3 additions & 1 deletion .github/workflows/fly-deploy-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ name: Deploy to Fly Staging

on:
push:
branches: [main]
# TODO remove feature/grpc-multiplexing-integrate when it's merged
# restore "main"
branches: [feature/grpc-multiplexing-integrate]

env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
Expand Down
93 changes: 64 additions & 29 deletions Cargo.lock

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

4 changes: 3 additions & 1 deletion cd/lite-rpc-staging.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ primary_region = "nrt"
[env]
PORT_HTTP = "8890"
PORT_WS = "8891"
RUST_LOG = "info"
# remove after grpc multipex got merged
RUST_LOG = "info,solana_lite_rpc_cluster_endpoints=debug,geyser_grpc_connector=debug"

[metrics]
path = "/metrics"
port = 9091

5 changes: 5 additions & 0 deletions cluster-endpoints/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ repository = "https://github.com/blockworks-foundation/lite-rpc"
license = "AGPL"

[dependencies]
#geyser-grpc-connector = { path = "../../geyser-grpc-connector" }
#geyser-grpc-connector = { tag = "v0.5.0+yellowstone.1.11+solana.1.16.17", git = "https://github.com/blockworks-foundation/geyser-grpc-connector.git" }
geyser-grpc-connector = "0.5.0+yellowstone.1.11"

solana-sdk = { workspace = true }
solana-rpc-client-api = { workspace = true }
solana-transaction-status = { workspace = true }
Expand All @@ -24,6 +28,7 @@ bs58 = { workspace = true }
base64 = { workspace = true }
thiserror = { workspace = true }
futures = { workspace = true }
merge-streams = "0.1.2"
bytes = { workspace = true }
anyhow = { workspace = true }
log = { workspace = true }
Expand Down
66 changes: 66 additions & 0 deletions cluster-endpoints/src/grpc_inspect.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
use log::{debug, warn};
use solana_lite_rpc_core::types::BlockStream;
use solana_sdk::commitment_config::CommitmentConfig;
use tokio::sync::broadcast::error::RecvError;
use tokio::task::JoinHandle;

pub fn block_debug_listen(
mut block_notifier: BlockStream,
commitment_config: CommitmentConfig,
) -> JoinHandle<()> {
tokio::spawn(async move {
let mut last_highest_slot_number = 0;

loop {
match block_notifier.recv().await {
Ok(block) => {
if block.commitment_config != commitment_config {
continue;
}

debug!(
"Saw block: {} @ {} with {} txs",
block.slot,
block.commitment_config.commitment,
block.transactions.len()
);

if last_highest_slot_number != 0 {
if block.parent_slot == last_highest_slot_number {
debug!(
"parent slot is correct ({} -> {})",
block.slot, block.parent_slot
);
} else {
warn!(
"parent slot not correct ({} -> {})",
block.slot, block.parent_slot
);
}
}

if block.slot > last_highest_slot_number {
last_highest_slot_number = block.slot;
} else {
// note: ATM this fails very often (using the RPC poller)
warn!(
"Monotonic check failed - block {} is out of order, last highest was {}",
block.slot, last_highest_slot_number
);
}
} // -- Ok
Err(RecvError::Lagged(missed_blocks)) => {
warn!(
"Could not keep up with producer - missed {} blocks",
missed_blocks
);
}
Err(other_err) => {
panic!("Error receiving block: {:?}", other_err);
}
}

// ...
}
})
}
Loading
Loading