Skip to content

Conversation

@jonasXchen
Copy link
Contributor

@jonasXchen jonasXchen commented Nov 23, 2025

Problem

SDK triggers error "unresolved import" when building.

Solution

Set feature flag "sdk" for optional import

Summary by CodeRabbit

  • New Features
    • Added serialization library to the public API when the SDK feature is disabled.

✏️ Tip: You can customize this high-level summary in your review settings.

@jonasXchen jonasXchen requested a review from snawaz November 23, 2025 06:35
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 23, 2025

Walkthrough

A conditional public re-export of the rkyv crate is added to the library's public API. This export is only available when the "sdk" feature flag is not enabled. No logic or control flow changes are introduced.

Changes

Cohort / File(s) Change Summary
Feature-gated public re-export
src/lib.rs
Added conditional public re-export: pub use rkyv; guarded by #[cfg(not(feature = "sdk"))] to expose rkyv when the "sdk" feature is disabled

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the main change: fixing an unresolved import issue in the SDK by conditionally re-exporting rkyv based on a feature flag.
Description check ✅ Passed The description covers the essential problem and solution but is minimal and lacks detail compared to the template structure.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch jonasXchen/rkyv-import

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5d14415 and 59f72ef.

📒 Files selected for processing (1)
  • src/lib.rs (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-10-15T11:45:25.802Z
Learnt from: snawaz
Repo: magicblock-labs/delegation-program PR: 107
File: src/entrypoint.rs:141-144
Timestamp: 2025-10-15T11:45:25.802Z
Learning: In the delegation-program codebase, prefer using `log!` (from pinocchio_log) over `msg!` for error and panic scenarios in the entrypoint code, as per maintainer preference.

Applied to files:

  • src/lib.rs
🔇 Additional comments (1)
src/lib.rs (1)

46-47: ```shell
#!/bin/bash

Description: Verify feature flag logic - check if diff module is conditionally compiled

echo "=== Checking if diff module is feature-gated ==="
rg -n 'cfg.*feature.*sdk' src/lib.rs

echo -e "\n=== Checking module declarations in lib.rs ==="
rg -n -A 1 'mod diff' src/lib.rs

echo -e "\n=== Checking state module contents ==="
ls -la src/state/


</blockquote></details>

</blockquote></details>

</details>

<!-- tips_start -->

---

Thanks for using [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=magicblock-labs/delegation-program&utm_content=120)! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

<details>
<summary>❤️ Share</summary>

- [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai)
- [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai)
- [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai)
- [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)

</details>

<sub>Comment `@coderabbitai help` to get the list of available commands and usage tips.</sub>

<!-- tips_end -->

<!-- internal state start -->


<!-- DwQgtGAEAqAWCWBnSTIEMB26CuAXA9mAOYCmGJATmriQCaQDG+Ats2bgFyQAOFk+AIwBWJBrngA3EsgEBPRvlqU0AgfFwA6NPEgQAfACgjoCEYDEZyAAUASpETZWaCrI5Go0dQBsSXAGbwAB5c2BgU0vheUvTwzNz4FLgoWIi0ANaQkAZQAHKOApRcAIwATAAMmdmQAKo2ADJcsLi43IgcAPTtROqw2AIaTMztzGjdDAJe+AxpYF4qiO1KPkTU8PgYYLz4RFRD3NheXu2lFVlQ1YiFkELraIgAGgywZJVQAMr42BQMJJACVBgnlwbhg7o9nhh2hQ0rIJGBYvFEpBAEmEMGcpCS/0wQMgI3gWDOkDeuGo2Da/G4L0JAGFwtQ6OhOJByiUAKxgIpFMAlADM0DKADYODzWRwiqyAFpGAAi0gYFHg3HE60gAAo/BQWNYbABKNxQKyaiYkZhcN7SgDSkFwCqIpAoyEwkAARKFwohItEUHEErhnZBKJq+AB3CF/bDwLy0fFEDRVD5ePBrDBmkhJPwkUnhSB+OZEF2pNL+vwJdBYfBK5NoLzexGadxgQwGExQMj0fB+HAEYhkZQ0eiDNgYJm8fjCUTiKQyeRMJRUVTqLQ6fTN8AeBDIVBOtB4QikchUfsKVjsLhUYP2RwjFx/GeKZQLzTaXSNoyr0wGRDfdpeeD9B1uM6QEGBYkAAIIAJI9ge9L0A4Tg3h2jCwJgpCIEYEHDpqtDYD8jqQOQF5MBg0bKqCNb7BM8AMJA4RgCQgR1iEJGUNazyMH4RCqhg+C4Oqma4F8vwALwFukzo6jqAA0PB9JAZK/NCsIANwwBu6C0LQyBKRI1r4GxvyUb+NFgVYEGQKGLy4OxzqFsWAlCSgyA8UkZAqD4tAaJAOT6bxzx8JMYwyYGpYoSRv4YEQMmlsRNqRDmkxEWFaFxm+UAALJprAigaUotBcAABpR8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pKmKDae+Zs5d1GMku5wtsH5PwRgohJSjkhJ8jmUIYhkzIBLB1aR7FuGRQZAEHwbD9LQ2rNdGgkBaDQptAIpgCLSBeTeGkRU3ABHMoYDCtldTlCkFQdMXZ7yDmJmxS6AAmp8RgToD5YAKgAAUhvOJmz59x9gqSy2FAM9K1k1FIJlBrhUcpIJK7JljrEhNsRQexkUslxM+f4rwPzgnDwtTPCJUDIkVwmt/O4ecbCpOqbK50RQRQCgACw8joKyEgcaTZoHVn4cUAgZY8nTX4Eo9sBR+FZLQONMsBAlAFCQEUca43FpIGbGWms7Yq3VnLdWJQGAyw1kUBgrrnQ/zDcgv5hCyhoBKNtLWZQijq31smtA3b1bWz8GUbt47eRlDNjyONrJ+p+B5LQA2PIZZxobYbWgAoCg8gYOrHkA8ygkBTWgftAqhWRXhaKkgmEaBOurMSekjc46BsDQHXgJBg6UDDgkj2ft9BAA= -->

<!-- internal state end -->

@GabrielePicco GabrielePicco merged commit c891abb into main Nov 24, 2025
4 checks passed
@GabrielePicco GabrielePicco deleted the jonasXchen/rkyv-import branch November 24, 2025 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants