Skip to content

Conversation

@LesnyRumcajs
Copy link
Member

@LesnyRumcajs LesnyRumcajs commented Feb 3, 2026

Summary of changes

Changes introduced in this pull request:

  • simplify some code with itertools::collect_vec

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.

Outside contributions

  • I have read and agree to the CONTRIBUTING document.
  • I have read and agree to the AI Policy document. I understand that failure to comply with the guidelines will lead to rejection of the pull request.

Summary by CodeRabbit

  • Refactor

    • Standardized collection calls across the codebase for more concise, consistent code. No functional or user-facing behavior changes.
  • Tests

    • Updated test collection patterns to match the refactor; test semantics and assertions remain unchanged.

@LesnyRumcajs LesnyRumcajs requested a review from a team as a code owner February 3, 2026 12:57
@LesnyRumcajs LesnyRumcajs requested review from hanabi1224 and sudo-shashank and removed request for a team February 3, 2026 12:57
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 3, 2026

Walkthrough

Replaces many uses of collect::<Vec<_>>() with itertools::Itertools::collect_vec() across multiple source and test files, adding underscore imports for Itertools where needed. No functional or public API changes.

Changes

Cohort / File(s) Summary
Blocks & Tipsets
src/blocks/chain4u.rs, src/blocks/tipset.rs
Swapped collect::<Vec<_>>() for collect_vec() when building sibling lists and tipset key Cid lists; stylistic only.
Chain Sync & Tracker
src/chain_sync/chain_follower.rs, src/chain_sync/tipset_syncer.rs, src/chain/store/tipset_tracker.rs
Test and error-message collection calls changed to collect_vec(); added Itertools imports in test scopes.
CLI & Commands
src/cli/humantoken.rs, src/cli/subcommands/mpool_cmd.rs, src/cli_shared/cli/completion_cmd.rs
Introduced Itertools import and replaced Vec collection with collect_vec() in command logic/tests.
RPC / API
src/rpc/filter_list.rs, src/rpc/methods/chain.rs, src/rpc/methods/eth.rs, src/rpc/methods/gas.rs, src/rpc/types/tests.rs, src/rpc/types/tsk_impl.rs
Replaced terminal .collect() usages with collect_vec() in handlers, conversions, and tests; Itertools trait imports added where required.
Database & Storage
src/db/parity_db.rs, src/shim/machine/manifest.rs
Test and serialization collections switched to collect_vec(); no behavior change.
Actors / JSON params
src/lotus_json/actors/params/miner_params.rs
Multiple collect::<Vec<_>>()collect_vec() replacements in miner param conversions; added Itertools import.
Message Pool & Network
src/message_pool/msgpool/msg_pool.rs, src/networks/actors_bundle.rs
Local message and flattened block collections now use collect_vec(); semantics unchanged.
State diff & Tools
src/statediff/mod.rs, src/tool/subcommands/archive_cmd.rs, src/tool/subcommands/backup_cmd.rs, src/tool/subcommands/shed_cmd.rs
Various test and diff collection sites updated to collect_vec() with Itertools imports; purely stylistic.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • sudo-shashank
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the primary change: replacing collect::<Vec<_>>() calls with itertools::collect_vec() across multiple files in the codebase.
Docstring Coverage ✅ Passed Docstring coverage is 80.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 collect-vec

Important

Action Needed: IP Allowlist Update

If your organization protects your Git platform with IP whitelisting, please add the new CodeRabbit IP address to your allowlist:

  • 136.113.208.247/32 (new)
  • 34.170.211.100/32
  • 35.222.179.152/32

Failure to add the new IP will result in interrupted reviews.


Comment @coderabbitai help to get the list of available commands and usage tips.

hanabi1224
hanabi1224 previously approved these changes Feb 3, 2026
@codecov
Copy link

codecov bot commented Feb 3, 2026

Codecov Report

❌ Patch coverage is 73.33333% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 63.32%. Comparing base (50b9326) to head (9cccfab).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
src/statediff/mod.rs 0.00% 2 Missing ⚠️
src/blocks/tipset.rs 50.00% 1 Missing ⚠️
src/chain_sync/tipset_syncer.rs 0.00% 1 Missing ⚠️
src/message_pool/msgpool/msg_pool.rs 0.00% 0 Missing and 1 partial ⚠️
src/rpc/methods/gas.rs 0.00% 0 Missing and 1 partial ⚠️
src/rpc/types/tsk_impl.rs 0.00% 1 Missing ⚠️
src/tool/subcommands/shed_cmd.rs 50.00% 1 Missing ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
src/blocks/chain4u.rs 92.54% <100.00%> (-0.08%) ⬇️
src/chain/store/tipset_tracker.rs 66.26% <100.00%> (-1.92%) ⬇️
src/chain_sync/chain_follower.rs 39.66% <100.00%> (ø)
src/cli/humantoken.rs 99.32% <100.00%> (ø)
src/cli/subcommands/mpool_cmd.rs 67.63% <100.00%> (ø)
src/cli_shared/cli/completion_cmd.rs 100.00% <100.00%> (ø)
src/db/parity_db.rs 67.81% <100.00%> (ø)
src/lotus_json/actors/params/miner_params.rs 75.66% <100.00%> (ø)
src/networks/actors_bundle.rs 90.17% <100.00%> (ø)
src/rpc/filter_list.rs 97.43% <100.00%> (ø)
... and 12 more

... and 9 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 50b9326...9cccfab. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@LesnyRumcajs LesnyRumcajs added this pull request to the merge queue Feb 3, 2026
Merged via the queue into main with commit 9d73408 Feb 3, 2026
34 checks passed
@LesnyRumcajs LesnyRumcajs deleted the collect-vec branch February 3, 2026 19:13
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