diff --git a/scripts/tests/api_compare/.env b/scripts/tests/api_compare/.env index a2b8a2b1739f..e5807be2edda 100644 --- a/scripts/tests/api_compare/.env +++ b/scripts/tests/api_compare/.env @@ -1,6 +1,6 @@ # Note: this should be a `fat` image so that it contains the pre-downloaded filecoin proof parameters FOREST_IMAGE=ghcr.io/chainsafe/forest:edge-fat -LOTUS_IMAGE=filecoin/lotus-all-in-one:v1.34.1-calibnet +LOTUS_IMAGE=filecoin/lotus-all-in-one:v1.34.3-calibnet FIL_PROOFS_PARAMETER_CACHE=/var/tmp/filecoin-proof-parameters LOTUS_RPC_PORT=1234 FOREST_RPC_PORT=2345 diff --git a/scripts/tests/bootstrapper/.env b/scripts/tests/bootstrapper/.env index ffc5e40744b4..6881d66aea90 100644 --- a/scripts/tests/bootstrapper/.env +++ b/scripts/tests/bootstrapper/.env @@ -1,5 +1,5 @@ # Note: this should be a `fat` image so that it contains the pre-downloaded filecoin proof parameters -LOTUS_IMAGE=filecoin/lotus-all-in-one:v1.34.1-calibnet +LOTUS_IMAGE=filecoin/lotus-all-in-one:v1.34.3-calibnet FIL_PROOFS_PARAMETER_CACHE=/var/tmp/filecoin-proof-parameters LOTUS_RPC_PORT=1234 FOREST_RPC_PORT=2345 diff --git a/scripts/tests/snapshot_parity/.env b/scripts/tests/snapshot_parity/.env index 3fe4aca67091..65195e85f1be 100644 --- a/scripts/tests/snapshot_parity/.env +++ b/scripts/tests/snapshot_parity/.env @@ -1,4 +1,4 @@ -LOTUS_IMAGE=filecoin/lotus-all-in-one:v1.34.1-calibnet +LOTUS_IMAGE=filecoin/lotus-all-in-one:v1.34.3-calibnet FIL_PROOFS_PARAMETER_CACHE=/var/tmp/filecoin-proof-parameters LOTUS_RPC_PORT=1234 FOREST_RPC_PORT=2345 diff --git a/src/rpc/methods/eth/errors.rs b/src/rpc/methods/eth/errors.rs index 33e200479836..5ce33eff96b4 100644 --- a/src/rpc/methods/eth/errors.rs +++ b/src/rpc/methods/eth/errors.rs @@ -22,10 +22,16 @@ pub enum EthErrors { impl EthErrors { /// Create a new ExecutionReverted error with formatted message - pub fn execution_reverted(exit_code: ExitCode, error: &str, reason: &str, data: &[u8]) -> Self { + pub fn execution_reverted(exit_code: ExitCode, reason: &str, error: &str, data: &[u8]) -> Self { + let revert_reason = if reason.is_empty() { + String::new() + } else { + format!(", revert reason=[{reason}]") + }; + Self::ExecutionReverted { message: format!( - "message execution failed (exit=[{exit_code}], revert reason=[{reason}], vm error=[{error}])" + "message execution failed (exit=[{exit_code}]{revert_reason}, vm error=[{error}])" ), data: (!data.is_empty()).then(|| format!("0x{}", hex::encode(data))), } diff --git a/src/rpc/methods/eth/types.rs b/src/rpc/methods/eth/types.rs index 58debb704027..7328fd16c23b 100644 --- a/src/rpc/methods/eth/types.rs +++ b/src/rpc/methods/eth/types.rs @@ -58,6 +58,14 @@ impl FromStr for EthBytes { } } +impl Deref for EthBytes { + type Target = Vec; + + fn deref(&self) -> &Self::Target { + &self.0 + } +} + #[derive(Debug, Deserialize, Serialize)] pub struct GetBytecodeReturn(pub Option); diff --git a/src/rpc/methods/eth/utils.rs b/src/rpc/methods/eth/utils.rs index 1b33d5a53177..cee25c00ba0e 100644 --- a/src/rpc/methods/eth/utils.rs +++ b/src/rpc/methods/eth/utils.rs @@ -106,12 +106,10 @@ pub fn decode_revert_reason(return_data: RawBytes) -> (Vec, String) { let (data, reason) = match decode_payload(&return_data, CBOR) { Err(e) => { log::warn!("failed to unmarshal cbor bytes from message receipt return error: {e}"); - ( - EthBytes::default(), - String::from("ERROR: revert reason is not cbor encoded bytes"), - ) + (EthBytes::default(), String::default()) } - Ok(data) => (data.clone(), parse_eth_revert(data.0.as_slice())), + Ok(data) if !data.is_empty() => (data.clone(), parse_eth_revert(data.as_slice())), + Ok(data) => (data.clone(), "none".to_string()), }; (data.0, reason)