feat: harden batch-sender (pause, admin, typed errors, multisig) - #175
Open
Eltimios wants to merge 5 commits into
Open
Conversation
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.
Overview
This PR completes the production-hardening pass for
stealth-batch-sender. It adds a one-timeinit(admin, announcer, asset_policy)flow, admin-guarded pause/unpause controls, a typedBatchSenderErrorsurface replacing all rawpanic!branches, and a 7-day timelocked signer-rotation flow that mirrorsstealth-sender.batch_sendremains withdrawal-free and is now guarded byrequire_not_paused(). The PR also lands the ABI snapshot, regenerated TypeScript bindings, size budget tracking, and production tests for the new lifecycle and error paths.Related Issue
Closes the batch-sender production-hardening bounty issue.
Changes
🛡️ Production-Hardening Core
stellar/stealth-batch-sender/src/lib.rsinit(admin, announcer, asset_policy)withAlreadyInitializedtyped error.Pausedstorage plus admin-guardedpause,unpause, andis_paused, mirroring thestealth-senderpattern.panic!with aBatchSenderErrorenum:EmptyBatch,BatchTooLarge,NonPositiveAmount,EmptyEphemeralKey,Paused,NotInitialized,AssetNotAllowed.batch_sendwithrequire_not_paused(); no withdrawal path is added.🔐 Signer-Set Multisig Rotation
stellar/stealth-batch-sender/src/multisig.rsstealth-sender/src/multisig.rsshape for signer-set storage and validation.propose_rotate_signers,approve_rotate_signers, andexecute_rotate_signerswith a 7-day timelock.🧪 Production Test Suite
stellar/stealth-batch-sender/tests/production.rsinitidempotency +AlreadyInitialized, pause/unpause, paused-call rejection, the full typed-error surface, and signer-rotation happy + adversarial paths.batch_sendrejects paused and uninitialized states with typed errors.📦 ABI, Bindings, and Size Tracking
stellar/abi/stealth_batch_sender.jsonstellar/bindings/typescript/stealth-batch-sender/src/index.tsinit,pause,unpause,is_paused,propose_rotate_signers,approve_rotate_signers,execute_rotate_signers, and typed error unions.stellar/SIZE.mdstellar/PAUSE.mdandstellar/MULTISIG.mdVerification Results
cargo test -p stealth-batch-sendercovers init, pause / unpause, paused-call rejection, typed-error surface, and signer-rotation happy + adversarial pathstests/production.rsstellar/SIZE.mdstellar/SIZE.mdstellar/abi/stealth_batch_sender.jsonsnapshot lands committed and the ABI CI gate is greenstellar/PAUSE.mdandstellar/MULTISIG.mdupdated to include batch-sender in the matrixstellar/bindings/typescript/stealth-batch-sender/Closes #155