Skip to content

Enable strict json check in api compare#6970

Merged
sudo-shashank merged 28 commits into
mainfrom
shashank/enable-strict-json-api
May 12, 2026
Merged

Enable strict json check in api compare#6970
sudo-shashank merged 28 commits into
mainfrom
shashank/enable-strict-json-api

Conversation

@sudo-shashank
Copy link
Copy Markdown
Contributor

@sudo-shashank sudo-shashank commented Apr 28, 2026

Summary of changes

Changes introduced in this pull request:

  • Set FOREST_STRICT_JSON=1 for all api compare check.

  • Fix the unknown field error found in the below methods:

    • Filecoin.ChainGetBlockMessages
    • Filecoin.ChainGetMessagesInTipset
    • Filecoin.ChainGetParentMessages
    • Filecoin.MpoolPending
    • Filecoin.StateCall
    • Filecoin.StateGetNetworkParams
    • Filecoin.StateReplay
    • Filecoin.StateCompute
    • Filecoin.Version
  • Updated Filecoin.StateCall, Filecoin.StateReplay and Filecoin.StateCompute test snapshots because ExecutionTrace now includes Logs and IpldOps, which earlier snapshots did not capture.

  • Updated Filecoin.StateGetNetworkParams test snapshot because NetworkParams now includes GenesisTimestamp.

Reference issue to close (if applicable)

Closes #5635

Other information and links

Change checklist

  • I have performed a self-review of my own code,
  • I have made corresponding changes to the documentation. All new code adheres to the team's documentation standards,
  • I have added tests that prove my fix is effective or that my feature works (if possible),
  • I have made sure the CHANGELOG is up-to-date. All user-facing changes should be reflected in this document.

Outside contributions

  • I have read and agree to the CONTRIBUTING document.
  • I have read and agree to the AI Policy document. I understand that failure to comply with the guidelines will lead to rejection of the pull request.

Summary by CodeRabbit

  • New Features

    • Messages include an optional CID and use Base64 params (default null). Execution traces gain Logs and IPLD operation arrays; new IPLD trace types added. NetworkParams adds GenesisTimestamp; PublicVersion adds Agent; ForkUpgradeParams adds UpgradeFireHorseHeight.
  • Refactor

    • Relevant RPCs now return Message directly instead of a flattened wrapper.
  • Tests / Other

    • API-compare tests and snapshots updated; test environment JSON strictness tightened.

@sudo-shashank sudo-shashank added the RPC requires calibnet RPC checks to run on CI label Apr 28, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 28, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: be0fdafe-34dc-434f-8978-bb2eddf0372b

📥 Commits

Reviewing files that changed from the base of the PR and between bbf2202 and 6f8ffd4.

⛔ Files ignored due to path filters (2)
  • src/rpc/snapshots/forest__rpc__tests__rpc__v0.snap is excluded by !**/*.snap
  • src/rpc/snapshots/forest__rpc__tests__rpc__v1.snap is excluded by !**/*.snap
📒 Files selected for processing (5)
  • docs/openrpc-specs/v0.json
  • docs/openrpc-specs/v1.json
  • src/rpc/methods/common.rs
  • src/rpc/methods/state.rs
  • src/rpc/methods/state/types.rs
🚧 Files skipped from review as they are similar to previous changes (5)
  • src/rpc/methods/state.rs
  • src/rpc/methods/state/types.rs
  • src/rpc/methods/common.rs
  • docs/openrpc-specs/v1.json
  • docs/openrpc-specs/v0.json

Walkthrough

Replace flattened message wrapper types with canonical Message across OpenRPC and Rust surfaces; add CID to Message and make Params base64 default to null. Extend ExecutionTrace with IpldOps and Logs. Add TraceIpld/TraceIpldOp. Add NetworkParams.GenesisTimestamp, PublicVersion.Agent, ForkUpgradeParams.UpgradeFireHorseHeight, and enable strict JSON for api-compare tests.

Changes

Schema & Runtime shape → wiring → tests

Layer / File(s) Summary
OpenRPC schema (Data Shape)
docs/openrpc-specs/v0.json, docs/openrpc-specs/v1.json
Swap method result schemas from FlattenedApiMessageMessage. Remove FlattenedApiMessage and Nullable_Base64String. Add Message.CID (Nullable_Cid) and change Message.Params to Base64String with default: null. Add TraceIpld / TraceIpldOp. Extend ExecutionTrace with IpldOps and Logs. Add NetworkParams.GenesisTimestamp, PublicVersion.Agent, and ForkUpgradeParams.UpgradeFireHorseHeight (and update required lists).
Core types & JSON surface (Data Shape → Core Impl)
src/rpc/methods/state/types.rs, src/lotus_json/message.rs, src/lotus_json/signed_message.rs
Introduce TraceIpldOp and TraceIpld; extend ExecutionTrace with logs: Vec<String> and ipld_ops: Vec<TraceIpld> (serde defaults/skip-empty). Change MessageLotusJson.params from Option<RawBytes>RawBytes with serde default; add optional cid: Option<Cid> serialized as CID. Update SignedMessage snapshot to include nested CID.
RPC surface & wiring (Integration)
src/rpc/methods/chain.rs, src/rpc/methods/gas.rs, src/rpc/methods/common.rs, src/rpc/methods/state.rs
Remove FlattenedApiMessage and its Lotus JSON glue. ChainGetMessage and GasEstimateMessageGas now return Message directly; handlers stop computing/returning a CID wrapper. Add PublicVersion.agent populated with "forest". Wire NetworkParams.genesis_timestamp from chain store genesis header. Map ForkUpgradeParams.upgrade_fire_horse_height from ChainConfig.
Trace population logic (Core behavior)
src/state_manager/utils.rs, src/rpc/methods/eth.rs
During structured execution-trace parsing, collect ExecutionEvent::Log into logs and convert ExecutionEvent::Ipld into TraceIpld entries; include these in returned ExecutionTrace. Update test helper to initialize empty logs/ipld_ops.
Call sites & tooling (Wiring → Integration tests)
src/tool/subcommands/api_cmd/api_compare_tests.rs, src/tool/subcommands/api_cmd/stateful_tests.rs, src/wallet/subcommands/wallet_cmd.rs, src/tool/subcommands/api_cmd/test_snapshots.txt
Adjust tests and tooling to accept unwrapped Message return values (remove .message field access). Use unsigned_msg where code previously accessed nested .message. Update wallet send/gas-estimate call sites to use returned Message. Refresh test snapshot artifact references.
Test runner config (Tests)
scripts/tests/api_compare/docker-compose.yml
Enable FOREST_STRICT_JSON=1 for api-compare services to enforce strict JSON validation.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant RPC
    participant StateManager
    participant IPLDStore

    Client->>RPC: Call ChainGetMessage / GasEstimateMessageGas
    RPC->>StateManager: lookup message & run execution trace
    StateManager->>IPLDStore: perform IPLD Get/Put operations
    IPLDStore-->>StateManager: return IPLD results
    StateManager-->>RPC: return Message + ExecutionTrace (Logs, IpldOps)
    RPC-->>Client: JSON response (Message schema)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

  • ChainSafe/forest#6028: Modifies ForkUpgradeParams / NetworkParams upgrade-height fields—overlaps with this PR's ForkUpgradeParams/NetworkParams changes.
  • ChainSafe/forest#6412: Related changes to execution-tracing (ipld_ops/logs) and trace test helpers.
  • ChainSafe/forest#6926: Related to enabling strict JSON validation and api-compare test wiring (FOREST_STRICT_JSON).

Suggested reviewers

  • akaladarshi
  • LesnyRumcajs
🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 73.68% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The PR title 'Enable strict json check in api compare' is partially related to the changeset, focusing on the docker-compose.yml file changes while missing the more significant RPC schema and code updates that form the bulk of the changes. The title emphasizes only the FOREST_STRICT_JSON environment variable addition; consider a title that better reflects all the RPC schema extensions (ExecutionTrace, Message, NetworkParams, PublicVersion, ForkUpgradeParams) and code refactoring to support strict deserialization across multiple RPC methods.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed The PR successfully addresses issue #5635 by enabling strict JSON deserialization (FOREST_STRICT_JSON=1) and fixing all resulting unknown-field errors across multiple RPC methods and test snapshots.
Out of Scope Changes check ✅ Passed All changes are in-scope and necessary to support strict JSON deserialization: schema updates align response structures with Lotus, RPC handlers are refactored to populate new fields, test snapshots are updated to match the new structures, and the docker-compose changes enable the feature.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch shashank/enable-strict-json-api
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch shashank/enable-strict-json-api

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Comment @coderabbitai help to get the list of available commands and usage tips.

@sudo-shashank sudo-shashank changed the title Enable strict json check Enable strict json check in api compare Apr 28, 2026
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/rpc/methods/state.rs (1)

3234-3284: ⚠️ Potential issue | 🟠 Major

upgrade_xx_height should be config-driven, not hardcoded.

Line 3284 hardcodes a sentinel epoch, so StateGetNetworkParams can diverge from the actual network config once that upgrade is scheduled (or on custom networks). Please source this value from ChainConfig (with an explicit fallback policy if needed) rather than embedding a literal.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/rpc/methods/state.rs` around lines 3234 - 3284, The code currently
hardcodes upgrade_xx_height to 999_999_999_999_999 in TryFrom<&ChainConfig> for
ForkUpgradeParams; instead, read the value from ChainConfig (use the existing
height lookup helper get_height or an explicit ChainConfig field for the XX
upgrade) and assign that to upgrade_xx_height, with a clear fallback policy
(e.g., use get_height(XX)? or fallback to
config.some_optional_xx_height.unwrap_or(default_epoch)) so
StateGetNetworkParams stays in sync with the network config. Locate this change
in the try_from implementation that constructs ForkUpgradeParams and replace the
literal with the config-driven lookup and fallback.
🧹 Nitpick comments (2)
src/lotus_json/message.rs (1)

120-120: Optional readability tweak for intentionally ignored CID.

Consider using an explicit ignored binding name and short comment for parity with signed_message.rs.

Suggested tiny cleanup
-            cid: _,
+            cid: _ignored_cid, // CID is derived from message fields; input CID is not used
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/lotus_json/message.rs` at line 120, The ignored CID field in message.rs
is currently written as cid: _, which is less explicit; update the pattern to
use an explicit ignored binding like cid: _cid and add a short comment (e.g., //
intentionally ignored) to match the style used in signed_message.rs so the
intent is clear when reading the Message destructuring.
src/rpc/methods/state/types.rs (1)

204-213: Consider adding a short struct-level note explaining why logs/ipld_ops are excluded from equality.

The code is fine as-is; this would just make intent easier to retain for future changes around API-compare behavior.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/rpc/methods/state/types.rs` around lines 204 - 213, Add a short doc
comment on the ExecutionTrace struct explaining why logs and ipld_ops are
intentionally excluded from the PartialEq implementation: they are
implementation-dependent and not part of API-level equality comparison. Update
the struct-level comment for ExecutionTrace (referencing fields logs and
ipld_ops and the PartialEq impl) to state this intent so future maintainers
understand why eq ignores those fields.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@src/rpc/methods/state.rs`:
- Around line 3234-3284: The code currently hardcodes upgrade_xx_height to
999_999_999_999_999 in TryFrom<&ChainConfig> for ForkUpgradeParams; instead,
read the value from ChainConfig (use the existing height lookup helper
get_height or an explicit ChainConfig field for the XX upgrade) and assign that
to upgrade_xx_height, with a clear fallback policy (e.g., use get_height(XX)? or
fallback to config.some_optional_xx_height.unwrap_or(default_epoch)) so
StateGetNetworkParams stays in sync with the network config. Locate this change
in the try_from implementation that constructs ForkUpgradeParams and replace the
literal with the config-driven lookup and fallback.

---

Nitpick comments:
In `@src/lotus_json/message.rs`:
- Line 120: The ignored CID field in message.rs is currently written as cid: _,
which is less explicit; update the pattern to use an explicit ignored binding
like cid: _cid and add a short comment (e.g., // intentionally ignored) to match
the style used in signed_message.rs so the intent is clear when reading the
Message destructuring.

In `@src/rpc/methods/state/types.rs`:
- Around line 204-213: Add a short doc comment on the ExecutionTrace struct
explaining why logs and ipld_ops are intentionally excluded from the PartialEq
implementation: they are implementation-dependent and not part of API-level
equality comparison. Update the struct-level comment for ExecutionTrace
(referencing fields logs and ipld_ops and the PartialEq impl) to state this
intent so future maintainers understand why eq ignores those fields.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 1d5006cd-50f9-4bf8-9882-73c9293697ea

📥 Commits

Reviewing files that changed from the base of the PR and between 65c39a0 and e15b409.

⛔ Files ignored due to path filters (2)
  • src/rpc/snapshots/forest__rpc__tests__rpc__v0.snap is excluded by !**/*.snap
  • src/rpc/snapshots/forest__rpc__tests__rpc__v1.snap is excluded by !**/*.snap
📒 Files selected for processing (11)
  • docs/openrpc-specs/v0.json
  • docs/openrpc-specs/v1.json
  • scripts/tests/api_compare/docker-compose.yml
  • src/lotus_json/message.rs
  • src/lotus_json/signed_message.rs
  • src/rpc/methods/common.rs
  • src/rpc/methods/eth.rs
  • src/rpc/methods/state.rs
  • src/rpc/methods/state/types.rs
  • src/state_manager/utils.rs
  • src/tool/subcommands/api_cmd/test_snapshots.txt

@sudo-shashank sudo-shashank marked this pull request as ready for review April 28, 2026 02:15
@sudo-shashank sudo-shashank requested a review from a team as a code owner April 28, 2026 02:15
@sudo-shashank sudo-shashank requested review from LesnyRumcajs and akaladarshi and removed request for a team April 28, 2026 02:15
Comment thread docs/openrpc-specs/v1.json Outdated
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
docs/openrpc-specs/v0.json (1)

10151-10189: ⚠️ Potential issue | 🟠 Major

Remove or make UpgradeXxHeight optional in the OpenRPC schema.

Lotus's StateGetNetworkParams returns UpgradeFireHorseHeight in ForkUpgradeParams, not UpgradeXxHeight. Forest's implementation hardcodes upgrade_xx_height to 999_999_999_999_999, but marking it as required in the OpenRPC schema will cause strict validation failures against Lotus responses, which omit this field entirely. Either remove UpgradeXxHeight from the schema or mark it as non-required to maintain compatibility.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/openrpc-specs/v0.json` around lines 10151 - 10189, The OpenRPC schema
currently lists UpgradeXxHeight as a required property in the ForkUpgradeParams
object which conflicts with Lotus's StateGetNetworkParams (which returns
UpgradeFireHorseHeight and omits UpgradeXxHeight) and forces strict validation
failures; update the schema by either removing UpgradeXxHeight from the
ForkUpgradeParams required array or moving UpgradeXxHeight out of the "required"
list (making it optional) so responses that omit upgrade_xx_height (Forest
hardcodes it but Lotus omits it) validate correctly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@docs/openrpc-specs/v0.json`:
- Around line 10151-10189: The OpenRPC schema currently lists UpgradeXxHeight as
a required property in the ForkUpgradeParams object which conflicts with Lotus's
StateGetNetworkParams (which returns UpgradeFireHorseHeight and omits
UpgradeXxHeight) and forces strict validation failures; update the schema by
either removing UpgradeXxHeight from the ForkUpgradeParams required array or
moving UpgradeXxHeight out of the "required" list (making it optional) so
responses that omit upgrade_xx_height (Forest hardcodes it but Lotus omits it)
validate correctly.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 17b75584-731e-4e12-b601-7db4e794ecda

📥 Commits

Reviewing files that changed from the base of the PR and between e15b409 and 0869652.

⛔ Files ignored due to path filters (2)
  • src/rpc/snapshots/forest__rpc__tests__rpc__v0.snap is excluded by !**/*.snap
  • src/rpc/snapshots/forest__rpc__tests__rpc__v1.snap is excluded by !**/*.snap
📒 Files selected for processing (8)
  • docs/openrpc-specs/v0.json
  • docs/openrpc-specs/v1.json
  • src/lotus_json/message.rs
  • src/rpc/methods/chain.rs
  • src/rpc/methods/gas.rs
  • src/tool/subcommands/api_cmd/api_compare_tests.rs
  • src/tool/subcommands/api_cmd/stateful_tests.rs
  • src/wallet/subcommands/wallet_cmd.rs
✅ Files skipped from review due to trivial changes (1)
  • src/tool/subcommands/api_cmd/api_compare_tests.rs

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 29, 2026

Codecov Report

❌ Patch coverage is 89.36170% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 64.22%. Comparing base (7a988ea) to head (6f8ffd4).
⚠️ Report is 2 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/state_manager/utils.rs 78.57% 3 Missing ⚠️
src/rpc/methods/state.rs 50.00% 0 Missing and 1 partial ⚠️
src/wallet/subcommands/wallet_cmd.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
src/lotus_json/message.rs 100.00% <100.00%> (ø)
src/lotus_json/signed_message.rs 92.45% <100.00%> (+0.45%) ⬆️
src/rpc/methods/chain.rs 56.03% <100.00%> (-0.05%) ⬇️
src/rpc/methods/common.rs 61.53% <100.00%> (+1.01%) ⬆️
src/rpc/methods/eth.rs 65.28% <100.00%> (+0.02%) ⬆️
src/rpc/methods/gas.rs 86.55% <100.00%> (-0.04%) ⬇️
src/rpc/methods/state/types.rs 100.00% <100.00%> (ø)
src/rpc/methods/state.rs 44.61% <50.00%> (+<0.01%) ⬆️
src/wallet/subcommands/wallet_cmd.rs 25.45% <0.00%> (ø)
src/state_manager/utils.rs 79.90% <78.57%> (+0.10%) ⬆️

... and 12 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e2becd7...6f8ffd4. Read the comment docs.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Member

@LesnyRumcajs LesnyRumcajs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the do the snap files change?

Comment thread src/rpc/methods/state.rs Outdated
Copy link
Copy Markdown
Collaborator

@akaladarshi akaladarshi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sudo-shashank Can you please add the ref link using the latest version of lotus instead of using the master branch, because master is subjected to change.

@akaladarshi
Copy link
Copy Markdown
Collaborator

@sudo-shashank Can you please add the ref link using the latest version of lotus instead of using the master branch, because master is subjected to change.

@sudo-shashank What I mean by latest version was something like this : <https://github.com/filecoin-project/lotus/blob/v1.35.1/chain/store/index.go#L52> instead of a commit or branch

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ Duplicate comments (1)
docs/openrpc-specs/v0.json (1)

10342-10399: 🛠️ Refactor suggestion | 🟠 Major

Split request and response message schemas.

Adding CID to the shared Message schema fixes response-side strict JSON, but this same schema is also referenced by request params like Filecoin.StateCall (Lines 3126-3131), Filecoin.GasEstimateMessageGas (Lines 2244-2248), Filecoin.MpoolPushMessage (Lines 2570-2575), and Filecoin.WalletSignMessage (Lines 5703-5708). That silently documents CID as valid input even though this PR only needs it on responses. Please keep Message for request bodies and introduce a response-only variant for the CID-carrying shape.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/openrpc-specs/v0.json` around lines 10342 - 10399, The shared "Message"
schema currently includes "CID" which incorrectly documents CID as valid for
request params; revert the request shape by keeping "Message" without "CID" and
introduce a new response-only schema (e.g., "MessageWithCID" or
"MessageResponse") that adds the "CID" property. Update all response references
that must carry CID to point to the new schema and leave the request references
(such as Filecoin.StateCall, Filecoin.GasEstimateMessageGas,
Filecoin.MpoolPushMessage, Filecoin.WalletSignMessage) referencing the original
"Message" schema so CID is no longer allowed in request bodies. Ensure the new
schema reuses the same properties as "Message" plus the "CID" $ref to avoid
duplication.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Duplicate comments:
In `@docs/openrpc-specs/v0.json`:
- Around line 10342-10399: The shared "Message" schema currently includes "CID"
which incorrectly documents CID as valid for request params; revert the request
shape by keeping "Message" without "CID" and introduce a new response-only
schema (e.g., "MessageWithCID" or "MessageResponse") that adds the "CID"
property. Update all response references that must carry CID to point to the new
schema and leave the request references (such as Filecoin.StateCall,
Filecoin.GasEstimateMessageGas, Filecoin.MpoolPushMessage,
Filecoin.WalletSignMessage) referencing the original "Message" schema so CID is
no longer allowed in request bodies. Ensure the new schema reuses the same
properties as "Message" plus the "CID" $ref to avoid duplication.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 68cbbdff-9b1c-4b70-88e7-62aa8ea43a5f

📥 Commits

Reviewing files that changed from the base of the PR and between a29c1b5 and 9152064.

⛔ Files ignored due to path filters (2)
  • src/rpc/snapshots/forest__rpc__tests__rpc__v0.snap is excluded by !**/*.snap
  • src/rpc/snapshots/forest__rpc__tests__rpc__v1.snap is excluded by !**/*.snap
📒 Files selected for processing (5)
  • docs/openrpc-specs/v0.json
  • docs/openrpc-specs/v1.json
  • src/rpc/methods/common.rs
  • src/rpc/methods/state.rs
  • src/rpc/methods/state/types.rs
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/rpc/methods/state/types.rs

@sudo-shashank
Copy link
Copy Markdown
Contributor Author

sudo-shashank commented May 6, 2026

@sudo-shashank Can you please add the ref link using the latest version of lotus instead of using the master branch, because master is subjected to change.

@sudo-shashank What I mean by latest version was something like this : <https://github.com/filecoin-project/lotus/blob/v1.35.1/chain/store/index.go#L52> instead of a commit or branch

@akaladarshi latest commit or v1.35.1 works here

Comment thread src/rpc/methods/state/types.rs Outdated
Comment thread src/lotus_json/message.rs
@sudo-shashank sudo-shashank enabled auto-merge May 12, 2026 09:09
@sudo-shashank sudo-shashank added this pull request to the merge queue May 12, 2026
Merged via the queue into main with commit 6191297 May 12, 2026
45 checks passed
@sudo-shashank sudo-shashank deleted the shashank/enable-strict-json-api branch May 12, 2026 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

RPC requires calibnet RPC checks to run on CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deny unknown fields on RPC response deserialization

3 participants