Repository navigation
Conversation
auto-compound printed "backing off for 30s" after a rate-limit refusal but did not wait, so the next attempt came with the next tick. It now waits 30 s; the waits after other refusals are unchanged. AI disclosure: prepared with AI assistance (OpenAI Codex and Claude by Anthropic). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
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.
Depends on: nothing.
Problem. The node allows each address a limited number of compound transactions per minute. When
auto-compoundhit that limit, it printed "RATE LIMITED, backing off for 30s" and then did not wait: the next attempt came with the next tick, as little as six seconds later, into the same limit.Change. The message and the wait for a refused compound broadcast now come from one function,
compoundBroadcastFailure: 30 s after a rate limit, 5 s after stale inputs ("already spent by transaction") and 30 s after any other refusal. Only the rate-limit wait changes; the other two keep their messages and waits.Validation.
TestCompoundBroadcastFailureBackoffchecks message and wait for the three kinds of refusal, andTestCompoundOnceWaitsAfterRateLimitrunscompoundOnceagainst a stub daemon that refuses every broadcast and checks with a fake clock that it waits at least 30 s. With the old code the rate-limited attempt returned after 0 s; the tests call the new function, so for that comparison the old code was put behind the same stub.gofmt -l,go vet ./cmd/htnwallet/...andgo test -race -count=1 ./cmd/htnwallet/...pass with Go 1.27.4 on linux/amd64.Compatibility and limits. Only the
auto-compoundcommand changes; the daemon, its API and the keys file do not. The wait is a fixed 30 s, not adapted to the node's actual limit window.AI disclosure: prepared with AI assistance (OpenAI Codex and Claude by Anthropic).