Skip to content

Commit 27c30b3

Browse files
author
Richard Patel
authored
tag 0.1.4+solana.1.11.3 (#44)
Signed-off-by: Richard Patel <me@terorie.dev>
1 parent c8b4022 commit 27c30b3

File tree

4 files changed

+22
-11
lines changed

4 files changed

+22
-11
lines changed

Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "solana-accountsdb-plugin-kafka"
33
description = "Solana AccountsDb plugin for Kafka"
44
authors = ["Blockdaemon"]
5-
version = "0.1.3+solana.1.10.11"
5+
version = "0.1.4+solana.1.11.3"
66
edition = "2021"
77
repository = "https://github.com/Blockdaemon/solana-accountsdb-plugin-kafka"
88
license = "Apache-2.0"
@@ -13,10 +13,10 @@ crate-type = ["cdylib", "rlib"]
1313
[dependencies]
1414
prost = "0.10"
1515
rdkafka = { version = "0.28", features = ["ssl-vendored", "sasl"] }
16-
solana-geyser-plugin-interface = { version = "=1.10.11" }
17-
solana-logger = { version = "=1.10.11" }
18-
solana-program = { version = "=1.10.11" }
19-
solana-transaction-status = { version = "=1.10.11" }
16+
solana-geyser-plugin-interface = { version = "=1.11.3" }
17+
solana-logger = { version = "=1.11.3" }
18+
solana-program = { version = "=1.11.3" }
19+
solana-transaction-status = { version = "=1.11.3" }
2020
log = "0.4"
2121
serde_json = "1.0"
2222
serde = { version = "1.0", features = ["derive"] }

ci/rust-version.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@
2323
if [[ -n $RUST_STABLE_VERSION ]]; then
2424
stable_version="$RUST_STABLE_VERSION"
2525
else
26-
stable_version=1.59.0
26+
stable_version=1.60.0
2727
fi
2828

2929
if [[ -n $RUST_NIGHTLY_VERSION ]]; then
3030
nightly_version="$RUST_NIGHTLY_VERSION"
3131
else
32-
nightly_version=2022-02-24
32+
nightly_version=2022-04-01
3333
fi
3434

3535

proto/event.proto

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ message UpdateAccountEvent {
3232
// with higher write_version should supersede the one with lower
3333
// write_version.
3434
uint64 write_version = 8;
35+
36+
// First signature of the transaction caused this account modification
37+
optional bytes txn_signature = 9;
3538
}
3639

3740
message SlotStatusEvent {

src/plugin.rs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use {
1818
rdkafka::util::get_rdkafka_version,
1919
simple_error::simple_error,
2020
solana_geyser_plugin_interface::geyser_plugin_interface::{
21-
GeyserPlugin, GeyserPluginError as PluginError, ReplicaAccountInfo,
21+
GeyserPlugin, GeyserPluginError as PluginError, ReplicaAccountInfoV2,
2222
ReplicaAccountInfoVersions, ReplicaTransactionInfoVersions, Result as PluginResult,
2323
SlotStatus as PluginSlotStatus,
2424
},
@@ -103,6 +103,7 @@ impl GeyserPlugin for KafkaPlugin {
103103
rent_epoch: info.rent_epoch,
104104
data: info.data.to_vec(),
105105
write_version: info.write_version,
106+
txn_signature: info.txn_signature.map(|sig| sig.as_ref().to_owned()),
106107
};
107108

108109
let publisher = self.unwrap_publisher();
@@ -172,9 +173,12 @@ impl KafkaPlugin {
172173
self.filter.as_ref().expect("filter is unavailable")
173174
}
174175

175-
fn unwrap_update_account(account: ReplicaAccountInfoVersions) -> &ReplicaAccountInfo {
176+
fn unwrap_update_account(account: ReplicaAccountInfoVersions) -> &ReplicaAccountInfoV2 {
176177
match account {
177-
ReplicaAccountInfoVersions::V0_0_1(info) => info,
178+
ReplicaAccountInfoVersions::V0_0_1(_info) => {
179+
panic!("ReplicaAccountInfoVersions::V0_0_1 unsupported, please upgrade your Solana node.");
180+
}
181+
ReplicaAccountInfoVersions::V0_0_2(info) => info,
178182
}
179183
}
180184

@@ -218,7 +222,11 @@ impl KafkaPlugin {
218222
slot: u64,
219223
transaction: ReplicaTransactionInfoVersions,
220224
) -> TransactionEvent {
221-
let ReplicaTransactionInfoVersions::V0_0_1(transaction) = transaction;
225+
let transaction = if let ReplicaTransactionInfoVersions::V0_0_2(transaction) = transaction {
226+
transaction
227+
} else {
228+
panic!("Unsupported ReplicaTransactionInfoVersions::V0_0_2, please upgrade your Solana node.")
229+
};
222230
let transaction_status_meta = transaction.transaction_status_meta;
223231
let signature = transaction.signature;
224232
let is_vote = transaction.is_vote;

0 commit comments

Comments
 (0)