diff --git a/scripts/tests/api_compare/docker-compose.yml b/scripts/tests/api_compare/docker-compose.yml index 0d4dc88029c1..38a8df93106c 100644 --- a/scripts/tests/api_compare/docker-compose.yml +++ b/scripts/tests/api_compare/docker-compose.yml @@ -266,6 +266,7 @@ services: - RUST_LOG=info,forest::tool::subcommands=debug - FOREST_RPC_DEFAULT_TIMEOUT=120 - FIL_PROOFS_PARAMETER_CACHE=${FIL_PROOFS_PARAMETER_CACHE} + - FOREST_STRICT_JSON=1 entrypoint: ["/bin/bash", "-c"] user: 0:0 command: @@ -310,6 +311,7 @@ services: - RUST_LOG=info,forest::tool::subcommands=debug - FOREST_RPC_DEFAULT_TIMEOUT=120 - FIL_PROOFS_PARAMETER_CACHE=${FIL_PROOFS_PARAMETER_CACHE} + - FOREST_STRICT_JSON=1 entrypoint: ["/bin/bash", "-c"] user: 0:0 command: @@ -379,6 +381,7 @@ services: - RUST_LOG=info,forest::tool::subcommands=debug - FOREST_RPC_DEFAULT_TIMEOUT=120 - FIL_PROOFS_PARAMETER_CACHE=${FIL_PROOFS_PARAMETER_CACHE} + - FOREST_STRICT_JSON=1 entrypoint: ["/bin/bash", "-c"] user: 0:0 command: diff --git a/src/lotus_json/message.rs b/src/lotus_json/message.rs index 306803b95821..86bd487eeb49 100644 --- a/src/lotus_json/message.rs +++ b/src/lotus_json/message.rs @@ -5,6 +5,7 @@ use super::*; use crate::shim::{address::Address, econ::TokenAmount, message::Message}; use fvm_ipld_encoding::RawBytes; +use ::cid::Cid; #[derive(Debug, PartialEq, Clone, Serialize, Deserialize, JsonSchema)] #[serde(rename_all = "PascalCase")] @@ -40,6 +41,14 @@ pub struct MessageLotusJson { default )] params: Option, + #[schemars(with = "LotusJson>")] + #[serde( + with = "crate::lotus_json", + rename = "CID", + default, + skip_serializing_if = "Option::is_none" + )] + cid: Option, } impl HasLotusJson for Message { @@ -47,6 +56,8 @@ impl HasLotusJson for Message { #[cfg(test)] fn snapshots() -> Vec<(serde_json::Value, Self)> { + let msg = Message::default(); + let cid = msg.cid(); vec![( json!({ "From": "f00", @@ -59,12 +70,14 @@ impl HasLotusJson for Message { "To": "f00", "Value": "0", "Version": 0, + "CID": { "/": cid.to_string() }, }), - Message::default(), + msg, )] } fn into_lotus_json(self) -> Self::LotusJson { + let cid = self.cid(); let Self { version, from, @@ -88,6 +101,7 @@ impl HasLotusJson for Message { gas_premium, method: method_num, params: Some(params), + cid: Some(cid), } } @@ -103,6 +117,7 @@ impl HasLotusJson for Message { gas_premium, method, params, + cid: _, } = lotus_json; Self { version, diff --git a/src/lotus_json/signed_message.rs b/src/lotus_json/signed_message.rs index 08d029c22693..4ed7e46693e9 100644 --- a/src/lotus_json/signed_message.rs +++ b/src/lotus_json/signed_message.rs @@ -39,6 +39,8 @@ impl HasLotusJson for SignedMessage { #[cfg(test)] fn snapshots() -> Vec<(serde_json::Value, Self)> { + let msg = Message::default(); + let msg_cid = msg.cid(); vec![( json!({ "Message": { @@ -52,6 +54,7 @@ impl HasLotusJson for SignedMessage { "To": "f00", "Value": "0", "Version": 0, + "CID": { "/": msg_cid.to_string() }, }, "Signature": {"Type": 2, "Data": "aGVsbG8gd29ybGQh"}, "CID": { @@ -59,7 +62,7 @@ impl HasLotusJson for SignedMessage { }, }), SignedMessage { - message: Message::default(), + message: msg, signature: Signature { sig_type: crate::shim::crypto::SignatureType::Bls, bytes: Vec::from_iter(*b"hello world!"), diff --git a/src/rpc/methods/chain.rs b/src/rpc/methods/chain.rs index c5d52a3d1c91..59c7b693bdc1 100644 --- a/src/rpc/methods/chain.rs +++ b/src/rpc/methods/chain.rs @@ -182,7 +182,7 @@ impl RpcMethod<1> for ChainGetMessage { const DESCRIPTION: Option<&'static str> = Some("Returns the message with the specified CID."); type Params = (Cid,); - type Ok = FlattenedApiMessage; + type Ok = Message; async fn handle( ctx: Ctx, @@ -193,13 +193,10 @@ impl RpcMethod<1> for ChainGetMessage { .store() .get_cbor(&message_cid)? .with_context(|| format!("can't find message with cid {message_cid}"))?; - let message = match chain_message { + Ok(match chain_message { ChainMessage::Signed(m) => Arc::unwrap_or_clone(m).into_message(), ChainMessage::Unsigned(m) => Arc::unwrap_or_clone(m), - }; - - let cid = message.cid(); - Ok(FlattenedApiMessage { message, cid }) + }) } } @@ -1511,18 +1508,6 @@ pub struct ApiMessage { lotus_json_with_self!(ApiMessage); -#[derive(Serialize, Deserialize, JsonSchema, Clone, Debug, Eq, PartialEq)] -pub struct FlattenedApiMessage { - #[serde(flatten, with = "crate::lotus_json")] - #[schemars(with = "LotusJson")] - pub message: Message, - #[serde(rename = "CID", with = "crate::lotus_json")] - #[schemars(with = "LotusJson")] - pub cid: Cid, -} - -lotus_json_with_self!(FlattenedApiMessage); - #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)] pub struct ForestChainExportParams { pub version: FilecoinSnapshotVersion, diff --git a/src/rpc/methods/common.rs b/src/rpc/methods/common.rs index 75653a7fca99..0a78661d4bf4 100644 --- a/src/rpc/methods/common.rs +++ b/src/rpc/methods/common.rs @@ -55,6 +55,7 @@ impl RpcMethod<0> for Version { // For the API v0, we don't support it but it should be `1.5.0`. api_version: ShiftingVersion::new(2, 3, 0), block_delay: ctx.chain_config().block_delay_secs, + agent: None, }) } } @@ -106,6 +107,8 @@ pub struct PublicVersion { #[serde(rename = "APIVersion")] pub api_version: ShiftingVersion, pub block_delay: u32, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub agent: Option, } lotus_json_with_self!(PublicVersion); diff --git a/src/rpc/methods/eth.rs b/src/rpc/methods/eth.rs index b895184646da..f12d8ffa2ea2 100644 --- a/src/rpc/methods/eth.rs +++ b/src/rpc/methods/eth.rs @@ -4502,6 +4502,8 @@ mod test { invoked_actor: None, gas_charges: vec![], subcalls: vec![], + logs: vec![], + ipld_ops: vec![], } } diff --git a/src/rpc/methods/gas.rs b/src/rpc/methods/gas.rs index 167269dd92b7..3b2e9f252ec9 100644 --- a/src/rpc/methods/gas.rs +++ b/src/rpc/methods/gas.rs @@ -5,7 +5,6 @@ use super::state::InvocResult; use crate::blocks::Tipset; use crate::chain::{BASE_FEE_MAX_CHANGE_DENOM, BLOCK_GAS_TARGET}; use crate::message::{ChainMessage, MessageRead as _, MessageReadWrite as _, SignedMessage}; -use crate::rpc::chain::FlattenedApiMessage; use crate::rpc::{ApiPaths, Ctx, Permission, RpcMethod, error::ServerError, types::*}; use crate::shim::executor::ApplyRet; use crate::shim::{ @@ -305,16 +304,14 @@ impl RpcMethod<3> for GasEstimateMessageGas { Some("Returns the estimated gas for the given parameters."); type Params = (Message, Option, ApiTipsetKey); - type Ok = FlattenedApiMessage; + type Ok = Message; async fn handle( ctx: Ctx, (msg, spec, tsk): Self::Params, _: &http::Extensions, ) -> Result { - let message = estimate_message_gas(&ctx, msg, spec, tsk).await?; - let cid = message.cid(); - Ok(FlattenedApiMessage { message, cid }) + estimate_message_gas(&ctx, msg, spec, tsk).await } } diff --git a/src/rpc/methods/state.rs b/src/rpc/methods/state.rs index 55feef3a7862..09149fe0553d 100644 --- a/src/rpc/methods/state.rs +++ b/src/rpc/methods/state.rs @@ -3172,6 +3172,7 @@ impl RpcMethod<0> for StateGetNetworkParams { fork_upgrade_params: ForkUpgradeParams::try_from(config) .context("Failed to get fork upgrade params")?, eip155_chain_id: config.eth_chain_id, + genesis_timestamp: ctx.chain_store().genesis_block_header().timestamp, }; Ok(params) @@ -3190,6 +3191,7 @@ pub struct NetworkParams { fork_upgrade_params: ForkUpgradeParams, #[serde(rename = "Eip155ChainID")] eip155_chain_id: EthChainId, + genesis_timestamp: u64, } lotus_json_with_self!(NetworkParams); @@ -3229,7 +3231,7 @@ pub struct ForkUpgradeParams { upgrade_teep_height: ChainEpoch, upgrade_tock_height: ChainEpoch, upgrade_golden_week_height: ChainEpoch, - //upgrade_xxx_height: ChainEpoch, + upgrade_xx_height: ChainEpoch, } impl TryFrom<&ChainConfig> for ForkUpgradeParams { @@ -3279,6 +3281,7 @@ impl TryFrom<&ChainConfig> for ForkUpgradeParams { upgrade_tock_height: get_height(Tock)?, upgrade_golden_week_height: get_height(GoldenWeek)?, //upgrade_firehorse_height: get_height(FireHorse)?, + upgrade_xx_height: 999_999_999_999_999, }) } } diff --git a/src/rpc/methods/state/types.rs b/src/rpc/methods/state/types.rs index 4edd6a6e3575..8c5609ebcaf9 100644 --- a/src/rpc/methods/state/types.rs +++ b/src/rpc/methods/state/types.rs @@ -17,8 +17,9 @@ use crate::shim::{ use cid::Cid; use fvm_ipld_encoding::RawBytes; use num::Zero as _; -use schemars::JsonSchema; +use schemars::{JsonSchema, Schema, SchemaGenerator}; use serde::{Deserialize, Serialize}; +use serde_with::{DeserializeFromStr, SerializeDisplay}; #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, PartialEq)] #[serde(rename_all = "PascalCase")] @@ -110,6 +111,51 @@ pub struct MessageGasCost { lotus_json_with_self!(MessageGasCost); +/// IPLD operation kind for [`TraceIpld`]. +#[derive( + Debug, + Clone, + PartialEq, + Eq, + SerializeDisplay, + DeserializeFromStr, + strum::Display, + strum::EnumString, +)] +#[strum(serialize_all = "PascalCase")] +pub enum TraceIpldOp { + Get, + Put, + #[strum(to_string = "Unknown", default)] + Unknown(String), +} + +impl JsonSchema for TraceIpldOp { + fn schema_name() -> std::borrow::Cow<'static, str> { + "TraceIpldOp".into() + } + + fn json_schema(_: &mut SchemaGenerator) -> Schema { + schemars::json_schema!({ + "type": "string", + "enum": ["Get", "Put", "Unknown"], + }) + } +} + +/// IPLD operation details attached to an [`ExecutionTrace`]. +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] +#[serde(rename_all = "PascalCase")] +pub struct TraceIpld { + pub op: TraceIpldOp, + #[serde(with = "crate::lotus_json")] + #[schemars(with = "LotusJson")] + pub cid: Cid, + pub size: u64, +} + +lotus_json_with_self!(TraceIpld); + impl MessageGasCost { fn is_zero_cost(&self) -> bool { self.base_fee_burn.is_zero() @@ -139,7 +185,7 @@ impl MessageGasCost { } } -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema)] +#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)] #[serde(rename_all = "PascalCase")] pub struct ExecutionTrace { pub msg: MessageTrace, @@ -149,6 +195,21 @@ pub struct ExecutionTrace { #[serde(with = "crate::lotus_json")] #[schemars(with = "LotusJson>")] pub subcalls: Vec, + #[serde(default, skip_serializing_if = "Vec::is_empty")] + pub logs: Vec, + #[serde(default, skip_serializing_if = "Vec::is_empty")] + pub ipld_ops: Vec, +} + +impl PartialEq for ExecutionTrace { + /// Ignore [`Self::logs`] and [`Self::ipld_ops`] as they are implementation-dependent + fn eq(&self, other: &Self) -> bool { + self.msg == other.msg + && self.msg_rct == other.msg_rct + && self.invoked_actor == other.invoked_actor + && self.gas_charges == other.gas_charges + && self.subcalls == other.subcalls + } } impl ExecutionTrace { diff --git a/src/rpc/snapshots/forest__rpc__tests__rpc__v0.snap b/src/rpc/snapshots/forest__rpc__tests__rpc__v0.snap index d3436b32a6ff..c2ff66a70971 100644 --- a/src/rpc/snapshots/forest__rpc__tests__rpc__v0.snap +++ b/src/rpc/snapshots/forest__rpc__tests__rpc__v0.snap @@ -147,7 +147,7 @@ methods: name: Filecoin.ChainGetMessage.Result required: true schema: - $ref: "#/components/schemas/FlattenedApiMessage" + $ref: "#/components/schemas/Message" paramStructure: by-position - name: Filecoin.ChainGetMessagesInTipset params: @@ -1846,7 +1846,7 @@ methods: name: Filecoin.GasEstimateMessageGas.Result required: true schema: - $ref: "#/components/schemas/FlattenedApiMessage" + $ref: "#/components/schemas/Message" paramStructure: by-position - name: Filecoin.MarketAddBalance params: @@ -5977,6 +5977,14 @@ components: anyOf: - $ref: "#/components/schemas/ActorTrace" - type: "null" + IpldOps: + type: array + items: + $ref: "#/components/schemas/TraceIpld" + Logs: + type: array + items: + type: string Msg: $ref: "#/components/schemas/MessageTrace" MsgRct: @@ -6179,50 +6187,6 @@ components: - SupplementalData - Signers - Signature - FlattenedApiMessage: - type: object - properties: - CID: - $ref: "#/components/schemas/Cid" - From: - $ref: "#/components/schemas/Address" - GasFeeCap: - $ref: "#/components/schemas/TokenAmount" - default: "0" - GasLimit: - type: integer - format: uint64 - default: 0 - minimum: 0 - GasPremium: - $ref: "#/components/schemas/TokenAmount" - default: "0" - Method: - type: integer - format: uint64 - default: 0 - minimum: 0 - Nonce: - type: integer - format: uint64 - default: 0 - minimum: 0 - Params: - $ref: "#/components/schemas/Nullable_Base64String" - To: - $ref: "#/components/schemas/Address" - Value: - $ref: "#/components/schemas/TokenAmount" - default: "0" - Version: - type: integer - format: uint64 - default: 0 - minimum: 0 - required: - - To - - From - - CID ForestChainExportDiffParams: type: object properties: @@ -6449,6 +6413,9 @@ components: UpgradeWatermelonHeight: type: integer format: int64 + UpgradeXxHeight: + type: integer + format: int64 required: - UpgradeSmokeHeight - UpgradeBreezeHeight @@ -6482,6 +6449,7 @@ components: - UpgradeTeepHeight - UpgradeTockHeight - UpgradeGoldenWeekHeight + - UpgradeXxHeight GasTrace: type: object properties: @@ -6595,6 +6563,8 @@ components: Message: type: object properties: + CID: + $ref: "#/components/schemas/Nullable_Cid" From: $ref: "#/components/schemas/Address" GasFeeCap: @@ -6952,6 +6922,10 @@ components: minimum: 0 ForkUpgradeParams: $ref: "#/components/schemas/ForkUpgradeParams" + GenesisTimestamp: + type: integer + format: uint64 + minimum: 0 NetworkName: type: string PreCommitChallengeDelay: @@ -6964,6 +6938,7 @@ components: - PreCommitChallengeDelay - ForkUpgradeParams - Eip155ChainID + - GenesisTimestamp NetworkVersion: description: "Specifies the network version\n\n# Examples\n```\n# use forest::doctest_private::NetworkVersion;\nlet v0 = NetworkVersion::V0;\n\n// dereference to convert to FVM4\nassert_eq!(fvm_shared4::version::NetworkVersion::V0, *v0);\n\n// use `.into()` when FVM3 has to be specified.\nassert_eq!(fvm_shared3::version::NetworkVersion::V0, v0.into());\n\n// use `.into()` when FVM2 has to be specified.\nassert_eq!(fvm_shared2::version::NetworkVersion::V0, v0.into());\n```" type: integer @@ -7308,6 +7283,10 @@ components: properties: APIVersion: $ref: "#/components/schemas/ShiftingVersion" + Agent: + type: + - string + - "null" BlockDelay: type: integer format: uint32 @@ -7665,6 +7644,28 @@ components: anyOf: - $ref: "#/components/schemas/EthCallTraceAction" - $ref: "#/components/schemas/EthCreateTraceAction" + TraceIpld: + description: "IPLD operation details attached to an [`ExecutionTrace`]." + type: object + properties: + Cid: + $ref: "#/components/schemas/Cid" + Op: + $ref: "#/components/schemas/TraceIpldOp" + Size: + type: integer + format: uint64 + minimum: 0 + required: + - Op + - Cid + - Size + TraceIpldOp: + type: string + enum: + - Get + - Put + - Unknown TraceResult: anyOf: - $ref: "#/components/schemas/EthCallTraceResult" diff --git a/src/rpc/snapshots/forest__rpc__tests__rpc__v1.snap b/src/rpc/snapshots/forest__rpc__tests__rpc__v1.snap index 65ed1a0d30b6..a6e665752592 100644 --- a/src/rpc/snapshots/forest__rpc__tests__rpc__v1.snap +++ b/src/rpc/snapshots/forest__rpc__tests__rpc__v1.snap @@ -143,7 +143,7 @@ methods: name: Filecoin.ChainGetMessage.Result required: true schema: - $ref: "#/components/schemas/FlattenedApiMessage" + $ref: "#/components/schemas/Message" paramStructure: by-position - name: Filecoin.ChainGetMessagesInTipset params: @@ -1926,7 +1926,7 @@ methods: name: Filecoin.GasEstimateMessageGas.Result required: true schema: - $ref: "#/components/schemas/FlattenedApiMessage" + $ref: "#/components/schemas/Message" paramStructure: by-position - name: Filecoin.MarketAddBalance params: @@ -6096,6 +6096,14 @@ components: anyOf: - $ref: "#/components/schemas/ActorTrace" - type: "null" + IpldOps: + type: array + items: + $ref: "#/components/schemas/TraceIpld" + Logs: + type: array + items: + type: string Msg: $ref: "#/components/schemas/MessageTrace" MsgRct: @@ -6298,50 +6306,6 @@ components: - SupplementalData - Signers - Signature - FlattenedApiMessage: - type: object - properties: - CID: - $ref: "#/components/schemas/Cid" - From: - $ref: "#/components/schemas/Address" - GasFeeCap: - $ref: "#/components/schemas/TokenAmount" - default: "0" - GasLimit: - type: integer - format: uint64 - default: 0 - minimum: 0 - GasPremium: - $ref: "#/components/schemas/TokenAmount" - default: "0" - Method: - type: integer - format: uint64 - default: 0 - minimum: 0 - Nonce: - type: integer - format: uint64 - default: 0 - minimum: 0 - Params: - $ref: "#/components/schemas/Nullable_Base64String" - To: - $ref: "#/components/schemas/Address" - Value: - $ref: "#/components/schemas/TokenAmount" - default: "0" - Version: - type: integer - format: uint64 - default: 0 - minimum: 0 - required: - - To - - From - - CID ForestChainExportDiffParams: type: object properties: @@ -6568,6 +6532,9 @@ components: UpgradeWatermelonHeight: type: integer format: int64 + UpgradeXxHeight: + type: integer + format: int64 required: - UpgradeSmokeHeight - UpgradeBreezeHeight @@ -6601,6 +6568,7 @@ components: - UpgradeTeepHeight - UpgradeTockHeight - UpgradeGoldenWeekHeight + - UpgradeXxHeight GasTrace: type: object properties: @@ -6811,6 +6779,8 @@ components: Message: type: object properties: + CID: + $ref: "#/components/schemas/Nullable_Cid" From: $ref: "#/components/schemas/Address" GasFeeCap: @@ -7168,6 +7138,10 @@ components: minimum: 0 ForkUpgradeParams: $ref: "#/components/schemas/ForkUpgradeParams" + GenesisTimestamp: + type: integer + format: uint64 + minimum: 0 NetworkName: type: string PreCommitChallengeDelay: @@ -7180,6 +7154,7 @@ components: - PreCommitChallengeDelay - ForkUpgradeParams - Eip155ChainID + - GenesisTimestamp NetworkVersion: description: "Specifies the network version\n\n# Examples\n```\n# use forest::doctest_private::NetworkVersion;\nlet v0 = NetworkVersion::V0;\n\n// dereference to convert to FVM4\nassert_eq!(fvm_shared4::version::NetworkVersion::V0, *v0);\n\n// use `.into()` when FVM3 has to be specified.\nassert_eq!(fvm_shared3::version::NetworkVersion::V0, v0.into());\n\n// use `.into()` when FVM2 has to be specified.\nassert_eq!(fvm_shared2::version::NetworkVersion::V0, v0.into());\n```" type: integer @@ -7544,6 +7519,10 @@ components: properties: APIVersion: $ref: "#/components/schemas/ShiftingVersion" + Agent: + type: + - string + - "null" BlockDelay: type: integer format: uint32 @@ -7901,6 +7880,28 @@ components: anyOf: - $ref: "#/components/schemas/EthCallTraceAction" - $ref: "#/components/schemas/EthCreateTraceAction" + TraceIpld: + description: "IPLD operation details attached to an [`ExecutionTrace`]." + type: object + properties: + Cid: + $ref: "#/components/schemas/Cid" + Op: + $ref: "#/components/schemas/TraceIpldOp" + Size: + type: integer + format: uint64 + minimum: 0 + required: + - Op + - Cid + - Size + TraceIpldOp: + type: string + enum: + - Get + - Put + - Unknown TraceResult: anyOf: - $ref: "#/components/schemas/EthCallTraceResult" diff --git a/src/state_manager/utils.rs b/src/state_manager/utils.rs index b8fbda9f7de0..53e3fcd865eb 100644 --- a/src/state_manager/utils.rs +++ b/src/state_manager/utils.rs @@ -669,6 +669,8 @@ pub mod structured { gas_charges, subcalls, invoked_actor: actor_trace, + logs: vec![], + ipld_ops: vec![], }); } } diff --git a/src/tool/subcommands/api_cmd/api_compare_tests.rs b/src/tool/subcommands/api_cmd/api_compare_tests.rs index 6d5bad680bcc..1319fafd73ab 100644 --- a/src/tool/subcommands/api_cmd/api_compare_tests.rs +++ b/src/tool/subcommands/api_cmd/api_compare_tests.rs @@ -2375,9 +2375,7 @@ fn gas_tests_with_tipset(shared_tipset: &Tipset) -> Vec { shared_tipset.key().into(), )) .unwrap(), - |forest_api_msg, lotus_api_msg| { - let forest_msg = forest_api_msg.message; - let lotus_msg = lotus_api_msg.message; + |forest_msg, lotus_msg| { // Validate that the gas limit is identical (must be deterministic) if forest_msg.gas_limit != lotus_msg.gas_limit { return false; diff --git a/src/tool/subcommands/api_cmd/stateful_tests.rs b/src/tool/subcommands/api_cmd/stateful_tests.rs index 53658b54717f..7feed17c22e2 100644 --- a/src/tool/subcommands/api_cmd/stateful_tests.rs +++ b/src/tool/subcommands/api_cmd/stateful_tests.rs @@ -344,14 +344,14 @@ async fn invoke_contract(client: &rpc::Client, tx: &TestTransaction) -> anyhow:: let eth_tx_args = crate::eth::EthEip1559TxArgsBuilder::default() .chain_id(ETH_CHAIN_ID) - .unsigned_message(&unsigned_msg.message)? + .unsigned_message(&unsigned_msg)? .build() .map_err(|e| anyhow::anyhow!("Failed to build EIP-1559 transaction: {}", e))?; let eth_tx = crate::eth::EthTx::from(eth_tx_args); let data = eth_tx.rlp_unsigned_message(ETH_CHAIN_ID)?; let sig = client.call(WalletSign::request((tx.from, data))?).await?; - let smsg = SignedMessage::new_unchecked(unsigned_msg.message, sig); + let smsg = SignedMessage::new_unchecked(unsigned_msg, sig); let cid = smsg.cid(); client.call(MpoolPush::request((smsg,))?).await?; diff --git a/src/wallet/subcommands/wallet_cmd.rs b/src/wallet/subcommands/wallet_cmd.rs index c5aa7940f07e..f771a3ebcea5 100644 --- a/src/wallet/subcommands/wallet_cmd.rs +++ b/src/wallet/subcommands/wallet_cmd.rs @@ -545,8 +545,7 @@ impl WalletCommands { &backend.remote, (message, spec, ApiTipsetKey(None)), ) - .await? - .message; + .await?; if message.gas_premium > message.gas_fee_cap { anyhow::bail!("After estimation, gas premium is greater than gas fee cap")