Skip to content

fix(monitor): store counter on wallet account#2293

Merged
Mirko-von-Leipzig merged 1 commit into
nextfrom
santiagopittella-fix-monitor-counter-onchain
Jun 29, 2026
Merged

fix(monitor): store counter on wallet account#2293
Mirko-von-Leipzig merged 1 commit into
nextfrom
santiagopittella-fix-monitor-counter-onchain

Conversation

@SantiagoPittella

@SantiagoPittella SantiagoPittella commented Jun 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

After running a benchmarks against devnet I noticed something off in the network monitor's counter: it was being properly increased by with a constant difference between the expected and the actual value of 7.

This was weird because usually it should catch up or not increase at all, and the cards was stuck as unhealthy (at the time of opening the PR it is still marked as unhealthy). We have some mechanisms to fix counter issues on runtime but, after some time debugging, I realized what happened:

  • I was running benchmarks
  • The monitor was increasing the counter too.
  • The mempool was at its limits.
  • Some monitor txs were rejected because of the mempool being full (this case is handled in the monitor).
  • Some monitor txs were acked and accepted by the node, but then the mempool dropped the transactions/were reverted (the case not handled in the monitor).
  • After the benchmark the network's load was reduced and everything started to run smoothly from there, making the counter to keep being increased.

To avoid this for happening in the future, this PR adds a counter in the wallet's storage as a new slot. This way we ensure that if the tx succeeds the counter is increased and the network note was truly created.

Changelog

[[entry]]
scope       = "network-monitor"
impact      = "fixed"
description = "Reverted transactions no longer desync counter state"

@SantiagoPittella SantiagoPittella force-pushed the santiagopittella-fix-monitor-counter-onchain branch from 1dfa960 to 60eb4e7 Compare June 29, 2026 16:08

@Mirko-von-Leipzig Mirko-von-Leipzig left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Ah yeah I'd seen that before a few times back when testnet crash looped.

Nice fix!

@Mirko-von-Leipzig Mirko-von-Leipzig merged commit 39f7175 into next Jun 29, 2026
24 checks passed
@Mirko-von-Leipzig Mirko-von-Leipzig deleted the santiagopittella-fix-monitor-counter-onchain branch June 29, 2026 17:10
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.

2 participants