fix: don't iterate unnecessarily over absolutely all HTXs every time#78
Merged
mfontanini merged 1 commit intomainfrom Feb 25, 2026
Merged
fix: don't iterate unnecessarily over absolutely all HTXs every time#78mfontanini merged 1 commit intomainfrom
mfontanini merged 1 commit intomainfrom
Conversation
jimouris
approved these changes
Feb 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
Optionthat made it hard to reason about what was/wasn't set (everything was always set).raw_htx_by_heartbeataltogether, since this was essentially only used to fill up these "fallback" HTXs.PS: there's till the issue of
roundsbeing piled up but this doesn't seem to cause issues (yet) so I'd rather not fix it right now.