You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(multisig)!: reject a zero Secp256k1EcdsaMultisig instance salt - #1255
Secp256k1EcdsaMultisig.initialize (the module the issue calls EcdsaSignerManager) now asserts that instanceSalt is not zero, failing with Secp256k1EcdsaMultisig: invalid salt. Signer commitments are derived from the public key and the salt, so with a zero salt two deployments that share a signer get the same commitment and the salt no longer separates them. This mirrors the same check added to ZOwnablePK in #1054.
The once-only guard still runs first, so a second initialize keeps failing with signers already registered.
Tests (in Secp256k1EcdsaMultisig.test.ts, constructor group):
a zero salt is rejected with Secp256k1EcdsaMultisig: invalid salt;
a salt with only the first or only the last byte set is accepted, registers all signers, and verifies a 2-of-3 approval.
No actionable comments were generated in the recent review.
Walkthrough
Secp256k1EcdsaMultisig.initialize now rejects an all-zero instanceSalt. Tests cover zero-salt rejection and successful initialization and approvals with salts whose first or last byte is set to 1.
Changes: Instance salt validation
Layer / File(s)
Summary
Validate instance salt contracts/src/multisig/Secp256k1EcdsaMultisig.compact, contracts/src/multisig/test/Secp256k1EcdsaMultisig.test.ts, CHANGELOG.md
The initialization requirements now state that instanceSalt must be nonzero, and initialize rejects a zero salt with Secp256k1EcdsaMultisig: invalid salt. Tests cover rejection and successful initialization and approvals with salts that have only the first or last byte set. The changelog records the change.
Initialization now rejects an all-zero instance salt, so signer commitments no longer collide across deployments that share a signer. No merge-blocking risk was identified. The CI run failed only because the compiler could not be downloaded, so a rerun is advisable.
Pre-merge checks: 4
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title states the main change: Secp256k1EcdsaMultisig now rejects a zero instance salt. The raw summary and objectives confirm this change in initialize, its tests, and its documentation. The title…
Linked Issues check
Issue #1066 asks that instanceSalt be asserted non-zero in initialize. The issue names EcdsaSignerManager, which does not exist under contracts/src/multisig at the reviewed head. The PR maps t…
Out of Scope Changes check
The changes are the initialize assert, its requirements documentation, a CHANGELOG entry under Unreleased, and tests in Secp256k1EcdsaMultisig.test.ts. The assert and documentation implement #1066…
Full details: Title check
Explanation
The title states the main change: Secp256k1EcdsaMultisig now rejects a zero instance salt. The raw summary and objectives confirm this change in initialize, its tests, and its documentation. The title follows the conventional commit form and marks the change as breaking with '!'. It is short, specific, and contains no vague terms.
Full details: Linked Issues check
Explanation
Issue #1066 asks that instanceSalt be asserted non-zero in initialize. The issue names EcdsaSignerManager, which does not exist under contracts/src/multisig at the reviewed head. The PR maps the request to Secp256k1EcdsaMultisig.initialize, which takes instanceSalt. The diff of Secp256k1EcdsaMultisig.compact adds assert(instanceSalt != default<Bytes<32>>, "Secp256k1EcdsaMultisig: invalid salt"); inside initialize. The assert runs after the once-only guard Signer_getSignerCount() == 0, as the PR describes. The requirements comment also lists the non-zero salt rule. The added tests in Secp256k1EcdsaMultisig.test.ts cover zero-salt rejection and acceptance of single-byte salts. The implementation meets the issue requirement under the PR's mapping. The name mismatch is a naming question only; no coding requirement is unmet.
Full details: Out of Scope Changes check
Explanation
The changes are the initialize assert, its requirements documentation, a CHANGELOG entry under Unreleased, and tests in Secp256k1EcdsaMultisig.test.ts. The assert and documentation implement #1066. The tests verify the new assert. The CHANGELOG entry documents the breaking behavior. No unrelated functional change was found in the reviewed diff of the .compact file. The test file and CHANGELOG were taken from the supplied summary and were not diffed in this review.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Fix failing CI checks
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
This branch has not been deployed
No deployments
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
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.
Types of changes
Fixes #1066
Secp256k1EcdsaMultisig.initialize(the module the issue callsEcdsaSignerManager) now asserts thatinstanceSaltis not zero, failing withSecp256k1EcdsaMultisig: invalid salt. Signer commitments are derived from the public key and the salt, so with a zero salt two deployments that share a signer get the same commitment and the salt no longer separates them. This mirrors the same check added toZOwnablePKin #1054.The once-only guard still runs first, so a second
initializekeeps failing withsigners already registered.Tests (in
Secp256k1EcdsaMultisig.test.ts, constructor group):Secp256k1EcdsaMultisig: invalid salt;PR Checklist
initializeRequirements now list "instanceSaltis not zero.")## UnreleasedVerified locally
yarn compile:multisigwith compiler 0.36.0: all 34 multisig contracts compile.vitest run --project unit src/multisig: 19 files, 436 passed (39 skipped), including the new tests.biome checkon the changed test file: clean.Summary by CodeRabbit