From af5d2344a0216f860eb4c48b2625b84ae26abf1f Mon Sep 17 00:00:00 2001 From: Guillaume Potier Date: Mon, 20 Jan 2025 11:18:54 +0100 Subject: [PATCH] Fix `Filecoin.EthGetBlockReceiptsLimited` method interface (#5150) --- CHANGELOG.md | 2 ++ src/rpc/methods/eth.rs | 4 ++-- src/tool/subcommands/api_cmd.rs | 6 ++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 598477a9cf3..4587f74dac5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -44,6 +44,8 @@ - [#5131](https://github.com/ChainSafe/forest/pull/5131) Fix incorrect data deserialization in the `Filecoin.EthGetBlockReceipts` RPC method. This caused the method to return an error on some blocks. +- [#5150](https://github.com/ChainSafe/forest/pull/5150) Fix incorrect prototype for the `Filecoin.EthGetBlockReceiptsLimited` RPC method. + ## Forest v.0.23.3 "Plumber" Mandatory release for calibnet node operators. It fixes a sync error at epoch 2281645. diff --git a/src/rpc/methods/eth.rs b/src/rpc/methods/eth.rs index b754cac9dfc..eee4040f23a 100644 --- a/src/rpc/methods/eth.rs +++ b/src/rpc/methods/eth.rs @@ -1296,12 +1296,12 @@ impl RpcMethod<2> for EthGetBlockReceiptsLimited { const PARAM_NAMES: [&'static str; 2] = ["block_hash", "limit"]; const API_PATHS: ApiPaths = ApiPaths::V1; const PERMISSION: Permission = Permission::Read; - type Params = (EthHash, EthUint64); + type Params = (EthHash, ChainEpoch); type Ok = Vec; async fn handle( ctx: Ctx, - (block_hash, EthUint64(limit)): Self::Params, + (block_hash, limit): Self::Params, ) -> Result { get_block_receipts(&ctx, block_hash, Some(limit as usize)).await } diff --git a/src/tool/subcommands/api_cmd.rs b/src/tool/subcommands/api_cmd.rs index f62c479dac0..722799cddc7 100644 --- a/src/tool/subcommands/api_cmd.rs +++ b/src/tool/subcommands/api_cmd.rs @@ -14,7 +14,7 @@ use crate::rpc; use crate::rpc::auth::AuthNewParams; use crate::rpc::beacon::BeaconGetEntry; use crate::rpc::eth::{ - new_eth_tx_from_signed_message, types::*, BlockNumberOrHash, EthInt64, EthUint64, Predefined, + new_eth_tx_from_signed_message, types::*, BlockNumberOrHash, EthInt64, Predefined, }; use crate::rpc::gas::GasEstimateGasLimit; use crate::rpc::miner::BlockTemplate; @@ -1529,9 +1529,7 @@ fn eth_tests_with_tipset(store: &Arc, shared_tipset: &Tipset RpcTest::identity( EthGetBlockTransactionCountByHash::request((block_hash.clone(),)).unwrap(), ), - RpcTest::identity( - EthGetBlockReceiptsLimited::request((block_hash.clone(), EthUint64(800))).unwrap(), - ), + RpcTest::identity(EthGetBlockReceiptsLimited::request((block_hash.clone(), 800)).unwrap()), RpcTest::identity( EthGetBlockTransactionCountByNumber::request((EthInt64(shared_tipset.epoch()),)) .unwrap(),