aptos-indexer-processors icon indicating copy to clipboard operation
aptos-indexer-processors copied to clipboard

Simplest MVP transaction filtering

Open CapCap opened this issue 1 year ago • 4 comments
trafficstars

an MVP version of the transaction filtering crate.

Performance

On a random 3mb proto of 1000txns during taptos, running the "everything" filter (looped) gives:

BENCH: Took 13.225167ms for 1000000 transactions (13ns each)

Random 10mb proto from April 25th with "everything" filter:

BENCH: Took 21.815375ms for 1000000 transactions (21ns each)

Graffio 100mb proto ("everything" filter, but with or):

BENCH: Took 31.559333ms for 1000000 transactions (31ns each)

More advanced feature complete version here: https://github.com/aptos-labs/aptos-indexer-processors/pull/392

CapCap avatar Jun 11 '24 18:06 CapCap

How do we plan to share this crate with aptos-core?

bowenyang007 avatar Jun 11 '24 19:06 bowenyang007

@bowenyang007 sorry I don't understand the question

CapCap avatar Jun 11 '24 19:06 CapCap

Data service needs to use this right? I'm curious if we're going to copy over the code or upload it to crates.io.

A few additional questions:

  • Can we add a readme? Particularly I'm not sure from the PR what exactly is being filtered or how it's meant to be used.
  • How are the proto fixtures supposed to work? How do we upgrade the proto?
  • Can we have comments?

bowenyang007 avatar Jun 11 '24 20:06 bowenyang007

@bowenyang007 I figured we'd do it the way we do everything else, i.e;

transaction-filter = { git = "https://github.com/aptos-labs/aptos-indexer-processors.git", rev = "4541add3fd29826ec57f22658ca286d2d6134b93" }

I can move stuff to the readme and add an example, sure

CapCap avatar Jun 11 '24 20:06 CapCap