Skip to content

Upgrade test framework (ithacaxyz#384)#39

Merged
Dargon789 merged 0 commit into
Dargon789:porto.shfrom
ithacaxyz:main
Apr 11, 2026
Merged

Upgrade test framework (ithacaxyz#384)#39
Dargon789 merged 0 commit into
Dargon789:porto.shfrom
ithacaxyz:main

Conversation

@Dargon789

Copy link
Copy Markdown
Owner

No description provided.

@snyk-io

snyk-io Bot commented Mar 14, 2026

Copy link
Copy Markdown

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Sorry @Dargon789, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@Dargon789

Copy link
Copy Markdown
Owner Author

@Mergifyio refresh

@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly upgrades the project's testing infrastructure and introduces new core functionalities. The primary focus was to enhance the simulation environment by integrating Multicall3, which allows for more intricate and realistic testing of smart contract execution and gas usage. Concurrently, a robust upgrade testing framework was established to ensure seamless contract migrations and state preservation. A new MultiSigSigner contract was also added, providing multi-signature capabilities. These changes collectively aim to improve the reliability and maintainability of the codebase, facilitating future development and deployments.

Highlights

  • Enhanced Simulation Capabilities: Introduced new simulation logic leveraging Multicall3, allowing for more complex and robust testing of contract interactions, including pre-calls and iterative gas estimation.
  • Comprehensive Upgrade Testing: Added a dedicated test suite for comprehensive upgrade scenarios, ensuring state preservation and post-upgrade functionality for various key types, spending limits, and execution permissions.
  • New MultiSigSigner Contract: Implemented a new MultiSigSigner contract along with extensive test coverage, enabling multi-signature capabilities for account owners.
  • Test Framework Modernization: Updated the project's test framework by removing husky pre-commit hooks, gas snapshot files, and related scripts, streamlining the development and testing workflow.
  • Configuration Updates: Modified the .env.example file to include new environment variables for upgrade testing and removed outdated RPC and verification key configurations.
Changelog
  • .env.example
    • Removed outdated RPC endpoints and verification API keys.
    • Added new environment variables for upgrade testing, including UPGRADE_TEST_RPC_URL, UPGRADE_TEST_OLD_PROXY, UPGRADE_TEST_OLD_VERSION, and GAS_SIGNER_MNEMONIC.
  • .husky/pre-commit
    • Removed the pre-commit hook script.
  • gas-snapshots/.gas-snapshot-main
    • Removed the main gas snapshot file.
  • package-lock.json
    • Updated project version from 0.5.5 to 0.5.7.
    • Removed husky dependency.
  • package.json
    • Updated project version from 0.5.5 to 0.5.7.
    • Removed snapshot:main, diff:main, and prepare scripts.
    • Added a new tests script to run forge test excluding UpgradeTests.
  • snapshots/BenchmarkTest.json
    • Updated gas values for several IthacaAccount related benchmark tests.
  • src/Escrow.sol
    • Applied minor formatting adjustments to improve code readability.
  • src/GuardedExecutor.sol
    • Applied minor formatting adjustments, including adding braces to if statements and reformatting function calls.
  • src/IthacaAccount.sol
    • Applied minor formatting adjustments to function calls.
  • src/LayerZeroSettler.sol
    • Applied minor formatting adjustments to function calls.
  • src/Orchestrator.sol
    • Applied minor formatting adjustments to an assembly call block.
  • src/SimpleFunder.sol
    • Applied minor formatting adjustments to a function signature.
  • src/Simulator.sol
    • Imported IMulticall3 interface.
    • Added _callMulticall3 function to perform calls via Multicall3 and parse gas usage.
    • Added _bubbleUpMulticall3Error function for error handling from Multicall3.
    • Implemented simulateMulticall3CombinedGas for iterative combined gas simulation using Multicall3.
    • Implemented simulateMulticall3V1Logs for Multicall3-based simulation with verification runs for logs.
  • src/interfaces/IFunder.sol
    • Applied minor formatting adjustments to a function signature.
  • src/interfaces/IMulticall3.sol
    • Added new interface for the Multicall3 contract, defining structs for calls and results, and aggregate and aggregate3 functions.
  • src/interfaces/IOrchestrator.sol
    • Applied minor formatting adjustments by removing a blank line.
  • src/libraries/LibNonce.sol
    • Applied minor formatting adjustments to a function signature.
  • src/vendor/layerzero/interfaces/IOAppCore.sol
    • Applied minor formatting adjustments to an import statement.
  • src/vendor/layerzero/mocks/EndpointV2Mock.sol
    • Applied minor formatting adjustments to import statements and if conditions.
  • src/vendor/layerzero/oapp/OAppReceiver.sol
    • Applied minor formatting adjustments to function signatures.
  • src/vendor/layerzero/oapp/OAppSender.sol
    • Applied minor formatting adjustments to an endpoint.send call.
  • test/Account.t.sol
    • Added testContextKeyHash function to verify context key hash functionality.
  • test/Base.t.sol
    • Added contextKeyHash state variable.
    • Added targetFunctionContextKeyHash function to support context key hash testing.
  • test/Benchmark.t.sol
    • Applied minor formatting adjustments to constants and function calls.
  • test/GuardedExecutor.t.sol
    • Applied minor formatting adjustments to function calls and if conditions.
  • test/LayerZeroSettler.t.sol
    • Applied minor formatting adjustments to function signatures and calls.
  • test/MultiSigSigner.t.sol
    • Added new test file for the MultiSigSigner contract, including tests for initConfig, addOwner, removeOwner, setThreshold, isValidSignatureWithKeyHash, and fuzz tests for configuration and signature validation.
  • test/Orchestrator.t.sol
    • Applied minor formatting adjustments to a function call.
  • test/SimpleFunder.t.sol
    • Applied minor formatting adjustments to a keccak256 call.
  • test/SimulateExecute.t.sol
    • Imported IMulticall3 interface.
    • Added multicall3 mock contract.
    • Updated _SimulateExecuteTemps struct with gMulticall3 and preCalls fields.
    • Added new test functions: testSimulateMulticall3V1Logs, testSimulateMulticall3NoRevertUnderfundedReverts, testSimulateMulticall3WithEOAKey, testSimulateMulticall3WithPassKey, testSimulateMulticall3EmptyPreCalls, testSimulateMulticall3MultiplePreCalls, and testSimulateVsActualGas to validate Multicall3 simulation logic.
    • Added MockMulticall3 contract implementation for testing purposes.
  • test/UpgradeTests.t.sol
    • Added new test file for comprehensive upgrade testing, including setup of old account states, state capture before and after upgrade, verification of state preservation, and testing of post-upgrade functionality.
  • test/mocks/SendLibMock.sol
    • Applied minor formatting adjustments to import statements.
  • test/utils/TestPlus.sol
    • Applied minor formatting adjustments to a function signature.
  • test/utils/interfaces/ISafe.sol
    • Applied minor formatting adjustments to a function signature.
  • test/utils/mocks/MockAccount.sol
    • Imported LibTStack.
    • Added setContextKeyHash function to push key hashes onto the transient stack.
  • test/utils/mocks/MockCallChecker.sol
    • Applied minor formatting adjustments to a return statement.
  • test/utils/mocks/MockERC4337Account.sol
    • Applied minor formatting adjustments to a function signature.
Ignored Files
  • Ignored by pattern: .github/workflows/** (2)
    • .github/workflows/ci.yaml
    • .github/workflows/version-check.yaml
Activity
  • No specific activity has been recorded for this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@mergify

mergify Bot commented Mar 14, 2026

Copy link
Copy Markdown

refresh

✅ Pull request refreshed

@Dargon789 Dargon789 enabled auto-merge (squash) March 14, 2026 09:49
@Dargon789

Copy link
Copy Markdown
Owner Author

@Mergifyio refresh

@mergify

mergify Bot commented Mar 14, 2026

Copy link
Copy Markdown

refresh

✅ Pull request refreshed

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request significantly enhances the testing framework by introducing comprehensive upgrade tests and new multicall simulation capabilities. The changes are well-organized and improve the project's test coverage and robustness. I've identified a few areas for improvement in the new simulator contract and upgrade tests to enhance accuracy and code clarity.

Comment thread src/Simulator.sol
Comment thread src/Simulator.sol
Comment thread test/UpgradeTests.t.sol
Comment thread test/UpgradeTests.t.sol
Comment thread test/UpgradeTests.t.sol
Comment thread test/UpgradeTests.t.sol
@Dargon789 Dargon789 self-assigned this Mar 14, 2026
@Dargon789 Dargon789 added bug Something isn't working documentation Improvements or additions to documentation duplicate This issue or pull request already exists enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers invalid This doesn't seem right question Further information is requested wontfix This will not be worked on labels Mar 14, 2026
@Dargon789 Dargon789 linked an issue Apr 7, 2026 that may be closed by this pull request
@Dargon789 Dargon789 disabled auto-merge April 7, 2026 12:02
@Dargon789 Dargon789 enabled auto-merge (rebase) April 7, 2026 12:02
@Dargon789 Dargon789 disabled auto-merge April 11, 2026 11:00
@Dargon789 Dargon789 merged commit 767e973 into Dargon789:porto.sh Apr 11, 2026
42 of 45 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation duplicate This issue or pull request already exists enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed invalid This doesn't seem right question Further information is requested wontfix This will not be worked on

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Updated class diagram for IthacaAccount Merkle signature support Sequence diagram for wrapped and Merkle signature validation

1 participant