-
Notifications
You must be signed in to change notification settings - Fork 383
Open
Description
The comment on the Immutable field in the Batch struct says:
https://github.com/ethersphere/bee/blob/master/pkg/postage/batch.go#L18
Immutable bool // if the batch allows adding new capacity (dilution)This suggests immutability controls whether a batch can be diluted (depth increased). However, looking at the actual code:
- The
increaseDepthfunction in the PostageStamp smart contract does not check theimmutableFlag— dilution is allowed for both immutable and mutable batches. - The
Immutableflag is actually checked instampissuer.goin theincrement()method, where it controls whether chunks can be overwritten when a bucket is full. Immutable batches returnErrBucketFull, while mutable batches reset the counter and allow overwriting.
The comment should reflect the actual behavior — immutability controls whether older chunks can be overwritten when buckets fill up, not whether the batch can be diluted.
Suggested fix:
Immutable bool // if true, chunks cannot be overwritten when buckets are fullReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels