Also known as: Virtual Gas limiter
Let’s take a look at what a rate limiter is, the importance of using a rate limiter, its features, and how to configure the rate limiter in RSKj nodes using config keys.
The Rate-Limiter deters accounts from issuing problematic transactions, preventing those transactions from being added to the transaction pool and relayed to other peers. It is designed to not affect normal usage, but limit resource-intensive transactions that exhaust the network capacity. An account can still perform any transaction, even the most expensive transactions (128KB in size) after about 32 minutes of inactivity.
RSKj now prevents such attacks, this is made possible by the Rate-Limiter, by preventing source accounts from broadcasting transactions which consume large amounts of resources. The higher the gas limit, the more the source account gets rate-limited. The rate-limit also takes into account additional factors such as:
The Rate-Limiter does this by granting a Virtual Gas Quota that will be consumed every time a transaction is received. It then allows this to replenish slowly, while the account is inactive.
If you have interacted with the Rootstock public nodes, you may have already encountered rate limiting in action. Note that the rate limits on the public nodes are implemented using a 3rd party service, and not within the RSKj node itself. Another notable difference is that the rate limits there are IP address based; and not account based.
The feature works as follows:
The implementation of the rate-limiter algorithm can be found within RSKj. See TxQuotaChecker for the implementation.
The rate limiter is intended to prevent two variants of Network Denial of Service (DoS) attack against Rootstock networks:
Both variants affect congested networks more than blockchains with empty blocks. All variants are highly practical on networks with cheap gas fees, but may be impractical on networks with expensive fees.
This feature has some inherent consequences:
The feature can be configured in RSKj nodes via the following configuration keys:
Open the configuration file. See expected Configuration file for more information. Add the following keys below to the config file.
transaction.accountTxRateLimit.enabled:<boolean>
true
.transaction.accountTxRateLimit.cleanerPeriod:<int>
30
minutes.Go to top