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

simple standalone chaindata-only service #31

Closed
wants to merge 58 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
7c8277f
chaindata standalone
grooviegermanikus Aug 7, 2024
ad076bc
copy start_chaindata_updating from router
grooviegermanikus Aug 7, 2024
4913e57
copy start_chaindata_updating from router
grooviegermanikus Aug 7, 2024
423bf25
wip
grooviegermanikus Aug 7, 2024
31c0eaf
basic rooting flow
grooviegermanikus Aug 7, 2024
e716f94
rename
grooviegermanikus Aug 7, 2024
d86ab92
more tests
grooviegermanikus Aug 7, 2024
b21d362
ignore
grooviegermanikus Aug 7, 2024
e37f98b
add graceful shutdown
grooviegermanikus Aug 7, 2024
0ac6da5
move to new crate
grooviegermanikus Aug 7, 2024
1a66598
add geyser connector
grooviegermanikus Aug 7, 2024
e34c443
minimal test for the vector logic
grooviegermanikus Aug 7, 2024
2858c06
add cases
grooviegermanikus Aug 7, 2024
4bcc00b
min max case
grooviegermanikus Aug 7, 2024
cf143ca
improve test data
grooviegermanikus Aug 7, 2024
379e3bb
test data write version
grooviegermanikus Aug 7, 2024
b0cd9c8
all green
grooviegermanikus Aug 7, 2024
7b521e7
make vector operation clearer
grooviegermanikus Aug 7, 2024
44cfab0
wire up service channels
grooviegermanikus Aug 7, 2024
aa529a8
fix debug thread
grooviegermanikus Aug 11, 2024
d908ec6
Merge branch 'main' into feature/chaindata-wrapped-tester
grooviegermanikus Aug 11, 2024
12b0c4f
updater job
grooviegermanikus Aug 11, 2024
8891828
fix shutdown
grooviegermanikus Aug 11, 2024
3894bcf
log channel flow
grooviegermanikus Aug 12, 2024
ca8cf9a
make naming clearer
grooviegermanikus Aug 12, 2024
a97183c
clarify subscription
grooviegermanikus Aug 12, 2024
61b0bcb
Fix sleep and lock issue
farnyser Aug 12, 2024
0686386
add tracing
grooviegermanikus Aug 12, 2024
b7da727
get snapshot via gpa compressed
grooviegermanikus Aug 12, 2024
2eba164
download gpa in 60s
grooviegermanikus Aug 12, 2024
57da6db
snapshot works
grooviegermanikus Aug 12, 2024
b61653d
replace async_channel for accounts
grooviegermanikus Aug 12, 2024
b36582f
count fixed
grooviegermanikus Aug 12, 2024
b83f81d
remove async channel
grooviegermanikus Aug 12, 2024
f698b82
nicer log
grooviegermanikus Aug 13, 2024
761a0e1
add whirlpool program id
grooviegermanikus Aug 13, 2024
848732a
use mpsc for grpc
grooviegermanikus Aug 13, 2024
90b7061
prom throughput
grooviegermanikus Aug 13, 2024
4d0f84e
prom
grooviegermanikus Aug 13, 2024
fbd87be
add some metrics
grooviegermanikus Aug 13, 2024
5c317bc
switch to raydium
grooviegermanikus Aug 13, 2024
c0f3617
fix filter name
grooviegermanikus Aug 13, 2024
9e48b21
read slot stream mainnet
grooviegermanikus Aug 13, 2024
5fcd57c
compiles
grooviegermanikus Aug 13, 2024
a3390c9
feed the slot stream
grooviegermanikus Aug 13, 2024
ae72fef
Merge branch 'improvement/test-chain-data-from-slotstream' into featu…
grooviegermanikus Aug 14, 2024
3b13220
read slot+account
grooviegermanikus Aug 14, 2024
53965b1
split into two binaries
grooviegermanikus Aug 14, 2024
47eedfe
println progress
grooviegermanikus Aug 14, 2024
603c439
Merge branch 'main' into feature/chaindata-wrapped-tester
grooviegermanikus Aug 14, 2024
e4b00f8
log chain_data + replay
grooviegermanikus Aug 14, 2024
d290c67
replay test
grooviegermanikus Aug 14, 2024
0d1f700
replay from inline
grooviegermanikus Aug 14, 2024
11c6067
ChainData: update account InsertAfter bug
farnyser Aug 14, 2024
126c2aa
ChainData: update account InsertAfter bug (#30)
farnyser Aug 15, 2024
4a54367
fix merge error
grooviegermanikus Aug 15, 2024
f9c754b
fix compile
grooviegermanikus Sep 4, 2024
28a5f06
delete 50MB CSV
grooviegermanikus Dec 17, 2024
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
299 changes: 291 additions & 8 deletions Cargo.lock

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[workspace]
members = [
"connector",
"chaindata_standalone"
]
resolver = "2"

Expand Down
57 changes: 57 additions & 0 deletions chaindata_standalone/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
[package]
name = "chaindata_standalone"
version = "0.1.0"
edition = "2021"

[[bin]]
name = "chaindata_standalone"
path = "src/standalone.rs"

[[bin]]
name = "replay_slot_account_stream"
path = "src/replay_slot_account_stream.rs"

[dependencies]
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }

tokio = { workspace = true }
tokio-stream = { workspace = true }

csv = "1.3.0"
log = { workspace = true }
anyhow = { workspace = true }

itertools = { workspace = true }
futures = { workspace = true }

lazy_static = "1.5.0"
serde = { workspace = true }
serde_json = { workspace = true }
serde_derive = { workspace = true }

lz4 = "1.24.0"
base64 = "0.21.7"

prometheus = "0.13.4"

bincode = "1.3.3"
async-trait = { workspace = true }

mango-feeds-connector = { path = "../connector" }
# note: this version does not relax the solana version
geyser-grpc-connector = { tag = "v0.10.6+yellowstone.1.13+solana.1.17.28", git = "https://github.com/blockworks-foundation/geyser-grpc-connector.git" }
yellowstone-grpc-proto = "1.13.0"
#yellowstone-grpc-client = "1.14.0"

jsonrpc-core = "18.0.0"
jsonrpc-core-client = { version = "18.0.0", features = ["ws", "http", "tls"] }
jsonrpc-derive = "18.0.0"
jsonrpc-pubsub = "18.0.0"

solana-sdk = { workspace = true }
solana-client = { workspace = true }
solana-rpc-client-api = "1.17"
solana-account-decoder = "1.17"
clap = { version = "3.2.25", features = ["derive"] }

39 changes: 39 additions & 0 deletions chaindata_standalone/SAMPLEFLOWS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@



```
2024-08-12T08:58:14.644200Z TRACE chaindata_standalone: [grpc->account_write_sender]: account update for 2F9YF2KiCX5ZfuHso5RXxc83W9eKYLnCbAcDyBGRCtd7@_slot_283111398 write_version=1390195675784
2024-08-12T08:58:14.739358Z TRACE chaindata_standalone: [grpc->account_write_sender]: account update for 2F9YF2KiCX5ZfuHso5RXxc83W9eKYLnCbAcDyBGRCtd7@_slot_283111398 write_version=1390195676308
2024-08-12T08:58:14.774673Z TRACE chaindata_standalone: [grpc->account_write_sender]: account update for 2F9YF2KiCX5ZfuHso5RXxc83W9eKYLnCbAcDyBGRCtd7@_slot_283111398 write_version=1390195676381
2024-08-12T08:58:14.899019Z TRACE chaindata_standalone: [grpc->account_write_sender]: account update for 2F9YF2KiCX5ZfuHso5RXxc83W9eKYLnCbAcDyBGRCtd7@_slot_283111398 write_version=1390195676458
2024-08-12T08:58:14.899313Z TRACE chaindata_standalone: [grpc->account_write_sender]: account update for 2F9YF2KiCX5ZfuHso5RXxc83W9eKYLnCbAcDyBGRCtd7@_slot_283111398 write_version=1390195676472
2024-08-12T08:58:14.914404Z TRACE chaindata_standalone: [grpc->account_write_sender]: account update for 2F9YF2KiCX5ZfuHso5RXxc83W9eKYLnCbAcDyBGRCtd7@_slot_283111398 write_version=1390195676532
2024-08-12T08:58:14.946106Z TRACE chaindata_standalone: [grpc->account_write_sender]: account update for 2F9YF2KiCX5ZfuHso5RXxc83W9eKYLnCbAcDyBGRCtd7@_slot_283111398 write_version=1390195676565
2024-08-12T08:58:14.946583Z TRACE chaindata_standalone: [grpc->account_write_sender]: account update for 2F9YF2KiCX5ZfuHso5RXxc83W9eKYLnCbAcDyBGRCtd7@_slot_283111398 write_version=1390195676579
2024-08-12T08:58:14.971928Z TRACE chaindata_standalone: [grpc->account_write_sender]: account update for 2F9YF2KiCX5ZfuHso5RXxc83W9eKYLnCbAcDyBGRCtd7@_slot_283111398 write_version=1390195676593
2024-08-12T08:58:14.986530Z TRACE chaindata_standalone: [grpc->account_write_sender]: account update for 2F9YF2KiCX5ZfuHso5RXxc83W9eKYLnCbAcDyBGRCtd7@_slot_283111398 write_version=1390195676627
2024-08-12T08:58:15.005577Z TRACE chaindata_standalone: [grpc->account_write_sender]: account update for 2F9YF2KiCX5ZfuHso5RXxc83W9eKYLnCbAcDyBGRCtd7@_slot_283111398 write_version=1390195676657
2024-08-12T08:58:15.864777Z TRACE chaindata_standalone::router_impl: [account_writes_channel->chain_data] .update_account for 2F9YF2KiCX5ZfuHso5RXxc83W9eKYLnCbAcDyBGRCtd7@_slot_283111398 write_version=1390195675784
2024-08-12T08:58:15.864815Z TRACE chaindata_standalone::router_impl: [account_writes_channel->account_update_sender] send write for 2F9YF2KiCX5ZfuHso5RXxc83W9eKYLnCbAcDyBGRCtd7@_slot_283111398 write_version=1390195675784
2024-08-12T08:58:15.864856Z DEBUG chaindata_standalone::router_impl: -> updater.invalidate_one for 2F9YF2KiCX5ZfuHso5RXxc83W9eKYLnCbAcDyBGRCtd7@_slot_283111398
2024-08-12T08:58:17.875143Z TRACE chaindata_standalone::router_impl: [account_writes_channel->chain_data] .update_account for 2F9YF2KiCX5ZfuHso5RXxc83W9eKYLnCbAcDyBGRCtd7@_slot_283111398 write_version=1390195676308
2024-08-12T08:58:17.875227Z TRACE chaindata_standalone::router_impl: [account_writes_channel->account_update_sender] send write for 2F9YF2KiCX5ZfuHso5RXxc83W9eKYLnCbAcDyBGRCtd7@_slot_283111398 write_version=1390195676308
2024-08-12T08:58:17.875421Z DEBUG chaindata_standalone::router_impl: -> updater.invalidate_one for 2F9YF2KiCX5ZfuHso5RXxc83W9eKYLnCbAcDyBGRCtd7@_slot_283111398
2024-08-12T08:58:17.875454Z TRACE chaindata_standalone::router_impl: [account_writes_channel->chain_data] .update_account for 2F9YF2KiCX5ZfuHso5RXxc83W9eKYLnCbAcDyBGRCtd7@_slot_283111398 write_version=1390195676381
2024-08-12T08:58:17.875516Z TRACE chaindata_standalone::router_impl: [account_writes_channel->account_update_sender] send write for 2F9YF2KiCX5ZfuHso5RXxc83W9eKYLnCbAcDyBGRCtd7@_slot_283111398 write_version=1390195676381
2024-08-12T08:58:17.875610Z DEBUG chaindata_standalone::router_impl: -> updater.invalidate_one for 2F9YF2KiCX5ZfuHso5RXxc83W9eKYLnCbAcDyBGRCtd7@_slot_283111398
2024-08-12T08:58:18.880978Z TRACE chaindata_standalone::router_impl: [account_writes_channel->chain_data] .update_account for 2F9YF2KiCX5ZfuHso5RXxc83W9eKYLnCbAcDyBGRCtd7@_slot_283111398 write_version=1390195676458
2024-08-12T08:58:18.881039Z TRACE chaindata_standalone::router_impl: [account_writes_channel->account_update_sender] send write for 2F9YF2KiCX5ZfuHso5RXxc83W9eKYLnCbAcDyBGRCtd7@_slot_283111398 write_version=1390195676458
2024-08-12T08:58:18.881218Z DEBUG chaindata_standalone::router_impl: -> updater.invalidate_one for 2F9YF2KiCX5ZfuHso5RXxc83W9eKYLnCbAcDyBGRCtd7@_slot_283111398
2024-08-12T08:58:18.881235Z TRACE chaindata_standalone::router_impl: [account_writes_channel->chain_data] .update_account for 2F9YF2KiCX5ZfuHso5RXxc83W9eKYLnCbAcDyBGRCtd7@_slot_283111398 write_version=1390195676472
2024-08-12T08:58:18.881297Z TRACE chaindata_standalone::router_impl: [account_writes_channel->account_update_sender] send write for 2F9YF2KiCX5ZfuHso5RXxc83W9eKYLnCbAcDyBGRCtd7@_slot_283111398 write_version=1390195676472
2024-08-12T08:58:18.881378Z DEBUG chaindata_standalone::router_impl: -> updater.invalidate_one for 2F9YF2KiCX5ZfuHso5RXxc83W9eKYLnCbAcDyBGRCtd7@_slot_283111398
2024-08-12T08:58:19.887019Z TRACE chaindata_standalone::router_impl: [account_writes_channel->chain_data] .update_account for 2F9YF2KiCX5ZfuHso5RXxc83W9eKYLnCbAcDyBGRCtd7@_slot_283111398 write_version=1390195676532
2024-08-12T08:58:19.887155Z TRACE chaindata_standalone::router_impl: [account_writes_channel->account_update_sender] send write for 2F9YF2KiCX5ZfuHso5RXxc83W9eKYLnCbAcDyBGRCtd7@_slot_283111398 write_version=1390195676532
2024-08-12T08:58:19.887320Z DEBUG chaindata_standalone::router_impl: -> updater.invalidate_one for 2F9YF2KiCX5ZfuHso5RXxc83W9eKYLnCbAcDyBGRCtd7@_slot_283111398
2024-08-12T08:58:19.887609Z TRACE chaindata_standalone::router_impl: [account_write_receiver->chain_data] account update for 2F9YF2KiCX5ZfuHso5RXxc83W9eKYLnCbAcDyBGRCtd7@_slot_283111398 write_version=1390195676565
2024-08-12T08:58:20.892641Z TRACE chaindata_standalone::router_impl: [account_writes_channel->chain_data] .update_account for 2F9YF2KiCX5ZfuHso5RXxc83W9eKYLnCbAcDyBGRCtd7@_slot_283111398 write_version=1390195676565
2024-08-12T08:58:20.892897Z TRACE chaindata_standalone::router_impl: [account_writes_channel->account_update_sender] send write for 2F9YF2KiCX5ZfuHso5RXxc83W9eKYLnCbAcDyBGRCtd7@_slot_283111398 write_version=1390195676565
2024-08-12T08:58:20.893127Z TRACE chaindata_standalone::router_impl: [account_writes_channel->chain_data] .update_account for 2F9YF2KiCX5ZfuHso5RXxc83W9eKYLnCbAcDyBGRCtd7@_slot_283111398 write_version=1390195676579
2024-08-12T08:58:20.893197Z TRACE chaindata_standalone::router_impl: [account_writes_channel->account_update_sender] send write for 2F9YF2KiCX5ZfuHso5RXxc83W9eKYLnCbAcDyBGRCtd7@_slot_283111398 write_version=1390195676579
```
40 changes: 40 additions & 0 deletions chaindata_standalone/src/account_write.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
use serde_derive::{Deserialize, Serialize};
use solana_sdk::account::Account;
use solana_sdk::pubkey::Pubkey;

pub fn account_write_from(
pubkey: Pubkey,
slot: u64,
write_version: u64,
account: Account,
) -> AccountWrite {
AccountWrite {
pubkey,
slot,
write_version,
lamports: account.lamports,
owner: account.owner,
executable: account.executable,
rent_epoch: account.rent_epoch,
data: account.data,
}
}

#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct AccountWrite {
pub pubkey: Pubkey,
pub slot: u64,
pub write_version: u64,
pub lamports: u64,
pub owner: Pubkey,
pub executable: bool,
pub rent_epoch: u64,
pub data: Vec<u8>,
// is_selected < removed
}

#[derive(Debug)]
pub enum AccountOrSnapshotUpdate {
AccountUpdate(AccountWrite),
SnapshotUpdate(Vec<AccountWrite>),
}
Loading
Loading