Skip to content

refactor(p2p): avoid unnecessary nested locks in artifact serve & download - #11974

Draft
pierugo-dfinity wants to merge 1 commit into
masterfrom
pierugo/p2p/dont-hold-nested-locks
Draft

pierugo-dfinity wants to merge 1 commit into
masterfrom
pierugo/p2p/dont-hold-nested-locks

Conversation

@pierugo-dfinity

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues were identified in the downloader/router separation and shared-pool locking refactor.

No open issues 🎉

What changed in this PR

This PR refactors peer-to-peer artifact downloading and serving to remove unnecessary nested pool locks while preserving the existing combined API.

Changes:

  • Separates downloader creation from router construction and encapsulates shared-pool locking.
  • Updates stripped-consensus handling to use the separate components.
  • Adds router tests for serving stripped block proposals and returning no content for missing messages.
File Description
rs/​p2p/​artifact_downloader/​src/​fetch_stripped_artifact/​assembler.rs Removes redundant wrapper locking and adds serving tests.
rs/​p2p/​artifact_downloader/​src/​fetch_artifact/​download.rs Splits downloader and router construction and introduces a shared-pool adapter.

Review effort: Balanced

This branch has not been deployed

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants