diff --git a/Cargo.toml b/Cargo.toml index bd25c6f..e6500fc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,13 +13,13 @@ crate-type = ["cdylib", "rlib"] [dependencies] prost = "0.11" rdkafka = { version = "0.29", features = ["ssl-vendored", "sasl"] } -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"] } +solana-geyser-plugin-interface = { version = "=1.14.16" } +solana-logger = { version = "=1.14.16" } +solana-program = { version = "=1.14.16" } +solana-transaction-status = { version = "=1.14.16" } +log = "0.4.17" +serde_json = "1.0.85" +serde = { version = "1.0.145", features = ["derive"] } simple-error = "0.3.0" [build-dependencies] diff --git a/README.md b/README.md index b6754ff..114d866 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ Config is specified via the plugin's JSON config file. ```json { - "libpath": "/solana/target/release/libsolana_accountsdb_plugin_kafka.so", + "libpath": "target/release/libsolana_accountsdb_plugin_kafka.so", "kafka": { "bootstrap.servers": "localhost:9092", "request.required.acks": "1", @@ -41,6 +41,7 @@ Config is specified via the plugin's JSON config file. "shutdown_timeout_ms": 30000, "update_account_topic": "solana.testnet.account_updates", "slot_status_topic": "solana.testnet.slot_status", + "transaction_topic": "solana.testnet.transactions", "publish_all_accounts": false, "program_ignores": [ "Sysvar1111111111111111111111111111111111111", diff --git a/proto/event.proto b/proto/event.proto index 4b8f9ee..224763c 100644 --- a/proto/event.proto +++ b/proto/event.proto @@ -94,6 +94,7 @@ message V0Message { message V0LoadedMessage { V0Message message_ = 1; LoadedAddresses loaded_adresses = 2; + repeated bool is_writable_account_cache = 3; } message LegacyMessage { @@ -103,9 +104,14 @@ message LegacyMessage { repeated CompiledInstruction instructions = 4; } +message LegacyLoadedMessage { + LegacyMessage message_ = 1; + repeated bool is_writable_account_cache = 2; +} + message SanitizedMessage { oneof message_payload { - LegacyMessage legacy = 1; + LegacyLoadedMessage legacy = 1; V0LoadedMessage v0 = 2; } } diff --git a/rust-toolchain b/rust-toolchain new file mode 100644 index 0000000..4d5fde5 --- /dev/null +++ b/rust-toolchain @@ -0,0 +1 @@ +1.60.0 diff --git a/src/plugin.rs b/src/plugin.rs index b50531e..d104aee 100644 --- a/src/plugin.rs +++ b/src/plugin.rs @@ -305,20 +305,27 @@ impl KafkaPlugin { message: Some(SanitizedMessage { message_payload: Some(match transaction.message() { solana_program::message::SanitizedMessage::Legacy(lv) => { - sanitized_message::MessagePayload::Legacy(LegacyMessage { - header: Some(Self::build_message_header(&lv.header)), - account_keys: lv - .account_keys - .clone() - .into_iter() - .map(|k| k.as_ref().into()) - .collect(), - instructions: lv - .instructions - .iter() - .map(Self::build_compiled_instruction) + sanitized_message::MessagePayload::Legacy(LegacyLoadedMessage { + message: Some(LegacyMessage { + header: Some(Self::build_message_header(&lv.message.header)), + account_keys: lv + .message + .account_keys + .clone() + .into_iter() + .map(|k| k.as_ref().into()) + .collect(), + instructions: lv + .message + .instructions + .iter() + .map(Self::build_compiled_instruction) + .collect(), + recent_block_hash: lv.message.recent_blockhash.as_ref().into(), + }), + is_writable_account_cache: (0..(lv.account_keys().len() - 1)) + .map(|i: usize| lv.is_writable(i)) .collect(), - recent_block_hash: lv.recent_blockhash.as_ref().into(), }) } solana_program::message::SanitizedMessage::V0(v0) => { @@ -375,6 +382,9 @@ impl KafkaPlugin { .map(|x| x.as_ref().into()) .collect(), }), + is_writable_account_cache: (0..(v0.account_keys().len() - 1)) + .map(|i: usize| v0.is_writable(i)) + .collect(), }) } }),