Skip to content

Commit

Permalink
Update master to solana v1.17 (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
buffalu authored Oct 11, 2023
1 parent 9967765 commit 1fc79af
Show file tree
Hide file tree
Showing 16 changed files with 1,403 additions and 1,246 deletions.
2,172 changes: 1,090 additions & 1,082 deletions Cargo.lock

Large diffs are not rendered by default.

44 changes: 44 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,47 @@ members = [
"proto",
"server"
]

# This prevents a Travis CI error when building for Windows.
resolver = "2"

[workspace.package]
version = "1.17.1"
license = "Apache-2.0"
authors = ["Jito Foundation <[email protected]>"]
edition = "2021"
repository = "https://github.com/jito-foundation/geyser-grpc-plugin"
homepage = "https://jito.network/"

[workspace.dependencies]
bincode = "1.3.3"
bs58 = "0.5.0"
clap = { version = "4.4.6", features = ["derive", "env"] }
crossbeam-channel = "0.5.8"
enum-iterator = "1.4.1"
futures-util = "0.3.28"
geyser-grpc-plugin-client = { path = "client" }
jito-geyser-protos = { path = "proto" }
log = "0.4.17"
lru = "0.12.0"
once_cell = "1.17.1"
prost = "0.12.1"
prost-types = "0.12.1"
rand = "0.8"
serde = "1.0.160"
serde_derive = "1.0.160"
serde_json = "1.0.96"
solana-account-decoder = "1.17.1"
solana-geyser-plugin-interface = "1.17.1"
solana-logger = "1.17.1"
solana-metrics = "1.17.1"
solana-program = "1.17.1"
solana-sdk = "1.17.1"
solana-transaction-status = "1.17.1"
solana-vote-program = "1.17.1"
thiserror = "1.0.40"
tokio = { version = "1.29.1", features = ["rt-multi-thread"] }
tokio-stream = "0.1"
tonic = { version = "0.10.2", features = ["tls"] }
tonic-build = "0.10.2"
uuid = { version = "1.3.1", features = ["v4", "fast-rng"] }
29 changes: 13 additions & 16 deletions cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
[package]
name = "jito-geyser-cli"
version = "0.0.1"
authors = ["Jito Labs"]
description = "Geyser testing"
edition = "2021"
publish = false
version = { workspace = true }
license = { workspace = true }
authors = { workspace = true }
edition = { workspace = true }

[dependencies]
clap = { version = "=4.0.32", features = ["derive", "env"] } # keep old clap. newer version needs rustc 1.64+
clap_lex = "=0.3.0" # manual dep override for clap.
futures-util = "0.3.28"
geyser-grpc-plugin-client = { path = "../client" }
jito-geyser-protos = { path = "../proto" }
prost-types = "0.11.9"
solana-sdk = "~1.14"
tokio = { version = "~1.14.1", features = ["rt-multi-thread"] }
toml_datetime = "=0.6.0" # manual dep override for clap.
tonic = { version = "0.9.2", features = ["tls", "tls-roots", "tls-webpki-roots"] }
uuid = { version = "1.3.1", features = ["v4"] }
clap = { workspace = true }
futures-util = { workspace = true }
geyser-grpc-plugin-client = { workspace = true }
jito-geyser-protos = { workspace = true }
prost-types = { workspace = true }
solana-sdk = { workspace = true }
tokio = { workspace = true }
tonic = { workspace = true }
uuid = { workspace = true }
2 changes: 1 addition & 1 deletion cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ async fn main() {
"slot: {} parent: {:?} status: {:?}",
slot_update.slot,
slot_update.parent_slot,
SlotUpdateStatus::from_i32(slot_update.status)
SlotUpdateStatus::try_from(slot_update.status).unwrap()
);
}
Err(e) => {
Expand Down
40 changes: 17 additions & 23 deletions client/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,29 +1,23 @@
[package]
name = "geyser-grpc-plugin-client"
version = "0.1.0"
authors = ["Jito Foundation <[email protected]>"]
license = "Apache-2.0"
edition = "2021"
version = { workspace = true }
license = { workspace = true }
authors = { workspace = true }
edition = { workspace = true }

[dependencies]
jito-geyser-protos = { path = "../proto" }
jito-solana-sdk = { git = "https://github.com/jito-foundation/jito-solana.git", tag = "v1.14.17-jito", package = "solana-sdk", optional = true }
log = "0.4"
lru = "0.8" # keep old version due to MSRV of 1.60
prost = "0.11.9"
prost-types = "0.11.9"
rand = "0.8"
serde = "1.0.160"
serde_json = "1.0.96"

solana-sdk = "~1.14"

thiserror = "1.0.40"
tokio = { version = "1", features = ["rt-multi-thread"] }
tonic = { version = "0.9.2", features = ["tls"] }
jito-geyser-protos = { workspace = true }
log = { workspace = true }
lru = { workspace = true }
prost = { workspace = true }
prost-types = { workspace = true }
rand = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
solana-sdk = { workspace = true }
thiserror = { workspace = true }
tokio = { workspace = true }
tonic = { workspace = true }

[build-dependencies]
tonic-build = "0.9.2"

[features]
jito-solana = ["jito-solana-sdk"]
tonic-build = { workspace = true }
2 changes: 1 addition & 1 deletion client/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ pub struct SlotUpdate {

impl From<geyser::SlotUpdate> for SlotUpdate {
fn from(proto: geyser::SlotUpdate) -> Self {
let status = geyser::SlotUpdateStatus::from_i32(proto.status).unwrap();
let status = geyser::SlotUpdateStatus::try_from(proto.status).unwrap();
Self {
parent_slot: proto.parent_slot,
slot: proto.slot,
Expand Down
34 changes: 16 additions & 18 deletions proto/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,26 +1,24 @@
[package]
name = "jito-geyser-protos"
version = "0.0.2"
authors = ["Jito Foundation <[email protected]>"]
license = "Apache-2.0"
edition = "2021"
version = { workspace = true }
license = { workspace = true }
authors = { workspace = true }
edition = { workspace = true }
description = "Jito's Solana geyser protobufs and helper libraries"

[dependencies]
bincode = "1.3.3"
jito-solana-account-decoder = { git = "https://github.com/jito-foundation/jito-solana.git", tag = "v1.14.17-jito", package = "solana-account-decoder", optional = true }
jito-solana-sdk = { git = "https://github.com/jito-foundation/jito-solana.git", tag = "v1.14.17-jito", package = "solana-sdk", optional = true }
jito-solana-transaction-status = { git = "https://github.com/jito-foundation/jito-solana.git", tag = "v1.14.17-jito", package = "solana-transaction-status", optional = true }
prost = "0.11.9"
prost-types = "0.11.9"
serde = "1.0.160"
solana-account-decoder = "~1.14"
solana-sdk = "~1.14"
solana-transaction-status = "~1.14"
tonic = "0.9.2"
bincode = { workspace = true }
prost = { workspace = true }
prost-types = { workspace = true }
serde = { workspace = true }
solana-account-decoder = { workspace = true }
solana-sdk = { workspace = true }
solana-transaction-status = { workspace = true }
tonic = { workspace = true }

[build-dependencies]
tonic-build = "0.9.2"
tonic-build = { workspace = true }

[features]
jito-solana = ["jito-solana-account-decoder", "jito-solana-sdk", "jito-solana-transaction-status"]
[dev-dependencies]
bs58 = { workspace = true }
enum-iterator = { workspace = true }
8 changes: 8 additions & 0 deletions proto/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@ use tonic_build::configure;

fn main() {
configure()
.type_attribute(
"TransactionErrorType",
"#[cfg_attr(test, derive(enum_iterator::Sequence))]",
)
.type_attribute(
"InstructionErrorType",
"#[cfg_attr(test, derive(enum_iterator::Sequence))]",
)
.compile(
&[
"proto/geyser.proto",
Expand Down
13 changes: 12 additions & 1 deletion proto/proto/confirmed_block.proto
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,18 @@ message TransactionError {

message InnerInstructions {
uint32 index = 1;
repeated CompiledInstruction instructions = 2;
repeated InnerInstruction instructions = 2;
}

message InnerInstruction {
uint32 program_id_index = 1;
bytes accounts = 2;
bytes data = 3;

// Invocation stack height of an inner instruction.
// Available since Solana v1.14.6
// Set to `None` for txs executed on earlier versions.
optional uint32 stack_height = 4;
}

message CompiledInstruction {
Expand Down
2 changes: 2 additions & 0 deletions proto/proto/geyser.proto
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ message BlockUpdate {
repeated storage.ConfirmedBlock.Reward rewards = 3;
google.protobuf.Timestamp block_time = 4;
optional uint64 block_height = 5;
optional uint64 executed_transaction_count = 6;
optional uint64 entry_count = 7;
}

message TimestampedBlockUpdate {
Expand Down
11 changes: 8 additions & 3 deletions proto/proto/transaction_by_addr.proto
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,11 @@ enum TransactionErrorType {
WOULD_EXCEED_ACCOUNT_DATA_TOTAL_LIMIT = 29;
DUPLICATE_INSTRUCTION = 30;
INSUFFICIENT_FUNDS_FOR_RENT = 31;
BUNDLE_NOT_CONTINUOUS = 32; // TODO (LB): this needs to be removed from here in jito-solana
SKIPPED_EXECUTION = 33; // TODO (LB): this needs to be removed from here in jito-solana
MAX_LOADED_ACCOUNTS_DATA_SIZE_EXCEEDED = 32;
INVALID_LOADED_ACCOUNTS_DATA_SIZE_LIMIT = 33;
RESANITIZATION_NEEDED = 34;
PROGRAM_EXECUTION_TEMPORARILY_RESTRICTED = 35;
UNBALANCED_TRANSACTION = 36;
}

message InstructionError {
Expand Down Expand Up @@ -122,8 +125,10 @@ enum InstructionErrorType {
ARITHMETIC_OVERFLOW = 47;
UNSUPPORTED_SYSVAR = 48;
ILLEGAL_OWNER = 49;
MAX_ACCOUNTS_DATA_SIZE_EXCEEDED = 50;
MAX_ACCOUNTS_DATA_ALLOCATIONS_EXCEEDED = 50;
MAX_ACCOUNTS_EXCEEDED = 51;
MAX_INSTRUCTION_TRACE_LENGTH_EXCEEDED = 52;
BUILTIN_PROGRAMS_MUST_CONSUME_COMPUTE_UNITS = 53;
}

message UnixTimestamp {
Expand Down
Loading

0 comments on commit 1fc79af

Please sign in to comment.