Skip to content

[EPIC][WIP] Signing Epic#674

Draft
derekpierre wants to merge 307 commits intoepic-v0.7.xfrom
signing-epic
Draft

[EPIC][WIP] Signing Epic#674
derekpierre wants to merge 307 commits intoepic-v0.7.xfrom
signing-epic

Conversation

@derekpierre
Copy link
Copy Markdown
Member

@derekpierre derekpierre commented Jul 2, 2025

Type of PR:

  • Bugfix
  • Feature
  • Documentation
  • Other

Required reviews:

  • 1
  • 2
  • 3

What this does:

@derekpierre derekpierre changed the title [WIP][EPIC][DO NOT MERGE] Signing Epic [WIP][EPIC] Signing Epic Jul 2, 2025
@derekpierre derekpierre changed the title [WIP][EPIC] Signing Epic [EPIC][WIP] Signing Epic Jul 2, 2025
@derekpierre derekpierre mentioned this pull request Jul 2, 2025
14 tasks
@theref theref force-pushed the signing-epic branch 2 times, most recently from 9340f58 to 6b16893 Compare January 7, 2026 15:03
theref and others added 22 commits April 10, 2026 08:52
- Add UserOperation type, UserOperationSignatureRequest class, and convertUserOperationToPython utility to shared/src/types.ts
- Export new types and classes in shared/src/index.ts
- Update taco/src/types.ts to re-export UserOperation from shared package
- Eliminates duplication of UserOperation type definitions across packages
- Fix Porter client to use POST data instead of query params for /sign endpoint
- Fix SigningCoordinator.getThreshold() to use signingCohorts(cohortId).threshold
- Update signUserOp() to use shared conversion utilities and proper base64 encoding
- Update tests to use shared conversion function and correct signature_type 'userOp'
- Remove console.log statements and simplify integration test
- All functionality now uses centralized types from shared package
- Updated SignResponse type to match new API response format with separated signatures and errors
- Enhanced PorterClient.sign() with better error handling and response structure validation
- Added debug logging to signing integration test
- Fixed signer key mapping from operator to provider in signUserOp
- Removed debug code for porter ursulas endpoint
- Remove private key security risk and use dummy address
- Switch to Ethereum Sepolia testnet (chain ID 11155111)
- Update RPC provider URL to publicnode.com
- Change ritual ID to 1
- Fix test skip condition for CI environment
- Fix UserOperationSignatureRequest constructor to accept objects instead of strings
- Remove double JSON stringification that caused address encoding errors
- Update convertUserOperationToPython to handle null/empty values properly
- Fix test expectations to match new data format and provider addresses
- Resolve AddressEncoder errors by ensuring proper hex address format

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Update test expectations to use JSON.stringify for user_op field serialization
- Rename digest field to messageHash in SignResult interface and all related code
- Implement strict address validation that fails fast on invalid checksums
- Fix Porter test mock response structure to match API format
- Update integration test to use properly checksummed addresses

Co-Authored-By: Kieran <kieranprasch@gmail.com>
…pt pattern

- Remove complex try-catch blocks and manual error checking in signUserOp
- Use direct destructuring of errors from Porter response
- Trust Porter's response structure instead of adding validation overhead
- Update tests to match new error handling pattern
- Follow same approach as tacoDecrypt for consistent error handling
- Add async forSigningCohort static method to build context from signing cohort conditions
- Fix import ordering and add missing ethers import
- Update integration test to use new signing context method with await
- Add tests for happy path scenario with valid cohort conditions
- Add error handling tests for network failures and invalid responses
- Add tests for invalid hex decoding and JSON parsing errors
- Add tests for complex compound condition structures
- Add tests for invalid condition schema validation
- Fix hex decoding in forSigningCohort method to handle contract responses
…ash validation

- Remove returnAggregated option from SigningOptions type
- Remove unused options parameter from signUserOp method
- Add validation to ensure all Ursulas return same message hash
- Throw error if message hashes don't match across signatures
…ash validation test

- Remove returnAggregated options from existing tests
- Add test case to verify error thrown when message hashes don't match
- Update test calls to match new signUserOp signature
…erface

- Remove SigningOptions import as no longer needed
- Remove options parameter from signUserOp function signature
- Update porter.signUserOp call to remove options parameter
- Remove unused INTERNAL_SIGNING_CONDITION constant
- Update RESERVED_CONTEXT_PARAMS to only include USER_ADDRESS_PARAM_DEFAULT
- Remove returnAggregated options from test calls
- Update function calls to match new signUserOp signature
- Remove unused options variable from test
- Remove returnAggregated option from signUserOp call in integration test
- Change aggregation logic from length > 0 to length >= threshold
- Ensures aggregated signature only provided with sufficient signatures
- Fix existing test expectation for insufficient signatures case
- Add new test to verify no aggregation when threshold not met
- Ensure test coverage for both threshold met and unmet scenarios
theref and others added 23 commits April 10, 2026 09:02
Caches getParticipants and getThreshold results with a 10-second TTL
to avoid redundant contract reads during short time windows. Cache is
keyed by domain and cohortId, with a public clearCache() method for
manual invalidation.

via [HAPI](https://hapi.run)

Co-Authored-By: HAPI <noreply@hapi.run>
Covers cache hits, TTL expiry, per-domain and per-cohortId isolation,
and manual cache clearing.

via [HAPI](https://hapi.run)

Co-Authored-By: HAPI <noreply@hapi.run>
via [HAPI](https://hapi.run)

Co-Authored-By: HAPI <noreply@hapi.run>
Add indexWithinArray field to abiParameterValidationSchema to enable
validation of specific elements within array parameters. This allows
more granular validation of ABI calldata when dealing with:
- Arrays of primitive types (address[], uint256[], etc.)
- Arrays of tuples ((address,uint256,bytes)[])
- Arrays of bytes with nested ABI validation

The validation logic ensures:
- indexWithinArray can only be used with array types
- Combined indexWithinArray and indexWithinTuple properly navigate
  into array elements before checking tuple structure
- Nested ABI validation correctly handles arrays of bytes
Move cache logic from SigningCoordinatorAgent into a reusable
TtlCache class. Bump TTL from 10s to 60s per review feedback.

via [HAPI](https://hapi.run)

Co-Authored-By: HAPI <noreply@hapi.run>
…variable

This context variable is automatically injected on the node side and resolves
to the Ethereum null address (0x0000000000000000000000000000000000000000).

- Add :nullAddress to AUTOMATICALLY_INJECTED_CONTEXT_PARAMS
- Add :nullAddress to RESERVED_CONTEXT_PARAMS to prevent manual setting
- Existing tests already handle automatically injected parameters

Related to nucypher/nucypher#3668
via [HAPI](https://hapi.run)

Co-Authored-By: HAPI <noreply@hapi.run>
Add comprehensive test coverage for indexWithinArray feature:
- Valid indexWithinArray with array parameters
- Rejection of indexWithinArray for non-array types
- Combined indexWithinArray and indexWithinTuple for arrays of tuples
- Rejection of indexWithinTuple for arrays of non-tuples
- Nested ABI validation with indexWithinArray for bytes arrays
- Rejection of nested ABI validation for arrays of non-bytes

All tests verify both success and failure cases with appropriate
error messages.
Reorder cache keys from field:domain:cohortId to domain:cohortId:field
(broader to specific) and extract a cacheKey() helper to keep key
structure consistent, per review feedback.
Replace ':nullAddress' string literals with NULL_ADDRESS_CONTEXT_VAR
constant defined in conditions/const.ts, used in both
AUTOMATICALLY_INJECTED_CONTEXT_PARAMS and RESERVED_CONTEXT_PARAMS.
via [HAPI](https://hapi.run)

Co-Authored-By: HAPI <noreply@hapi.run>
Replace separate indexWithinArray and indexWithinTuple fields with a
single subIndices array that handles arbitrary nesting of arrays and
tuples. This resolves the ambiguity of operation ordering when both
array and tuple indexing are needed.

The subIndices approach interprets each index based on the current ABI
type at that position:
- Arrays (type[]) consume an index and access that element
- Tuples ((a,b,c)) consume an index and access that field
- Supports any depth of nesting

This aligns with the corresponding nucypher/nucypher PR #3685 changes.
Replace Buffer.from(...).toString('hex') with the existing toHexString
utility from @nucypher/shared for consistency with the rest of the
codebase.
…dices

Idiomatic TypeScript prefers undefined over null for absent values.
Addresses PR review feedback.
derekpierre and others added 6 commits April 10, 2026 13:51
Don't include node v25 which has a change where node's built-in localStorage can interfere with the browser-like one.
The existing schema-docs-generation script produces a human-readable
markdown reference for condition schemas. This adds a sibling output
that emits a standard JSON Schema document for the full
ConditionExpression envelope ({version, condition}).

Editors that understand $schema (VS Code, JetBrains, Cursor) and LLMs
both consume this format directly, giving inline validation,
autocomplete, and structured output for any conditions.json file
without depending on @nucypher/taco at runtime.

The lazy union root (anyConditionSchema) is wrapped in the
ConditionExpression shape so the schema validates the same shape that
ConditionExpression.fromObj parses.

BigInt bounds (uint256 ranges) are stripped during serialization
because standard JSON Schema requires numeric bounds; the integer
type constraint still applies.

The markdown output also picks up an unrelated description-text
refresh from regenerating against the current schemas.
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.

4 participants