-
Notifications
You must be signed in to change notification settings - Fork 3
fix(hermes): New implementation of IPFS get and add file #750
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
bkioshn
merged 20 commits into
fix/doc-sync-p2p-propagation
from
fix/736/ipfs-get-add-block
Jan 15, 2026
Merged
fix(hermes): New implementation of IPFS get and add file #750
bkioshn
merged 20 commits into
fix/doc-sync-p2p-propagation
from
fix/736/ipfs-get-add-block
Jan 15, 2026
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: bkioshn <[email protected]>
Signed-off-by: bkioshn <[email protected]>
Signed-off-by: bkioshn <[email protected]>
Signed-off-by: bkioshn <[email protected]>
Signed-off-by: bkioshn <[email protected]>
Signed-off-by: bkioshn <[email protected]>
8 tasks
Signed-off-by: bkioshn <[email protected]>
rafal-ch
reviewed
Jan 7, 2026
Signed-off-by: bkioshn <[email protected]>
Signed-off-by: bkioshn <[email protected]>
Signed-off-by: bkioshn <[email protected]>
Signed-off-by: bkioshn <[email protected]>
Signed-off-by: bkioshn <[email protected]>
Signed-off-by: bkioshn <[email protected]>
Signed-off-by: bkioshn <[email protected]>
Signed-off-by: bkioshn <[email protected]>
Signed-off-by: bkioshn <[email protected]>
Signed-off-by: bkioshn <[email protected]>
Signed-off-by: bkioshn <[email protected]>
Signed-off-by: bkioshn <[email protected]>
cong-or
approved these changes
Jan 14, 2026
Contributor
cong-or
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…-block Signed-off-by: bkioshn <[email protected]>
bkioshn
added a commit
that referenced
this pull request
Jan 19, 2026
* fix(hermes): doc-sync P2P message format and subscription conflicts
WHAT THIS FIXES:
- CID format: Use dag-cbor codec (0x51) instead of dag-pb (0x70) for protocol compliance
- Message encoding: Publish CBOR-encoded payload::New with CID lists instead of raw document bytes
- Subscription conflict: Remove auto-subscription that prevented doc-sync module from subscribing
CHANGES:
- hermes/bin/src/runtime_extensions/hermes/doc_sync/host.rs:
* Import minicbor crate directly (not via cardano_chain_follower)
* Compute both dag-pb CID (storage) and dag-cbor CID (protocol) in add_file()
* Construct proper payload::New structure in publish()
* Encode to CBOR before publishing to PubSub
- hermes/bin/src/ipfs/mod.rs:
* Remove auto-subscription to documents.new during bootstrap
* Prevents subscription kind conflicts with doc-sync module
- hermes/bin/src/ipfs/task.rs:
* Add extensive documentation of blocking operations issue
* Document root cause and recommended async solution
REMAINING ISSUE:
P2P propagation still fails due to blocking operations in async context.
The doc_sync_topic_message_handler (added in 944360f) calls file_pin()
and file_get() which use blocking_send()/blocking_recv(). This causes
deadlock when called from async PubSub handler.
NEXT STEPS:
Convert file_pin() and file_get() to async versions. See detailed
implementation guide in task.rs comments (lines 354-374).
TEST:
cd p2p-testing && just test-pubsub-propagation
Currently FAILS with No Propagation due to blocking operations issue.
Will PASS once async conversion is complete.
Related: #691 (introduced blocking operations bug)
* fix(hermes): make doc-sync PubSub handler non-blocking with async file operations
The doc_sync_topic_message_handler was blocking the PubSub event loop by using
blocking_send/blocking_recv for IPFS file operations, preventing new messages
from being processed while fetching content.
Changes:
- Add file_get_async() and file_pin_async() methods in ipfs/mod.rs that use
send().await instead of blocking_send()
- Update doc_sync_topic_message_handler() in ipfs/task.rs to spawn async task
with tokio::spawn() for file operations
- Add RECEIVED PubSub message with CID logging for test detection
- Fix test-pubsub-propagation in p2p-testing/justfile to properly detect
message reception using wc -l instead of grep -q
Result:
- PubSub handler no longer blocks - can process new messages while previous
content is still being fetched
- test-pubsub-propagation now passes with 100% success rate (5/5 nodes)
- Resolves doc-sync P2P message propagation issue
* fix(hermes): make doc-sync PubSub handler non-blocking with async file operations
The doc_sync_topic_message_handler was blocking the PubSub event loop by using
blocking_send/blocking_recv for IPFS file operations, preventing new messages
from being processed while fetching content.
Changes:
- Add file_get_async() and file_pin_async() methods in ipfs/mod.rs that use
send().await instead of blocking_send()
- Update doc_sync_topic_message_handler() in ipfs/task.rs to spawn async task
with tokio::spawn() for file operations
- Add RECEIVED PubSub message with CID logging for test detection
- Fix test-pubsub-propagation in p2p-testing/justfile to properly detect
message reception using wc -l instead of grep -q
Result:
- PubSub handler no longer blocks - can process new messages while previous
content is still being fetched
- test-pubsub-propagation now passes with 100% success rate (5/5 nodes)
- Resolves doc-sync P2P message propagation issue
* fix(hermes): make doc-sync PubSub handler non-blocking with async file operations
The doc_sync_topic_message_handler was blocking the PubSub event loop by using
blocking_send/blocking_recv for IPFS file operations, preventing new messages
from being processed while fetching content.
Changes:
- Add file_get_async() and file_pin_async() methods in ipfs/mod.rs that use
send().await instead of blocking_send()
- Update doc_sync_topic_message_handler() in ipfs/task.rs to spawn async task
with tokio::spawn() for file operations
- Add RECEIVED PubSub message with CID logging for test detection
- Fix test-pubsub-propagation in p2p-testing/justfile to properly detect
message reception using wc -l instead of grep -q
Result:
- PubSub handler no longer blocks - can process new messages while previous
content is still being fetched
- test-pubsub-propagation now passes with 100% success rate (5/5 nodes)
- Resolves doc-sync P2P message propagation issue
* fix(hermes): make doc-sync PubSub handler non-blocking with async file operations
The doc_sync_topic_message_handler was blocking the PubSub event loop by using
blocking_send/blocking_recv for IPFS file operations, preventing new messages
from being processed while fetching content.
Changes:
- Add file_get_async() and file_pin_async() methods in ipfs/mod.rs that use
send().await instead of blocking_send()
- Update doc_sync_topic_message_handler() in ipfs/task.rs to spawn async task
with tokio::spawn() for file operations
- Add RECEIVED PubSub message with CID logging for test detection
- Fix test-pubsub-propagation in p2p-testing/justfile to properly detect
message reception using wc -l instead of grep -q
Result:
- PubSub handler no longer blocks - can process new messages while previous
content is still being fetched
- test-pubsub-propagation now passes with 100% success rate (5/5 nodes)
- Resolves doc-sync P2P message propagation issue
* fix(hermes): make doc-sync PubSub handler non-blocking with async file operations
The doc_sync_topic_message_handler was blocking the PubSub event loop by using
blocking_send/blocking_recv for IPFS file operations, preventing new messages
from being processed while fetching content.
Changes:
- Add file_get_async() and file_pin_async() methods in ipfs/mod.rs that use
send().await instead of blocking_send()
- Update doc_sync_topic_message_handler() in ipfs/task.rs to spawn async task
with tokio::spawn() for file operations
- Add RECEIVED PubSub message with CID logging for test detection
- Fix test-pubsub-propagation in p2p-testing/justfile to properly detect
message reception using wc -l instead of grep -q
Result:
- PubSub handler no longer blocks - can process new messages while previous
content is still being fetched
- test-pubsub-propagation now passes with 100% success rate (5/5 nodes)
- Resolves doc-sync P2P message propagation issue
* use type CID instead of string
Signed-off-by: bkioshn <[email protected]>
* small cleanup
Signed-off-by: bkioshn <[email protected]>
* reverts commit 7043008
Signed-off-by: bkioshn <[email protected]>
* change cid string to CID
Signed-off-by: bkioshn <[email protected]>
* change ipfs-cid type string to bstr
Signed-off-by: bkioshn <[email protected]>
* revert change
Signed-off-by: bkioshn <[email protected]>
* fix linter
Signed-off-by: bkioshn <[email protected]>
* cleanup task.rs and add comment about unixfs
Signed-off-by: bkioshn <[email protected]>
* cleanup
Signed-off-by: bkioshn <[email protected]>
* hack, add conversion
Signed-off-by: bkioshn <[email protected]>
* fix node 3 connection + log capture
Signed-off-by: bkioshn <[email protected]>
* add log necessary for test
Signed-off-by: bkioshn <[email protected]>
* revert peer docker config
Signed-off-by: bkioshn <[email protected]>
* fix linter
Signed-off-by: bkioshn <[email protected]>
* filter non-empty cid array
Signed-off-by: bkioshn <[email protected]>
* fix(hermes): New implementation of IPFS get and add file (#750)
* use new implementation of add and get ipfs file
Signed-off-by: bkioshn <[email protected]>
* hermes-ipfs points to branch
Signed-off-by: bkioshn <[email protected]>
* add error to hermes-ipfs wit
Signed-off-by: bkioshn <[email protected]>
* move cbor encode logic
Signed-off-by: bkioshn <[email protected]>
* fix get_ipfs_file
Signed-off-by: bkioshn <[email protected]>
* fix syntax and format
Signed-off-by: bkioshn <[email protected]>
* update hermes-ipfs to 0.0.11
Signed-off-by: bkioshn <[email protected]>
* update function
Signed-off-by: bkioshn <[email protected]>
* handle store documenet to db after success post
Signed-off-by: bkioshn <[email protected]>
* handle ipfs/doc-sync module id
Signed-off-by: bkioshn <[email protected]>
* change cid to string
Signed-off-by: bkioshn <[email protected]>
* minor fix
Signed-off-by: bkioshn <[email protected]>
* fix compute cid
Signed-off-by: bkioshn <[email protected]>
* fix get file and add file
Signed-off-by: bkioshn <[email protected]>
* event module all
Signed-off-by: bkioshn <[email protected]>
* handle event module
Signed-off-by: bkioshn <[email protected]>
* fix doc data encode
Signed-off-by: bkioshn <[email protected]>
* fix linter and format
Signed-off-by: bkioshn <[email protected]>
* minor fix
Signed-off-by: bkioshn <[email protected]>
---------
Signed-off-by: bkioshn <[email protected]>
* fix linter and format
Signed-off-by: bkioshn <[email protected]>
* fix channel name
Signed-off-by: bkioshn <[email protected]>
* remove unused err
Signed-off-by: bkioshn <[email protected]>
* fix spelling
Signed-off-by: bkioshn <[email protected]>
* Bump CI
* Update `deny.toml`
* fix event-on-new-doc
Signed-off-by: bkioshn <[email protected]>
* bump hermes-ipfs to v0.0.11
Signed-off-by: bkioshn <[email protected]>
* fix linter and format
Signed-off-by: bkioshn <[email protected]>
---------
Signed-off-by: bkioshn <[email protected]>
Co-authored-by: cong-or <[email protected]>
Co-authored-by: rafal-ch <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Apply new implementation of
add_ipfs_fileandget_ipfs_fileRelated Issue(s)
#736
Description of Changes
compute_cidexpected CBOR document encodedadd_ipfs_fileandget_ipfs_file, addGetFileWithProvidersRelated Pull Requests
input-output-hk/catalyst-libs#763
Please confirm the following checks