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
Tx pool: strict mode #3675
Comments
This is highly welcome. Except for things related to oracles, I predict that absolutely no transaction will ever really "become valid". This pattern leaves more doors for attacks open than bringing any benefits. The common pattern should be: If it's not valid now and maybe a tiny amount of micro blocks, it should be kicked (with the exemption of oracle related stuff as stated before). |
should we keep a tx with an invalid (or yet unknown) just for me to understand the behavior better:
|
If someone broadcasts it again, the node will accept a GCed tx. Currently nodes do not broadcast hanging in poll txs but we plan on adding a feature "broadcast again this particular transaction". If you restart your node, on startup it will ask its peers for all txs in their pool and can consume it again; if the tx is being included in a micro block - the node will accept it of course :) |
The tx pool does some checks for transactions and accepts ones that could be valid soon - ex. it does not check if the
origin
has enough tokens to spend and etc. The tx pool actively rejects txs with obvious issues - nonce is already used, insufficient fee, wrong signatures and etc.This results in tx pool accumulating some transactions that are not valid at the moment (and could become eventually valid).
Applying them results in errors:
Provide optional strict mode for the transaction pool: if the node is a miner one and if tries applying a transaction and it fails (not enough tokens, nonce too high...) - kick the transaction out of the pool on the
X
attempt, whereX
could be specified for each error independently. This is different by the current GC behaviour as a transaction can be tried and can fail many times until it matures for GC. Since a transaction can be marked as tried once a generation, this means we still provide a transaction at leastX
generations of attempts to become valid before we kick it out.This will provide us with better granularity for kicking out invalid txs. For example a transaction that comes with the wrong
vm_version
is not likely to become valid anytime soon, so no reason for keeping it. Atx_nonce_too_high_for_account
might be worth keeping for longer and so on.The text was updated successfully, but these errors were encountered: