-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[Feature] Mitigate payment-free verification #2428
Conversation
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.
Just some comment nits.
I'll also rerun consensus test 8.- Load-Batch-Proposal-Attack. |
/// - The transaction is producing a duplicate output | ||
/// - The transaction is producing a duplicate transition public key | ||
/// - The transaction is another deployment in the block from the same public fee payer. | ||
fn should_abort_transaction( |
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.
As there are other reasons and locations where a transaction may be aborted, perhaps a more descriptive name would be: check_transaction_uniqueness_in_block
Co-authored-by: vicsn <[email protected]> Signed-off-by: Raymond Chu <[email protected]>
Co-authored-by: vicsn <[email protected]> Signed-off-by: Raymond Chu <[email protected]>
Co-authored-by: vicsn <[email protected]> Signed-off-by: Raymond Chu <[email protected]>
@vicsn @onetrickwolf can you guys run this branch with CI validation and consensus burn-in / test criteria checks? |
Long-running e2e test passed, consensus test 8 passed as well and clearly logs many |
Motivation
This PR adds a few rules to mitigate the case where malicious parties can force validators to perform transaction verification without having to pay transaction fees (due to transaction aborts).
Example cases:
In both of these cases, the validators will perform verification on all transactions, but only the first transaction will be accepted. All others will be aborted.
The mitigating factors in this PR are:
VM::prepare_for_speculate
.VM::atomic_speculate
, but now we also perform it prior to tx verification.Note that these checks are added prior to verification, so it may be aggressive in aborting transactions. For example given transactions A and B who have the same fee record. If A is aborted for a separate reason (for example, invalid finalize operation):
1. This PR will abort both A and B.
2. The previous logic will only abort A and accept B.
Possible future mitigations:
Test Plan
Tests have been added to ensure that there can only be 1 deployment per block per public fee payer. In addition, more checks have been added to existing tests to ensure that the aborted transactions do not incur verification costs.
Note
This could break existing testnets, and will require a chain reset.