fix(gateway): tolerate kubo /api/v0/id field changes (NodeInfo optional fields)#81
Open
ehsan6sha wants to merge 1 commit into
Open
fix(gateway): tolerate kubo /api/v0/id field changes (NodeInfo optional fields)#81ehsan6sha wants to merge 1 commit into
ehsan6sha wants to merge 1 commit into
Conversation
…al fields) kubo 0.41 dropped `ProtocolVersion` from /api/v0/id (it now sends a `Protocols` list), but NodeInfo required `protocol_version: String`, so serde failed the whole decode -> origins() returned empty -> the gateway logged "Failed to fetch local IPFS node multiaddrs (error decoding response body)" and omitted the pinning `origins` hint (pins still succeed, just resolve slower via DHT walk). origins() only reads `addresses`; make public_key/agent_version/protocol_version #[serde(default)] so a kubo field rename/removal can never break the decode again. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0161UGEJmTpM6DM2cVZyV6Ev
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
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.
Problem
The gateway logs a non-fatal WARN on every pin:
Failed to fetch local IPFS node multiaddrs ... error=IPFS API error: error decoding response bodyRoot cause: the deployed kubo is 0.41.0, whose
/api/v0/idno longer returnsProtocolVersion(it now sends aProtocolslist).NodeInfo(fula-blockstore/src/ipfs.rs) isrename_all="PascalCase"and requiresprotocol_version: String→ProtocolVersion. Missing required field → serde fails the whole decode →origins()returns empty → the WARN, and the pin omits theoriginshint.Impact is non-fatal — pins land regardless; the
originshint just lets the pinning service fetch the CID directly from the gateway's kubo instead of DHT-walking, so without it pins propagate a touch slower.Fix
origins()only readsaddresses. Make the other fields#[serde(default)]so a kubo/api/v0/idfield rename/removal can never break the decode again.Test
cargo check -p fula-blockstoreclean. After deploy the WARN disappears and pins carry the origins hint.🤖 Generated with Claude Code