feat: use surfpool by default for anchor test/anchor localnet commands#4106
Merged
jacobcreech merged 8 commits intosolana-foundation:masterfrom Dec 11, 2025
Merged
feat: use surfpool by default for anchor test/anchor localnet commands#4106jacobcreech merged 8 commits intosolana-foundation:masterfrom
anchor test/anchor localnet commands#4106jacobcreech merged 8 commits intosolana-foundation:masterfrom
Conversation
* wip * refactor: Simplify Surfpool configuration and enhance validator argument handling - Removed the SurfpoolConfig struct and related logic, simplifying the ValidatorType enum. - Updated the command processing to accept additional arguments for the validator. - Adjusted the localnet and test functions to handle Surfpool and Solana validators more effectively. - Improved logging management for Surfpool validator. * feat(cli): Enhance argument handling for Surfpool validator - Added support for additional arguments to be passed to the test runner and validator. - Updated command definitions to include `--args` and `--validator-args` options. - Improved handling of validator arguments in the `test` and `localnet` functions. - Ensured proper routing of arguments to Surfpool when no explicit validator arguments are provided. * refactor(cli): Update ValidatorType enum and streamline argument handling * feat(cli): Introduce Surfpool configuration with validator integration * feat(cli): enable tui startup to localnet and fix some typos * feat(cli): add runbooks startup check to wait for the deployment of the program then run the tests against the local environment * chore: remove debug print * refactor(cli): change flags to be compatible with surfpool cli, add the runbooks serialization struct to make a more robust verification when waiting for runbooks * fix(cli): Improve runbook execution handling to consider failures as completed * clean up runbook execution checking logic * augment surfpool config fields * remove `SURFPOOL_RPC_URL` const * `remote_rpc_url` -> `datasource_rpc_url` * use `DEFAULT_RPC_PORT` const * fix surfpool command * add/use workflow to install surfpool * specify surfpool cli version for CI * disable surfpool logs by default; allow configuring in anchor.toml * add timeout_minutes to setup surfpool * clean up action * allow too many arguments for localnet fn * bump surfpool version for CI * start surfpool instead of validator in ci * update run-test.sh * fix setup-surfpool cache * add `.surfpool` folder to gitignore for `anchor init` * fix: apply `--offline` flag by default for surfpool * only print message about surfpool logs if logs created * feat: add block production mode to Surfpool configuration * bump surfpool versions in CI * feat: add block production mode to surfpool config for ido-pool test * feat: add sleep functionality to log tests for improved reliability * fix: update program log messages to use dynamic identifiers for better clarity * fix: skip mut error test until LiteSVM issue is resolved * fix: update surfpool CLI version to 0.11.2 in workflow files * fix: refactor testValidateAssociatedToken calls to use confirmed commitment * fix: add surfpool block production mode configuration for errors test * fix: start surfpool in daemon mode for client/example test * fix: add block production mode configuration for surfpool for misc * lint * fix: add setup step for surfpool in reusable tests workflow * add sleep in run-test.sh to execute runbooks * disable check_surfpool call in run-test.sh --------- Co-authored-by: MicaiahReid <micaiahreid@gmail.com>
|
@BretasArthur1 is attempting to deploy a commit to the Solana Foundation Team on Vercel. A member of the Team first needs to authorize it. |
anchor test/anchor localnet commands
jacobcreech
approved these changes
Dec 11, 2025
Collaborator
acheroncrypto
left a comment
There was a problem hiding this comment.
custom-discriminator tests are broken after this change:
1) custom-discriminator
Instructions
Integer:
TransactionExpiredTimeoutError: Transaction was not confirmed in 30.00 seconds. It is unknown if it succeeded or failed. Check signature 2gam24YNpo61hDLpEy89XbP993U5iVpwqTT8hdXrS9zKdQXDL4Sp1k2cPygVxuo1TEkGHKRhPMTMxjzuf6y6F9Et using the Solana Explorer or CLI tools.
1) New IDL
Case conversion
Works when instructions have no case conversion in IDL:
Error: failed to send transaction: Transaction simulation failed: This program may not be used for executing instructions
Comment on lines
-166
to
+175
| it("Emits a mut error", async () => { | ||
| // Skip until LiteSVM issue is resolved: https://github.com/LiteSVM/litesvm/issues/235 | ||
| it.skip("Emits a mut error", async () => { |
Comment on lines
+271
to
+277
| // wait for logs to be captured | ||
| for (let i = 0; i < 20; i++) { | ||
| if (signature) { | ||
| break; | ||
| } | ||
| await sleep(100); | ||
| } |
Collaborator
There was a problem hiding this comment.
Why is this necessary?
| }, | ||
| }); | ||
| }) | ||
| .rpc({ commitment: "confirmed" }); |
Collaborator
There was a problem hiding this comment.
Why is the confirmed commitment necessary here (and others)?
This was referenced Dec 12, 2025
Otter-0x4ka5h
pushed a commit
to Otter-0x4ka5h/anchor
that referenced
this pull request
Mar 25, 2026
…mands (solana-foundation#4106) * feat(cli): add surfpool config and integration (#3) * wip * refactor: Simplify Surfpool configuration and enhance validator argument handling - Removed the SurfpoolConfig struct and related logic, simplifying the ValidatorType enum. - Updated the command processing to accept additional arguments for the validator. - Adjusted the localnet and test functions to handle Surfpool and Solana validators more effectively. - Improved logging management for Surfpool validator. * feat(cli): Enhance argument handling for Surfpool validator - Added support for additional arguments to be passed to the test runner and validator. - Updated command definitions to include `--args` and `--validator-args` options. - Improved handling of validator arguments in the `test` and `localnet` functions. - Ensured proper routing of arguments to Surfpool when no explicit validator arguments are provided. * refactor(cli): Update ValidatorType enum and streamline argument handling * feat(cli): Introduce Surfpool configuration with validator integration * feat(cli): enable tui startup to localnet and fix some typos * feat(cli): add runbooks startup check to wait for the deployment of the program then run the tests against the local environment * chore: remove debug print * refactor(cli): change flags to be compatible with surfpool cli, add the runbooks serialization struct to make a more robust verification when waiting for runbooks * fix(cli): Improve runbook execution handling to consider failures as completed * clean up runbook execution checking logic * augment surfpool config fields * remove `SURFPOOL_RPC_URL` const * `remote_rpc_url` -> `datasource_rpc_url` * use `DEFAULT_RPC_PORT` const * fix surfpool command * add/use workflow to install surfpool * specify surfpool cli version for CI * disable surfpool logs by default; allow configuring in anchor.toml * add timeout_minutes to setup surfpool * clean up action * allow too many arguments for localnet fn * bump surfpool version for CI * start surfpool instead of validator in ci * update run-test.sh * fix setup-surfpool cache * add `.surfpool` folder to gitignore for `anchor init` * fix: apply `--offline` flag by default for surfpool * only print message about surfpool logs if logs created * feat: add block production mode to Surfpool configuration * bump surfpool versions in CI * feat: add block production mode to surfpool config for ido-pool test * feat: add sleep functionality to log tests for improved reliability * fix: update program log messages to use dynamic identifiers for better clarity * fix: skip mut error test until LiteSVM issue is resolved * fix: update surfpool CLI version to 0.11.2 in workflow files * fix: refactor testValidateAssociatedToken calls to use confirmed commitment * fix: add surfpool block production mode configuration for errors test * fix: start surfpool in daemon mode for client/example test * fix: add block production mode configuration for surfpool for misc * lint * fix: add setup step for surfpool in reusable tests workflow * add sleep in run-test.sh to execute runbooks * disable check_surfpool call in run-test.sh --------- Co-authored-by: MicaiahReid <micaiahreid@gmail.com> * fix: Ensure proper quoting in cleanup calls and improve process termination logic * fix: Improve cleanup logic and enhance surfpool process management * fix: supply surfpool_config to cluster_url fn * fix(ci): ensure local bin path is added to GITHUB_PATH during Surfpool installation * ci: debug surfpool install * debug ci * ci: remove sudo from install --------- Co-authored-by: Arthur Bretas <158767751+BretasArthur1@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR updates the behavior of the
anchor testandanchor localnetcommands to use Surfpool as the default validator.As a safeguard in case this breaks tests for any users, we've kept the
solana-test-validatorcodepaths for now. Users can continue use the test validator by using the--validator legacyflag.Though Surfpool should start and deploy your protocol out of the box when testing, Surfpool's behavior can configured in the
Anchor.tomlas such:Some notes:
.surfpoolfile to the.gitignoreproduced byanchor initso that surfpool logs aren't muddying commitsAnchor.toml's genesis fields, andTest.tomlaccount/clone/account_dir fields are respected and deployed to surfpool