Skip to content

Stabilize daemon utxo propagation test#1003

Merged
michaelsutton merged 1 commit into
kaspanet:toccatafrom
michaelsutton:fix-daemon-prop-test
May 14, 2026
Merged

Stabilize daemon utxo propagation test#1003
michaelsutton merged 1 commit into
kaspanet:toccatafrom
michaelsutton:fix-daemon-prop-test

Conversation

@michaelsutton
Copy link
Copy Markdown
Contributor

The daemon UTXO propagation test could start mining before all multi-listener subscriptions were fully registered server-side. When that happened, a listener could miss the event it later waited for, causing an intermittent timeout despite the block itself being processed.

This PR makes the test wait for the initial notification batch to reach all relevant listeners and drains stale events before entering the per-block mining/wait loop. This keeps the test’s notification expectations aligned with the actual listener registration state.

ListeningClient uses the multi-listener gRPC path, where start_notify awaits the local listener mutation but upstream server-side registration is applied asynchronously by the notifier subscriber task. The test subscribed and immediately mined, so CI could start mining before one of the server-side notification registrations was active, causing the matching notification to be missed and the test to time out.

Warm up the multi-listener clients during the initial mining batch, wait until both listeners observe the final block and virtual DAA notifications, and drain old block/DAA events before each submitted block so mine_block waits only on fresh notifications.
@michaelsutton michaelsutton changed the title stabilize daemon utxo propagation notifications Stabilize daemon utxo propagation test May 14, 2026
@michaelsutton
Copy link
Copy Markdown
Contributor Author

Replaces #992

@michaelsutton michaelsutton merged commit 530402b into kaspanet:toccata May 14, 2026
8 checks passed
@michaelsutton michaelsutton deleted the fix-daemon-prop-test branch May 14, 2026 14:14
@demisrael
Copy link
Copy Markdown
Contributor

@michaelsutton — re your audit ask: your diagnosis is grounded in source. notify/src/notifier.rs:462subscriber.rs:114-117 is a sync try_send; the spawned task at subscriber.rs:88-110 applies the upstream subscription. That's the async gap your commit body names. Closing #992 with a pointer here.

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.

4 participants