Repository navigation
refactor(rpc-client): migrate fee queries to VersionedMessage - #15310
Conversation
cc891d8 to
527dc45
Compare
|
idk what's going on with github rn - if you click into buildkite it's done, but check shown as pending. |
joncinque
left a comment
There was a problem hiding this comment.
Looks great to me! Just a question on one of the tests, nothing stopping this from merging though
| let rpc_client = RpcClient::new_with_commitment( | ||
| format!("http://{rpc_addr}"), | ||
| CommitmentConfig::processed(), | ||
| ); |
There was a problem hiding this comment.
For my own information, why's this change needed?
There was a problem hiding this comment.
not, codex added some asserts above that made it necessary. and i missed it during self review.
thanks for catching
527dc45 to
c7a0cc9
Compare
|
@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 |
c7a0cc9 to
c14ed0b
Compare
joncinque
left a comment
There was a problem hiding this comment.
Looks good overall! Just some nits and a question
|
|
||
| /// Trait used to add support for versioned messages to RPC APIs while | ||
| /// retaining backwards compatibility | ||
| #[deprecated(since = "4.4.0", note = "Use VersionedMessage instead")] |
There was a problem hiding this comment.
nit: Since v4.4.0 was cut, we should change this to v4.5.0
| /// 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")] |
| 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); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Follow-up is fine to me, will approve then!
|
Btw it looks like I had to add the CI label to kick off buildkite, not sure what's going on there |
Codecov Report❌ Patch coverage is 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:
|
Problem
SerializableMessage#15277SerializableMessagerequires a separate implementation for each message versionSummary of Changes
get_fee_for_versioned_messageto rpc-client.SerializableMessageandget_fee_for_message(client fn NOT rpc call)Testing
Note: PR on top of #15309
Fixes #