-
Notifications
You must be signed in to change notification settings - Fork 80
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
AVM-1 No Gas Gharges for Failed Transactions #409
Comments
We looked at the logic of the code fix in #542, and it was fixed for the same sequence_number too new, but it could still be attacked in the same way as the previous attack for a different sequence_number too new transaction. |
@msjyryxdzzj What is your proposed attack? You cannot duplicate sequence numbers will not leave the mempool to the same node under #542? This also became PR #722 (as it was ultimately signed). See the tests added therein for whether the issue is addressed. |
Attacker sends a transaction with seq_number greater than the current seq_number |
I think the following issues still exist in the latest PR:
|
@poetyellow yes, we are accepting that some transactions can enter out to the sequence number too new tolerance. The reason we want some to enter as opposed to always simply requiring the next highest sequence number is that users should be able to have multiple transactions in flight. When that tolerance is low, this prevents someone from running a particularly effective DOS. Your amortized cost for these transactions is Changing the gas charges requires modifications to Aptos Core execution ordering and fee statement processing which we did not want to introduce at the last. See #665 . |
Got it |
AVM-1 No Gas Gharges for Failed Transactions
Auditor: Movebit
Code: Aptos Core
Severity: Critical
Discovery Methods: Manual Review
Status: Pending
Code Location:
aptos-move/aptos-vm/src/aptos_vm.rs#1654
Descriptions:
Pre-processing checks are performed on transactions as they enter the mempool:
But the SEQUENCE_NUMBER_TOO_NEW error for transactions with sequence_number
greater than the current account.sequence_number is covered in the function. This is as
expected (because future transactions are also going into the pool pending.) But the too_new
error for transactions with sequence_number greater than the current
account.sequence_number is covered in the function. This is as expected (since future
transactions are also going into the transaction pool pending:
At this point the transaction goes to the mempool and is written to the DA. After that it will
read the transaction from DA and execute it when the code is as follows:
At this point, the transaction is still checked for the same things that are checked during
preprocessing.
In this case, the sequence_number is higher than the current sequence_number, resulting in
an error. However, the handling fee is deducted after this check is performed, so no handling
fee is deducted for the transaction. This issue can lead to DA of transactions, mempool
being dosed at 0 cost.
Suggestion:
It is suggested to refer to the design idea of aptos to do the pending processing for the
transaction whose sequence_number is larger than the current sequence_number.
The text was updated successfully, but these errors were encountered: