You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
gateway: remember hashes that are not bundle manifests so a repeat request does not pay again #2478
area:clidecdn binary: get, gateway, pool, publish, origin, setuparea:paymentsPools, vouchers, redeem, reclaim, staking (incentive crate and chain)kind:featureNew capability or a change to current behaviorprio:lowWhen convenient
The gateway caches only manifests that parse (Gateway::manifest, crates/cli/src/commands/gateway.rs). Since #2477, a /<hash>/ or /<hash>/<path> request for a blob that is not a manifest answers 404. That covers a blob over the manifest cap and a blob whose bytes do not parse. Each failed pull still costs up to the manifest cap (64 MiB, or a lower nonzero --max-blob-mb), and nothing records the verdict. So every repeat request for the same hash pulls and pays again. The pulls run one at a time under manifest_fill, but each one is paid.
The verdict is permanent:
the bytes are content-addressed, so the same hash never parses differently;
the cap stop comes from verified bytes, so a blob over the cap stays over it.
Only an operator change to --max-blob-mb changes it, and that takes a restart.
Proposed fix
Keep a small bounded set of hashes found not to be manifests, beside ManifestCache. Use the same LRU pattern with a count bound like MAX_CACHED_MANIFESTS.
Look it up before taking manifest_fill, and again after, as cached_manifest is checked twice.
Answer a hit with the same 404 and message, without a pull. Store the message, or the cap and the hint, with the hash.
Record a hash only for PullError::NotManifest. Never record Funding or Other, which are transient or upstream.
Test
Use the Recording backend in gateway/tests.rs. Request /<hash>/ twice for a Reply::TooLarge blob and for a Reply::Bytes(b"not json") blob. Check two 404s and one recorded pull per hash. Check that an Other failure such as "no node holds the blob" is pulled again.
area:clidecdn binary: get, gateway, pool, publish, origin, setuparea:paymentsPools, vouchers, redeem, reclaim, staking (incentive crate and chain)kind:featureNew capability or a change to current behaviorprio:lowWhen convenient
Activity
fix(client): reject a bundle manifest with a malformed hash at parse …
fix(gateway): pull a non-manifest once, reuse verified sizes, count l…