Skip to content

feat: ini v3 core #210

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 297 commits into
base: master
Choose a base branch
from
Open

feat: ini v3 core #210

wants to merge 297 commits into from

Conversation

shunkakinoki
Copy link

@shunkakinoki shunkakinoki commented Feb 20, 2025

Includes all required core configuration, imageHash, signature modules derived from sequence-core for v3 and ensures that all critical tests are passing.

Steps to test

  1. Run the following command from the root go repository to initiate the rpc:
go run ./cmd/sequence/ server
  1. In the v3 module, run the following foundry tests:
forge test --mp test/modules/BaseSig.t.sol
forge test --mp test/modules/Calls.t.sol
forge test --mp test/modules/Payload.t.sol
forge test --mp test/Guest.t.sol
forge test --mp test/Stage1Module.t.sol
forge test --mp test/Wallet.t.sol

Caveats

Some gas-estimation commands, etc. are commented out because of the scope of this PR. will follow up in a later PR. Also, Permission, SmartSession, SessionManager related modules will follow up later.

@shunkakinoki shunkakinoki changed the base branch from master to waas-scoped-sessions February 25, 2025 11:44
@shunkakinoki shunkakinoki changed the base branch from waas-scoped-sessions to master February 25, 2025 11:45
shunkakinoki and others added 30 commits May 1, 2025 00:30
This commit introduces a new test, TestIntentConfigurationAddress_RealWorldExample, which validates the creation of an intent configuration and the calculation of its counterfactual address. The test includes two operations on different chains and asserts that the generated address matches the expected deterministic address. Additionally, the BehaviorOnError for the TestCreateIntentCallsPayloadDigest test has been updated to ignore errors instead of reverting.
…te multiple payload execution

This commit introduces a new test, TestIntentTransactionToGuestModuleDeployAndCallMultiple, which verifies the deployment and execution of multiple payloads in a single transaction. The test ensures that the wallet remains undeployed before execution and is successfully deployed afterward, while also checking the expected values returned from the contract calls. Additionally, it confirms that the meta transaction receipts are correctly fetched for each operation.
…payload handling and logging

This commit updates the TestIntentTransactionToGuestModuleDeployAndCallMultiple test by modifying the payload creation to use big.NewInt(0) instead of nil, ensuring consistency in payload handling. Additionally, it enhances the test with logging statements to output payload digests, encoded payloads, and expected MetaTxnIDs, improving traceability during execution. The test function name has also been updated for clarity.
…nature generation

This commit modifies the GetIntentConfigurationSignature function to include a new parameter, targetCall, allowing for the creation of a signature that incorporates a specific target call's subdigest. The associated tests have been updated to reflect this change, ensuring that the signature generation process correctly handles the target call for improved accuracy in intent configuration signatures.
… for signature generation"

This reverts commit 42f6d13.
This commit modifies the behavior of the TestIntentTransactionToGuestModuleDeployAndCallMultiple test by changing the BehaviorOnError from revert to ignore for multiple payloads. Additionally, it updates the main module and utils addresses in the sequence context to new values, ensuring consistency across the configuration. The payload creation logic has also been adjusted to reflect these changes, enhancing the overall test reliability and accuracy.
This commit updates the GuestModuleAddress in the network context and the corresponding contract artifacts to a new address. The changes ensure consistency across the codebase and align with the latest deployment configurations. Additionally, the WalletGuestMetaData has been updated to reflect the new bytecode and ABI, enhancing the contract's integration with the system.
…n and wallet signature validation

This commit modifies the expected address in the TestIntentConfigurationAddress_RealWorldExample test and updates the expected signature in the TestWalletSignMessageAndValidate test. These changes ensure that the tests reflect the latest configurations and expected outcomes, enhancing the accuracy and reliability of the test suite.
…meter hashing

This commit introduces the HashIntentParams function, which generates a unique bytes32 hash from the IntentParams struct, ensuring proper validation of input fields. Additionally, new test cases are added to validate the hashing functionality for various scenarios, including empty fields, single calls, and multiple calls, enhancing the test coverage and reliability of the intent configuration.
… payload handling

This commit refines the IntentParams structure by introducing OriginToken and DestinationToken types, enhancing the clarity and organization of token-related data. The HashIntentParams function is updated to validate the new structure, ensuring that both OriginTokens and DestinationTokens are properly checked. Additionally, test cases are modified to reflect the new expected hash values, improving the accuracy of the intent parameter hashing functionality.
…tions

This commit enhances the test cases for hashing intent parameters by updating the names of test runs to reflect their alignment with Solidity test cases. It also modifies the payload creation logic to use an empty address for the wallet and adjusts the expected hash values to ensure consistency with the Solidity implementation. These changes improve the clarity and accuracy of the tests related to intent parameter hashing.
…d tests

This commit modifies the OriginToken and DestinationToken structures to use *big.Int for the ChainId field, enhancing compatibility with larger values. Additionally, the TestHashIntentParams function is updated to reflect these changes, ensuring that the tests align with the new data types and expected hash values. This improves the robustness and accuracy of the intent parameter hashing tests.
…tion for improved ABI encoding

This commit updates the DestinationToken structure to include ABI tags for better encoding and modifies the HashIntentParams function to properly handle the encoding of both OriginTokens and DestinationTokens. The changes ensure that the ABI encoding is consistent with the new structure, improving the overall robustness of the intent parameter hashing process.
…est expectations

This commit refines the HashIntentParams function by restructuring the ABI encoding process for OriginTokens and DestinationTokens, enhancing clarity and error handling. Additionally, the expected hash value in the TestHashIntentParams function is updated to align with the new encoding logic, ensuring consistency with the Solidity implementation.
…oad parameters

This commit changes the BehaviorOnError setting in the TestHashIntentParams function from revert to ignore, and updates the payload parameters to ensure consistency in test cases. These adjustments enhance the accuracy of the intent parameter hashing tests.
…ntentParams function for improved validation

This commit introduces a Nonce field to the IntentParams structure, enhancing the parameterization of intent data. The HashIntentParams function is updated to validate the Nonce, ensuring it is not nil, and the ABI encoding process is adjusted to include the Nonce in the hash generation. Corresponding updates to the TestHashIntentParams function reflect the new expected hash values, improving the accuracy of the tests.
…clarity and update related tests to reflect the new function name. This change improves consistency across the codebase regarding intent configuration handling.
…er address and update related tests. This change improves the flexibility of signature generation by allowing the use of an additional signer, ensuring better alignment with wallet configuration requirements.
…n signer and updating related functions and tests. This change enhances the wallet configuration process, allowing for better signature management and alignment with the new intent configuration structure.
…ature and update related tests. This change enhances the signature generation process by providing more detailed output, improving the overall functionality and flexibility of intent configuration handling.
…ration by removing the auth signer parameter and updating related tests. This change simplifies the function's interface and enhances the clarity of intent configuration handling.
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