Skip to content

Feat/timelock#22

Open
kostyamospan wants to merge 16 commits intomainfrom
feat/timelock
Open

Feat/timelock#22
kostyamospan wants to merge 16 commits intomainfrom
feat/timelock

Conversation

@kostyamospan
Copy link
Copy Markdown
Collaborator

No description provided.

@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello @kostyamospan, 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 introduces robust support for the Squads multisig protocol, a critical component for secure on-chain governance and asset management. The changes primarily involve integrating the necessary library, developing new testing infrastructure, and writing comprehensive tests to validate the creation, configuration, and execution of multisig transactions, with a particular emphasis on ensuring the correct behavior of timelock features. This enhancement lays the groundwork for more secure and controlled operations within the system.

Highlights

  • Squads Multisig Integration: Integrated the @sqds/multisig library to enable and test multisignature functionalities, including the creation of multisigs and handling of timelocks for various transactions.
  • Comprehensive Timelock Testing: Introduced extensive test cases for Squads multisig operations, specifically focusing on timelock mechanisms for both configuration changes and regular vault transactions, ensuring secure and time-delayed execution.
  • Test Fixture Refactoring: Refactored existing test fixtures (acFixture, dataFeedFixture, vaultsFixture) to accept and reuse a shared Bankrun context, which improves test setup efficiency and reduces redundancy.
  • Transaction Type Support: Updated common transaction processing helpers to support VersionedTransaction types, enhancing compatibility with newer Solana transaction formats within the testing environment.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • Anchor.toml
    • Added a new test-squads script to run Squads-related tests.
  • package.json
    • Added @sqds/multisig as a new dependency.
  • test/constants/squads.constant.ts
    • Added a new file defining the SQUADS_PROGRAM_ID constant.
  • test/data-feed.test.ts
    • Updated calls to vaultsFixture to pass undefined as the first argument, aligning with the refactored fixture signature.
  • test/fixture/ac.fixture.ts
    • Modified acFixture to accept an optional InitBankrunReturnType fixture, allowing context reuse.
  • test/fixture/dafa-feed.fixture.ts
    • Modified dataFeedFixture to accept an optional InitBankrunReturnType fixture and passed it to acFixture.
  • test/fixture/squads.fixture.ts
    • Added a new fixture for setting up Squads multisig test environments, including functions to create multisigs with varying timelocks and mock accounts.
  • test/fixture/vaults.fixture.ts
    • Modified vaultsFixture to accept an optional InitBankrunReturnType fixture and passed it to dataFeedFixture.
  • test/helpers/common.helpers.ts
    • Imported VersionedTransaction and AddedProgram types.
    • Imported SQUADS_PROGRAM_ID constant.
    • Defined InitBankrunReturnType for consistent Bankrun context handling.
    • Implemented caching for initBankrun to reuse the Bankrun context across tests and added support for extraPrograms.
    • Updated expectTxReverted, expectTxNotReverted, and processTransaction functions to handle both Transaction and VersionedTransaction types.
  • test/squads.test.ts
    • Added a new test file for Squads multisig functionality, covering initialization, timelock behavior for configuration and vault transactions, and interactions with Squads members.
  • test/testers/squads.testers.ts
    • Added new helper functions (wrapTxWithSqudsSigner, sendSquadsTxWithTimelock, sendSquadsConfigurationTxWithTimelock) to streamline testing of Squads multisig transactions and timelock logic.
  • yarn.lock
    • Updated various dependencies, including @sqds/multisig, @solana/web3.js, and their transitive dependencies, to support the new multisig integration.
Activity
  • kostyamospan created this pull request.
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.

Copy link
Copy Markdown

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

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 introduces comprehensive testing for Squads multisig integration, adding the @sqds/multisig dependency and related @metaplex-foundation and @solana/codecs packages. New files (squads.constant.ts, squads.fixture.ts, squads.test.ts, squads.testers.ts) were added to define the Squads program ID, set up Bankrun test fixtures for multisig environments, and implement tests for multisig creation, configuration changes (including timelock and member management), and transaction execution. Core testing utilities in common.helpers.ts were updated to support VersionedTransaction, allow for external program loading, and introduce Bankrun context caching, while existing fixtures were refactored to reuse these contexts. Review comments highlight several type safety improvements, such as strongly typing connection parameters and removing unnecessary any casts for multisigPda, suggest extracting a hardcoded base64 string into a named constant for readability, correct a typo in a helper function name, and recommend adjusting time travel logic to prevent potential off-by-one errors when waiting for timelocks to expire.

@kostyamospan kostyamospan marked this pull request as ready for review February 17, 2026 19:30
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