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
Overview
In PR #7116 (#7116), an
unsafeenvironment-variable initialization was added torun_test_from_snapshotinsrc/tool/subcommands/api_cmd/test_snapshot.rs(see comment #7116 (comment)):This was added as a short-term workaround to keep existing RPC regression snapshot tests passing after the new
StateRecomputePolicydefaulting toDisallowedfor 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_MISSunset /false).Affected snapshots
The following 15 tests currently fail without the workaround:
Acceptance criteria
unsafe { std::env::set_var("FOREST_ETH_RPC_COMPUTE_STATE_ON_INDEX_MISS", "1") }line is removed fromrun_test_from_snapshot