Skip to content

Extract message crate#3704

Merged
joncinque merged 32 commits into
anza-xyz:masterfrom
kevinheavey:extract-message-crate
Dec 2, 2024
Merged

Extract message crate#3704
joncinque merged 32 commits into
anza-xyz:masterfrom
kevinheavey:extract-message-crate

Conversation

@kevinheavey
Copy link
Copy Markdown

@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
Copy Markdown

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

Comment thread sdk/message/src/legacy.rs
Comment thread sdk/message/src/sanitized.rs
Comment thread sdk/message/src/versions/v0/loaded.rs
Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown

@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

Copy link
Copy Markdown

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
Copy Markdown

@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
@mergify
Copy link
Copy Markdown

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
@mergify
Copy link
Copy Markdown

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
Copy Markdown

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
@mergify
Copy link
Copy Markdown

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
Copy Markdown
Author

Need to figure out some doctest dependency issues

@joncinque
Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown

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

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants