Postage: silent bucket rollover on mutable batches overwrites previously stamped chunks — make reuse explicit
I maintainer di solito rispondono entro 2 giorni
@martinconic ci sta già lavorando.
Dal 10/8/2026.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
Context
When a postage batch's collision bucket is full, StampIssuer.increment behaves differently depending on the batch type (pkg/postage/stampissuer.go):
- Immutable batch: returns
ErrBucketFull— the upload fails, as expected. - Mutable batch: silently resets the bucket counter to
0and starts issuing stamp indices that were already used.
Because a reused (bucket, index) pair with a newer timestamp displaces the chunk previously holding that slot, uploading past a mutable batch's capacity silently destroys earlier data — including data from the same upload.
Concretely: uploading a ~4 GB file with a ~512 MB batch does not fail. Bee just rolls over the buckets ~8 times, overwriting the earlier parts of the file with the later parts. The upload "succeeds" and returns a reference, but the content is unretrievable. The user gets no signal that anything went wrong.
Proposal
-
Drop the implicit rollover. On bucket-full, mutable batches should behave the same as immutable ones at stamping time: return
ErrBucketFull(surfaced as an appropriate API error) instead of silently reusing slots. Overwriting paid-for data should never be an accidental side effect of an upload. -
Add an explicit bucket-reset API. Intentional reuse of a mutable batch is a legitimate use case, so make it deliberate: an endpoint (e.g.
POST /stamps/{batch_id}/resetor similar) that resets the issuer's bucket counters for that batch. The docs should make clear that previously stamped chunks may subsequently be displaced. -
Randomize the chunk encryption key on bucket-full (encrypted uploads). For encrypted chunks the address is not fixed by content alone, so when the target bucket is full the stamper can re-roll the chunk encryption key until the resulting address lands in a non-full bucket. This lets encrypted uploads utilize the batch's full nominal capacity instead of failing on the first full bucket, and composes with (1): the hard failure only happens when the batch is genuinely exhausted.
Notes
- (1) is a behavioral/API change: uploads that previously "succeeded" (while corrupting earlier data) will now fail with bucket-full. That failure is strictly more honest than the current behavior, but it deserves an API version note and a changelog entry.
- (2) needs a decision on scope: reset all buckets vs. per-bucket, and whether the reset should also be reflected in utilization reporting (
Utilization/UtilizationRatio). - (3) applies only to node-side encrypted uploads; plaintext chunk addresses are content-derived and cannot be re-rolled.
Proposed by Ábel, based on Áron's observation about stamp overwriting on bucket overflow.
- Lingua principale
- Go
- Stelle
- 1.5k
- Fork
- 390
- Merge medio
- 3g 58m
- PR unite (30g)
- 25
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di ethersphere/bee
-
Chequebook deployment uses a fixed 175,000 gas limit; it needs about 630,000 under Glamsterdam (live on Sepolia since 2026-10-06)Forse già presa @sbackend123 l’ha presa 20 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
ethersphere/bee#5650 · 1 assegnatario ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
ethersphere/bee#5678 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
ethersphere/bee#5666 ·
I maintainer di solito rispondono entro 2 giorni
-
Add a transaction inbox for outbound chain transactionsForse già presa @sbackend123 l’ha presa 14 giorni fa. Apertaseen
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
ethersphere/bee#5660 · 1 assegnatario ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
ethersphere/bee#5659 · 6 commenti ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di ethersphere/bee
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
yetone/magpie#4095 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
docs: Google Safe Browsing flags go-bonnie.dev as "deceptive" (pipe-to-shell install instructions)Apertadocumentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 2 giorni
-
[Bug]: Telegram bot (v3.11.0): "Ban log" no longer sends the current 3xipl-banned.logForse già presa @HamedSanaei l’ha presa oggi. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
MHSanaei/3x-ui#6990 · 1 commento ·
I maintainer di solito rispondono entro 3 giorni
-
bug(tool/internal/instrument): identical inject_code rules from two rule packages are applied twiceAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
open-telemetry/opentelemetry-go-compile-instrumentation#1611 ·
I maintainer di solito rispondono entro 2 giorni