Revert block-broadcast fallback path

Removes the entire fallback submitter mechanism: ckpool patch 0004,
the blocksubmit package, the wiring in main.go, the config fields,
the aggregator's fallback counters and snapshot fields, the healthz
fallback fields, and the TS type fields plus the HealthBanners
fallback alert.

Reasoning: ckpool's primary bitcoind submission must remain the
single source of truth, and getting the parallel "race a fallback
during the submit" semantics right is more architectural complexity
than the marginal reliability gain justifies. The original upstream
behavior — submit to bitcoind, retry indefinitely if unavailable —
is what we want.

Kept intact:
  * Submit-attempt vs confirmed counters (block_submit_attempts /
    block_submits_confirmed). Useful on their own as a "did bitcoind
    confirm the submission?" signal.
  * HealthBanners shows submit_gap and zmq_stale only.
  * /healthz exposes submit_gap, zmq_stale, etc.
  * All P0 reliability work (tailer cursor, reconcile loop, reorg
    detection, multi-solve guard) and other P1 (RPC retry, WS
    back-pressure, ZMQ tracking, startup readiness gate).
This commit is contained in:
satoshi
2026-04-28 02:07:17 +03:00
parent 99302cf4af
commit 1dcf087842
9 changed files with 20 additions and 618 deletions
-25
View File
@@ -39,27 +39,6 @@ type Config struct {
// the UI uses the public mempool.space; non-empty means the user
// has pointed Kamado at their own instance via the StartOS config.
MempoolBaseURL string
// Directory ckpool's patched local_block_submit writes raw block
// hex into. Empty disables the fallback submitter.
PendingBlocksDir string
// Comma- or newline-separated list of fallback bitcoind RPC URLs
// that the submitter will try in order if a block stays pending
// past the grace window. Each entry can encode credentials inline:
// https://user:pass@host:8332/
// or without (e.g. an unauthenticated localhost backup node).
BackupRPCURLs string
// How long a pending block file must persist before the submitter
// will try fallback RPCs. Defaults to 3s — short enough that a
// failed submit is recovered while the work is still relevant,
// long enough that ckpool's bounded internal wait (~3s for a live
// primary server) and a single slow round-trip don't trigger a
// spurious fallback. Patch 0004 makes ckpool's submit return false
// rather than spinning indefinitely, so we no longer need to wait
// for that case to time out.
PendingBlocksGrace time.Duration
}
func FromEnv() (*Config, error) {
@@ -75,10 +54,6 @@ func FromEnv() (*Config, error) {
DBPath: getenv("DB_PATH", "/var/lib/kamado/kamado.db"),
PollInterval: getenvDuration("POLL_INTERVAL", 5*time.Second),
MempoolBaseURL: os.Getenv("MEMPOOL_BASE_URL"),
PendingBlocksDir: os.Getenv("PENDING_BLOCKS_DIR"),
BackupRPCURLs: os.Getenv("BACKUP_RPC_URLS"),
PendingBlocksGrace: getenvDuration("PENDING_BLOCKS_GRACE", 3*time.Second),
}
if cfg.BitcoinRPCURL == "" {