Skip to content

refactor(rpc-client): migrate fee queries to VersionedMessage - #15310

Merged
apfitzge merged 3 commits into
anza-xyz:masterfrom
apfitzge:deprecate_serializable_message
Sep 24, 2026
Merged

apfitzge merged 3 commits into
anza-xyz:masterfrom
apfitzge:deprecate_serializable_message

Conversation

@apfitzge

Copy link
Copy Markdown

Problem

Summary of Changes

  • Add get_fee_for_versioned_message to rpc-client.
  • Deprecate SerializableMessage and get_fee_for_message (client fn NOT rpc call)

Testing

  • Converted tests to use VersionedMessage

Note: PR on top of #15309

Fixes #

@apfitzge
apfitzge force-pushed the deprecate_serializable_message branch 2 times, most recently from cc891d8 to 527dc45 Compare September 17, 2026 15:04
@apfitzge
apfitzge requested a review from joncinque September 17, 2026 17:01
@apfitzge
apfitzge marked this pull request as ready for review September 17, 2026 17:01
@apfitzge

Copy link
Copy Markdown
Author

idk what's going on with github rn - if you click into buildkite it's done, but check shown as pending.

joncinque
joncinque previously approved these changes Sep 17, 2026

@joncinque joncinque 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.

Looks great to me! Just a question on one of the tests, nothing stopping this from merging though

Comment thread rpc-client/src/rpc_client.rs Outdated
Comment on lines +5242 to +5245
let rpc_client = RpcClient::new_with_commitment(
format!("http://{rpc_addr}"),
CommitmentConfig::processed(),
);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

For my own information, why's this change needed?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

not, codex added some asserts above that made it necessary. and i missed it during self review.

thanks for catching

@apfitzge apfitzge changed the title refactor(rpc-client): replace SerializableMessage fee API with VersionedMessage refactor(rpc-client): migrate fee queries to VersionedMessage Sep 23, 2026
@apfitzge
apfitzge force-pushed the deprecate_serializable_message branch from 527dc45 to c7a0cc9 Compare September 23, 2026 15:13
@apfitzge
apfitzge requested a review from joncinque September 23, 2026 15:13
@apfitzge

Copy link
Copy Markdown
Author

@joncinque sorry for the rug. there were several clones that I ended up removing in the latest series of commits.

I also reverted the stupid test change you pointed out

@apfitzge
apfitzge force-pushed the deprecate_serializable_message branch from c7a0cc9 to c14ed0b Compare September 23, 2026 22:00

@joncinque joncinque 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.

Looks good overall! Just some nits and a question

Comment thread rpc-client/src/rpc_client.rs Outdated

/// Trait used to add support for versioned messages to RPC APIs while
/// retaining backwards compatibility
#[deprecated(since = "4.4.0", note = "Use VersionedMessage instead")]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

nit: Since v4.4.0 was cut, we should change this to v4.5.0

Comment thread rpc-client/src/rpc_client.rs Outdated
/// This method corresponds directly to the [`getFeeForMessage`] RPC method.
///
/// [`getFeeForMessage`]: https://solana.com/docs/rpc/http/getfeeformessage
#[deprecated(since = "4.4.0", note = "Use get_fee_for_versioned_message instead")]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

nit: same here, should be 4.5.0

Comment thread cli/src/program.rs
Comment on lines +3189 to +3198
let into_legacy = |message| match message {
VersionedMessage::Legacy(message) => message,
_ => unreachable!("program deployment constructs legacy messages"),
};
let initial_message = initial_message.map(into_legacy);
let mut write_messages = write_messages
.into_iter()
.map(into_legacy)
.collect::<Vec<_>>();
let final_message = final_message.map(into_legacy);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This unwrapping back to legacy messages is a little rough -- is it even worse to use versioned messages because we modify them during the simulations and all that?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

hmm let me think of how to do this in a cleaner way. I want to follow-up with moving all of these to txv1...so VersionedTransaction/VersionedMessage is where we wanna go

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Might just fallback to what it was doing before and cloning the Message for the wrap.

Then follow-up with dedicated PR to make this better.
Does that sound reasonable, or would you prefer it's part of this one?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Follow-up is fine to me, will approve then!

@joncinque joncinque added the CI Pull Request is ready to enter CI label Sep 24, 2026
@anza-team anza-team removed the CI Pull Request is ready to enter CI label Sep 24, 2026
@joncinque

Copy link
Copy Markdown

Btw it looks like I had to add the CI label to kick off buildkite, not sure what's going on there

@codecov-commenter

codecov-commenter commented Sep 24, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 72.65625% with 35 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.4%. Comparing base (2f6b982) to head (408bbe6).
⚠️ Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##           master   #15310     +/-   ##
=========================================
- Coverage    82.5%    82.4%   -0.1%     
=========================================
  Files         936      936             
  Lines      372168   372241     +73     
=========================================
+ Hits       307069   307090     +21     
- Misses      65099    65151     +52     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@apfitzge
apfitzge added this pull request to the merge queue Sep 24, 2026
Merged via the queue into anza-xyz:master with commit 0bf8a24 Sep 24, 2026
55 checks passed
@apfitzge
apfitzge deleted the deprecate_serializable_message branch September 24, 2026 13:21
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.

4 participants