Skip to content

Configurable wallet KEY_COUNT across all bots (#1) - #3

Merged
nimcon merged 1 commit into
mainfrom
keeper-bots-configurable-key-count
Jul 17, 2026
Merged

Configurable wallet KEY_COUNT across all bots (#1)#3
nimcon merged 1 commit into
mainfrom
keeper-bots-configurable-key-count

Conversation

@nimcon

@nimcon nimcon commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Addresses the remaining actionable item from #1 (issue 2): the default key_count=500 makes each bot send 500 synthetic keys per request, and the node scans them all, so a wallet with address history can hit the per-wallet coin-fetch limit or time out.

Change

Add a global KEY_COUNT env var (like RPC_URL / PRIVATE_KEY / FEE_PER_COST), default 500 (unchanged), applied to every bot that builds a CircuitRPCClient. Keepers who hold CRT/XCH on early derivation indexes can set e.g. KEY_COUNT=1 to avoid scanning empty addresses. Documented in .env.example.

Notes on the other items in #1

  • Issue 1 (fee_per_cost never resolved): already fixed — surplus_bid_bot calls set_fee_per_cost() at the top of each loop.
  • Issue 3 (KeyError: 'expired'): not a current-code bug. SurplusAuctionCoin.expired is a required field the surplus list endpoint always sets, and the client raises (not returns) on error responses, so a valid response can't omit it — the overnight error was a deployed-API-version artifact. No bot-side guard added. (A genuine instance of this bug class exists in recharge_start_settle_bot's settle path — is_expired plus an undefined pub_key — tracked separately.)
  • Issue 4 (CRT fragmentation / /send_crt): the blocking bidding failure is fixed on the backend by circuit#55 (surplus bids now auto-aggregate small CRT coins), so manual CRT merging is no longer required for reliable bidding.

Related backend PRs: circuit#55 (CRT aggregation for surplus bids), circuit#56 (coin-fetch error messages).

🤖 Generated with Claude Code

Every bot derives key_count synthetic keys (wallet addresses) and sends them on
each request; the node scans them all, so the default 500 over a wallet with
address history can hit the per-wallet coin-fetch limit or time out. Add a global
KEY_COUNT env var (default 500, unchanged) so keepers can lower it (e.g. 1-20)
when funds live on early derivation indexes. Applied to every bot that builds a
CircuitRPCClient. Addresses keeper-bots#1 (issue 2).

Issue 1 (fee_per_cost) was already fixed. Issue 3 (KeyError 'expired') is not a
current-code bug: SurplusAuctionCoin.expired is a required field the list
endpoint always sets, so no bot-side guard is needed.
@nimcon
nimcon requested a review from trepca as a code owner July 17, 2026 21:12
@nimcon
nimcon merged commit d3e24b6 into main Jul 17, 2026
1 check failed
@nimcon
nimcon deleted the keeper-bots-configurable-key-count branch July 17, 2026 21:26
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.

1 participant