Skip to content

Commit

Permalink
tag 0.1.4+solana.1.11.3 (#44)
Browse files Browse the repository at this point in the history
Signed-off-by: Richard Patel <[email protected]>
  • Loading branch information
Richard Patel authored Jul 23, 2022
1 parent c8b4022 commit 27c30b3
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 11 deletions.
10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "solana-accountsdb-plugin-kafka"
description = "Solana AccountsDb plugin for Kafka"
authors = ["Blockdaemon"]
version = "0.1.3+solana.1.10.11"
version = "0.1.4+solana.1.11.3"
edition = "2021"
repository = "https://github.com/Blockdaemon/solana-accountsdb-plugin-kafka"
license = "Apache-2.0"
Expand All @@ -13,10 +13,10 @@ crate-type = ["cdylib", "rlib"]
[dependencies]
prost = "0.10"
rdkafka = { version = "0.28", features = ["ssl-vendored", "sasl"] }
solana-geyser-plugin-interface = { version = "=1.10.11" }
solana-logger = { version = "=1.10.11" }
solana-program = { version = "=1.10.11" }
solana-transaction-status = { version = "=1.10.11" }
solana-geyser-plugin-interface = { version = "=1.11.3" }
solana-logger = { version = "=1.11.3" }
solana-program = { version = "=1.11.3" }
solana-transaction-status = { version = "=1.11.3" }
log = "0.4"
serde_json = "1.0"
serde = { version = "1.0", features = ["derive"] }
Expand Down
4 changes: 2 additions & 2 deletions ci/rust-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@
if [[ -n $RUST_STABLE_VERSION ]]; then
stable_version="$RUST_STABLE_VERSION"
else
stable_version=1.59.0
stable_version=1.60.0
fi

if [[ -n $RUST_NIGHTLY_VERSION ]]; then
nightly_version="$RUST_NIGHTLY_VERSION"
else
nightly_version=2022-02-24
nightly_version=2022-04-01
fi


Expand Down
3 changes: 3 additions & 0 deletions proto/event.proto
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ message UpdateAccountEvent {
// with higher write_version should supersede the one with lower
// write_version.
uint64 write_version = 8;

// First signature of the transaction caused this account modification
optional bytes txn_signature = 9;
}

message SlotStatusEvent {
Expand Down
16 changes: 12 additions & 4 deletions src/plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use {
rdkafka::util::get_rdkafka_version,
simple_error::simple_error,
solana_geyser_plugin_interface::geyser_plugin_interface::{
GeyserPlugin, GeyserPluginError as PluginError, ReplicaAccountInfo,
GeyserPlugin, GeyserPluginError as PluginError, ReplicaAccountInfoV2,
ReplicaAccountInfoVersions, ReplicaTransactionInfoVersions, Result as PluginResult,
SlotStatus as PluginSlotStatus,
},
Expand Down Expand Up @@ -103,6 +103,7 @@ impl GeyserPlugin for KafkaPlugin {
rent_epoch: info.rent_epoch,
data: info.data.to_vec(),
write_version: info.write_version,
txn_signature: info.txn_signature.map(|sig| sig.as_ref().to_owned()),
};

let publisher = self.unwrap_publisher();
Expand Down Expand Up @@ -172,9 +173,12 @@ impl KafkaPlugin {
self.filter.as_ref().expect("filter is unavailable")
}

fn unwrap_update_account(account: ReplicaAccountInfoVersions) -> &ReplicaAccountInfo {
fn unwrap_update_account(account: ReplicaAccountInfoVersions) -> &ReplicaAccountInfoV2 {
match account {
ReplicaAccountInfoVersions::V0_0_1(info) => info,
ReplicaAccountInfoVersions::V0_0_1(_info) => {
panic!("ReplicaAccountInfoVersions::V0_0_1 unsupported, please upgrade your Solana node.");
}
ReplicaAccountInfoVersions::V0_0_2(info) => info,
}
}

Expand Down Expand Up @@ -218,7 +222,11 @@ impl KafkaPlugin {
slot: u64,
transaction: ReplicaTransactionInfoVersions,
) -> TransactionEvent {
let ReplicaTransactionInfoVersions::V0_0_1(transaction) = transaction;
let transaction = if let ReplicaTransactionInfoVersions::V0_0_2(transaction) = transaction {
transaction
} else {
panic!("Unsupported ReplicaTransactionInfoVersions::V0_0_2, please upgrade your Solana node.")
};
let transaction_status_meta = transaction.transaction_status_meta;
let signature = transaction.signature;
let is_vote = transaction.is_vote;
Expand Down

0 comments on commit 27c30b3

Please sign in to comment.