EVM/Node: bound the size of the transaction pool itself
What
Previous: !12741 (merged).
Part. of #7109 (closed): Bound the size of the transaction pool itself (both the number of addresses, and the number of transactions by address)..
Why
This is just to prevent spamming of the transaction pool (to be more precise to discourage attackers) .
How
By simply putting a threshold on how much addresses are allowed simultaneously inside the pool but also the number of transaction per user.
For now I've used a metric reported by Hantang on the limit of the injector's queue: 50_000 (but this might no be relevant at all) to set the two thresolds decribed in this MR (4000 users / 16 txs per user). Please feel free to suggest other numbers that might suit better didn't think of this that much to be honest, the code is ready in any case.
Also namings from this MR might not be the best, don't hesitate to suggest other namings if you feel that the current ones are unclear.
Manually testing the MR
dune exec etherlink/tezt/tests/main.exe -- --file evm_rollup.ml evm tx_pool address boundaries
It'd be cleaner to write this test with txpool_content RPC (one of the item from #7109 (closed)) implemented. It should probably be tweaked in a follow-up issue #7125 (closed).
Checklist
-
Document the interface of any function added or modified (see the coding guidelines) -
Document any change to the user interface, including configuration parameters (see node configuration) -
Provide automatic testing (see the testing guide). -
For new features and bug fixes, add an item in the appropriate changelog ( docs/protocols/alpha.rstfor the protocol and the environment,CHANGES.rstat the root of the repository for everything else). -
Select suitable reviewers using the Reviewersfield below. -
Select as Assigneethe next person who should take action on that MR