From 50925dcd657709ec842a71a812750af6c90e6df5 Mon Sep 17 00:00:00 2001 From: elmattic Date: Thu, 30 Jan 2025 14:03:09 +0100 Subject: [PATCH 1/2] Fix incorrect ts passed to new_eth_tx_receipt --- scripts/tests/api_compare/filter-list | 3 --- scripts/tests/api_compare/filter-list-offline | 3 --- src/rpc/methods/eth.rs | 18 +++++++++++++++++- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/scripts/tests/api_compare/filter-list b/scripts/tests/api_compare/filter-list index 407781cf7275..5d44591afac5 100644 --- a/scripts/tests/api_compare/filter-list +++ b/scripts/tests/api_compare/filter-list @@ -4,6 +4,3 @@ !Filecoin.MpoolGetNonce # CustomCheckFailed in Forest: https://github.com/ChainSafe/forest/actions/runs/9593268587/job/26453560366 !Filecoin.StateReplay -# TODO: https://github.com/ChainSafe/forest/issues/4996 -!Filecoin.EthGetTransactionReceipt -!Filecoin.EthGetTransactionReceiptLimited diff --git a/scripts/tests/api_compare/filter-list-offline b/scripts/tests/api_compare/filter-list-offline index 9036c310fab1..94fd97034526 100644 --- a/scripts/tests/api_compare/filter-list-offline +++ b/scripts/tests/api_compare/filter-list-offline @@ -34,6 +34,3 @@ !Filecoin.EthGetBlockByNumber !eth_getBlockByNumber !Filecoin.ChainSetHead -# TODO: https://github.com/ChainSafe/forest/issues/4996 -!Filecoin.EthGetTransactionReceipt -!Filecoin.EthGetTransactionReceiptLimited diff --git a/src/rpc/methods/eth.rs b/src/rpc/methods/eth.rs index aaffea3f3187..86453670da1d 100644 --- a/src/rpc/methods/eth.rs +++ b/src/rpc/methods/eth.rs @@ -2360,7 +2360,23 @@ async fn get_eth_transaction_receipt( let tx = new_eth_tx_from_message_lookup(&ctx, &message_lookup, None) .with_context(|| format!("failed to convert {} into an Eth Tx", tx_hash))?; - let tx_receipt = new_eth_tx_receipt(&ctx, &tipset, &tx, &message_lookup.receipt).await?; + let ts = ctx + .chain_index() + .load_required_tipset(&message_lookup.tipset)?; + + // The tx is located in the parent tipset + let parent_ts = ctx + .chain_index() + .load_required_tipset(ts.parents()) + .map_err(|e| { + format!( + "failed to lookup tipset {} when constructing the eth txn receipt: {}", + ts.parents(), + e + ) + })?; + + let tx_receipt = new_eth_tx_receipt(&ctx, &parent_ts, &tx, &message_lookup.receipt).await?; Ok(tx_receipt) } From 0587f85682194161d8666a897a494a22160cccc1 Mon Sep 17 00:00:00 2001 From: elmattic Date: Thu, 30 Jan 2025 14:31:32 +0100 Subject: [PATCH 2/2] Update CHANGELOG --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6607ef5565c0..f88cee4588b0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -55,6 +55,9 @@ - [#5006](https://github.com/ChainSafe/forest/issues/5006) Fix incorrect logs, logs bloom and event index for the `Filecoin.EthGetBlockReceipts` RPC method. +- [#4996](https://github.com/ChainSafe/forest/issues/4996) Fix incorrect logs and logs bloom for the `Filecoin.EthGetTransactionReceipt` and + `Filecoin.EthGetTransactionReceiptLimited` RPC methods on some blocks. + ## Forest v.0.23.3 "Plumber" Mandatory release for calibnet node operators. It fixes a sync error at epoch 2281645.