Skip to content

Commit

Permalink
[Data Service] Implement simple upstream transaction filtering
Browse files Browse the repository at this point in the history
There are two types of transaction filtering we will support in the future:
1. Per stream configuration: The downstream declares what txns they want to receive.
2. Global configuration: At the data service level we refuse to include full txns for all streams.

This PR implements the second of these, using @CapCap's work here:
aptos-labs/aptos-indexer-processors#398.

Rather than not sending txns at all if they match the blocklist filters, we just omit the writesets and events. Not sending the txns entirely would cause issues with processors, which today assume that they will receive all txns.
  • Loading branch information
banool committed Jun 14, 2024
1 parent 2a9057f commit 1b965b2
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 17 deletions.
88 changes: 71 additions & 17 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,7 @@ ark-groth16 = "0.4.0"
ark-serialize = "0.4.0"
ark-std = { version = "0.4.0", features = ["getrandom"] }
aptos-moving-average = { git = "https://github.com/aptos-labs/aptos-indexer-processors.git", rev = "4801acae7aea30d7e96bbfbe5ec5b04056dfa4cf" }
transaction-filter = { git = "https://github.com/aptos-labs/aptos-indexer-processors.git", rev = "13a63d8e3c07cbda36907ca2f1ee1a323e910897" }
assert_approx_eq = "1.1.0"
assert_unordered = "0.3.5"
async-channel = "1.7.1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ tokio = { workspace = true }
tokio-stream = { workspace = true }
tonic = { workspace = true }
tonic-reflection = { workspace = true }
transaction-filter = { workspace = true }
tracing = { workspace = true }
uuid = { workspace = true }

Expand Down

0 comments on commit 1b965b2

Please sign in to comment.