diff --git a/CHANGELOG.md b/CHANGELOG.md index 29123e89dc8..598477a9cf3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,6 +42,8 @@ - [#5122](https://github.com/ChainSafe/forest/issues/5122) Fix a bug in database garbage collection flow. +- [#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. + ## 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 7a798bb7121..b754cac9dfc 100644 --- a/src/rpc/methods/eth.rs +++ b/src/rpc/methods/eth.rs @@ -1094,7 +1094,7 @@ async fn new_eth_tx_receipt( let ret: eam::CreateExternalReturn = from_slice_with_fallback(message_lookup.receipt.return_data().bytes())?; - receipt.contract_address = Some(ret.eth_address.into()); + receipt.contract_address = Some(ret.eth_address.0.into()); } let mut events = vec![]; diff --git a/src/shim/actors/builtin/eam.rs b/src/shim/actors/builtin/eam.rs index b0941c6cdbf..52608951129 100644 --- a/src/shim/actors/builtin/eam.rs +++ b/src/shim/actors/builtin/eam.rs @@ -1,34 +1,4 @@ // Copyright 2019-2025 ChainSafe Systems // SPDX-License-Identifier: Apache-2.0, MIT -use crate::shim::address::Address; - -use serde::{Deserialize, Serialize}; - -#[derive(Debug, PartialEq, Serialize, Deserialize, Clone)] -pub struct CreateExternalReturn { - pub actor_id: u64, - pub robust_address: Address, - pub eth_address: [u8; 20], -} - -#[cfg(test)] -mod tests { - use super::*; - use crate::utils::encoding::from_slice_with_fallback; - use fvm_ipld_encoding::to_vec; - - #[test] - fn test_create_external_return_roundtrip() { - let ret_struct = CreateExternalReturn { - actor_id: 666, - robust_address: Address::new_id(2), - eth_address: [0; 20], - }; - let struct_encoded = to_vec(&ret_struct).unwrap(); - - let struct_decoded: CreateExternalReturn = - from_slice_with_fallback(&struct_encoded).unwrap(); - assert_eq!(struct_decoded, ret_struct); - } -} +pub type CreateExternalReturn = fil_actor_eam_state::v16::CreateExternalReturn;