p2p: a publisher can push its body, so a node nobody can reach can still sell - #5
p2p: a publisher can push its body, so a node nobody can reach can still sell#5kimminhyun-ai wants to merge 8 commits into
Conversation
…ill sell
Every blob transfer here is a pull — the fetcher goes to the holder. That is
right for a CONSUMER behind a firewall and wrong for a PUBLISHER behind one: the
verifier has to reach in, cannot, and the anchor sits at ANNOUNCED for ever.
Nothing errors anywhere. The anchor gossips, the catalogue lists it, and the
body is simply unobtainable — which is how ainize.ai came to show a knowledge
whose live test cannot run, because the seller node that held it no longer runs.
Three parts:
POST /p2p/blob/:sha accepts a body on behalf of its author. Off unless
`p2p.relayBlobs`, bounded by `p2p.maxRelayBytes`.
P2P.offerBlob() pushes to peers, best-effort, never throws.
Market.offerBody() called after announce; logs who took it, and warns
plainly when nobody did.
Accepting is not a matter of trusting the caller. The sha must name an anchor
this node already knows from the gossiped ledger, so it is not open storage; the
uploader must sign as that anchor's author, so only the publisher can place its
own bytes; and importFile rehashes and refuses a mismatch — the signed anchor
already fixes the hash, this checks the bytes against it.
Discovery and fetch needed no change: holders() already works off the blobs a
peer advertises in PeerInfo, so a relay shows up as a holder and fetchBlob finds
it unmodified.
Needs @ainize/core 0.1.2 for p2p.relayBlobs / p2p.maxRelayBytes.
Native outbound P2P relay hardeningSource: This is a source prerelease and validation evidence, not an npm publication,
Validation: 39/39 Docker tests pass (14 relay tests + 25 existing cluster/chat-guard regressions). Failures retained locally: r1 executable-tmpfs setup, r2 incomplete test verifier config, Deployment caveat: at 08:58:53 UTC both https://ainize.ai and https://www.ainize.ai No verification quorum, payment entitlement, dataset visibility or PII checks are waived. |
Preserve and recover existing P2P knowledge bodiesSource commit: This is a source prerelease with diagnostic evidence, not npm publication, Direct evidence, not a missing-file assumptionThe original publisher
At 09:11:52 and 09:12:53 UTC, actual author-signed multipart body offers to www Changes
Validation49/49 tests pass: 18 relay/retention regressions, six recovery-client transport The actual signed offers used separate Docker containers with CPU quota 1, The deployment still needs node PR #5 plus the core relay configuration fields. |
|
Updated to257bfe853b9bbc1f08ded002a3646fd01891a3a1: incorporated main20e599a6 and core0.1.3/VERIFIED, resolved relay merge conflicts, preserved bounded authenticated imports and retention, and fixed a watchdog stack-snapshot race (3 red→green regressions;52 selected Docker tests pass). Full source and raw evidence: https://github.com/ainblockchain/ainize-node/releases/tag/p2p-relay-runtime-compat-20260911 . At10:12:59UTC both public domains still return HTML404 Cannot POST for POST /p2p/blob/:sha; /readyz is frontend HTML, not backend readiness JSON. Two original publisher bodies remain available locally and previous signed full-body POST failures are retained. Please distinguish source availability from actual backend deployment/route matching; public replication/Live is not yet claimed. |
…rsion from package version
…iginals over isolated P2P
Blob transfer is pull-only, so a publisher behind NAT or a firewall announces successfully and nobody can ever fetch what it announced. No error is raised: the anchor gossips, the catalogue lists it, and the status never leaves ANNOUNCED. This is how ainize.ai came to show a knowledge whose live test cannot run.
POST /p2p/blob/:sha— accepts a body on behalf of its author. Off unlessp2p.relayBlobs, bounded byp2p.maxRelayBytes.P2P.offerBlob()— best-effort push to peers, never throws.Market.offerBody()— called after announce; warns plainly when no peer took it.Accepting is safe without trusting the caller: the sha must name an anchor already known from the gossiped ledger (not open storage), the uploader must sign as that anchor's author, and
importFilerehashes and refuses a mismatch.Discovery and fetch are unchanged —
holders()already works off advertisedPeerInfo.blobs.Depends on ainize-core#3 (
@ainize/core0.1.2). Build clean, 223 tests pass.