Skip to content

Commit

Permalink
Fix incorrect Tipset passed to new_eth_tx_receipt (#5205)
Browse files Browse the repository at this point in the history
  • Loading branch information
elmattic authored Feb 4, 2025
1 parent 2755a80 commit 778a39c
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 7 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,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.
Expand Down
5 changes: 2 additions & 3 deletions scripts/tests/api_compare/filter-list
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
# They should be considered bugged, and not used until the root cause is resolved.
# Internal Server Error on Lotus: https://github.com/ChainSafe/forest/actions/runs/8619017774/job/23623141130?pr=4170
!Filecoin.MpoolGetNonce
# CustomCheckFailed in Forest: https://github.com/ChainSafe/forest/actions/runs/9593268587/job/26453560366
!Filecoin.StateReplay
# CustomCheckFailed in Forest: https://github.com/ChainSafe/forest/issues/5213
!Filecoin.EthGetLogs
# TODO: https://github.com/ChainSafe/forest/issues/4996
!Filecoin.EthGetTransactionReceipt
!Filecoin.EthGetTransactionReceiptLimited
3 changes: 0 additions & 3 deletions scripts/tests/api_compare/filter-list-offline
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,3 @@
!Filecoin.EthGetBlockByNumber
!eth_getBlockByNumber
!Filecoin.ChainSetHead
# TODO: https://github.com/ChainSafe/forest/issues/4996
!Filecoin.EthGetTransactionReceipt
!Filecoin.EthGetTransactionReceiptLimited
18 changes: 17 additions & 1 deletion src/rpc/methods/eth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 778a39c

Please sign in to comment.