diff --git a/CHANGELOG.md b/CHANGELOG.md index 315ac9b274d..c0d74847c4d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,8 @@ ### Fixed +- [#7214](https://github.com/ChainSafe/forest/pull/7214): Aligned the `eth` transaction `accessList` field with go-ethereum/reth (typed: `[]`, legacy: omitted, never `null`). + - [#7227](https://github.com/ChainSafe/forest/issues/7227): Fixed invalid `Filecoin.GasEstimateGasPremium` and `Filecoin.GasEstimateFeeCap` responses that were returning a fraction instead of an integer. ## Forest v0.33.7 "Shimmergloom" diff --git a/docs/openrpc-specs/v0.json b/docs/openrpc-specs/v0.json index 017db4222a3..93651fb1596 100644 --- a/docs/openrpc-specs/v0.json +++ b/docs/openrpc-specs/v0.json @@ -811,12 +811,9 @@ "params": [], "result": { "name": "Filecoin.EthAccounts.Result", - "required": false, + "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": "array", "items": { "type": "string" } @@ -1100,12 +1097,9 @@ ], "result": { "name": "Filecoin.EthGetBlockReceipts.Result", - "required": false, + "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": "array", "items": { "$ref": "#/components/schemas/EthTxReceipt" } @@ -1135,12 +1129,9 @@ ], "result": { "name": "Filecoin.EthGetBlockReceiptsLimited.Result", - "required": false, + "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": "array", "items": { "$ref": "#/components/schemas/EthTxReceipt" } @@ -1753,12 +1744,9 @@ ], "result": { "name": "Filecoin.EthTraceBlock.Result", - "required": false, + "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": "array", "items": { "$ref": "#/components/schemas/EthBlockTrace" } @@ -1780,12 +1768,9 @@ ], "result": { "name": "Filecoin.EthTraceFilter.Result", - "required": false, + "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": "array", "items": { "$ref": "#/components/schemas/EthBlockTrace" } @@ -1820,12 +1805,9 @@ ], "result": { "name": "Filecoin.EthTraceReplayBlockTransactions.Result", - "required": false, + "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": "array", "items": { "$ref": "#/components/schemas/EthReplayBlockTransactionTrace" } @@ -1847,12 +1829,9 @@ ], "result": { "name": "Filecoin.EthTraceTransaction.Result", - "required": false, + "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": "array", "items": { "$ref": "#/components/schemas/EthBlockTrace" } @@ -6227,12 +6206,9 @@ "params": [], "result": { "name": "eth_accounts.Result", - "required": false, + "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": "array", "items": { "type": "string" } @@ -6495,12 +6471,9 @@ ], "result": { "name": "eth_getBlockReceipts.Result", - "required": false, + "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": "array", "items": { "$ref": "#/components/schemas/EthTxReceipt" } @@ -6530,12 +6503,9 @@ ], "result": { "name": "eth_getBlockReceiptsLimited.Result", - "required": false, + "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": "array", "items": { "$ref": "#/components/schemas/EthTxReceipt" } @@ -7208,12 +7178,9 @@ ], "result": { "name": "trace_block.Result", - "required": false, + "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": "array", "items": { "$ref": "#/components/schemas/EthBlockTrace" } @@ -7235,12 +7202,9 @@ ], "result": { "name": "trace_filter.Result", - "required": false, + "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": "array", "items": { "$ref": "#/components/schemas/EthBlockTrace" } @@ -7275,12 +7239,9 @@ ], "result": { "name": "trace_replayBlockTransactions.Result", - "required": false, + "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": "array", "items": { "$ref": "#/components/schemas/EthReplayBlockTransactionTrace" } @@ -7302,12 +7263,9 @@ ], "result": { "name": "trace_transaction.Result", - "required": false, + "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": "array", "items": { "$ref": "#/components/schemas/EthBlockTrace" } @@ -7694,10 +7652,7 @@ "type": "object", "properties": { "accessList": { - "type": [ - "array", - "null" - ], + "type": "array", "items": { "$ref": "#/components/schemas/EthHash" } diff --git a/docs/openrpc-specs/v1.json b/docs/openrpc-specs/v1.json index 83c828becbd..b61aee70ae9 100644 --- a/docs/openrpc-specs/v1.json +++ b/docs/openrpc-specs/v1.json @@ -803,12 +803,9 @@ "params": [], "result": { "name": "Filecoin.EthAccounts.Result", - "required": false, + "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": "array", "items": { "type": "string" } @@ -1092,12 +1089,9 @@ ], "result": { "name": "Filecoin.EthGetBlockReceipts.Result", - "required": false, + "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": "array", "items": { "$ref": "#/components/schemas/EthTxReceipt" } @@ -1127,12 +1121,9 @@ ], "result": { "name": "Filecoin.EthGetBlockReceiptsLimited.Result", - "required": false, + "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": "array", "items": { "$ref": "#/components/schemas/EthTxReceipt" } @@ -1745,12 +1736,9 @@ ], "result": { "name": "Filecoin.EthTraceBlock.Result", - "required": false, + "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": "array", "items": { "$ref": "#/components/schemas/EthBlockTrace" } @@ -1772,12 +1760,9 @@ ], "result": { "name": "Filecoin.EthTraceFilter.Result", - "required": false, + "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": "array", "items": { "$ref": "#/components/schemas/EthBlockTrace" } @@ -1812,12 +1797,9 @@ ], "result": { "name": "Filecoin.EthTraceReplayBlockTransactions.Result", - "required": false, + "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": "array", "items": { "$ref": "#/components/schemas/EthReplayBlockTransactionTrace" } @@ -1839,12 +1821,9 @@ ], "result": { "name": "Filecoin.EthTraceTransaction.Result", - "required": false, + "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": "array", "items": { "$ref": "#/components/schemas/EthBlockTrace" } @@ -6283,12 +6262,9 @@ "params": [], "result": { "name": "eth_accounts.Result", - "required": false, + "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": "array", "items": { "type": "string" } @@ -6551,12 +6527,9 @@ ], "result": { "name": "eth_getBlockReceipts.Result", - "required": false, + "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": "array", "items": { "$ref": "#/components/schemas/EthTxReceipt" } @@ -6586,12 +6559,9 @@ ], "result": { "name": "eth_getBlockReceiptsLimited.Result", - "required": false, + "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": "array", "items": { "$ref": "#/components/schemas/EthTxReceipt" } @@ -7264,12 +7234,9 @@ ], "result": { "name": "trace_block.Result", - "required": false, + "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": "array", "items": { "$ref": "#/components/schemas/EthBlockTrace" } @@ -7333,12 +7300,9 @@ ], "result": { "name": "trace_filter.Result", - "required": false, + "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": "array", "items": { "$ref": "#/components/schemas/EthBlockTrace" } @@ -7373,12 +7337,9 @@ ], "result": { "name": "trace_replayBlockTransactions.Result", - "required": false, + "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": "array", "items": { "$ref": "#/components/schemas/EthReplayBlockTransactionTrace" } @@ -7400,12 +7361,9 @@ ], "result": { "name": "trace_transaction.Result", - "required": false, + "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": "array", "items": { "$ref": "#/components/schemas/EthBlockTrace" } @@ -7834,10 +7792,7 @@ "type": "object", "properties": { "accessList": { - "type": [ - "array", - "null" - ], + "type": "array", "items": { "$ref": "#/components/schemas/EthHash" } diff --git a/docs/openrpc-specs/v2.json b/docs/openrpc-specs/v2.json index d60e0dff492..2bbeb08a4f9 100644 --- a/docs/openrpc-specs/v2.json +++ b/docs/openrpc-specs/v2.json @@ -45,12 +45,9 @@ "params": [], "result": { "name": "Filecoin.EthAccounts.Result", - "required": false, + "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": "array", "items": { "type": "string" } @@ -334,12 +331,9 @@ ], "result": { "name": "Filecoin.EthGetBlockReceipts.Result", - "required": false, + "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": "array", "items": { "$ref": "#/components/schemas/EthTxReceipt" } @@ -369,12 +363,9 @@ ], "result": { "name": "Filecoin.EthGetBlockReceiptsLimited.Result", - "required": false, + "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": "array", "items": { "$ref": "#/components/schemas/EthTxReceipt" } @@ -987,12 +978,9 @@ ], "result": { "name": "Filecoin.EthTraceBlock.Result", - "required": false, + "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": "array", "items": { "$ref": "#/components/schemas/EthBlockTrace" } @@ -1014,12 +1002,9 @@ ], "result": { "name": "Filecoin.EthTraceFilter.Result", - "required": false, + "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": "array", "items": { "$ref": "#/components/schemas/EthBlockTrace" } @@ -1054,12 +1039,9 @@ ], "result": { "name": "Filecoin.EthTraceReplayBlockTransactions.Result", - "required": false, + "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": "array", "items": { "$ref": "#/components/schemas/EthReplayBlockTransactionTrace" } @@ -1081,12 +1063,9 @@ ], "result": { "name": "Filecoin.EthTraceTransaction.Result", - "required": false, + "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": "array", "items": { "$ref": "#/components/schemas/EthBlockTrace" } @@ -1518,12 +1497,9 @@ "params": [], "result": { "name": "eth_accounts.Result", - "required": false, + "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": "array", "items": { "type": "string" } @@ -1786,12 +1762,9 @@ ], "result": { "name": "eth_getBlockReceipts.Result", - "required": false, + "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": "array", "items": { "$ref": "#/components/schemas/EthTxReceipt" } @@ -1821,12 +1794,9 @@ ], "result": { "name": "eth_getBlockReceiptsLimited.Result", - "required": false, + "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": "array", "items": { "$ref": "#/components/schemas/EthTxReceipt" } @@ -2499,12 +2469,9 @@ ], "result": { "name": "trace_block.Result", - "required": false, + "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": "array", "items": { "$ref": "#/components/schemas/EthBlockTrace" } @@ -2568,12 +2535,9 @@ ], "result": { "name": "trace_filter.Result", - "required": false, + "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": "array", "items": { "$ref": "#/components/schemas/EthBlockTrace" } @@ -2608,12 +2572,9 @@ ], "result": { "name": "trace_replayBlockTransactions.Result", - "required": false, + "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": "array", "items": { "$ref": "#/components/schemas/EthReplayBlockTransactionTrace" } @@ -2635,12 +2596,9 @@ ], "result": { "name": "trace_transaction.Result", - "required": false, + "required": true, "schema": { - "type": [ - "array", - "null" - ], + "type": "array", "items": { "$ref": "#/components/schemas/EthBlockTrace" } @@ -2769,10 +2727,7 @@ "type": "object", "properties": { "accessList": { - "type": [ - "array", - "null" - ], + "type": "array", "items": { "$ref": "#/components/schemas/EthHash" } diff --git a/src/lotus_json/vec.rs b/src/lotus_json/vec.rs index 342139fa946..cbdafb6161c 100644 --- a/src/lotus_json/vec.rs +++ b/src/lotus_json/vec.rs @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0, MIT use super::*; +use get_size2::GetSize; impl HasLotusJson for Vec // TODO(forest): https://github.com/ChainSafe/forest/issues/4032 @@ -37,7 +38,7 @@ where // while an empty `NotNullVec` serializes into `[]` // this is a temporary workaround and will likely be deprecated once // other issues on serde of `Vec` are resolved. -#[derive(Debug, Clone, PartialEq, JsonSchema)] +#[derive(Debug, Clone, Default, PartialEq, JsonSchema, GetSize)] pub struct NotNullVec(pub Vec); impl HasLotusJson for NotNullVec @@ -60,6 +61,22 @@ where } } +/// Deserialize `Option>`, mapping `null` and empty `[]` to `None`. +/// +/// Generic `HasLotusJson for Option` keeps `Some(NotNullVec([]))` on `[]`; +/// Lotus sends `null` for empty access lists and we treat both as absent. +pub fn deserialize_empty_not_null_opt<'de, T, D>( + deserializer: D, +) -> Result>, D::Error> +where + T: Deserialize<'de>, + D: Deserializer<'de>, +{ + Ok(Option::>::deserialize(deserializer)? + .filter(|l| !l.is_empty()) + .map(NotNullVec)) +} + #[test] fn snapshots() { assert_one_snapshot(json!([{"/": "baeaaaaa"}]), vec![::cid::Cid::default()]); diff --git a/src/rpc/methods/eth.rs b/src/rpc/methods/eth.rs index 5a98cf4e577..2c7d8bed3ba 100644 --- a/src/rpc/methods/eth.rs +++ b/src/rpc/methods/eth.rs @@ -26,7 +26,7 @@ use crate::eth::{ EAMMethod, EVMMethod, EthChainId as EthChainIdType, EthEip1559TxArgs, EthLegacyEip155TxArgs, EthLegacyHomesteadTxArgs, parse_eth_transaction, }; -use crate::lotus_json::{HasLotusJson, lotus_json_with_self}; +use crate::lotus_json::{HasLotusJson, NotNullVec, lotus_json_with_self}; use crate::message::{ChainMessage, MessageRead as _, MessageReadWrite as _, SignedMessage}; use crate::networks::Height; use crate::prelude::*; @@ -642,9 +642,14 @@ pub struct ApiEthTx { pub max_priority_fee_per_gas: Option, #[serde(skip_serializing_if = "Option::is_none", default)] pub gas_price: Option, - #[schemars(with = "Option>")] - #[serde(with = "crate::lotus_json")] - pub access_list: Vec, + #[schemars(with = "Vec")] + #[serde( + default, + skip_serializing_if = "Option::is_none", + serialize_with = "crate::lotus_json::serialize", + deserialize_with = "crate::lotus_json::deserialize_empty_not_null_opt" + )] + pub access_list: Option>, pub v: EthBigInt, pub r: EthBigInt, pub s: EthBigInt, @@ -846,7 +851,7 @@ impl RpcMethod<0> for EthAccounts { ); type Params = (); - type Ok = Vec; + type Ok = NotNullVec; async fn handle( _: Ctx, @@ -854,7 +859,7 @@ impl RpcMethod<0> for EthAccounts { _: &http::Extensions, ) -> Result { // EthAccounts will always return [] since we don't expect Forest to manage private keys - Ok(vec![]) + Ok(NotNullVec(vec![])) } } @@ -1263,7 +1268,7 @@ fn eth_tx_from_native_message( gas: EthUint64(msg.gas_limit), max_fee_per_gas: Some(msg.gas_fee_cap.clone().into()), max_priority_fee_per_gas: Some(msg.gas_premium.clone().into()), - access_list: vec![], + access_list: Some(NotNullVec(vec![])), ..ApiEthTx::default() }) } @@ -1602,7 +1607,7 @@ impl RpcMethod<1> for EthGetBlockReceipts { ); type Params = (BlockNumberOrHash,); - type Ok = Vec; + type Ok = NotNullVec; async fn handle( ctx: Ctx, @@ -1615,6 +1620,7 @@ impl RpcMethod<1> for EthGetBlockReceipts { .await?; get_block_receipts(&ctx, ts, None) .await + .map(NotNullVec) .map_err(ServerError::from) } } @@ -1631,7 +1637,7 @@ impl RpcMethod<2> for EthGetBlockReceiptsLimited { ); type Params = (BlockNumberOrHash, ChainEpoch); - type Ok = Vec; + type Ok = NotNullVec; async fn handle( ctx: Ctx, @@ -1644,6 +1650,7 @@ impl RpcMethod<2> for EthGetBlockReceiptsLimited { .await?; get_block_receipts(&ctx, ts, Some(limit)) .await + .map(NotNullVec) .map_err(ServerError::from) } } @@ -3580,7 +3587,7 @@ impl RpcMethod<1> for EthTraceBlock { const DESCRIPTION: Option<&'static str> = Some("Returns traces created at given block."); type Params = (BlockNumberOrHash,); - type Ok = Vec; + type Ok = NotNullVec; async fn handle( ctx: Ctx, (block_param,): Self::Params, @@ -3590,7 +3597,9 @@ impl RpcMethod<1> for EthTraceBlock { let ts = resolver .tipset_by_block_number_or_hash(block_param, ResolveNullTipset::TakeOlder) .await?; - eth_trace_block(&ctx.state_manager, &ts).await + eth_trace_block(&ctx.state_manager, &ts) + .await + .map(NotNullVec) } } @@ -3979,7 +3988,7 @@ impl RpcMethod<1> for EthTraceTransaction { Some("Returns the traces for a specific transaction."); type Params = (String,); - type Ok = Vec; + type Ok = NotNullVec; async fn handle( ctx: Ctx, (tx_hash,): Self::Params, @@ -4000,7 +4009,7 @@ impl RpcMethod<1> for EthTraceTransaction { .into_iter() .filter(|trace| trace.transaction_hash == eth_hash) .collect(); - Ok(traces) + Ok(NotNullVec(traces)) } } @@ -4017,7 +4026,7 @@ impl RpcMethod<2> for EthTraceReplayBlockTransactions { ); type Params = (BlockNumberOrHash, Vec); - type Ok = Vec; + type Ok = NotNullVec; async fn handle( ctx: Ctx, @@ -4036,7 +4045,9 @@ impl RpcMethod<2> for EthTraceReplayBlockTransactions { .tipset_by_block_number_or_hash(block_param, ResolveNullTipset::TakeOlder) .await?; - eth_trace_replay_block_transactions(&ctx, &ts).await + eth_trace_replay_block_transactions(&ctx, &ts) + .await + .map(NotNullVec) } } @@ -4089,7 +4100,7 @@ impl RpcMethod<1> for EthTraceFilter { const DESCRIPTION: Option<&'static str> = Some("Returns the traces for transactions matching the filter criteria."); type Params = (EthTraceFilterCriteria,); - type Ok = Vec; + type Ok = NotNullVec; async fn handle( ctx: Ctx, @@ -4123,7 +4134,9 @@ impl RpcMethod<1> for EthTraceFilter { return Err(EthErrors::limit_exceeded(max_block_range, range).into()); } } - Ok(trace_filter(ctx, filter, from_block, to_block, ext).await?) + Ok(NotNullVec( + trace_filter(ctx, filter, from_block, to_block, ext).await?, + )) } } @@ -4155,7 +4168,7 @@ async fn trace_filter( ext, ) .await?; - for block_trace in block_traces { + for block_trace in block_traces.0 { if block_trace .trace .match_filter_criteria(filter.from_address.as_ref(), filter.to_address.as_ref())? @@ -4209,6 +4222,59 @@ mod test { } } + #[rstest] + // Non-empty access list → JSON array. + #[case::populated_array(ApiEthTx { access_list: Some(NotNullVec(vec![EthHash::default()])), ..Default::default() }, Some(1))] + // `access_list: None` → field omitted. + #[case::explicit_none_omitted(ApiEthTx { access_list: None, ..Default::default() }, None)] + // Legacy tx → field omitted. + #[case::legacy_homestead_omitted(EthLegacyHomesteadTxArgs::default().into(), None)] + // Typed tx with no entries → `[]`. + #[case::eip1559_empty_array(EthEip1559TxArgs::default().into(), Some(0))] + fn access_list_serialization(#[case] tx: ApiEthTx, #[case] expected: Option) { + let json = serde_json::to_value(tx.into_lotus_json()).unwrap(); + match expected { + Some(len) => assert_eq!( + json["accessList"] + .as_array() + .expect("accessList should serialize as an array") + .len(), + len + ), + None => assert!(!json.as_object().unwrap().contains_key("accessList")), + } + } + + #[rstest] + // `"accessList": null` → `None`. + #[case::null_to_none(Some(serde_json::Value::Null), None)] + // Omitted/Missing field → `None`. + #[case::missing_to_none(None, None)] + // `"accessList": []` → `None`. + #[case::empty_array_to_none(Some(serde_json::json!([])), None)] + // Non-empty array → `Some(...)`. + #[case::populated_array_to_some( + Some(serde_json::json!([EthHash::default()])), + Some(NotNullVec(vec![EthHash::default()])) + )] + fn access_list_deserialization( + #[case] access_list_value: Option, + #[case] expected: Option>, + ) { + let mut json = serde_json::to_value(ApiEthTx::default().into_lotus_json()).unwrap(); + let obj = json.as_object_mut().unwrap(); + match access_list_value { + Some(value) => { + obj.insert("accessList".into(), value); + } + None => { + obj.remove("accessList"); + } + } + let tx = ApiEthTx::from_lotus_json(serde_json::from_value(json).unwrap()); + assert_eq!(tx.access_list, expected); + } + #[quickcheck] fn gas_price_result_serde_roundtrip(i: u128) { let r = EthBigInt(ethereum_types::U256::from(i)); diff --git a/src/rpc/methods/eth/eth_tx.rs b/src/rpc/methods/eth/eth_tx.rs index 09107a2d76f..c16eca72a53 100644 --- a/src/rpc/methods/eth/eth_tx.rs +++ b/src/rpc/methods/eth/eth_tx.rs @@ -98,6 +98,7 @@ impl From for ApiEthTx { v: v.into(), r: r.into(), s: s.into(), + access_list: Some(NotNullVec(vec![])), ..Default::default() } } diff --git a/src/rpc/snapshots/forest__rpc__tests__rpc__v0.snap b/src/rpc/snapshots/forest__rpc__tests__rpc__v0.snap index 7286ed2d616..42267792f50 100644 --- a/src/rpc/snapshots/forest__rpc__tests__rpc__v0.snap +++ b/src/rpc/snapshots/forest__rpc__tests__rpc__v0.snap @@ -493,11 +493,9 @@ methods: params: [] result: name: Filecoin.EthAccounts.Result - required: false + required: true schema: - type: - - array - - "null" + type: array items: type: string paramStructure: by-position @@ -506,11 +504,9 @@ methods: params: [] result: name: eth_accounts.Result - required: false + required: true schema: - type: - - array - - "null" + type: array items: type: string paramStructure: by-position @@ -867,11 +863,9 @@ methods: $ref: "#/components/schemas/BlockNumberOrHash" result: name: Filecoin.EthGetBlockReceipts.Result - required: false + required: true schema: - type: - - array - - "null" + type: array items: $ref: "#/components/schemas/EthTxReceipt" paramStructure: by-position @@ -884,11 +878,9 @@ methods: $ref: "#/components/schemas/BlockNumberOrHash" result: name: eth_getBlockReceipts.Result - required: false + required: true schema: - type: - - array - - "null" + type: array items: $ref: "#/components/schemas/EthTxReceipt" paramStructure: by-position @@ -906,11 +898,9 @@ methods: format: int64 result: name: Filecoin.EthGetBlockReceiptsLimited.Result - required: false + required: true schema: - type: - - array - - "null" + type: array items: $ref: "#/components/schemas/EthTxReceipt" paramStructure: by-position @@ -928,11 +918,9 @@ methods: format: int64 result: name: eth_getBlockReceiptsLimited.Result - required: false + required: true schema: - type: - - array - - "null" + type: array items: $ref: "#/components/schemas/EthTxReceipt" paramStructure: by-position @@ -1639,11 +1627,9 @@ methods: $ref: "#/components/schemas/BlockNumberOrHash" result: name: Filecoin.EthTraceBlock.Result - required: false + required: true schema: - type: - - array - - "null" + type: array items: $ref: "#/components/schemas/EthBlockTrace" paramStructure: by-position @@ -1656,11 +1642,9 @@ methods: $ref: "#/components/schemas/BlockNumberOrHash" result: name: trace_block.Result - required: false + required: true schema: - type: - - array - - "null" + type: array items: $ref: "#/components/schemas/EthBlockTrace" paramStructure: by-position @@ -1673,11 +1657,9 @@ methods: $ref: "#/components/schemas/EthTraceFilterCriteria" result: name: Filecoin.EthTraceFilter.Result - required: false + required: true schema: - type: - - array - - "null" + type: array items: $ref: "#/components/schemas/EthBlockTrace" paramStructure: by-position @@ -1690,11 +1672,9 @@ methods: $ref: "#/components/schemas/EthTraceFilterCriteria" result: name: trace_filter.Result - required: false + required: true schema: - type: - - array - - "null" + type: array items: $ref: "#/components/schemas/EthBlockTrace" paramStructure: by-position @@ -1707,11 +1687,9 @@ methods: type: string result: name: Filecoin.EthTraceTransaction.Result - required: false + required: true schema: - type: - - array - - "null" + type: array items: $ref: "#/components/schemas/EthBlockTrace" paramStructure: by-position @@ -1724,11 +1702,9 @@ methods: type: string result: name: trace_transaction.Result - required: false + required: true schema: - type: - - array - - "null" + type: array items: $ref: "#/components/schemas/EthBlockTrace" paramStructure: by-position @@ -1749,11 +1725,9 @@ methods: type: string result: name: Filecoin.EthTraceReplayBlockTransactions.Result - required: false + required: true schema: - type: - - array - - "null" + type: array items: $ref: "#/components/schemas/EthReplayBlockTransactionTrace" paramStructure: by-position @@ -1774,11 +1748,9 @@ methods: type: string result: name: trace_replayBlockTransactions.Result - required: false + required: true schema: - type: - - array - - "null" + type: array items: $ref: "#/components/schemas/EthReplayBlockTransactionTrace" paramStructure: by-position @@ -4806,9 +4778,7 @@ components: type: object properties: accessList: - type: - - array - - "null" + type: array items: $ref: "#/components/schemas/EthHash" blockHash: diff --git a/src/rpc/snapshots/forest__rpc__tests__rpc__v1.snap b/src/rpc/snapshots/forest__rpc__tests__rpc__v1.snap index 792db9214e2..f39fe8add37 100644 --- a/src/rpc/snapshots/forest__rpc__tests__rpc__v1.snap +++ b/src/rpc/snapshots/forest__rpc__tests__rpc__v1.snap @@ -488,11 +488,9 @@ methods: params: [] result: name: Filecoin.EthAccounts.Result - required: false + required: true schema: - type: - - array - - "null" + type: array items: type: string paramStructure: by-position @@ -501,11 +499,9 @@ methods: params: [] result: name: eth_accounts.Result - required: false + required: true schema: - type: - - array - - "null" + type: array items: type: string paramStructure: by-position @@ -862,11 +858,9 @@ methods: $ref: "#/components/schemas/BlockNumberOrHash" result: name: Filecoin.EthGetBlockReceipts.Result - required: false + required: true schema: - type: - - array - - "null" + type: array items: $ref: "#/components/schemas/EthTxReceipt" paramStructure: by-position @@ -879,11 +873,9 @@ methods: $ref: "#/components/schemas/BlockNumberOrHash" result: name: eth_getBlockReceipts.Result - required: false + required: true schema: - type: - - array - - "null" + type: array items: $ref: "#/components/schemas/EthTxReceipt" paramStructure: by-position @@ -901,11 +893,9 @@ methods: format: int64 result: name: Filecoin.EthGetBlockReceiptsLimited.Result - required: false + required: true schema: - type: - - array - - "null" + type: array items: $ref: "#/components/schemas/EthTxReceipt" paramStructure: by-position @@ -923,11 +913,9 @@ methods: format: int64 result: name: eth_getBlockReceiptsLimited.Result - required: false + required: true schema: - type: - - array - - "null" + type: array items: $ref: "#/components/schemas/EthTxReceipt" paramStructure: by-position @@ -1634,11 +1622,9 @@ methods: $ref: "#/components/schemas/BlockNumberOrHash" result: name: Filecoin.EthTraceBlock.Result - required: false + required: true schema: - type: - - array - - "null" + type: array items: $ref: "#/components/schemas/EthBlockTrace" paramStructure: by-position @@ -1651,11 +1637,9 @@ methods: $ref: "#/components/schemas/BlockNumberOrHash" result: name: trace_block.Result - required: false + required: true schema: - type: - - array - - "null" + type: array items: $ref: "#/components/schemas/EthBlockTrace" paramStructure: by-position @@ -1714,11 +1698,9 @@ methods: $ref: "#/components/schemas/EthTraceFilterCriteria" result: name: Filecoin.EthTraceFilter.Result - required: false + required: true schema: - type: - - array - - "null" + type: array items: $ref: "#/components/schemas/EthBlockTrace" paramStructure: by-position @@ -1731,11 +1713,9 @@ methods: $ref: "#/components/schemas/EthTraceFilterCriteria" result: name: trace_filter.Result - required: false + required: true schema: - type: - - array - - "null" + type: array items: $ref: "#/components/schemas/EthBlockTrace" paramStructure: by-position @@ -1748,11 +1728,9 @@ methods: type: string result: name: Filecoin.EthTraceTransaction.Result - required: false + required: true schema: - type: - - array - - "null" + type: array items: $ref: "#/components/schemas/EthBlockTrace" paramStructure: by-position @@ -1765,11 +1743,9 @@ methods: type: string result: name: trace_transaction.Result - required: false + required: true schema: - type: - - array - - "null" + type: array items: $ref: "#/components/schemas/EthBlockTrace" paramStructure: by-position @@ -1828,11 +1804,9 @@ methods: type: string result: name: Filecoin.EthTraceReplayBlockTransactions.Result - required: false + required: true schema: - type: - - array - - "null" + type: array items: $ref: "#/components/schemas/EthReplayBlockTransactionTrace" paramStructure: by-position @@ -1853,11 +1827,9 @@ methods: type: string result: name: trace_replayBlockTransactions.Result - required: false + required: true schema: - type: - - array - - "null" + type: array items: $ref: "#/components/schemas/EthReplayBlockTransactionTrace" paramStructure: by-position @@ -4875,9 +4847,7 @@ components: type: object properties: accessList: - type: - - array - - "null" + type: array items: $ref: "#/components/schemas/EthHash" blockHash: diff --git a/src/rpc/snapshots/forest__rpc__tests__rpc__v2.snap b/src/rpc/snapshots/forest__rpc__tests__rpc__v2.snap index 62911c06a72..c50b6d763fc 100644 --- a/src/rpc/snapshots/forest__rpc__tests__rpc__v2.snap +++ b/src/rpc/snapshots/forest__rpc__tests__rpc__v2.snap @@ -78,11 +78,9 @@ methods: params: [] result: name: Filecoin.EthAccounts.Result - required: false + required: true schema: - type: - - array - - "null" + type: array items: type: string paramStructure: by-position @@ -91,11 +89,9 @@ methods: params: [] result: name: eth_accounts.Result - required: false + required: true schema: - type: - - array - - "null" + type: array items: type: string paramStructure: by-position @@ -452,11 +448,9 @@ methods: $ref: "#/components/schemas/BlockNumberOrHash" result: name: Filecoin.EthGetBlockReceipts.Result - required: false + required: true schema: - type: - - array - - "null" + type: array items: $ref: "#/components/schemas/EthTxReceipt" paramStructure: by-position @@ -469,11 +463,9 @@ methods: $ref: "#/components/schemas/BlockNumberOrHash" result: name: eth_getBlockReceipts.Result - required: false + required: true schema: - type: - - array - - "null" + type: array items: $ref: "#/components/schemas/EthTxReceipt" paramStructure: by-position @@ -491,11 +483,9 @@ methods: format: int64 result: name: Filecoin.EthGetBlockReceiptsLimited.Result - required: false + required: true schema: - type: - - array - - "null" + type: array items: $ref: "#/components/schemas/EthTxReceipt" paramStructure: by-position @@ -513,11 +503,9 @@ methods: format: int64 result: name: eth_getBlockReceiptsLimited.Result - required: false + required: true schema: - type: - - array - - "null" + type: array items: $ref: "#/components/schemas/EthTxReceipt" paramStructure: by-position @@ -1224,11 +1212,9 @@ methods: $ref: "#/components/schemas/BlockNumberOrHash" result: name: Filecoin.EthTraceBlock.Result - required: false + required: true schema: - type: - - array - - "null" + type: array items: $ref: "#/components/schemas/EthBlockTrace" paramStructure: by-position @@ -1241,11 +1227,9 @@ methods: $ref: "#/components/schemas/BlockNumberOrHash" result: name: trace_block.Result - required: false + required: true schema: - type: - - array - - "null" + type: array items: $ref: "#/components/schemas/EthBlockTrace" paramStructure: by-position @@ -1304,11 +1288,9 @@ methods: $ref: "#/components/schemas/EthTraceFilterCriteria" result: name: Filecoin.EthTraceFilter.Result - required: false + required: true schema: - type: - - array - - "null" + type: array items: $ref: "#/components/schemas/EthBlockTrace" paramStructure: by-position @@ -1321,11 +1303,9 @@ methods: $ref: "#/components/schemas/EthTraceFilterCriteria" result: name: trace_filter.Result - required: false + required: true schema: - type: - - array - - "null" + type: array items: $ref: "#/components/schemas/EthBlockTrace" paramStructure: by-position @@ -1338,11 +1318,9 @@ methods: type: string result: name: Filecoin.EthTraceTransaction.Result - required: false + required: true schema: - type: - - array - - "null" + type: array items: $ref: "#/components/schemas/EthBlockTrace" paramStructure: by-position @@ -1355,11 +1333,9 @@ methods: type: string result: name: trace_transaction.Result - required: false + required: true schema: - type: - - array - - "null" + type: array items: $ref: "#/components/schemas/EthBlockTrace" paramStructure: by-position @@ -1418,11 +1394,9 @@ methods: type: string result: name: Filecoin.EthTraceReplayBlockTransactions.Result - required: false + required: true schema: - type: - - array - - "null" + type: array items: $ref: "#/components/schemas/EthReplayBlockTransactionTrace" paramStructure: by-position @@ -1443,11 +1417,9 @@ methods: type: string result: name: trace_replayBlockTransactions.Result - required: false + required: true schema: - type: - - array - - "null" + type: array items: $ref: "#/components/schemas/EthReplayBlockTransactionTrace" paramStructure: by-position @@ -1690,9 +1662,7 @@ components: type: object properties: accessList: - type: - - array - - "null" + type: array items: $ref: "#/components/schemas/EthHash" blockHash: diff --git a/src/tool/subcommands/api_cmd/test_snapshots.txt b/src/tool/subcommands/api_cmd/test_snapshots.txt index 310ed20b0bc..986cab5c856 100644 --- a/src/tool/subcommands/api_cmd/test_snapshots.txt +++ b/src/tool/subcommands/api_cmd/test_snapshots.txt @@ -46,7 +46,7 @@ filecoin_eam_statedecodeparams_1756139121347218.rpcsnap.json.zst filecoin_eam_statedecodeparams_1756139121347288.rpcsnap.json.zst filecoin_eam_statedecodeparams_1756139121347364.rpcsnap.json.zst filecoin_ethaccount_statedecodeparams_1756186350854913.rpcsnap.json.zst -filecoin_ethaccounts_1737446676689764.rpcsnap.json.zst +filecoin_ethaccounts_1782207886518096.rpcsnap.json.zst filecoin_ethaddresstofilecoinaddress_1740132538465536.rpcsnap.json.zst filecoin_ethbasefee_1778755118342258.rpcsnap.json.zst filecoin_ethblocknumber_1741272348346171.rpcsnap.json.zst @@ -97,7 +97,7 @@ filecoin_ethgetstorageat_v2_finalized_1769611091511354.rpcsnap.json.zst filecoin_ethgetstorageat_v2_safe_1769611091439347.rpcsnap.json.zst filecoin_ethgetstorageat_v2_unknown_addr_1770288667897031.rpcsnap.json.zst filecoin_ethgettransactionbyblockhashandindex_1773159088537607.rpcsnap.json.zst -filecoin_ethgettransactionbyblocknumberandindex_1740132538304408.rpcsnap.json.zst +filecoin_ethgettransactionbyblocknumberandindex_1782207831415446.rpcsnap.json.zst filecoin_ethgettransactionbyblocknumberandindex_latest_1769103643171646.rpcsnap.json.zst filecoin_ethgettransactionbyblocknumberandindex_pending_1769103643171774.rpcsnap.json.zst filecoin_ethgettransactionbyblocknumberandindex_v2_1769103643172125.rpcsnap.json.zst