Skip to content

Conversation

@hanabi1224
Copy link
Contributor

@hanabi1224 hanabi1224 commented Nov 19, 2025

Summary of changes

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

  • Refactor
    • Optimized internal memory handling patterns and reduced unnecessary operations throughout the chain synchronization, state management, and validation layers for improved efficiency. No changes to user-facing functionality.

@hanabi1224 hanabi1224 changed the title fix: refine Arc params to reduce point cloning fix: refine Arc params to reduce pointer cloning Nov 19, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 19, 2025

Walkthrough

A comprehensive refactoring systematically replacing owned Arc<T> parameters with borrowed &Arc<T> references across the codebase. Simplifies StateManager method receivers from self: &Arc<Self> to &self. Updates internal callers and return types accordingly, eliminating unnecessary Arc clones while preserving functional behavior.

Changes

Cohort / File(s) Change Summary
Chain Store API
src/chain/store/chain_store.rs
Changed get_lookback_tipset_for_round, messages_for_tipset_with_cache, and messages_for_tipset function signatures to accept borrowed Arc references (&Arc<...>) instead of owned values; updated internal cloning patterns to accommodate borrowed parameters.
Chain Sync Validation & Status
src/chain_sync/chain_follower.rs, src/chain_sync/sync_status.rs, src/chain_sync/tipset_syncer.rs
Updated validate_tipset to accept &Arc<StateManager<DB>> instead of owned Arc; changed SyncStatus::update to take &StateManager<DB> directly; refactored async validation tasks in TipsetSyncer to use borrowed references and moved values in spawned tasks; updated check_block_messages to use blockstore() instead of blockstore_owned().
Consensus Validation
src/fil_cns/validation.rs
Reworked async validation spawn blocks to use borrowed references for state and tipset data; updated get_lookback_tipset_for_round calls to pass borrowed chain index, chain config, and tipset references; adjusted validation helper calls to take borrowed state/tipset references.
FVM Interpreter Chain Lookups
src/interpreter/fvm2.rs, src/interpreter/fvm3.rs, src/interpreter/fvm4.rs
Updated all calls to ChainStore::get_lookback_tipset_for_round to pass borrowed Arc references (&self.chain_index, &self.chain_config, &self.heaviest_tipset) instead of cloned values.
StateManager Core API
src/state_manager/mod.rs, src/state_manager/circulating_supply.rs
Changed method receivers from self: &Arc<Self> to &self in get_all_sectors, call_raw, call, search_for_message, validate_range, and validate_tipsets; updated resolve_to_deterministic_address parameter from ts: Arc<Tipset> to ts: &Arc<Tipset>; adjusted internal call sites to pass borrowed tipset references.
RPC Service & Methods
src/rpc/mod.rs, src/rpc/methods/state.rs, src/rpc/methods/gas.rs, src/rpc/methods/miner.rs, src/rpc/methods/eth/filter/mod.rs, src/rpc/methods/f3.rs, src/rpc/methods/wallet.rs
Changed RPCState::store() return type from &DB to &Arc<DB>; updated StateCall::run to accept &StateManager<DB> instead of &Arc<StateManager<DB>>; refactored RPC method calls to pass tipset and store references instead of clones/owned values.
Libp2p Network Service
src/libp2p/service.rs
Updated handler parameter types in handle_network_message, handle_forest_behaviour_event, and handle_chain_exchange_event from &Arc<PeerManager> to &PeerManager.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~40 minutes

  • Large number of affected files (15+): Systematic refactoring across multiple modules requires verifying consistency across the codebase.
  • Homogeneous change pattern: The same refactoring pattern (Arc parameter borrowing) is repeated throughout, reducing per-file cognitive load.
  • StateManager receiver changes: Shifting from self: &Arc<Self> to &self requires careful verification that internal clone() operations still function correctly and that no lifetime conflicts arise.
  • Return type changes: The RPCState::store() return type change from &DB to &Arc<DB> propagates through call sites; verify all callers handle the Arc wrapper appropriately.
  • Database handle passing: Multiple changes between blockstore(), blockstore_owned(), and borrowed Arc references need validation across async boundaries and spawned tasks.

Possibly related PRs

Suggested reviewers

  • akaladarshi
  • LesnyRumcajs

Pre-merge checks and finishing touches

✅ 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 'fix: refine Arc params to reduce pointer cloning' directly and clearly describes the main objective of the changeset, which is to optimize Arc parameter passing throughout multiple modules to reduce unnecessary cloning.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ 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 hm/refine-arc-params

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

@hanabi1224 hanabi1224 marked this pull request as ready for review November 19, 2025 19:01
@hanabi1224 hanabi1224 requested a review from a team as a code owner November 19, 2025 19:01
@hanabi1224 hanabi1224 requested review from LesnyRumcajs and removed request for a team November 19, 2025 19:01
Copy link
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

🧹 Nitpick comments (4)
src/state_manager/circulating_supply.rs (1)

151-159: Simplifying market::State::load argument removes an unnecessary reference

Passing db (a &Arc<DB>) instead of &db avoids a &&Arc<DB> and better matches how similar loaders are typically called, with no behavioral change.

You might also consider updating the adjacent miner::State::load(&db, ..) and multisig::State::load(&db, ..) calls to use db directly for consistency, though this is purely cosmetic.

src/chain_sync/tipset_syncer.rs (1)

225-331: Async/blocking validation split is sensible; consider grouping state-dependent tasks if contention shows up

Moving base-fee and parent-weight checks into spawn_blocking with owned Arc blockstore, and keeping state-root/receipt-root and consensus checks in async tasks, is a reasonable separation: CPU/blockstore-heavy, synchronous code runs off the core runtime, and async pieces reuse the existing tipset_state pipeline. Everything captured into the tasks (Arc<StateManager<_>>, Arc<Block>, Arc<Tipset>, work_addr) is Send + 'static, so JoinSet usage remains sound.

If you ever see excessive contention in these per-block validations, you could explore reusing a single cloned blockstore for both blocking closures or batching the "parent-dependent" checks (base fee, weight, state/receipt roots) into one blocking job to reduce task orchestration overhead, but that’s an optional micro-optimization.

src/state_manager/mod.rs (2)

470-508: Nice early-return via try_lookup_state_from_next_tipset

Integrating self.try_lookup_state_from_next_tipset(tipset) into tipset_state_output gives a cheap, blockstore-backed fast path before kicking off a full VM state computation. The method call via &Arc<Self> auto-deref is fine, and the logic still populates caches and indexes only when the state actually has to be computed.

If this optimization proves valuable, you might consider instrumenting a metric (hit/miss rate) here to validate its impact in production, but that’s optional and can be added later.


1658-1681: Borrowed-tipset resolve_to_deterministic_address wiring is sound

Changing resolve_to_deterministic_address to take ts: &Arc<Tipset> and updating miner_get_base_info to call it with &tipset keeps all uses on Arc<Tipset> while avoiding extra cloning. The fast path (parent-state StateTree) and slow path (tipset_state(ts) then building a new StateTree) still implement the same resolution semantics.

You could consider sharing the deterministic-address resolution logic with resolve_to_key_addr to reduce duplication, but that’s a style refactor, not required.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 06e744d and ac98ef5.

📒 Files selected for processing (18)
  • src/chain/store/chain_store.rs (3 hunks)
  • src/chain_sync/chain_follower.rs (1 hunks)
  • src/chain_sync/sync_status.rs (1 hunks)
  • src/chain_sync/tipset_syncer.rs (4 hunks)
  • src/fil_cns/validation.rs (2 hunks)
  • src/interpreter/fvm2.rs (1 hunks)
  • src/interpreter/fvm3.rs (1 hunks)
  • src/interpreter/fvm4.rs (1 hunks)
  • src/libp2p/service.rs (2 hunks)
  • src/rpc/methods/eth/filter/mod.rs (1 hunks)
  • src/rpc/methods/f3.rs (1 hunks)
  • src/rpc/methods/gas.rs (1 hunks)
  • src/rpc/methods/miner.rs (1 hunks)
  • src/rpc/methods/state.rs (2 hunks)
  • src/rpc/methods/wallet.rs (1 hunks)
  • src/rpc/mod.rs (1 hunks)
  • src/state_manager/circulating_supply.rs (1 hunks)
  • src/state_manager/mod.rs (13 hunks)
🧰 Additional context used
🧠 Learnings (5)
📓 Common learnings
Learnt from: hanabi1224
Repo: ChainSafe/forest PR: 5930
File: build.rs:64-77
Timestamp: 2025-08-13T09:43:20.301Z
Learning: hanabi1224 prefers hard compile-time errors in build scripts rather than runtime safeguards or collision detection, believing it's better to fail fast and fix root causes of issues like malformed snapshot names.
Learnt from: hanabi1224
Repo: ChainSafe/forest PR: 6057
File: src/cli/subcommands/f3_cmd.rs:0-0
Timestamp: 2025-09-09T10:37:17.947Z
Learning: hanabi1224 prefers having default timeouts (like 10m for --no-progress-timeout) to prevent commands from hanging indefinitely, even when the timeout flag isn't explicitly provided by users. This fail-fast approach is preferred over requiring explicit flag usage.
📚 Learning: 2025-10-17T14:24:47.046Z
Learnt from: hanabi1224
Repo: ChainSafe/forest PR: 6167
File: src/tool/subcommands/state_compute_cmd.rs:89-91
Timestamp: 2025-10-17T14:24:47.046Z
Learning: In `src/tool/subcommands/state_compute_cmd.rs`, when using `ReadOpsTrackingStore` to generate minimal snapshots, `HEAD_KEY` should be written to `db.tracker` (not `db` itself) before calling `export_forest_car()`, because the export reads from the tracker MemoryDB which accumulates only the accessed data during computation.

Applied to files:

  • src/rpc/mod.rs
  • src/state_manager/circulating_supply.rs
  • src/interpreter/fvm4.rs
  • src/chain/store/chain_store.rs
📚 Learning: 2025-09-02T10:05:34.350Z
Learnt from: akaladarshi
Repo: ChainSafe/forest PR: 5923
File: src/rpc/registry/actors/miner.rs:221-223
Timestamp: 2025-09-02T10:05:34.350Z
Learning: For miner actor ChangeOwnerAddress and ChangeOwnerAddressExported methods: versions 8-10 use bare Address as parameter type, while versions 11+ use ChangeOwnerAddressParams. This reflects the evolution of the Filecoin miner actor parameter structures across versions.

Applied to files:

  • src/rpc/methods/eth/filter/mod.rs
  • src/rpc/methods/miner.rs
📚 Learning: 2025-08-18T03:09:47.932Z
Learnt from: hanabi1224
Repo: ChainSafe/forest PR: 5944
File: src/chain/store/index.rs:0-0
Timestamp: 2025-08-18T03:09:47.932Z
Learning: In Forest's tipset_by_height caching implementation, hanabi1224 prefers performance-conscious solutions that leverage finality guarantees rather than expensive chain walking for fork detection. The approach of constraining cache lookups to finalized epochs (using CHECKPOINT_INTERVAL >= CHAIN_FINALITY) provides fork safety without the performance cost of ancestry verification.

Applied to files:

  • src/interpreter/fvm4.rs
  • src/interpreter/fvm3.rs
  • src/interpreter/fvm2.rs
📚 Learning: 2025-08-08T12:11:55.266Z
Learnt from: hanabi1224
Repo: ChainSafe/forest PR: 5867
File: src/ipld/util.rs:461-487
Timestamp: 2025-08-08T12:11:55.266Z
Learning: Forest (src/ipld/util.rs, Rust): In UnorderedChainStream::poll_next, dropping `extract_sender` (when no more tipsets and the extract queue is empty) is the intended shutdown signal for workers. Any subsequent attempt to enqueue work after this drop is a logic error and should be treated as an error; do not change `send()` to ignore a missing sender.

Applied to files:

  • src/interpreter/fvm3.rs
  • src/interpreter/fvm2.rs
  • src/chain_sync/chain_follower.rs
🧬 Code graph analysis (8)
src/rpc/methods/eth/filter/mod.rs (1)
src/blocks/chain4u.rs (1)
  • tipset (183-185)
src/rpc/methods/gas.rs (1)
src/chain/store/chain_store.rs (1)
  • messages_for_tipset_with_cache (618-632)
src/chain_sync/tipset_syncer.rs (4)
src/chain/store/base_fee.rs (1)
  • compute_base_fee (59-98)
src/fil_cns/mod.rs (1)
  • weight (91-96)
src/fil_cns/weight.rs (1)
  • fil_cns (23-57)
src/state_manager/mod.rs (1)
  • get_bls_public_key (1265-1282)
src/libp2p/service.rs (1)
src/chain_sync/network_context.rs (1)
  • peer_manager (134-136)
src/fil_cns/validation.rs (4)
src/state_manager/mod.rs (3)
  • chain_store (348-350)
  • beacon_schedule (291-293)
  • chain_config (358-360)
src/utils/misc/env.rs (1)
  • is_env_truthy (17-19)
src/blocks/block.rs (1)
  • header (30-32)
src/chain/store/chain_store.rs (1)
  • chain_config (252-254)
src/rpc/methods/f3.rs (1)
src/shim/actors/builtin/miner/mod.rs (1)
  • worker (896-898)
src/chain/store/chain_store.rs (3)
src/state_manager/mod.rs (4)
  • chain_index (353-355)
  • chain_config (358-360)
  • heaviest_tipset (208-210)
  • new (180-182)
src/interpreter/fvm2.rs (1)
  • new (44-61)
src/shim/state_tree.rs (1)
  • new_from_tipset (190-192)
src/state_manager/mod.rs (1)
src/shim/actors/builtin/miner/mod.rs (1)
  • info (84-97)
⏰ 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). (7)
  • GitHub Check: Build forest binaries on Linux AMD64
  • GitHub Check: tests
  • GitHub Check: tests-release
  • GitHub Check: All lint checks
  • GitHub Check: cargo-publish-dry-run
  • GitHub Check: Build MacOS
  • GitHub Check: Build Ubuntu
🔇 Additional comments (28)
src/rpc/methods/f3.rs (1)

449-452: Using borrowed tipset here correctly matches the new resolve_to_deterministic_address API

ts is already a &Arc<Tipset>, so passing it directly avoids an unnecessary Arc clone while staying compatible with the updated resolve_to_deterministic_address signature.

src/libp2p/service.rs (2)

439-446: Switching handle_network_message to &PeerManager is type‑safe and avoids Arc noise

Callers now pass &self.peer_manager (an Arc<PeerManager> field), which deref‑coerces to &PeerManager, so this removes an extra Arc layer in the signature without changing behavior.


865-870: Borrowing PeerManager in handle_forest_behaviour_event is consistent with new call sites

Accepting peer_manager: &PeerManager aligns with the updated run loop usage (&self.peer_manager) and keeps the handler free of unnecessary Arc cloning.

src/rpc/methods/wallet.rs (1)

250-255: WalletSignMessage now correctly borrows the heaviest tipset

Passing &ts into resolve_to_deterministic_address matches the updated &Arc<Tipset> signature and removes an unnecessary Arc clone without changing semantics.

src/rpc/methods/eth/filter/mod.rs (1)

293-307: Reusing the borrowed tipset in collect_events avoids redundant Arc cloning

tipset is already a &Arc<Tipset>, and resolve_to_deterministic_address now takes &Arc<Tipset>, so passing it directly is correct and more efficient than cloning the Arc.

src/chain_sync/chain_follower.rs (1)

850-857: validate_tipset now borrows the StateManager Arc instead of taking ownership

Passing &state_manager into validate_tipset matches the updated signature and removes an extra Arc clone per task, without changing validation behavior.

src/interpreter/fvm3.rs (1)

67-75: Borrowing chain_index/chain_config/heaviest_tipset into get_lookback_tipset_for_round is correct

Using &self.chain_index, &self.chain_config, and &self.heaviest_tipset matches the refactored get_lookback_tipset_for_round signature and avoids cloning these Arcs while preserving behavior.

src/rpc/methods/gas.rs (1)

115-123: estimate_gas_premium now calls messages_for_tipset_with_cache using borrowed store and cache

Switching to data.store() and &data.msgs_in_tipset aligns with the updated messages_for_tipset_with_cache signature, eliminating extra Arc clones without changing gas premium calculation logic.

src/chain_sync/tipset_syncer.rs (4)

100-121: Arc borrowing change in validate_tipset looks correct

Switching state_manager to &Arc<StateManager<DB>> and cloning it only when spawning validate_block keeps the async tasks 'static while avoiding an extra Arc clone at the call site. The ownership and lifetimes still line up, and chainstore continues to be used only on the sync path for add_to_tipset_tracker.


207-215: get_lookback_tipset_for_round argument wiring is consistent

Passing state_manager.chain_store().chain_index() and state_manager.chain_config() by reference, plus &base_tipset, matches how the helper is used elsewhere (e.g., miner_get_base_info). The mapping to a state root handle and its later use in get_miner_work_addr preserves the previous behavior.


352-370: BLS pubkey lookup now cleanly reuses the shared blockstore Arc

Using let db = state_manager.blockstore(); and then calling StateManager::get_bls_public_key(db, ...) avoids cloning the blockstore Arc at the call site while keeping the helper responsible for owning its own Arc clone. This keeps the interface tidy and aligns with other state-manager helpers.


483-488: Message-root computation correctly switches to borrowed blockstore

Calling TipsetValidator::compute_msg_root(state_manager.blockstore(), ...) instead of passing an owned clone reduces unnecessary Arc churn and is consistent with how other helpers now accept &Arc<DB>. No behavior change to the header vs. computed root comparison logic.

src/state_manager/mod.rs (6)

440-451: get_all_sectors receiver change is consistent

Switching get_all_sectors to take &self (instead of self: &Arc<Self>) matches the rest of the synchronous state-accessors in this impl and doesn’t affect behavior; it still walks through get_actor and miner::State::load as before.


582-668: call_raw / call borrowing self and tipset is an improvement

Using &self and &Arc<Tipset> in call_raw, and having call construct a local Arc<Tipset> and pass &ts, removes unnecessary Arc indirection on the API without changing semantics. The VM ExecutionContext still receives an owned Arc::clone(tipset), so the lifetime and ownership over the heaviest tipset are preserved.


710-748: Circulating-supply call now reuses the shared blockstore handle

Passing self.blockstore() into get_vm_circulating_supply in call_with_gas aligns with the broader refactor of using borrowed Arc<DB> everywhere. That avoids a redundant Arc clone while leaving the VM construction path unchanged.


1550-1585: Range-validation helpers now use &self cleanly

validate_range and validate_tipsets no longer require self: &Arc<Self>, which makes them simpler to call from both Arc-managed and direct contexts. They still pass cloned Arc handles (chain index, chain config, beacon, engine) into the free validate_tipsets function, so the actual validation behavior is untouched.


1588-1622: Search helpers now consistently borrow self

search_for_message using &self and keeping the search logic in check_search / search_back_for_message unchanged is a straightforward API cleanup. The interplay between “from” tipset, heaviest tipset, and look-back semantics remains the same.


1265-1282: get_bls_public_key signature matches new call sites

Taking db: &Arc<DB> lets callers pass state_manager.blockstore() directly (as in check_block_messages), while the helper remains responsible for cloning the Arc for StateTree::new_from_root. Internally it still resolves to a key address and enforces the “must be BLS” invariant, so behavior is preserved with slightly cheaper call plumbing.

src/interpreter/fvm4.rs (1)

67-75: Borrowing Arc parameters here is correct and avoids extra clones

Passing &self.chain_index, &self.chain_config, and &self.heaviest_tipset matches the updated ChainStore::get_lookback_tipset_for_round signature without changing behavior.

src/interpreter/fvm2.rs (1)

63-71: Consistent Arc borrowing in lookback call

Using &self.chain_index, &self.chain_config, and &self.heaviest_tipset aligns with the new get_lookback_tipset_for_round API and removes unnecessary Arc cloning.

src/rpc/mod.rs (1)

486-488: Expose the underlying Arc<DB> from RPCState::store

Returning &Arc<DB> directly from chain_store().blockstore() is consistent with ChainStore’s API and avoids extra indirection; existing callers can still treat it as a Blockstore via deref.

src/chain_sync/sync_status.rs (1)

141-185: Accepting &StateManager<DB> instead of &Arc<StateManager<DB>> is a safe simplification

The method body only needs a shared reference, so dropping the Arc from the signature reduces coupling and avoids needless Arc cloning at call sites while preserving behavior.

src/rpc/methods/miner.rs (1)

115-132: Miner lookback state now uses borrowed Arc inputs correctly

Passing ctx.chain_index(), ctx.chain_config(), and &parent_tipset into ChainStore::get_lookback_tipset_for_round, then wrapping the returned state root in Arc keeps the original semantics while avoiding redundant Arc clones.

src/fil_cns/validation.rs (1)

71-176: Async validation refactor correctly switches to borrowed/Arc inputs

The updated get_lookback_tipset_for_round call and the spawn_blocking/async closures now:

  • Move/cloned Arc state (state_manager, base_tipset, block, prev_beacon, lookback_state) into the tasks, and
  • Pass shared references (&StateManager<_>, &Tipset, &Cid, &BeaconEntry, &Address) into the validation helpers.

This removes unnecessary Arc cloning while keeping lifetimes and concurrency semantics sound.

src/rpc/methods/state.rs (2)

84-95: StateCall::run now correctly abstracts over StateManager without exposing Arc

Taking state_manager: &StateManager<DB> and calling it via &ctx.state_manager keeps the call behavior identical while hiding Arc from the API surface and avoiding redundant clones.


196-205: Pass tipset by reference into resolve_to_deterministic_address

Switching to resolve_to_deterministic_address(address, &ts) avoids moving/cloning the Arc<Tipset> and matches an interface that works on a borrowed tipset, without changing the call’s semantics.

src/chain/store/chain_store.rs (2)

321-381: Refactored lookback helper cleanly borrows Arc inputs

get_lookback_tipset_for_round now:

  • Accepts &Arc<ChainIndex<_>>, &Arc<ChainConfig>, and &Arc<Tipset>,
  • Clones those Arcs only where needed (apply_block_messages, return value).

This preserves the prior logic while avoiding unnecessary Arc moves.


617-632: messages_for_tipset never populates applied/balances, so it always yields no messages

The Arc-borrowing changes here look correct, but there is a pre‑existing logic bug in messages_for_tipset:

  • applied and balances start empty.
  • They are only initialized when applied.contains_key(from_address) is true:
    if applied.contains_key(from_address) {
        let actor_state = state
            .get_actor(from_address)?
            .ok_or_else(|| Error::Other("Actor state not found".to_string()))?;
        applied.insert(*from_address, actor_state.sequence);
        balances.insert(*from_address, actor_state.balance.clone().into());
    }
  • Because nothing is ever inserted before this check, it never runs for a new sender; applied.get_mut(from_address) then returns None, and the message is skipped.
  • As a result, messages_for_tipset (and anything using messages_for_tipset_with_cache) will always return an empty Vec<ChainMessage> for a fresh tipset.

This contradicts the intended Lotus‑style behavior of initializing sender state on first encounter and then walking sequential nonces.

Flip the condition so initialization happens for first‑seen senders:

-                if applied.contains_key(from_address) {
+                if !applied.contains_key(from_address) {
                     let actor_state = state
                         .get_actor(from_address)?
                         .ok_or_else(|| Error::Other("Actor state not found".to_string()))?;
                     applied.insert(*from_address, actor_state.sequence);
                     balances.insert(*from_address, actor_state.balance.clone().into());
                 }

With this change, the rest of the nonce/balance filtering logic becomes effective and messages_for_tipset will actually surface valid messages as intended.

Also applies to: 637-692

⛔ Skipped due to learnings
Learnt from: hanabi1224
Repo: ChainSafe/forest PR: 5867
File: src/ipld/util.rs:461-487
Timestamp: 2025-08-08T12:11:55.266Z
Learning: Forest (src/ipld/util.rs, Rust): In UnorderedChainStream::poll_next, dropping `extract_sender` (when no more tipsets and the extract queue is empty) is the intended shutdown signal for workers. Any subsequent attempt to enqueue work after this drop is a logic error and should be treated as an error; do not change `send()` to ignore a missing sender.
Learnt from: hanabi1224
Repo: ChainSafe/forest PR: 6167
File: src/tool/subcommands/state_compute_cmd.rs:89-91
Timestamp: 2025-10-17T14:24:47.046Z
Learning: In `src/tool/subcommands/state_compute_cmd.rs`, when using `ReadOpsTrackingStore` to generate minimal snapshots, `HEAD_KEY` should be written to `db.tracker` (not `db` itself) before calling `export_forest_car()`, because the export reads from the tracker MemoryDB which accumulates only the accessed data during computation.

@LesnyRumcajs LesnyRumcajs added this pull request to the merge queue Nov 20, 2025
Merged via the queue into main with commit 264c99b Nov 20, 2025
46 checks passed
@LesnyRumcajs LesnyRumcajs deleted the hm/refine-arc-params branch November 20, 2025 23:14
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