From 4d2e2018aca58b178ddce2ec068f4f4cddcccbc3 Mon Sep 17 00:00:00 2001 From: hanabi1224 Date: Mon, 6 Apr 2026 21:13:44 +0800 Subject: [PATCH] fix(rpc): use large message lookback limit in API tests to mitigate offline test failure --- .../subcommands/api_cmd/api_compare_tests.rs | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/tool/subcommands/api_cmd/api_compare_tests.rs b/src/tool/subcommands/api_cmd/api_compare_tests.rs index 3339b32f622e..a8ea39111a88 100644 --- a/src/tool/subcommands/api_cmd/api_compare_tests.rs +++ b/src/tool/subcommands/api_cmd/api_compare_tests.rs @@ -71,6 +71,7 @@ use tracing::debug; const COLLECTION_SAMPLE_SIZE: usize = 5; const SAFE_EPOCH_DELAY_FOR_TESTING: i64 = 20; // `SAFE_HEIGHT_DISTANCE`(200) is too large for testing +const MESSAGE_LOOKBACK_LIMIT: i64 = 2000; /// This address has been funded by the calibnet faucet and the private keys /// has been discarded. It should always have a non-zero balance. @@ -1237,16 +1238,19 @@ fn state_tests_with_tipset( validate_message_lookup(StateSearchMsg::request(( None.into(), msg_cid, - 800, + MESSAGE_LOOKBACK_LIMIT, true, ))?), validate_message_lookup(StateSearchMsg::request(( None.into(), msg_cid, - 800, + MESSAGE_LOOKBACK_LIMIT, false, ))?), - validate_message_lookup(StateSearchMsgLimited::request((msg_cid, 800))?), + validate_message_lookup(StateSearchMsgLimited::request(( + msg_cid, + MESSAGE_LOOKBACK_LIMIT, + ))?), ]); } for msg in sample_messages(bls_messages.iter(), secp_messages.iter()) { @@ -2306,8 +2310,11 @@ fn eth_state_tests_with_tipset( .policy_on_rejected(PolicyOnRejected::PassWithQuasiIdenticalError), ); tests.push( - RpcTest::identity(EthGetTransactionReceiptLimited::request((tx.hash, 800))?) - .policy_on_rejected(PolicyOnRejected::PassWithQuasiIdenticalError), + RpcTest::identity(EthGetTransactionReceiptLimited::request(( + tx.hash, + MESSAGE_LOOKBACK_LIMIT, + ))?) + .policy_on_rejected(PolicyOnRejected::PassWithQuasiIdenticalError), ); } }