Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ db
plugin-agave/config.dev.json
plugin-agave/fixtures/blocks
richat/config.dev.yml
.local
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is usually where I add configurations file.


# Solana
test-ledger
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ The minor version will be incremented upon a breaking change and the patch versi

### Breaking

## 2025-12-23

- richat-plugin-agave-v7.1.0

### Features

- plugin-agave: add option to disable/enable account/transaction updates + filter account data size ([#171](https://github.com/lamports-dev/richat/pull/171))

## 2025-12-22

- richat-shared-v7.2.0
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ regex = "1.11.1"
richat-client = { path = "client", version = "7.0.0" }
richat-filter = { path = "filter", version = "7.0.0" }
richat-metrics = { path = "metrics", version = "1.0.1" }
richat-plugin-agave = { path = "plugin-agave", version = "7.0.0" }
richat-plugin-agave = { path = "plugin-agave", version = "7.1.0" }
richat-proto = { path = "proto", version = "7.0.0" }
richat-shared = { path = "shared", version = "7.2.0", default-features = false }
rocksdb = "0.24.0"
Expand Down
2 changes: 1 addition & 1 deletion plugin-agave/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "richat-plugin-agave"
version = "7.0.0"
version = "7.1.0"
authors = { workspace = true }
edition = { workspace = true }
description = "Richat Agave Geyser Plugin"
Expand Down
22 changes: 22 additions & 0 deletions plugin-agave/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ pub struct Config {
pub metrics: Option<ConfigMetrics>,
pub tokio: ConfigTokio,
pub channel: ConfigChannel,
pub filters: ConfigFilters,
pub quic: Option<ConfigQuicServer>,
pub grpc: Option<ConfigGrpcServer>,
}
Expand Down Expand Up @@ -90,3 +91,24 @@ impl ConfigChannel {
}
}
}

#[derive(Debug, Clone, Copy, Deserialize)]
#[serde(deny_unknown_fields, default)]
pub struct ConfigFilters {
/// Enable/disable account update notifications
pub enable_account_update: bool,
/// Enable/disable transaction update notifications
pub enable_transaction_update: bool,
/// Maximum account data size to send, if None no limit
pub max_account_data_size: Option<usize>,
}

impl Default for ConfigFilters {
fn default() -> Self {
Self {
enable_account_update: true,
enable_transaction_update: true,
max_account_data_size: None,
}
}
}
24 changes: 21 additions & 3 deletions plugin-agave/src/plugin.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use {
crate::{
channel::Sender,
config::Config,
config::{Config, ConfigFilters},
metrics,
protobuf::{ProtobufEncoder, ProtobufMessage},
version::VERSION,
Expand Down Expand Up @@ -59,6 +59,7 @@ pub struct PluginInner {
encoder: ProtobufEncoder,
shutdown: CancellationToken,
tasks: Vec<(&'static str, PluginTask)>,
filters: ConfigFilters,
}

impl PluginInner {
Expand Down Expand Up @@ -146,6 +147,7 @@ impl PluginInner {
encoder: config.channel.encoder,
shutdown,
tasks,
filters: config.filters,
})
}
}
Expand Down Expand Up @@ -212,6 +214,14 @@ impl GeyserPlugin for Plugin {
};

let inner = self.inner.as_ref().expect("initialized");

// Filter by account data size
if let Some(max_size) = inner.filters.max_account_data_size {
if account.data.len() > max_size {
return Ok(());
}
}

inner
.messages
.push(ProtobufMessage::Account { slot, account }, inner.encoder);
Expand Down Expand Up @@ -307,15 +317,23 @@ impl GeyserPlugin for Plugin {
}

fn account_data_notifications_enabled(&self) -> bool {
true
self.inner
.as_ref()
.expect("initialized")
.filters
.enable_account_update
}

fn account_data_snapshot_notifications_enabled(&self) -> bool {
false
}

fn transaction_notifications_enabled(&self) -> bool {
true
self.inner
.as_ref()
.expect("initialized")
.filters
.enable_transaction_update
}

fn entry_notifications_enabled(&self) -> bool {
Expand Down