Skip to content

program: depend on v3 interface#308

Merged
grod220 merged 1 commit intomainfrom
3.0-deps
Apr 16, 2026
Merged

program: depend on v3 interface#308
grod220 merged 1 commit intomainfrom
3.0-deps

Conversation

@grod220
Copy link
Copy Markdown
Member

@grod220 grod220 commented Mar 10, 2026

The interface is on v3 but program depends on v2. While rebasing #152 to the latest main, found this to be a blocker.

Comment thread program/Cargo.toml
Comment on lines +48 to +50
# TODO: Remove after agave/mollusk/stake-program depend on aligned StakeHistory version
# Either solana-stake-interface v3 or new solana-stake-history crate
solana-stake-interface-v2 = { package = "solana-stake-interface", version = "2.0.1" }
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Points raised anza-xyz/mollusk#228 (review)

StakeHistory sysvar is creating a dependency chain between

stake interface -> agave -> mollusk -> stake program

Can be resolved by:

  1. Agave libraries shipping with updated solana-stake-inteface dependency
  2. Or even better, moving solana-stake-history to its own crate.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We could potentially move stake history to its own crate, since it likely won't change as often.

Note that it wouldn't really help right now since it still depends on solana-sysvar, which depends on solana-account / solana-rent, which is at the root of all this annoyance.

Two versions of a crate is totally fine if there's no other way

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

SysvarSerialize removed from stake & mollusk. Now just agave to go.

@grod220 grod220 marked this pull request as ready for review April 15, 2026 20:29
@grod220 grod220 requested review from 2501babe and joncinque April 15, 2026 20:29
Comment thread program/Cargo.toml
solana-rent = "3.0.0"
solana-security-txt = "1.1.2"
solana-stake-interface = { version = "2", features = ["bincode", "borsh", "sysvar"] }
solana-stake-interface = { path = "../interface", version = "3.1.0", features = ["bincode", "borsh", "sysvar"] }
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

iirc there was a reason we stopped using path in favor of version but i can never remember what it was... maybe @joncinque does? or it could have been febo, i dont think it was me

Copy link
Copy Markdown
Member Author

@grod220 grod220 Apr 15, 2026

Choose a reason for hiding this comment

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

Oh wait a sec: #79 (comment)

I suppose we want to keep it detached to update the interface & program independently? Why is that desirable though?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The chain of dependencies goes: program -> agave -> interface

This means we can't update agave until the interface is updated, and we can't update the program until agave is updated.

The whole point of separating out the interface was to remove the circular dependency between the program and agave.

As for the dep here, it's probably better to use the local one to help catch issues right away. But it does mean we can also accidentally publish the program crate without the interface and cause issues.

But I don't feel too strongly either way.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

In the worst case, I think someone attempts a stake-program publish when the used stake-interface version isn't published. That seems worthwhile as it requires interface changes to be handled in the program crate as they are changed versus lagging program-sync PRs.

That said, it's easy enough to drop the path = "../interface" if we run into issues later.

Copy link
Copy Markdown
Contributor

@joncinque joncinque left a comment

Choose a reason for hiding this comment

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

Looks great to me!

@grod220 grod220 merged commit cbdcf11 into main Apr 16, 2026
23 checks passed
@grod220 grod220 deleted the 3.0-deps branch April 16, 2026 10:25
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.

3 participants