Skip to content

feat: ini attestation lifi info payloads#3

Merged
shunkakinoki merged 10 commits intomasterfrom
feat/ini-lifi-validator-v2
May 15, 2025
Merged

feat: ini attestation lifi info payloads#3
shunkakinoki merged 10 commits intomasterfrom
feat/ini-lifi-validator-v2

Conversation

@shunkakinoki
Copy link
Collaborator

  • Reorganized the signature decoding process in AnypayLifiSapientSigner, ensuring the recovery of the signer occurs after decoding the signature.
  • Updated the validation logic in AnypayLifiInterpreter to improve clarity and functionality, including renaming error messages for better context.
  • Enhanced test cases for AnypayLifiSapientSigner to reflect changes in signature encoding and validation, ensuring comprehensive coverage for various scenarios.

…e functions

- Added `mockLifiBridgeOnly` and `mockLifiSwapAndBridge` functions to the MockLiFiDiamond contract to support distinct call types.
- Updated the test suite to include a new test for validating signatures on bridge-only calls, ensuring proper handling of empty swap data.
- Adjusted existing test cases to utilize the new function signatures for improved clarity and functionality.
…ypayLifiInterpreter for improved clarity and functionality

- Removed an unnecessary blank line in AnypayLifiModifierWrapper for cleaner code.
- Adjusted spacing in AnypayLiFiDecoder to enhance readability.
- Added `originChainId` to the AnypayLifiInfo struct in AnypayLifiInterpreter to capture the originating chain ID, improving data handling.
…roved data access

- Updated the visibility of the `getOriginSwapInfo` function from `pure` to `view` in the AnypayLifiInterpreter library to allow access to state variables, enhancing data retrieval capabilities.
- Adjusted function signature formatting in the MockLiFiDiamond contract for better readability.
- Cleaned up spacing in the AnypayLifiSapientSignerTest contract to enhance clarity and maintain consistency throughout the file.
…signature decoding and validation

- Added a new internal function `_decodeSignature` in AnypayLifiSapientSigner to decode combined signatures into LiFi information and attestation signatures.
- Updated the lifi intent hashing process to utilize decoded attestation information.
- Introduced a new `validateLifiInfos` function in AnypayLifiInterpreter to validate inferred LiFi info against attested data, including comprehensive error handling for mismatches and invalid data.
…apientSigner and AnypayLifiInterpreter

- Reorganized the signature decoding process in AnypayLifiSapientSigner, ensuring the recovery of the signer occurs after decoding the signature.
- Updated the validation logic in AnypayLifiInterpreter to improve clarity and functionality, including renaming error messages for better context.
- Enhanced test cases for AnypayLifiSapientSigner to reflect changes in signature encoding and validation, ensuring comprehensive coverage for various scenarios.
@shunkakinoki shunkakinoki self-assigned this May 15, 2025
… clarity

- Removed the InferredInfo_InvalidOriginToken and InferredInfo_ZeroMinAmount error definitions, replacing them with a more descriptive InvalidInferredMinAmount error.
- Updated the validation logic in the validateLifiInfos function to reflect these changes, enhancing the clarity of error messages in the library.
- Adjusted corresponding test cases to ensure they align with the new error handling structure.
- Deleted the AnypayLifiInterpreter library, which included functions for interpreting LiFi data and validating inferred information.
- Removed the corresponding test suite for AnypayLifiInterpreter, ensuring no references to the deleted library remain in the codebase.
…n and data handling

- Added the AnypayLifiInterpreter library, which includes functions for interpreting LiFi data into AnypayLifiInfo structs and validating inferred information against attested data.
- Implemented error handling for various validation scenarios, including mismatched lengths and invalid minimum amounts.
- Created a comprehensive test suite for AnypayLifiInterpreter, covering multiple scenarios to ensure robust functionality and error handling.
…pientSigner and AnypayLifiInterpreter

- Updated import statements to ensure consistent naming of AnypayLiFiInterpreter across all files.
- Adjusted references to AnypayLifiInfo and related functions to match the corrected naming convention, enhancing code clarity and maintainability.
- Ensured that all test cases reflect these naming changes for accurate functionality verification.
@shunkakinoki shunkakinoki merged commit fb5ca71 into master May 15, 2025
2 checks passed
shunkakinoki added a commit that referenced this pull request Oct 15, 2025
Add comprehensive technical sequence diagrams documenting all Trails
contract interaction flows. Created in response to the October 15, 2025
audit call request for detailed contract interaction documentation.

Includes 6 detailed flows with Mermaid diagrams:
1. Cross-chain flow without destination calldata
2. Cross-chain flow with destination calldata (balance injection)
3. Same-chain flow without destination calldata
4. Same-chain flow with destination calldata (direct replacement)
5. Origin chain failure and refund flow
6. Destination chain failure and refund flow

Each flow includes:
- Call batch sequence numbering (Call #1, #2, #3, etc.)
- Key characteristics and use cases
- Detailed Mermaid sequence diagrams
- Implementation notes and semantics
- Contract addresses, function signatures, and call types

Addresses audit requests from Tim Sigl and Andy Lin regarding:
- Contract interaction details with function names
- When injectAndCall() is used vs direct replacement
- TrailsRouterShim purpose and call forwarding
- Sentinel validation and fallback mechanisms

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

Co-Authored-By: Claude <noreply@anthropic.com>
shunkakinoki added a commit that referenced this pull request Oct 15, 2025
* docs: add technical flow diagrams for audit

Add comprehensive technical sequence diagrams documenting all Trails
contract interaction flows. Created in response to the October 15, 2025
audit call request for detailed contract interaction documentation.

Includes 6 detailed flows with Mermaid diagrams:
1. Cross-chain flow without destination calldata
2. Cross-chain flow with destination calldata (balance injection)
3. Same-chain flow without destination calldata
4. Same-chain flow with destination calldata (direct replacement)
5. Origin chain failure and refund flow
6. Destination chain failure and refund flow

Each flow includes:
- Call batch sequence numbering (Call #1, #2, #3, etc.)
- Key characteristics and use cases
- Detailed Mermaid sequence diagrams
- Implementation notes and semantics
- Contract addresses, function signatures, and call types

Addresses audit requests from Tim Sigl and Andy Lin regarding:
- Contract interaction details with function names
- When injectAndCall() is used vs direct replacement
- TrailsRouterShim purpose and call forwarding
- Sentinel validation and fallback mechanisms

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

Co-Authored-By: Claude <noreply@anthropic.com>

* docs: refine technical flow diagrams for clarity

Updated the technical flow diagrams documenting Trails contract interactions by removing specific references to the October 15, 2025 audit call and enhancing the clarity of various sections. Adjusted wording for better readability and streamlined the presentation of key characteristics and implementation notes across different scenarios.

---------

Co-authored-by: Claude <noreply@anthropic.com>
@pkieltyka pkieltyka deleted the feat/ini-lifi-validator-v2 branch October 23, 2025 10:34
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.

1 participant