Skip to content

chore: remove serde_tuple in favor of fvm_ipld_encoding::tuple#5906

Merged
hanabi1224 merged 1 commit into
mainfrom
hm/no-serde-tuple
Aug 6, 2025
Merged

chore: remove serde_tuple in favor of fvm_ipld_encoding::tuple#5906
hanabi1224 merged 1 commit into
mainfrom
hm/no-serde-tuple

Conversation

@hanabi1224
Copy link
Copy Markdown
Contributor

@hanabi1224 hanabi1224 commented Aug 6, 2025

Summary of changes

This PR removes serde_tuple from deps in favor of fvm_ipld_encoding::tuple which is a re-export of serde_tuple

Changes introduced in this pull request:

Reference issue to close (if applicable)

Closes

Other information and links

Change checklist

  • I have performed a self-review of my own code,
  • I have made corresponding changes to the documentation. All new code adheres to the team's documentation standards,
  • I have added tests that prove my fix is effective or that my feature works (if possible),
  • I have made sure the CHANGELOG is up-to-date. All user-facing changes should be reflected in this document.

Summary by CodeRabbit

  • Chores
    • Updated serialization and deserialization imports throughout the codebase to use a unified internal library, replacing the previous external dependency.
    • Removed an unused dependency from the project configuration.
  • Documentation
    • Clarified documentation to reference the new serialization helper library.

@hanabi1224 hanabi1224 marked this pull request as ready for review August 6, 2025 13:20
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Aug 6, 2025

Walkthrough

This change removes the serde_tuple dependency from the project and updates all relevant imports to use tuple serialization and deserialization macros from the fvm_ipld_encoding::tuple module instead. The modifications are limited to import statements and documentation, with no changes to logic or public APIs.

Changes

Cohort / File(s) Change Summary
Dependency Removal
Cargo.toml
Removes the serde_tuple dependency from the project dependencies.
Tuple Macro Import Updates
src/beacon/beacon_entries.rs, src/blocks/block.rs, src/blocks/election_proof.rs, src/blocks/gossip_block.rs, src/blocks/header.rs, src/blocks/ticket.rs, src/cli/subcommands/state_cmd.rs, src/libp2p/chain_exchange/message.rs, src/libp2p/hello/message.rs, src/message/signed_message.rs, src/rpc/methods/f3/types.rs, src/rpc/methods/miner.rs, src/shim/actors/builtin/verifreg/mod.rs
Replaces imports of serde_tuple::{Deserialize_tuple, Serialize_tuple} with fvm_ipld_encoding::tuple::* for tuple serialization/deserialization derives. No logic or API changes.
Documentation Update
src/lotus_json/mod.rs
Updates documentation comments to reference fvm_ipld_encoding::tuple::Serialize_tuple instead of serde_tuple.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~7 minutes

Suggested labels

dependencies, rust

Suggested reviewers

  • elmattic
  • LesnyRumcajs

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch hm/no-serde-tuple

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@hanabi1224 hanabi1224 requested a review from a team as a code owner August 6, 2025 13:20
@hanabi1224 hanabi1224 requested review from LesnyRumcajs and sudo-shashank and removed request for a team August 6, 2025 13:20
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

♻️ Duplicate comments (4)
src/message/signed_message.rs (1)

13-13: Same wildcard-import concern as noted in verifreg/mod.rs – consider switching to an explicit list.

src/blocks/header.rs (1)

22-22: Wildcard import can be narrowed

Please see the earlier comment on using explicit imports for Serialize_tuple/Deserialize_tuple.

src/cli/subcommands/state_cmd.rs (1)

12-12: Wildcard import can be narrowed

Same note on replacing tuple::* with the two concrete derive macros.

src/libp2p/hello/message.rs (1)

7-7: Wildcard import can be narrowed

See initial comment – import only the derive macros needed.

🧹 Nitpick comments (6)
src/rpc/methods/miner.rs (1)

34-34: Prefer explicit macro imports over wildcard for clarity

Using a wildcard (*) pulls every symbol from tuple into scope, which can obscure where individual macros originate and may accidentally shadow similarly-named items in the future. Import only what the file actually needs — here, just Serialize_tuple.

-use fvm_ipld_encoding::tuple::*;
+use fvm_ipld_encoding::tuple::Serialize_tuple;
src/blocks/gossip_block.rs (1)

5-5: Limit tuple macro import set

Only the derive macros are required; bring them in explicitly to improve readability and avoid namespace clutter.

-use fvm_ipld_encoding::tuple::*;
+use fvm_ipld_encoding::tuple::{Serialize_tuple, Deserialize_tuple};
src/blocks/block.rs (1)

8-8: Narrow tuple macro import

Same rationale as above – import just the two derive macros actually used in this module.

-use fvm_ipld_encoding::tuple::*;
+use fvm_ipld_encoding::tuple::{Serialize_tuple, Deserialize_tuple};
src/blocks/ticket.rs (1)

5-5: Replace wildcard with specific derives

Keep the import surface minimal; only Serialize_tuple and Deserialize_tuple are necessary here.

-use fvm_ipld_encoding::tuple::*;
+use fvm_ipld_encoding::tuple::{Serialize_tuple, Deserialize_tuple};
src/rpc/methods/f3/types.rs (1)

16-16: Restrict tuple macro glob import

For consistency with other modules and to avoid bringing in unused items, replace the wildcard with the explicit derive macros consumed below.

-use fvm_ipld_encoding::tuple::*;
+use fvm_ipld_encoding::tuple::{Serialize_tuple, Deserialize_tuple};
src/shim/actors/builtin/verifreg/mod.rs (1)

17-17: Prefer explicit tuple macro imports over a wildcard

use fvm_ipld_encoding::tuple::*; brings every item in the tuple module into scope.
Given only the derive macros are required (Serialize_tuple, Deserialize_tuple), an explicit list keeps the namespace clean and prevents accidental collisions as the dependency evolves.

-use fvm_ipld_encoding::tuple::*;
+use fvm_ipld_encoding::tuple::{Deserialize_tuple, Serialize_tuple};
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0874cee and 365a0ae.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (15)
  • Cargo.toml (0 hunks)
  • src/beacon/beacon_entries.rs (1 hunks)
  • src/blocks/block.rs (1 hunks)
  • src/blocks/election_proof.rs (1 hunks)
  • src/blocks/gossip_block.rs (1 hunks)
  • src/blocks/header.rs (1 hunks)
  • src/blocks/ticket.rs (1 hunks)
  • src/cli/subcommands/state_cmd.rs (1 hunks)
  • src/libp2p/chain_exchange/message.rs (1 hunks)
  • src/libp2p/hello/message.rs (1 hunks)
  • src/lotus_json/mod.rs (1 hunks)
  • src/message/signed_message.rs (1 hunks)
  • src/rpc/methods/f3/types.rs (1 hunks)
  • src/rpc/methods/miner.rs (1 hunks)
  • src/shim/actors/builtin/verifreg/mod.rs (1 hunks)
💤 Files with no reviewable changes (1)
  • Cargo.toml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
  • GitHub Check: Build forest binaries on Linux AMD64
  • GitHub Check: tests
  • GitHub Check: tests-release
  • GitHub Check: cargo-publish-dry-run
  • GitHub Check: Build MacOS
  • GitHub Check: Build Ubuntu
  • GitHub Check: All lint checks
  • GitHub Check: Analyze (rust)
  • GitHub Check: Analyze (go)
🔇 Additional comments (4)
src/beacon/beacon_entries.rs (1)

7-7: LGTM - Clean dependency replacement

The import change from serde_tuple to fvm_ipld_encoding::tuple::* is correct and maintains functional equivalency while removing the external dependency.

src/libp2p/chain_exchange/message.rs (1)

10-10: LGTM - Consistent dependency migration

The import replacement follows the same pattern as other files in this PR, switching from serde_tuple to the re-exported fvm_ipld_encoding::tuple functionality.

src/lotus_json/mod.rs (1)

58-58: LGTM - Documentation updated to reflect new import path

The documentation correctly updates the example to use fvm_ipld_encoding::tuple::Serialize_tuple instead of the old serde_tuple::Serialize_tuple, maintaining consistency with the codebase changes.

src/blocks/election_proof.rs (1)

7-7: LGTM - Completes the consistent dependency migration

The import change aligns with the broader refactoring effort to replace serde_tuple with fvm_ipld_encoding::tuple across the codebase, maintaining functional equivalency.

@hanabi1224 hanabi1224 added this pull request to the merge queue Aug 6, 2025
Merged via the queue into main with commit 97354db Aug 6, 2025
48 checks passed
@hanabi1224 hanabi1224 deleted the hm/no-serde-tuple branch August 6, 2025 14:43
@coderabbitai coderabbitai Bot mentioned this pull request Oct 8, 2025
4 tasks
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