You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(node): stop a top-up for one pool from joining a settling topUp for another #2496
The node has one top-up slot (topup_in_flight), and that slot does not record which pool its topUp funds.
join_or_spawn_topup(pool_id, ..) (crates/node/src/buyer_pool.rs) joins any topUp in flight. InFlightTopUp stores no pool_id, so the join does not compare pools.
Before #2492 a topUp held the slot only until its receipt arrived. Now settle_unconfirmed_top_up holds it until the chain resolves the topUp. That can take a long time, and the pool can be replaced meanwhile: it closes, and recovery opens a new one. In that case:
A recovery top-up for the new pool joins the old pool's topUp. That topUp escrows into the old pool, so it cannot fund the new one.
When the settle ends, it credits the old pool's row, which no longer exists. It ends with EscrowedUntracked. A joiner treats that error as final (retryable_join_error), so the new pool's recovery fails, and nothing escrows into the new pool.
A low-water refill of the new pool does nothing while the slot is held.
So funding for the new pool stops until the old pool's topUp settles.
Fix direction
Choose one:
Store the pool_id in InFlightTopUp. A caller for another pool does not join. It fails at once as a local fault, or it waits for the slot to free.
Key the slot by pool, so that a topUp for the new pool can run beside one that is settling for the old pool. One wallet sends both, so the second topUp takes a later nonce, and it cannot mine until the settling topUp's nonce is spent.
Either way, a join must never count headroom that a topUp escrowed into another pool.
Checks
A topUp for pool A is settling, and the row now tracks pool B. A recovery for B does not join A's topUp, and does not get A's EscrowedUntracked error.
The existing join and claim tests (top_up_at_least_*) still pass.
Activity