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

Open
wants to merge 30 commits into
base: master
Choose a base branch
from

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)

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

@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

@joncinque
Copy link

I think we're looking good! Tagged @febo for an approval since I can't merge it 🙃

febo
febo previously approved these changes Nov 25, 2024
Copy link

@febo febo 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! There are some CI tasks failing.

@joncinque
Copy link

Looks like there's a missing dependency on wasm-bindgen. But even after fixing that, there's multiply defined symbols for the system instructions between solana-system-interface and sdk/program/src/system_instruction.rs -- we'll need to remove those first and change solana-program to re-export all of those.

@febo
Copy link

febo commented Nov 25, 2024

Looks like there's a missing dependency on wasm-bindgen. But even after fixing that, there's multiply defined symbols for the system instructions between solana-system-interface and sdk/program/src/system_instruction.rs -- we'll need to remove those first and change solana-program to re-export all of those.

Would you like me do have a look at it?

@joncinque
Copy link

Would you like me do have a look at it?

Yes please that'd be great, whenever you have a moment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

3 participants