Skip to content

Conversation

@jasagredo
Copy link
Contributor

@jasagredo jasagredo commented Jun 17, 2025

Description

  • The mempool will now carry its own forker instead of acquiring one on each
    revalidation. This particularly implies that the mempool will no longer
    re-sync under the hood while trying to add a transaction, and only the
    background thread will perform such a re-sync.

  • The mempool now has its own registry in which it allocates forkers. The
    background thread was moved to this inner registry such that it can access the
    mempool internal registry, but an action to cancel it will still live in the
    outer registry, to ensure the thread is closed before we attempt to close the
    mempool internal registry. Otherwise we would run into a race condition if the
    background thread would attempt a resync while the internal registry was being
    closed.

@jasagredo jasagredo force-pushed the js/remove-forkers-resource-reg branch from 11bad3a to 1eabc2b Compare June 17, 2025 15:37
@jasagredo jasagredo force-pushed the js/mempool-carry-vh branch from 506d793 to bf9c254 Compare June 17, 2025 15:38
@jasagredo jasagredo moved this to 🏗 In progress in Consensus Team Backlog Jun 17, 2025
@jasagredo jasagredo self-assigned this Jun 17, 2025
@jasagredo jasagredo force-pushed the js/remove-forkers-resource-reg branch from 36e01ae to ae188df Compare June 18, 2025 11:23
@jasagredo jasagredo force-pushed the js/mempool-carry-vh branch from bf9c254 to 95bd119 Compare June 18, 2025 14:46
@jasagredo jasagredo force-pushed the js/remove-forkers-resource-reg branch 3 times, most recently from 6b00088 to 9d4748d Compare June 19, 2025 13:17
@jasagredo jasagredo force-pushed the js/mempool-carry-vh branch 4 times, most recently from 0366e24 to 690bfaf Compare June 20, 2025 12:11
@jasagredo jasagredo marked this pull request as ready for review June 20, 2025 12:12
@jasagredo jasagredo moved this from 🏗 In progress to 👀 In review in Consensus Team Backlog Jun 20, 2025
@jasagredo jasagredo changed the title [WIP] Carry a forker in the mempool Carry a forker in the mempool Jun 20, 2025
@jasagredo jasagredo force-pushed the js/mempool-carry-vh branch 2 times, most recently from 0972dfc to c02aea1 Compare June 23, 2025 11:20
@jasagredo jasagredo linked an issue Jun 23, 2025 that may be closed by this pull request
@jasagredo jasagredo force-pushed the js/remove-forkers-resource-reg branch 2 times, most recently from 5e66a72 to a7e96d3 Compare June 24, 2025 10:54
@jasagredo jasagredo force-pushed the js/remove-forkers-resource-reg branch from a7e96d3 to e2d80d1 Compare June 24, 2025 11:33
@jasagredo jasagredo force-pushed the js/mempool-carry-vh branch from c02aea1 to 82392d5 Compare June 24, 2025 11:35
Base automatically changed from js/remove-forkers-resource-reg to main June 24, 2025 11:47
@jasagredo jasagredo force-pushed the js/mempool-carry-vh branch 4 times, most recently from 8676768 to 0e92ed1 Compare June 26, 2025 09:00
@jasagredo
Copy link
Contributor Author

Note to self: remove now stale mempool traces (TraceMempoolLedgerNotFound for example)

@jasagredo jasagredo force-pushed the js/mempool-carry-vh branch from 0e92ed1 to 1940671 Compare June 27, 2025 10:51
@jasagredo jasagredo enabled auto-merge June 27, 2025 11:10
@jasagredo jasagredo added this pull request to the merge queue Jun 27, 2025
Merged via the queue into main with commit d6eff84 Jun 27, 2025
13 of 17 checks passed
@jasagredo jasagredo deleted the js/mempool-carry-vh branch June 27, 2025 12:24
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in Consensus Team Backlog Jun 27, 2025
Comment on lines +71 to +75
-- With this allocation on the top level registry, we make sure that we first
-- stop the watcher thread before closing the mempool registry, as otherwise
-- we would run into a race condition (the thread might try to re-sync and
-- allocate a forker on the mempool registry which would be closing down).
void $ allocate topLevelRegistry (\_ -> pure w) cancelThread
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jasagredo I came across this code while reviewing #1738. Is this code here still necessary with your recent work in IntersectMBO/io-classes-extra#10?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

Explanation for Mempool test failures and next steps

5 participants