From 3e1d8f424bb92cca6fd8753a9500fcfe2e1ed9fb Mon Sep 17 00:00:00 2001 From: Alan Shaw Date: Tue, 1 Sep 2026 16:16:20 +0100 Subject: [PATCH 1/2] fix: align MaxBlobSize with Piri DefaultMaxPaddedSize --- commands/blob/allocate.go | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/commands/blob/allocate.go b/commands/blob/allocate.go index 1bf3d03..2046fd8 100644 --- a/commands/blob/allocate.go +++ b/commands/blob/allocate.go @@ -7,6 +7,20 @@ import ( "github.com/fil-forge/ucantone/ucan/command" ) -const MaxBlobSize = 268_435_456 +// MaxBlobSize is the network-wide ceiling on a single blob, in bytes, as +// shipped to a storage node: the most raw bytes a default-configured piri +// accepts in one piece. Piri's default piece ceiling is a 256 MiB PADDED +// piece (piri pkg/pdp/piecesize, DefaultMaxPaddedSize), and Fr32 padding +// leaves 127/128 of it for data — 266338304 (~254 MiB). Piri's piece config +// is raise-only (an operator may accept more, never less), so a client +// sharding uploads at this constant is safe against every conforming node. +// +// This measures the stored artifact. An encrypting client must choose its +// plaintext split below this, leaving room for its envelope framing — see +// ingot's bucket.DefaultMaxBlobSize. +// +// (Was 268_435_456 — 256 MiB raw — which no default-configured node +// accepts: it pads to a 2^29 piece, over the 2^28 default ceiling.) +const MaxBlobSize = (256 << 20) * 127 / 128 var Allocate = binding.Bind[*AllocateArguments, *AllocateOK](command.MustParse("/blob/allocate")) From eb2ac109f27a2848f68c8b01978a63a984df1f24 Mon Sep 17 00:00:00 2001 From: Alan Shaw Date: Tue, 1 Sep 2026 16:23:11 +0100 Subject: [PATCH 2/2] refactor: history is in git --- commands/blob/allocate.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/commands/blob/allocate.go b/commands/blob/allocate.go index 2046fd8..5ca89b9 100644 --- a/commands/blob/allocate.go +++ b/commands/blob/allocate.go @@ -16,11 +16,7 @@ import ( // sharding uploads at this constant is safe against every conforming node. // // This measures the stored artifact. An encrypting client must choose its -// plaintext split below this, leaving room for its envelope framing — see -// ingot's bucket.DefaultMaxBlobSize. -// -// (Was 268_435_456 — 256 MiB raw — which no default-configured node -// accepts: it pads to a 2^29 piece, over the 2^28 default ceiling.) +// plaintext split below this, leaving room for its envelope framing. const MaxBlobSize = (256 << 20) * 127 / 128 var Allocate = binding.Bind[*AllocateArguments, *AllocateOK](command.MustParse("/blob/allocate"))