Skip to content

Backport for_each_cacheless to fvm2 and fvm3 state trees #7238

Description

@coderabbitai

Summary

Currently, StateTree::for_each_cacheless in src/shim/state_tree.rs falls back to the caching for_each for FvmV2 and FvmV3 variants, because those upstream crates do not yet expose a cacheless iteration API. Only FvmV4 has a native for_each_cacheless.

Required Changes

  1. Contribute for_each_cacheless upstream to the fvm2 and fvm3 crates (or, if upstream is not feasible, implement a workaround in the shim layer that avoids caching HAMT nodes during iteration).
  2. Once available, update StateTree::for_each_cacheless in src/shim/state_tree.rs to call the native cacheless method for FvmV2 and FvmV3 variants instead of falling back to for_each.

Affected Files

  • src/shim/state_tree.rsStateTree::for_each_cacheless implementation for FvmV2 and FvmV3 arms.

Context

Acceptance Criteria

  • StateTree::for_each_cacheless for FvmV2 and FvmV3 no longer caches HAMT nodes during iteration.
  • Memory usage during state-tree iteration on older network versions is comparable to FvmV4.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

Status
New

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions