Skip to content

bug: spark exit fee ask stays up during a redo hold the held funding paid #1313

Closed

Description

@ovitrif

Description

When a Redo arrives while a top-up is awaited, the funding the exit already holds can pay for the rebuild. If that rebuild's prepare skips a waiting leaf the diverged generation recovers, the Redo hold from #1309 keeps the exit in .needsFunding. The hold only moves to .running once fundingShortfallSats is null, and here the old shortfall is still set. So the emergency exit screen and App Status keep asking for that top-up for up to redoHoldBlocks (about an hour), although the held funding paid for the build. A user who pays in that hour sends funds the rebuild didn't need. The leftover sweep returns them, minus fees.

Found by @coreyphillips on the Android twin (synonymdev/bitkit-android#1892 (comment)); iOS has the same check.

Steps

  1. An unverified rebuild asks for a top-up (.needsFunding, isUnverifiedAsk).
  2. driveWhileFunding gets Redo, which sets isRebuilding and isRedoRebuild.
  3. The top-up hasn't arrived, so the funding branch of tick builds from the held funding. recover succeeds, but the prepare skipped leaf-2 as Unverified.
  4. holdsRedo keeps .needsFunding, so the fee ask stays up until the hold ends.

Expected

After a successful recover (the holdsRedo calls after a build, in the failed-only and normal branches), the exit moves to .running whatever the old shortfall, since the held funding paid for the build. Only the empty-prepare call, which has no build, keeps the phase. A later build that's short asks again through askForFunding.

Activity

  1. added this to the 3.2.0 milestone on Nov 12, 2026
  2. ovitrif commented on Nov 12, 2026

    @ovitrif
    CollaboratorAuthor

    Milestone 3.2.0: this issue is a Spark emergency exit bug, the iOS twin of synonymdev/bitkit-android#1894, and the exit ships in 3.2.0 with #1128.

  3. self-assigned this
    on Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions