Skip to content

Commit

Permalink
MAke acking work better and actually redeliver the message (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
austbot authored Dec 7, 2022
1 parent 3ed06be commit 79e1d49
Show file tree
Hide file tree
Showing 11 changed files with 167 additions and 1,206 deletions.
790 changes: 18 additions & 772 deletions Cargo.lock

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docker/runs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ args=(
--config config.yaml
--log
--reset
--limit-ledger-size 10000000000000000
--rpc-port 8899
--geyser-plugin-config /plugin-config/accountsdb-plugin-config.json
)
Expand Down
4 changes: 2 additions & 2 deletions plerkle/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "plerkle"
description = "Geyser plugin with dynamic config reloading, message bus agnostic abstractions and a whole lot of fun."
version = "0.6.0"
version = "0.6.1"
authors = ["Metaplex Developers <dev@metaplex.com>"]
repository = "https://github.com/metaplex-foundation/digital-asset-validator-plugin"
license = "AGPL-3.0"
Expand Down Expand Up @@ -33,7 +33,7 @@ cadence-macros = "0.29.0"
chrono = "0.4.19"
tracing = "0.1.35"
hex = "0.4.3"
plerkle_messenger = { path = "../plerkle_messenger", version = "0.6.0", features = ["redis"] }
plerkle_messenger = { path = "../plerkle_messenger", version = "1.0.0", features = ["redis"] }
flatbuffers = "22.10.26"
plerkle_serialization = { path = "../plerkle_serialization", version = "0.6.0" }
tokio = { version = "1.17.0", features = ["full"] }
Expand Down
3 changes: 1 addition & 2 deletions plerkle_messenger/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "plerkle_messenger"
description = "Metaplex Messenger trait for Geyser plugin producer/consumer patterns."
version = "0.6.0"
version = "1.0.0"
authors = ["Metaplex Developers <dev@metaplex.com>"]
repository = "https://github.com/metaplex-foundation/digital-asset-validator-plugin"
license = "AGPL-3.0"
Expand All @@ -10,7 +10,6 @@ readme = "Readme.md"

[dependencies]
redis = { version = "0.22.0", features = ["aio", "tokio-comp", "streams"], optional = true}
metaplex-pulsar = { version = "4.1.1", optional = true}
log = "0.4.11"
thiserror = "1.0.30"
async-trait = "0.1.53"
Expand Down
7 changes: 6 additions & 1 deletion plerkle_messenger/Readme.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Messenger

A message bus agnostic Messaging Library that sends Transaction, Account, Block and Slot updates in the Plerkle Serialization format.
A message bus agnostic Messaging Library that sends Transaction, Account, Block and Slot updates in the Plerkle Serialization format.

## Note on 1.0.0

The plerkle serialization API changes at 1.0.0 which is a breaking change.
This method removes confusion around the Recv data lifetime being tied back to the messenger interface. Now the data is owned.
2 changes: 0 additions & 2 deletions plerkle_messenger/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#[cfg(feature = "pulsar")]
pub mod pulsar_messenger;
#[cfg(feature = "redis")]
pub mod redis_messenger;

Expand Down
15 changes: 10 additions & 5 deletions plerkle_messenger/src/plerkle_messenger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,19 @@ pub const SLOT_STREAM: &str = "SLT";
pub const TRANSACTION_STREAM: &str = "TXN";
pub const BLOCK_STREAM: &str = "BLK";

pub struct RecvData<'a> {
pub struct RecvData {
pub id: String,
pub data: &'a [u8],
pub tries: usize,
pub data: Vec<u8>,
}

impl<'a> RecvData<'a> {
pub fn new(id: String, data: &'a [u8]) -> Self {
RecvData { id, data }
impl RecvData {
pub fn new(id: String, data: Vec<u8>) -> Self {
RecvData { id, data, tries: 0 }
}

pub fn new_retry(id: String, data: Vec<u8>, tries: usize) -> Self {
RecvData { id, data, tries }
}
}

Expand Down
306 changes: 0 additions & 306 deletions plerkle_messenger/src/pulsar_messenger.rs

This file was deleted.

Loading

0 comments on commit 79e1d49

Please sign in to comment.