Skip to content
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

txpool: continue pool pruning even if a tx can't be found #8415

Merged
merged 1 commit into from
Aug 23, 2022

Conversation

j-berman
Copy link
Collaborator

@j-berman j-berman commented Jul 1, 2022

  • Defensive change from return to continue to ensure pool pruning executes to completion.
  • Ensure tx pool weight doesn't underflow.
  • Will propose a fix in PR wallet2, RPC: Optimize RPC calls for periodic refresh from 3 down to 1 call #8076 that prevents the root cause of the "Failed to find tx_meta in txpool" error. Noticed the cause of the error while reviewing that PR and that PR seems well positioned to solve it.

Copy link
Contributor

@rbrunner7 rbrunner7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

Looking forward to the revealing of the root cause for that meta finding problem!

@@ -423,8 +436,14 @@ namespace cryptonote
txpool_tx_meta_t meta;
if (!m_blockchain.get_txpool_tx_meta(txid, meta))
{
MERROR("Failed to find tx_meta in txpool");
return;
static bool warned = false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes it print the error once per daemon launch, not once per tx_memory_pool::prune call like it was before. Any specific reason for this change? To copy the previous behavior, warned shouldn't be static and it should be initialized outside of the while loop.

Copy link
Collaborator Author

@j-berman j-berman Jul 19, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once the cap is reached, it will print here incessantly. I assume it wasn't realized that incessant printing would occur here because normal usage hasn't breached the default cap to my knowledge.

This matches #6881

txpool_tx_meta_t meta;
if (!m_blockchain.get_txpool_tx_meta(sorted_it->second, meta))
{
static bool warned = false;
if (!warned)
MERROR(" failed to find tx meta: " << sorted_it->second << " (will only print once)");
warned = true;
continue;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants