Skip to content

Commit 5fc070b

Browse files
committed
Simplest MVP transaction filtering
1 parent 44cd72f commit 5fc070b

19 files changed

+1320
-41
lines changed

rust/Cargo.lock

Lines changed: 143 additions & 37 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust/Cargo.toml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[workspace]
22
resolver = "2"
33

4-
members = ["indexer-metrics", "moving-average", "processor", "server-framework"]
4+
members = ["indexer-metrics", "moving-average", "processor", "server-framework", "transaction-filter"]
55

66
[workspace.package]
77
authors = ["Aptos Labs <[email protected]>"]
@@ -58,6 +58,7 @@ gcloud-sdk = { version = "0.20.4", features = [
5858
"google-cloud-bigquery-storage-v1",
5959
] }
6060
cloud-storage = { version = "0.11.1", features = ["global-client"] }
61+
derive_builder = "0.20.0"
6162
google-cloud-googleapis = "0.10.0"
6263
google-cloud-pubsub = "0.18.0"
6364
hex = "0.4.3"
@@ -69,6 +70,8 @@ jemallocator = { version = "0.5.0", features = [
6970
] }
7071
kanal = { version = "0.1.0-pre8", features = ["async"] }
7172
once_cell = "1.10.0"
73+
# SIMD for string search
74+
memchr = "2.7.2"
7275
num_cpus = "1.16.0"
7376
pbjson = "0.5.1"
7477
prometheus = { version = "0.13.0", default-features = false }
@@ -83,11 +86,12 @@ reqwest = { version = "0.11.20", features = [
8386
] }
8487
serde = { version = "1.0.193", features = ["derive", "rc"] }
8588
serde_json = { version = "1.0.81", features = ["preserve_order"] }
86-
serde_yaml = "0.8.24"
89+
serde_yaml = "0.9.34"
8790
sha2 = "0.9.3"
8891
sha3 = "0.9.1"
8992
strum = { version = "0.24.1", features = ["derive"] }
9093
tempfile = "3.3.0"
94+
thiserror = "1.0.61"
9195
toml = "0.7.4"
9296
tracing-subscriber = { version = "0.3.17", features = ["json", "env-filter"] }
9397
tiny-keccak = { version = "2.0.2", features = ["keccak", "sha3"] }

rust/processor/src/grpc_stream.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,6 @@ pub async fn get_stream(
150150

151151
let mut rpc_client = match connect_res {
152152
Ok(client) => client
153-
.accept_compressed(tonic::codec::CompressionEncoding::Gzip)
154153
.accept_compressed(tonic::codec::CompressionEncoding::Zstd)
155154
.send_compressed(tonic::codec::CompressionEncoding::Zstd)
156155
.max_decoding_message_size(MAX_RESPONSE_SIZE)

rust/processor/src/utils/util.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,11 @@ pub struct MultisigPayloadClean {
6666
}
6767

6868
/// Standardizes all addresses and table handles to be length 66 (0x-64 length hash)
69+
#[inline]
6970
pub fn standardize_address(handle: &str) -> String {
70-
if let Some(handle) = handle.strip_prefix("0x") {
71+
if handle.len() == 66 {
72+
handle.to_string()
73+
} else if let Some(handle) = handle.strip_prefix("0x") {
7174
format!("0x{:0>64}", handle)
7275
} else {
7376
format!("0x{:0>64}", handle)

0 commit comments

Comments
 (0)