Skip to content

Commit

Permalink
Simplest MVP transaction filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
CapCap committed Jun 21, 2024
1 parent 44cd72f commit 5fc070b
Show file tree
Hide file tree
Showing 19 changed files with 1,320 additions and 41 deletions.
180 changes: 143 additions & 37 deletions rust/Cargo.lock

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

8 changes: 6 additions & 2 deletions rust/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[workspace]
resolver = "2"

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

[workspace.package]
authors = ["Aptos Labs <opensource@aptoslabs.com>"]
Expand Down Expand Up @@ -58,6 +58,7 @@ gcloud-sdk = { version = "0.20.4", features = [
"google-cloud-bigquery-storage-v1",
] }
cloud-storage = { version = "0.11.1", features = ["global-client"] }
derive_builder = "0.20.0"
google-cloud-googleapis = "0.10.0"
google-cloud-pubsub = "0.18.0"
hex = "0.4.3"
Expand All @@ -69,6 +70,8 @@ jemallocator = { version = "0.5.0", features = [
] }
kanal = { version = "0.1.0-pre8", features = ["async"] }
once_cell = "1.10.0"
# SIMD for string search
memchr = "2.7.2"
num_cpus = "1.16.0"
pbjson = "0.5.1"
prometheus = { version = "0.13.0", default-features = false }
Expand All @@ -83,11 +86,12 @@ reqwest = { version = "0.11.20", features = [
] }
serde = { version = "1.0.193", features = ["derive", "rc"] }
serde_json = { version = "1.0.81", features = ["preserve_order"] }
serde_yaml = "0.8.24"
serde_yaml = "0.9.34"
sha2 = "0.9.3"
sha3 = "0.9.1"
strum = { version = "0.24.1", features = ["derive"] }
tempfile = "3.3.0"
thiserror = "1.0.61"
toml = "0.7.4"
tracing-subscriber = { version = "0.3.17", features = ["json", "env-filter"] }
tiny-keccak = { version = "2.0.2", features = ["keccak", "sha3"] }
Expand Down
1 change: 0 additions & 1 deletion rust/processor/src/grpc_stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ pub async fn get_stream(

let mut rpc_client = match connect_res {
Ok(client) => client
.accept_compressed(tonic::codec::CompressionEncoding::Gzip)
.accept_compressed(tonic::codec::CompressionEncoding::Zstd)
.send_compressed(tonic::codec::CompressionEncoding::Zstd)
.max_decoding_message_size(MAX_RESPONSE_SIZE)
Expand Down
5 changes: 4 additions & 1 deletion rust/processor/src/utils/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,11 @@ pub struct MultisigPayloadClean {
}

/// Standardizes all addresses and table handles to be length 66 (0x-64 length hash)
#[inline]
pub fn standardize_address(handle: &str) -> String {
if let Some(handle) = handle.strip_prefix("0x") {
if handle.len() == 66 {
handle.to_string()
} else if let Some(handle) = handle.strip_prefix("0x") {
format!("0x{:0>64}", handle)
} else {
format!("0x{:0>64}", handle)
Expand Down
Loading

0 comments on commit 5fc070b

Please sign in to comment.