Release: develop -> main#4340
Merged
Merged
Conversation
* fix(liquidity): keep activation debounce across drain chunks verifyRule cleared the rule's activation-debounce timer (ruleActivations) unconditionally right before executeRule. After each pipeline completed and the rule returned to Active, the next cron cycle re-armed the timer and had to wait the full lmActivationDelay again before the next chunk. For a redundancy rule whose orders are liquidity-capped (best-price chunk, e.g. an exchange sell), this serialized the drain to one chunk per delay, turning a large offload into a multi-hour trickle. Arm the timer once when the condition first appears and clear it only when the condition resolves (else branch); follow-up chunks then fire at the normal every-minute cadence. Also clear the timer when a rule is Paused so a rule paused by a failed pipeline re-debounces on reactivation — deliberately not for other non-active states, notably Processing (occurs between chunks). * test(liquidity): cover the activation-debounce invariant Regression tests for verifyRule's ruleActivations behaviour: the timer persists across a drain chunk (Active + ongoing condition), is cleared on Paused so a failed-then-reactivated rule re-debounces, and is kept while Processing between chunks. Verified to fail if either fix is reverted. * fix(liquidity): clear activation timer at pause transition, not in verifyRule The earlier verifyRule guard cleared the activation-debounce timer only when the every-minute cron observed the rule Paused. A manual reactivation (reactivateRule) can flip Paused -> Active in a different service before that tick, letting a just-failed rule skip the debounce with a stale timestamp. Move the reset to the actual pause transition: handlePipelineFail now calls a new resetActivation(ruleId) on the liquidity service right after rule.pause(). Revert the verifyRule non-active guard to its original form. Covers manual and cron reactivation alike. Tests updated; adds a handlePipelineFail spec. * style(liquidity): apply prettier formatting to pipeline spec
github-actions
Bot
requested review from
TaprootFreak and
davidleomay
as code owners
July 23, 2026 13:33
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.
Automatic Release PR
This PR was automatically created after changes were pushed to develop.
Commits: 1 new commit(s)
Checklist