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 message crate #3704

Merged
merged 32 commits into from
Dec 2, 2024
Merged

Conversation

kevinheavey
Copy link

@kevinheavey kevinheavey commented Nov 19, 2024

Problem

solana_program::message needs to be pulled out

Summary of Changes

  • Move to its own crate and re-export with deprecation
  • Move AddressLookupTableAccount to this crate
  • Move CompiledInstruction to this crate
  • Copy ALL_IDS from the sysvar module to avoid a dependency. This code is deprecated anyway so the stuff we are copying should not change.
  • Inline the NONCED_TX_MARKER_IX_INDEX from solana_nonce to avoid a dependency
  • Make serde and bincode optional in this crate
  • Remove thiserror from the new crate
  • Add doc_auto_cfg

This uses the solana-system-interface crate so that needs to be published before this can be merged (update: solana-system-interface has been published)

@kevinheavey kevinheavey force-pushed the extract-message-crate branch 4 times, most recently from 45242b6 to 891e6cc Compare November 21, 2024 19:31
@kevinheavey kevinheavey marked this pull request as ready for review November 21, 2024 19:36
@kevinheavey kevinheavey force-pushed the extract-message-crate branch from 891e6cc to 5cd83a7 Compare November 22, 2024 08:41
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 really good, just one suggestion to add a test and to revert some changes that might have snuck in. Is this the last of the painful crate extractions from solana-program?

sdk/message/src/legacy.rs Show resolved Hide resolved
sdk/message/src/sanitized.rs Show resolved Hide resolved
sdk/message/src/versions/v0/loaded.rs Show resolved Hide resolved

Choose a reason for hiding this comment

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

Were these changes intended?

Copy link
Author

Choose a reason for hiding this comment

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

yes, for some reason the CI only complained about an unused import in this PR. Maybe the warning wasn't causing any CI to fail. But the warning is real

Copy link

@joncinque joncinque Nov 22, 2024

Choose a reason for hiding this comment

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

Gotcha, makes sense -- it's unused in target_os = "solana", so if you run ./cargo-build-sbf --manifest-path sdk/transaction-error/Cargo.toml, you'll see that error warning. I'll put in a separate PR for that if that's ok

Choose a reason for hiding this comment

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

#3742 fixes that and another thing

joncinque
joncinque previously approved these changes Nov 22, 2024
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! @yihau can you accept solana-message?

joncinque
joncinque previously approved these changes Nov 25, 2024
@joncinque joncinque added the automerge automerge Merge this Pull Request automatically once CI passes label Nov 25, 2024
Copy link

mergify bot commented Nov 25, 2024

automerge label removed due to a CI failure

@mergify mergify bot removed the automerge automerge Merge this Pull Request automatically once CI passes label Nov 25, 2024
@kevinheavey kevinheavey force-pushed the extract-message-crate branch from 0d038f7 to 3d09ffb Compare November 25, 2024 17:37
@kevinheavey kevinheavey added the automerge automerge Merge this Pull Request automatically once CI passes label Nov 25, 2024
Copy link

mergify bot commented Nov 25, 2024

automerge label removed due to a CI failure

@mergify mergify bot removed the automerge automerge Merge this Pull Request automatically once CI passes label Nov 25, 2024
@joncinque
Copy link

Sorry, can you rebase once more to pick up #3774 ?

@kevinheavey kevinheavey force-pushed the extract-message-crate branch from 3d09ffb to ace0bf6 Compare November 25, 2024 18:36
@joncinque joncinque added the automerge automerge Merge this Pull Request automatically once CI passes label Nov 25, 2024
Copy link

mergify bot commented Nov 25, 2024

automerge label removed due to a CI failure

@mergify mergify bot removed the automerge automerge Merge this Pull Request automatically once CI passes label Nov 25, 2024
@kevinheavey
Copy link
Author

Need to figure out some doctest dependency issues

@joncinque
Copy link

Need to figure out some doctest dependency issues

There's another issue with the cargo build-sbf tests -- since they're using a local solana-program without patching the deps for solana-system-interface, the build pulls in two versions of solana-pubkey / solana-instruction / solana-decode-error. I can push up a fix for this if you like

@kevinheavey
Copy link
Author

Oh yes please, maybe that's it

@kevinheavey kevinheavey force-pushed the extract-message-crate branch from d1ba18e to 6dd02ce Compare December 2, 2024 20:20
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 for the quick rebase!

@joncinque joncinque merged commit 773e32c into anza-xyz:master Dec 2, 2024
52 checks passed
@kevinheavey kevinheavey deleted the extract-message-crate branch December 3, 2024 00:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants