-
Notifications
You must be signed in to change notification settings - Fork 159
Add wincode support for Entry components #461
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
base: master
Are you sure you want to change the base?
Conversation
buffalojoec
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Super cool! The library looks awesome.
joncinque
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the fly-by, but the code looks great to me! Just a comment on enabling deps for tests
transaction/Cargo.toml
Outdated
| solana-pubkey = { workspace = true, features = ["rand"] } | ||
| solana-sha256-hasher = { workspace = true } | ||
| solana-system-interface = { workspace = true, features = ["bincode"] } | ||
| solana-transaction = { path = ".", features = ["dev-context-only-utils"] } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might have missed something, but since the wincode feature isn't always enabled for test builds, we won't actually run the test that's gated on the wincode feature -- can you add the wincode feature here to make sure we do run the test?
Alternatively, we can add wincode to dev-context-only-utils, but I'd prefer adding the feature here since there's nothing in dev-context-only-utils that requires wincode at the moment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done! 07c53ae
joncinque
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thanks!
|
@joncinque -- updated to wincode v0.2.2 to leverage the safer uninit struct extensions builder (see anza-xyz/wincode#42 and anza-xyz/agave#9366) and resolved merge conflicts with |
joncinque
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
| [[package]] | ||
| name = "solana-short-vec" | ||
| version = "3.1.0" | ||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| checksum = "79fb1809a32cfcf7d9c47b7070a92fa17cdb620ab5829e9a8a9ff9d138a7a175" | ||
| dependencies = [ | ||
| "serde_core", | ||
| ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I'm only noticing this now, but we might have some issues with two versions of the same crate in our build at some point. At worst, we'll need to add a patch in Cargo.toml to force using the local solana-short-vec. We could potentially bring solana-short-vec down with the wincode crate if needed too.
Either way, it looks like we're ok for now, so nothing to do yet
agave'sEntryis comprised of a few core types exposed by thesolana-sdkcrate. Agave currently has its own wincode-derive implementations for those types. This PR migrates those implementations here to make this crate the source of truth for those implementations, as well as making them available to users ofsolana-sdkmore broadly.This isn't meant to provide comprehensive support for
wincodetosolana-sdk, but rather to begin introducingwincodeas a feature to a few subcrates, laying the groundwork for future implementations.Implemented types:
MessageHeaderCompiledInstructionAddressHashSignaturelegacy::MessageMessageAddressTableLookupv0::MessageVersionedTransactionI can also break each into a separate PR if that's preferable, though there will be some PR stacking as many of these types have dependencies in this list.