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

Extract solana-transaction from solana-sdk #3634

Merged
merged 24 commits into from
Dec 4, 2024

Conversation

kevinheavey
Copy link

@kevinheavey kevinheavey commented Nov 14, 2024

Problem

solana_sdk::transaction needs to be pulled out of solana_sdk

Summary of Changes

  • Move to its own crate and re-export for backwards compatibility as required, with deprecation notices
  • Move solana_sdk::simple_vote_transaction_checker to this crate (not much choice here as there'd be a circular dep otherwise)
  • Move solana_sdk::transaction::Result to solana_transaction_error::TransactionResult and re-export in solana_sdk::transaction with deprecation. This should have been done before but it was quite noticeable when moving things that it clearly belongs in solana_transaction_error
  • Put the verify_precompiles methods behind a feature gate "precompiles", as these bring in extra dependencies
  • Put the other verify and verify_* methods behind a feature gate "verify", as they bring in extra dependencies (not as many as the precompiles though)
  • Make serde and bincode optional in the new crate. The new crate still depends indirectly on serde and bincode for now because it depends on solana-program
  • Make blake3 optional in the new crate

This branches off #3622 so that needs to be merged first (update: done)

@kevinheavey kevinheavey force-pushed the extract-transaction branch 5 times, most recently from 3186d52 to 303be04 Compare November 14, 2024 17:00
@kevinheavey kevinheavey force-pushed the extract-transaction branch 5 times, most recently from 0dcdc95 to 936e4af Compare November 21, 2024 00:15
@kevinheavey kevinheavey marked this pull request as ready for review November 25, 2024 17:56
@kevinheavey kevinheavey force-pushed the extract-transaction branch 2 times, most recently from 86eeea0 to dcd740a Compare November 26, 2024 07:28
Copy link

mergify bot commented Nov 27, 2024

If this PR represents a change to the public RPC API:

  1. Make sure it includes a complementary update to rpc-client/ (example)
  2. Open a follow-up PR to update the JavaScript client @solana/web3.js (example)

Thank you for keeping the RPC clients in sync with the server API @kevinheavey.

Copy link

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

Thanks for taking this one on too. The separation of precompiles and verify makes sense, we should just use solana_system_interface and solana_message instead of solana_program

@@ -48,7 +48,7 @@ serde = [
std = []

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
targets = ["x86_64-unknown-linux-gnu", "wasm32-unknown-unknown"]

Choose a reason for hiding this comment

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

What's this change for?

Copy link
Author

Choose a reason for hiding this comment

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

Can't remember why it happened in this PR but it is a good change, otherwise you can't see the wasm-specific code on docs.rs

Copy link
Author

Choose a reason for hiding this comment

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

it's possible i meant to add it for the solana-transaction crate. But it matters for solana-instruction too

Choose a reason for hiding this comment

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

If it's not needed, let's make the change in a separate PR. That way we can add it to all of the affected crates at once. I put in #3901 for it

sdk/transaction/src/sanitized.rs Outdated Show resolved Hide resolved
@@ -0,0 +1,21 @@
#![cfg(feature = "full")]
#[deprecated(since = "2.2.0", note = "Use solana_transaction_error crate instead")]

Choose a reason for hiding this comment

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

nit: all of these re-exports except for TransactionResult were already deprecated as of 2.1.0, but it's fine to bump this up for simplicity

sdk/transaction/src/sanitized.rs Show resolved Hide resolved
sdk/transaction/src/lib.rs Outdated Show resolved Hide resolved
sdk/transaction/src/sanitized.rs Outdated Show resolved Hide resolved
sdk/transaction/src/versioned/mod.rs Outdated Show resolved Hide resolved
sdk/transaction/src/versioned/mod.rs Outdated Show resolved Hide resolved
sdk/transaction/src/versioned/mod.rs Outdated Show resolved Hide resolved
sdk/transaction/src/wasm.rs Outdated Show resolved Hide resolved
@kevinheavey
Copy link
Author

@apfitzge I see that you are the owner of the empty solana-transaction crate: https://crates.io/crates/solana-transaction/settings

Could you please add anza-team as an owner so @yihau can take it over?

@apfitzge
Copy link

apfitzge commented Dec 3, 2024

@apfitzge I see that you are the owner of the empty solana-transaction crate: https://crates.io/crates/solana-transaction/settings

Could you please add anza-team as an owner so @yihau can take it over?

Yeah, I'll transfer ownership when I get to my desk

@apfitzge
Copy link

apfitzge commented Dec 3, 2024

@yihau I added anza-team as an owner on crates.io

joncinque added a commit to joncinque/solana that referenced this pull request Dec 4, 2024
#### Problem

As pointed out in [this PR
comment](anza-xyz#3634 (comment))
it's good to specify that docs build for wasm32 where needed.

Also, solana-sdk and solana-program don't configure docs builds with all
features enabled.

#### Summary of changes

In most places, add "wasm32-unknown-unknown" as a build target. For sdk
and program, also configure the features to be enabled.
Copy link

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

Really close, just one last little nit and the bit about solana-instruction's Cargo.toml

sdk/transaction/src/lib.rs Outdated Show resolved Hide resolved
Copy link

@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, thanks!

@joncinque joncinque added the automerge automerge Merge this Pull Request automatically once CI passes label Dec 4, 2024
@mergify mergify bot merged commit e4e232c into anza-xyz:master Dec 4, 2024
52 of 53 checks passed
mergify bot pushed a commit that referenced this pull request Dec 4, 2024
#### Problem

As pointed out in [this PR
comment](#3634 (comment))
it's good to specify that docs build for wasm32 where needed.

Also, solana-sdk and solana-program don't configure docs builds with all
features enabled.

#### Summary of changes

In most places, add "wasm32-unknown-unknown" as a build target. For sdk
and program, also configure the features to be enabled.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge automerge Merge this Pull Request automatically once CI passes need:merge-assist
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants