Skip to content

fix: don't iterate unnecessarily over absolutely all HTXs every time#78

Merged
mfontanini merged 1 commit intomainfrom
fix/bad-big-oh
Feb 25, 2026
Merged

fix: don't iterate unnecessarily over absolutely all HTXs every time#78
mfontanini merged 1 commit intomainfrom
fix/bad-big-oh

Conversation

@mfontanini
Copy link
Contributor

@mfontanini mfontanini commented Feb 24, 2026

This fixes the performance issues in the keeper. The problem was in how this was pulling literally all HTXs we knew of as "fallback", whatever that meant, causing it to iterate through all of them and checking their state against the contract. It seems like this was only there somehow in case we saw a HTX that was enqueued but never had a round started, which looking at the contract (https://github.com/NillionNetwork/blacklight-contracts/blob/main/src/HeartbeatManager.sol) doesn't seem possible.

The summarized changes here:

  • Remove unnecessary Option that made it hard to reason about what was/wasn't set (everything was always set).
  • Remove raw_htx_by_heartbeat altogether, since this was essentially only used to fill up these "fallback" HTXs.
  • Remove the dealing of fallback HTXs altogether. Now we go through all rounds and keep the ones that are not done and have hit the deadline.

PS: there's till the issue of rounds being piled up but this doesn't seem to cause issues (yet) so I'd rather not fix it right now.

@mfontanini mfontanini merged commit e4af24b into main Feb 25, 2026
1 check passed
@mfontanini mfontanini deleted the fix/bad-big-oh branch February 25, 2026 17:35
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