Skip to content

Add v1.11.0 cluster definition hashing with List[Bytes65,32] signatures.#220

Merged
HananINouman merged 3 commits into
mainfrom
Hanan/v1.11-signature-list-support
Jul 8, 2026
Merged

Add v1.11.0 cluster definition hashing with List[Bytes65,32] signatures.#220
HananINouman merged 3 commits into
mainfrom
Hanan/v1.11-signature-list-support

Conversation

@HananINouman

@HananINouman HananINouman commented Jun 2, 2026

Copy link
Copy Markdown
Collaborator

Support Charon's variable-length Safe multisig signatures by hashing up to 32 concatenated 65-byte ECDSA chunks while keeping v1.10.0 on fixed Bytes65.

Summary by CodeRabbit

  • New Features
    • Added support for v1.11.0 cluster definitions and distributed validator lock verification, including updated signature-list hashing for config/definition and lock verification.
  • Documentation
    • Updated the acceptClusterDefinition JSDoc example to reference v1.11.0.
  • Tests
    • Added v1.11.0 fixtures and parity/unit tests to validate generated config_hash, definition_hash, and lock_hash values.
  • Chores
    • Updated Jest e2e setup to load environment configuration before tests.

Support Charon's variable-length Safe multisig signatures by hashing up to 32
concatenated 65-byte ECDSA chunks while keeping v1.10.0 on fixed Bytes65.

Co-authored-by: Cursor <cursoragent@cursor.com>
@HananINouman HananINouman requested a review from a team as a code owner June 2, 2026 19:14
@coderabbitai

coderabbitai Bot commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@HananINouman, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 52 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 0c0efadd-a77e-4f32-9d88-220c711c8221

📥 Commits

Reviewing files that changed from the base of the PR and between f5998f2 and b2a7177.

📒 Files selected for processing (3)
  • src/verification/v1.11.0.ts
  • test/client/methods.spec.ts
  • test/fixtures.ts
📝 Walkthrough

Walkthrough

This PR adds v1.11.0 cluster verification support. It updates the SDK version constant and docs example, adds new SSZ schemas and hashing helpers for cluster definitions and locks, wires v1.11.0 into the verifier dispatch paths, and adds fixtures and tests for the new version.

Changes

v1.11.0 Cluster Verification Support

Layer / File(s) Summary
Version Constant and Documentation Updates
src/constants.ts, src/index.ts
CONFIG_VERSION is bumped to v1.11.0, and the acceptClusterDefinition example now uses version: "v1.11.0".
v1.11.0 SSZ Types and Hashing
src/verification/sszTypes.ts, src/verification/v1.11.0.ts
Adds v1.11.0 SSZ container variants, signature-list handling, cluster-definition and cluster-lock hashing helpers, and verifyDVV1X11 as an alias of verifyDVV1X8.
Verification Dispatcher Wiring
src/verification/common.ts
Routes v1.11.0 cluster definitions and locks through the new hashing and verification helpers.
v1.11.0 Fixtures and Hash Tests
test/fixtures.ts, test/client/methods.spec.ts, test/verification/v1x11-parity.spec.ts, test/sdk-package/jest-e2e.json
Adds a v1.11.0 fixture, unit/parity tests for the new hashes, and dotenv setup for Jest e2e runs.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related PRs

Suggested reviewers: OisinKyne, anadi2311, aly-obol

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding v1.11.0 cluster definition hashing with signature-list support.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch Hanan/v1.11-signature-list-support

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/verification/v1.11.0.ts (1)

34-46: ⚡ Quick win

Reject oversized signature lists before SSZ hashing.

This helper enforces 65-byte chunking but not the List[Bytes65,32] upper bound. A 33-chunk Safe signature will currently fail later inside SSZ hashing instead of at the parse boundary, which makes the error harder to diagnose.

Proposed change
 const splitK1SignatureList = (signature: string): Uint8Array[] => {
   const bytes = fromHexString(signature);
   if (bytes.length === 0) return [];
   if (bytes.length % 65 !== 0) {
     throw new Error('Signature length must be a multiple of 65 bytes');
   }
+  const chunkCount = bytes.length / 65;
+  if (chunkCount > 32) {
+    throw new Error('Signature list cannot exceed 32 chunks');
+  }
 
   const chunks: Uint8Array[] = [];
   for (let i = 0; i < bytes.length; i += 65) {
     chunks.push(bytes.slice(i, i + 65));
   }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/verification/v1.11.0.ts` around lines 34 - 46, splitK1SignatureList
currently validates 65-byte chunking but doesn't reject lists larger than the
SSZ List[Bytes65,32] max; update splitK1SignatureList to check bytes.length (or
computed chunk count) against the 32-item upper bound and throw a clear Error
(e.g., "Signature list exceeds maximum of 32 signatures") before returning
chunks so oversized (33+) signature lists are rejected at parse time; reference
the splitK1SignatureList function and ensure the check occurs prior to
slicing/returning.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@test/client/methods.spec.ts`:
- Around line 298-311: The test needs a real v1.11 fixture instead of only
changing the version string: create v1x11Definition by cloning
clusterLockV1X10.cluster_definition, then call
clusterConfigOrDefinitionHash(clonedDef, true) to recompute and set
clonedDef.config_hash before computing the definition hash via
clusterConfigOrDefinitionHash(clonedDef, false); also modify at least one
creator/operator signature field in the clonedDef to be a multi-chunk signature
(split into a List[Bytes65,32] style multi-chunk value) so the new v1.11
splitting logic is exercised when computing definitionHash (refer to
clusterConfigOrDefinitionHash, v1x11Definition and
clusterLockV1X10.cluster_definition).

---

Nitpick comments:
In `@src/verification/v1.11.0.ts`:
- Around line 34-46: splitK1SignatureList currently validates 65-byte chunking
but doesn't reject lists larger than the SSZ List[Bytes65,32] max; update
splitK1SignatureList to check bytes.length (or computed chunk count) against the
32-item upper bound and throw a clear Error (e.g., "Signature list exceeds
maximum of 32 signatures") before returning chunks so oversized (33+) signature
lists are rejected at parse time; reference the splitK1SignatureList function
and ensure the check occurs prior to slicing/returning.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f4e925ea-c45e-4b29-a7a4-76ff52250fab

📥 Commits

Reviewing files that changed from the base of the PR and between b802a5a and da072e9.

📒 Files selected for processing (6)
  • src/constants.ts
  • src/index.ts
  • src/verification/common.ts
  • src/verification/sszTypes.ts
  • src/verification/v1.11.0.ts
  • test/client/methods.spec.ts

Comment thread test/client/methods.spec.ts Outdated
… order

- Add clusterLockV1X11 fixture: real cluster with a 2-of-N Safe multisig
  creator signature (two 65-byte chunks) and empty operator addresses/sigs,
  exercising the List[Bytes65,32] signature-list hashing.
- Rework the v1.11 unit test to assert golden config_hash/definition_hash
  (produced by charon + the dev API) instead of only version-flip inequality,
  addressing the CodeRabbit review comment.
- Add test/verification/v1x11-parity.spec.ts golden-vector parity check
  (config/definition/lock hash) under the CI test glob.
- sdk-package e2e: load .env via jest setupFiles ("dotenv/config") so the RPC
  is set before the SDK is imported, so PROVIDER_MAP resolves and Safe /
  ERC-1271 lock verification works locally (previously fell back to EOA).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
test/verification/v1x11-parity.spec.ts (1)

15-15: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Consider removing as any casts if fixture types align with function parameters.

The as any casts on lines 15, 21, and 27 bypass TypeScript's type checking. If clusterLockV1X11 and its cluster_definition property already conform to the expected parameter types of clusterConfigOrDefinitionHash and clusterLockHash, removing the casts would provide compile-time assurance that the fixture shape matches the hashing functions' contracts. If the types don't align, consider tightening the fixture type instead.

Also applies to: 21-21, 27-27

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test/verification/v1x11-parity.spec.ts` at line 15, The parity test is
bypassing TypeScript safety by casting the fixture to any before calling
clusterConfigOrDefinitionHash and clusterLockHash. Remove the as any casts in
v1x11-parity.spec.ts at the calls using def and
clusterLockV1X11.cluster_definition, and if the fixture types do not match,
tighten the fixture or function parameter types so clusterLockV1X11 and its
cluster_definition satisfy the expected inputs without casts.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@test/verification/v1x11-parity.spec.ts`:
- Line 15: The parity test is bypassing TypeScript safety by casting the fixture
to any before calling clusterConfigOrDefinitionHash and clusterLockHash. Remove
the as any casts in v1x11-parity.spec.ts at the calls using def and
clusterLockV1X11.cluster_definition, and if the fixture types do not match,
tighten the fixture or function parameter types so clusterLockV1X11 and its
cluster_definition satisfy the expected inputs without casts.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 0887bdfb-a3bd-4eb1-8559-9522f022a569

📥 Commits

Reviewing files that changed from the base of the PR and between da072e9 and f5998f2.

📒 Files selected for processing (4)
  • test/client/methods.spec.ts
  • test/fixtures.ts
  • test/sdk-package/jest-e2e.json
  • test/verification/v1x11-parity.spec.ts

Fixes the CI prettier-ci failure on src/verification/v1.11.0.ts (never
formatted since it was added) and applies prettier to the new v1.11 fixture
and test files.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@sonarqubecloud

sonarqubecloud Bot commented Jul 8, 2026

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
29.3% Duplication on New Code (required ≤ 15%)

See analysis details on SonarQube Cloud

@HananINouman HananINouman merged commit cf6d99f into main Jul 8, 2026
4 of 6 checks passed
@HananINouman HananINouman deleted the Hanan/v1.11-signature-list-support branch July 8, 2026 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants