fix(stamp): remove unused immutable batch flag#319
Open
0xCardiE wants to merge 2 commits into
Open
Conversation
The immutableFlag was stored and exposed on-chain but never enforced. Remove it from PostageStamp ABI, events, and migration helpers to stop implying a network guarantee that does not exist.
Run prettier on touched files and remove stale commented copyBatch tests.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Removes the legacy
immutableFlagfromPostageStamp. The field was stored and exposed on-chain but never enforced — not inPostageStamp, not inRedistribution, and not at the network level. Keeping it implied a guarantee that does not exist.Closes #317 (cleanup path).
Changes
immutableFlagfromBatch/ImportBatchstructs_immutablefromcreateBatch()andcopyBatch()batchImmutableFlag()view andimmutableFlagfromBatchCreatedeventRedistribution.stampFunction()batch destructuringdocs/POSTAGE_STAMP.mdBreaking changes
This is a breaking ABI change for the next
PostageStampdeployment:createBatch(owner, balance, depth, bucketDepth, nonce, immutable)createBatch(owner, balance, depth, bucketDepth, nonce)copyBatch(owner, balance, depth, bucketDepth, batchId, immutable)copyBatch(owner, balance, depth, bucketDepth, batchId)batchImmutableFlag(batchId)BatchCreated(..., immutableFlag)BatchCreated(...)(no flag)batches(id)returns 6 fieldsExisting mainnet batches are unaffected until the next contract migration.
Follow-up work (not in this PR)
Swarm / Bee docs
createBatch/copyBatchsignatures for integratorsBee node
_immutableargumentbatchImmutableFlag()if used anywhereBatch migration
immutablefield — safe to ignore on import (updatedimport.ts/import.sh/copytask no longer pass it)copyBatchsignaturebatch-migrationtooling and any offline export scripts drop the field or treat it as legacy metadata onlyFuture (separate RFC)
Network-level immutability + depth-lock is a protocol change (Bee overwrite policy, conflict resolution, redistribution) — not a contract-only toggle. Track separately if we pursue storage guarantees.
Test plan
npx hardhat compilenpx hardhat test test/PostageStamp.test.tsnpx hardhat test test/Redistribution.test.ts