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
increaseDepth function in the PostageStamp smart contract does not check the immutableFlag — dilution is allowed for both immutable and mutable batches.
- The
Immutable flag is actually checked in stampissuer.go in the increment() method, where it controls whether chunks can be overwritten when a bucket is full. Immutable batches return ErrBucketFull, 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 full
The comment on the
Immutablefield in theBatchstruct says:https://github.com/ethersphere/bee/blob/master/pkg/postage/batch.go#L18
This suggests immutability controls whether a batch can be diluted (depth increased). However, looking at the actual code:
increaseDepthfunction in the PostageStamp smart contract does not check theimmutableFlag— dilution is allowed for both immutable and mutable batches.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: