Skip to content

chore: remove FOREST_ETH_RPC_COMPUTE_STATE_ON_INDEX_MISS workaround in snapshot tests and update affected snapshots #7118

@coderabbitai

Description

@coderabbitai

Overview

In PR #7116 (#7116), an unsafe environment-variable initialization was added to run_test_from_snapshot in src/tool/subcommands/api_cmd/test_snapshot.rs (see comment #7116 (comment)):

        // https://github.com/ChainSafe/forest/issues/7118
        #[cfg(test)]
        let policy = {
            _ = policy;
            StateRecomputePolicy::Allowed
        };

This was added as a short-term workaround to keep existing RPC regression snapshot tests passing after the new StateRecomputePolicy defaulting to Disallowed for Eth RPC methods landed.

Goal

Evaluate removing this line and regenerating / updating the affected snapshot files so the tests pass with the default policy (FOREST_ETH_RPC_COMPUTE_STATE_ON_INDEX_MISS unset / false).

Affected snapshots

The following 15 tests currently fail without the workaround:

tool::subcommands::api_cmd::test_snapshot::tests::cargo_test_rpc_snapshot_test_filecoin_ethfeehistory_1737446676883828
tool::subcommands::api_cmd::test_snapshot::tests::cargo_test_rpc_snapshot_test_filecoin_ethfeehistory_v2_1767605175056660
tool::subcommands::api_cmd::test_snapshot::tests::cargo_test_rpc_snapshot_test_filecoin_ethgetblockbyhash_1773157415768830
tool::subcommands::api_cmd::test_snapshot::tests::cargo_test_rpc_snapshot_test_filecoin_ethgetblockbynumber_v2_1768192171057588
tool::subcommands::api_cmd::test_snapshot::tests::cargo_test_rpc_snapshot_test_filecoin_ethgetblockreceipts_1773157886472662
tool::subcommands::api_cmd::test_snapshot::tests::cargo_test_rpc_snapshot_test_filecoin_ethgetblockreceipts_v2_1773157886472662
tool::subcommands::api_cmd::test_snapshot::tests::cargo_test_rpc_snapshot_test_filecoin_ethgetblockreceipts_v2_finalized_1769603486031510
tool::subcommands::api_cmd::test_snapshot::tests::cargo_test_rpc_snapshot_test_filecoin_ethgetblockreceipts_v2_safe_1769603485649367
tool::subcommands::api_cmd::test_snapshot::tests::cargo_test_rpc_snapshot_test_filecoin_ethgetblockreceiptslimited_1773157887312363
tool::subcommands::api_cmd::test_snapshot::tests::cargo_test_rpc_snapshot_test_filecoin_ethgetblockreceiptslimited_v2_1773157887312363
tool::subcommands::api_cmd::test_snapshot::tests::cargo_test_rpc_snapshot_test_filecoin_ethgetlogs_1759922913569082
tool::subcommands::api_cmd::test_snapshot::tests::cargo_test_rpc_snapshot_test_filecoin_ethgettransactionreceipt_1741272955712904
tool::subcommands::api_cmd::test_snapshot::tests::cargo_test_rpc_snapshot_test_filecoin_ethgettransactionreceiptlimited_1741272955611272
tool::subcommands::api_cmd::test_snapshot::tests::cargo_test_rpc_snapshot_test_filecoin_ethtracefilter_1778490960890609
tool::subcommands::api_cmd::test_snapshot::tests::cargo_test_rpc_snapshot_test_filecoin_getactoreventsraw_1741782590255476

Acceptance criteria

  • The unsafe { std::env::set_var("FOREST_ETH_RPC_COMPUTE_STATE_ON_INDEX_MISS", "1") } line is removed from run_test_from_snapshot
  • All 15 affected snapshot files above are regenerated / updated so the tests pass without the env var override
  • CI passes with default policy

Metadata

Metadata

Assignees

No one assigned

    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