-
Notifications
You must be signed in to change notification settings - Fork 3.9k
[Data Service] Implement simple upstream transaction filtering #13699
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
Conversation
⏱️ 4h 47m total CI duration on this PR
🚨 2 jobs on the last run were significantly faster/slower than expected
|
1b965b2 to
bb5a4e7
Compare
e10b908 to
d73b44f
Compare
d73b44f to
dd22f7a
Compare
| // 2. Push the data to the response channel, i.e. stream the data to the client. | ||
| let current_batch_size = transaction_data.as_slice().len(); | ||
| let end_of_batch_version = transaction_data.as_slice().last().unwrap().version; | ||
| let resp_items = get_transactions_responses_builder( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we have some metrics to measure the filtering, like "bytes after filtering" or "number of transactions filtered"?
See this comment inline on Graphite.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great call, done for both!
ce4b9be to
8af264b
Compare
dd22f7a to
1148dc7
Compare
8482bb7 to
7815ce6
Compare
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.
1148dc7 to
05aa06d
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
✅ Forge suite
|
✅ Forge suite
|
✅ Forge suite
|
| // Note: `is_allowed` means the txn matches the filter, in which case | ||
| // we strip it. | ||
| if txns_to_strip_filter.is_allowed(&txn) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: is_allowed is a bit confusing, maybe we can rename later?
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.
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.
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.
* [GRPC] Enable data service ZSTD and update crate that uses old tonic (#13621) * replace println with tracing * [GRPC] Simple Transaction Filtering * Improve transaction filter comments, exports, README, fix lz4 in tests * [Data Service] Implement simple upstream transaction filtering (#13699) 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. --------- Co-authored-by: Max Kaplan <[email protected]> Co-authored-by: yuunlimm <[email protected]> Co-authored-by: CapCap <[email protected]> Co-authored-by: Daniel Porteous <[email protected]>
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.
Description
There are two types of transaction filtering we will support in the future:
This PR implements the second of these, using @CapCap's work here:
aptos-labs/aptos-indexer-processors#398#13715.Rather than not sending txns at all if they match the blocklist filters, we just omit the writesets and events (and payload + signature, like we did with
sender_addresses_to_ignore). Not sending the txns entirely would cause issues with processors, which today assume that they will receive all txns.The txn filtering stuff is a superset of the existing
sender_addresses_to_ignorefunctionality, so I remove that in this PR. I will include how to expresssender_addresses_to_ignoreusing the txn filter stuff in the runbook.Type of Change
Which Components or Systems Does This Change Impact?
How Has This Been Tested?
See updated unit test. We'll try this out in devnet first and release as per the release strategy.
Key Areas to Review
Make sure the configuration approach seems ergonomic.
Checklist