Skip to content
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

Feat/anchor 0.30.0 support #148

Merged
merged 2 commits into from
May 19, 2024
Merged

Feat/anchor 0.30.0 support #148

merged 2 commits into from
May 19, 2024

Conversation

Ikrk
Copy link
Contributor

@Ikrk Ikrk commented Apr 30, 2024

Now Anchor 0.29 and higher is supported. In order to support multiple versions of Anchor and solana-program, it was necessary to get rid of the solana-program-test-anchor-fix crate. I created new convert_entry macro that converts the new entry point of programs based on Anchor 0.29 and higher to the previous version of entry closure. See convert_entry description for more information.

Anchor 0.29.0 works only with solana-program 1.17 due to issues with pinned dependencies. It is possible that Anchor 0.30.0 will work also with 1.16 but I did not test if trident works in this setup.

@Ikrk Ikrk changed the base branch from master to develop April 30, 2024 13:55
@Ikrk Ikrk force-pushed the feat/anchor-0.30.0-support branch from c58c6c3 to 0b2229e Compare April 30, 2024 14:09
@Ikrk Ikrk force-pushed the feat/anchor-0.30.0-support branch from 0b2229e to 4873bf3 Compare May 2, 2024 07:53
@Ikrk Ikrk requested a review from lukacan May 2, 2024 08:13
@Ikrk Ikrk marked this pull request as ready for review May 2, 2024 08:13
Copy link
Collaborator

@lukacan lukacan left a comment

Choose a reason for hiding this comment

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

I tested the PR and it looks nice! One thing, that Im not sure about is if we do not want to include in the documentation the steps required to make it work with 0.30.0. It will work (it can be initialized without changes, but to run fuzz test) with 30, however as Trident uses 29 the accounts_snapshots.rs shows

the trait bound test30::Escrow: trident_client::anchor_lang::AccountSerialize is not satisfied

the above is a result of the example: "arbitrary-limit-inputs-5" used with 0.30.0

this error can be resolved if we temporarily switch in the Cargo.toml of the program to 0.29.0, but I don't know if this is desirable.

@Ikrk
Copy link
Contributor Author

Ikrk commented May 15, 2024

I tested the PR and it looks nice! One thing, that Im not sure about is if we do not want to include in the documentation the steps required to make it work with 0.30.0. It will work (it can be initialized without changes, but to run fuzz test) with 30, however as Trident uses 29 the accounts_snapshots.rs shows

the trait bound test30::Escrow: trident_client::anchor_lang::AccountSerialize is not satisfied

the above is a result of the example: "arbitrary-limit-inputs-5" used with 0.30.0

this error can be resolved if we temporarily switch in the Cargo.toml of the program to 0.29.0, but I don't know if this is desirable.

I have done some modifications and now when you want to use Trident with Anchor 0.29.0, you can run

cargo update anchor-client@0.30.0 --precise 0.29.0
cargo update anchor-spl@0.30.0 --precise 0.29.0

after Trident initialization and it should set the correct versions in Cargo.lock file without having to do any other adjustments in Cargo.toml. I did not find a way how it could be done automatically without user intervention.

It could be done also the other way around, when you want to use v0.30.0, than you would need to override the versions, but I think we want to support primarily new versions without friction.

@Ikrk Ikrk requested a review from lukacan May 15, 2024 08:43
@lukacan lukacan merged commit a429055 into develop May 19, 2024
8 checks passed
@lukacan lukacan deleted the feat/anchor-0.30.0-support branch May 19, 2024 19:37
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.

None yet

2 participants