Skip to content

Commit

Permalink
add internal methods for FfiContactInfoInterface, cargo-fmt, add safe…
Browse files Browse the repository at this point in the history
…ty tags
  • Loading branch information
gregcusack committed Nov 7, 2024
1 parent 30d5d73 commit c635fee
Show file tree
Hide file tree
Showing 4 changed files with 287 additions and 127 deletions.
2 changes: 1 addition & 1 deletion geyser-plugin-interface/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ edition = { workspace = true }

[dependencies]
log = { workspace = true }
solana-gossip = { workspace = true }
solana-sdk = { workspace = true }
solana-transaction-status = { workspace = true }
solana-gossip = { workspace = true }
thiserror = { workspace = true }

[package.metadata.docs.rs]
Expand Down
4 changes: 4 additions & 0 deletions geyser-plugin-interface/src/geyser_plugin_interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,10 @@ pub enum GeyserPluginError {
/// Error when updating the transaction.
#[error("Error updating transaction. Error message: ({msg})")]
TransactionUpdateError { msg: String },

/// Error when updating the node status.
#[error("Error updating node. Error message: ({msg})")]
NodeUpdateError { msg: String },
}

/// The current status of a slot
Expand Down
9 changes: 4 additions & 5 deletions geyser-plugin-manager/src/gossip_message_receiver_notifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ use {
agave_geyser_plugin_interface::geyser_plugin_interface::FfiPubkey,
log::*,
solana_gossip::{
contact_info::ContactInfo,
contact_info_ffi::create_contact_info_interface,
contact_info::ContactInfo, contact_info_ffi::create_contact_info_interface,
gossip_message_notifier_interface::GossipMessageNotifierInterface,
},
solana_measure::measure::Measure,
Expand All @@ -21,7 +20,7 @@ pub(crate) struct GossipMessageNotifierImpl {

impl GossipMessageNotifierInterface for GossipMessageNotifierImpl {
fn notify_receive_node_update(&self, contact_info: &ContactInfo) {
self.notify_plugins_of_node_update(&contact_info);
self.notify_plugins_of_node_update(contact_info);
}

fn notify_remove_node(&self, pubkey: &Pubkey) {
Expand Down Expand Up @@ -55,15 +54,15 @@ impl GossipMessageNotifierImpl {
match plugin.notify_node_update(&ffi_contact_info_interface) {
Err(err) => {
error!(
"Failed to insert crds value w/ origin: {}, error: {} to plugin {}",
"Failed to insert ContactInfo w/ origin: {}, error: {} to plugin {}",
contact_info.pubkey(),
err,
plugin.name()
)
}
Ok(_) => {
trace!(
"Inserted crds value w/ origin: {} to plugin {}",
"Inserted ContactInfo w/ origin: {} to plugin {}",
contact_info.pubkey(),
plugin.name()
)
Expand Down
Loading

0 comments on commit c635fee

Please sign in to comment.