Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion scripts/tests/api_compare/.env
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion scripts/tests/bootstrapper/.env
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion scripts/tests/snapshot_parity/.env
Original file line number Diff line number Diff line change
@@ -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
Expand Down
10 changes: 8 additions & 2 deletions src/rpc/methods/eth/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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))),
}
Expand Down
8 changes: 8 additions & 0 deletions src/rpc/methods/eth/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,14 @@ impl FromStr for EthBytes {
}
}

impl Deref for EthBytes {
type Target = Vec<u8>;

fn deref(&self) -> &Self::Target {
&self.0
}
}

#[derive(Debug, Deserialize, Serialize)]
pub struct GetBytecodeReturn(pub Option<Cid>);

Expand Down
8 changes: 3 additions & 5 deletions src/rpc/methods/eth/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,10 @@ pub fn decode_revert_reason(return_data: RawBytes) -> (Vec<u8>, 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)
Expand Down
Loading