-
Notifications
You must be signed in to change notification settings - Fork 11.2k
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
[TrafficController] correctly categorize spam #18324
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
3 Ignored Deployments
|
2ecefc4
to
aeb24ff
Compare
} | ||
Err(err) => { | ||
Err(err) | ||
} |
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.
this could just be .map(|(result, _)| result)
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.
Fixed
if !policy_config.spam_sample_rate.is_sampled().await { | ||
let sampled = futures::future::join_all(vec![ | ||
tally.spam_weight.is_sampled(), | ||
policy_config.spam_sample_rate.is_sampled(), |
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.
I don't understand why this requires anything async or join_all
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.
Missed this, you're right the function called here doesn't need to be async
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.
Fixed
// unless request requires gas payment, count against | ||
// spam tally | ||
match method.as_str() { | ||
"sui_executeTransactionBlock" | "sui_devInspectTransactionBlock" => Weight::zero(), |
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.
So, sui_devInspectTransactionBlock
certainly could be spammed, and arguable a fullnode operator would want to count sui_executeTransactionBlock
as spam as well, since its the validators that are being paid, not them.
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.
Done
72bab95
to
b4a59bf
Compare
## Description This PR redefines spam in the context of traffic controller as any request type that does not consume gas. There are two such categories that have bee considered so far - read api requests and transaction execution requests that do not invoke the vm (which, to my knowledge, should only happen on submitting a certificate for an already executed transaction, at which point all validators simply read and return the effects). Both cases are hadled here. ## Test plan Fixed existing tests to exercise the new logic --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK:
## Description CP #18396 and #18324 ## Test plan How did you test the new or updated feature? --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK:
## Description This PR redefines spam in the context of traffic controller as any request type that does not consume gas. There are two such categories that have bee considered so far - read api requests and transaction execution requests that do not invoke the vm (which, to my knowledge, should only happen on submitting a certificate for an already executed transaction, at which point all validators simply read and return the effects). Both cases are hadled here. ## Test plan Fixed existing tests to exercise the new logic --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK:
Description
This PR redefines spam in the context of traffic controller as any request type that does not consume gas. There are two such categories that have bee considered so far - read api requests and transaction execution requests that do not invoke the vm (which, to my knowledge, should only happen on submitting a certificate for an already executed transaction, at which point all validators simply read and return the effects). Both cases are hadled here.
Test plan
Fixed existing tests to exercise the new logic
Release notes
Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required.
For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates.