Skip to content

feat: add description field to EIP-712 intent signatures#74

Merged
ScreamingHawk merged 6 commits intomasterfrom
feat/trails-intent-entrypoint-desc
Nov 26, 2025
Merged

feat: add description field to EIP-712 intent signatures#74
ScreamingHawk merged 6 commits intomasterfrom
feat/trails-intent-entrypoint-desc

Conversation

@miguelmota
Copy link
Member

@miguelmota miguelmota commented Nov 25, 2025

  • Add description field to TRAILS_INTENT_TYPEHASH for human-readable intent descriptions
  • Update depositToIntentWithPermit and depositToIntent to accept description parameter
  • Refactor signature parameters to use Signature struct to reduce stack depth
  • Include description hash in intent hash calculation via assembly optimization
  • Update assembly block size from 0x140 to 0x160 bytes to accommodate description hash

This allows clients to include human-readable descriptions (e.g., "Transfer 5 USDC") in intent signatures, improving UX and transaction clarity.

Related

- Add `description` field to TRAILS_INTENT_TYPEHASH for human-readable intent descriptions
- Update depositToIntentWithPermit and depositToIntent to accept description parameter
- Refactor signature parameters to use Signature struct to reduce stack depth
- Include description hash in intent hash calculation via assembly optimization
- Update assembly block size from 0x140 to 0x160 bytes to accommodate description hash

This allows clients to include human-readable descriptions (e.g., "Transfer 5 USDC")
in intent signatures, improving UX and transaction clarity.
@miguelmota miguelmota requested a review from a team November 25, 2025 18:13
…t parameter

- Modified TRAILS_INTENT_TYPEHASH to place the `description` field at the beginning of the parameter list for better clarity.
- Adjusted the intent hash calculation in the assembly block to reflect the new parameter order.
- Updated the interface version in ITrailsIntentEntrypoint.sol to 0.8.30 for compatibility.
- Ensured all related tests are updated to accommodate the changes in parameter ordering.

This change enhances the structure of the intent signature, improving readability and maintainability.
@ScreamingHawk
Copy link
Contributor

ScreamingHawk commented Nov 25, 2025

Refactor signature parameters to use Signature struct to reduce stack depth

While we are changing the signature format, let's consider using EIP-2098 to reduce call data size further.

ScreamingHawk
ScreamingHawk previously approved these changes Nov 25, 2025
Copy link
Contributor

@ScreamingHawk ScreamingHawk left a comment

Choose a reason for hiding this comment

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

LGTM! Happy to push the signature encoding changes another time.

@pkieltyka pkieltyka self-requested a review November 26, 2025 00:55
pkieltyka
pkieltyka previously approved these changes Nov 26, 2025
@ScreamingHawk ScreamingHawk dismissed stale reviews from pkieltyka and themself via cd08dca November 26, 2025 01:27
@ScreamingHawk ScreamingHawk merged commit 37b4984 into master Nov 26, 2025
1 check passed
@ScreamingHawk ScreamingHawk deleted the feat/trails-intent-entrypoint-desc branch November 26, 2025 01:28
shunkakinoki added a commit that referenced this pull request Nov 26, 2025
pkieltyka pushed a commit that referenced this pull request Nov 26, 2025
…" (#79)

* Revert "feat: add description field to EIP-712 intent signatures (#74)"

This reverts commit 37b4984.

* Refactor TrailsIntentEntrypoint to improve permit handling and update test cases

- Updated permit handling in TrailsIntentEntrypoint to enhance clarity and maintainability, adjusting the try-catch structure.
- Removed the description parameter from the _verifyAndMarkIntent function call to streamline the code.
- Updated test cases to reflect changes in signature parameters, ensuring consistency and accuracy in intent hash calculations.
- Adjusted gas snapshots for TrailsIntentEntrypoint tests to align with recent performance optimizations.

* Refactor permit handling in TrailsIntentEntrypoint for improved clarity

- Simplified the try-catch structure in the permit execution to enhance readability and maintainability.
- Removed unnecessary line breaks to streamline the code flow.
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.

3 participants