-
Notifications
You must be signed in to change notification settings - Fork 860
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 REQUEST] Set DEFAULT_LOWEST_INVALID_KNOWN_NONCE_CACHE configurable, like others transaction pool options #6058
Comments
We are facing the same problem. In our case, we have a lot of accounts that as blocked (all transactions signed by these accounts are getting stuck in TX_POOL). One other option is a command line option that disables invalid nonce cache control. |
I raised a discussion on discord about exactly this issue a couple of days ago: https://discord.com/channels/905194001349627914/905205502940696607/1164623046389272699 I was considering a PR that would prevent invalid TXs entering the invalid nonce cache if the reason was I'll potentially raise that PR, but I think the new layered pool implementation doesn't use an invalid nonce cache. So you could set |
I've raised #6067 which I think could help in a large number of the cases. |
Note that I think this issue which I raised yesterday is closely related to the scenario described: Currently even if you set |
@matthew1001 as you mentioned, there is a new layered pool implementation. Has this new implementation already been released? |
Yes it's available in 23.10.0 as the default pool implementation. |
Before 23.10.0 you need to set |
the invalid known nonce cache was introduced as a workaround to mitigate the nonce gap problem while we where introducing the new layered txpool, that solves this problem in a much better way. So if you are running Besu version >= 23.4.1 I strongly recommend to use it instead of the legacy one. Since version 23.10.0 it is the default Said that we see that there are some specific use cases for private networks that are not supported, and there is the opportunity to create a txpool tailored for them. |
Excellent advice. We will enable this option, but we are using 23.4.1 version and there is no documented option related There is an equivalent ENV variable to set this config? |
It is not documented in that version, because we are not documenting experimental or hidden features, but you can read about the options, directly in the PR #5290 for the env variable try |
FYI: This PR is an improvement to allow for easier tx replacement |
@fab-10, I understand and agree with your suggestion to enable the parameters (or migrate to 23.10), but we are trying to reproduce the error to document and justify the configuration change, but we are not succeeding. When we didn't want to generate the error it occurred, but now that we want to generate it we can't. Could you help us understand how we can reproduce the nonce gap scenario in version 23.4? Except network problems and spam transactions (mentioned in the PR), is there any practical way to cause the inclusion of an address in the cache of invalid nonces? |
@alexcostars could you share the configuration and parameters used to start Besu? it will also help to know about your setup, how many nodes and from which nodes you send the txs. |
Here we have the genesis file (https://github.com/bacen/pilotord-kit-onboarding/blob/main/genesis.json) and conf (https://github.com/bacen/pilotord-kit-onboarding/blob/main/config.toml). We are connected to 20 peers, 14 full nodes and 6 validators. |
Hi, 2 weeks ago we faced this error, and the solution was to restart all validator nodes (because Invalid Nonce Cache is controlled in memory). Today the error occurred again. We have, now, an account blocked (possibly setted as invalid nonce cache into validators). There is anything that I can do to understand why is this occurring? |
@alexcostars unfortunately with your version is not possible to do much, the only thing that comes to mind is to check the metrics, but also there there are limits. About your request to reproduce the issue, if you were on a gas priced network, then I would have suggested to play with the balances of the account, to simulate it, but since in your case you are on a gas free network, it is not easy to manually simulate the issue, because if the invalid reason is NONCE_TOO_LOW, that depends on the timing of events. NONCE_TOO_LOW is triggered when a validator is trying to create a block, and it selects a tx with a nonce that is already present in the world state for that sender, namely already confirmed, and this should happens if some events overlaps as detailed below: Normal flow
the issue is when 5. happens before 4., that is, when a new block is being built, before the removal of confirmed txs from the pool is complete, as below:
So this case is hard to reproduce in a deterministic way, at some point you need to upgrade to a newer version where, with the help of @matthew1001, we are improving on this part. |
Thanks for describing the scenario, we know that it's hard to reproduce it. I have 2 questions:
|
@matthew1001 found another race condition that results in chain head not available error, that he is tracking here , and could be also a cause of your errors. About your questions:
|
@fab-10 2- There is a bug on besu code that is misaligning the nonce cache and the actual blockchain data/world state. Somehow the nonce cache gets higher than it should and txs with the correct nonces are considered invalid (nonce already used) |
Said that, I reckon that the invalid nonce cache, was a quick workaround, specifically crafted for public networks, to avoiding that the txpool was polluted with spam txs, while we were developing the layered txpool, that is built to solve this issue at the core. |
@fab-10 |
Description
We are In a private free gas chain , using QBFT protocol, to implement a national CBDC, when a trasanction get stucked in TX_POOL, that transactions are included in cache. We are unable to send a new transaction with higher gas, so the only way is set our TX_POOL_MAX_SIZE to 0 , and back to default value, then we are able to sent new transactons, but , the invalid transaction was included in cache of validator and we are unable to reset then. because of network rules. So always we sent new transactions BESU will check this cache, and invalidate again because we have a higher nonce.
Acceptance Criteria
IF we are able to set LOWEST_INVALID_KNOWN_NONCE_CACHE = 0 on bootstrap of validators nodes, we can transact normally and transactions will not being invalidated every time, because we haven't a cache, in our case this cache isn't necessary.
The text was updated successfully, but these errors were encountered: