Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Boolean Logic Transaction Filtering #392

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft

Conversation

CapCap
Copy link
Contributor

@CapCap CapCap commented May 31, 2024

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)

@CapCap CapCap force-pushed the transaction_filter_simple branch from 2a41972 to c73f38f Compare May 31, 2024 02:44
@CapCap CapCap force-pushed the transaction_filter_simple branch from c73f38f to 236b94d Compare May 31, 2024 02:47
@rtso rtso requested a review from a team June 10, 2024 19:50
}
}

impl Filterable<i32> for Option<i32> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We use i64 in most places in the processors, should we use i64 here too?


#[inline]
fn is_allowed(&self, struct_tag: &MoveStructTag) -> bool {
self.address.is_allowed(&struct_tag.address)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it expect that the address is 64 length? Should we support both truncated and standardized addresses?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it does expect standardized addresses, yeah... I was hoping this could be a convention, but we could also put it in custom serde?

Comment on lines +9 to +12
/// This is a wrapper around ChangeItemFilter, which differs because:
/// While `ChangeItemFilter` will return false if the Event does not match the filter,
/// `ChangeItemFilter` will return true- i.e `WriteSetChangeFilter` *only* tries to match if the
/// change type matches its internal change type
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need both the ChangeItemFilter and WriteSetChangeFilter? If it's possible, I prefer having a single one to keep things simpler.

Also how will we check a transaction if a transaction is allowed? Is it if any of its wsc is allowed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

currently this simple version- yeah

In the follow up PR, there is a AND, OR, and NOT

@CapCap CapCap changed the title Simpler Transaction Filtering Boolean Logic Transaction Filtering Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants