Skip to content

fix: preserve sync RPC empty params shape#3847

Open
luyua9 wants to merge 1 commit into
ApeWorX:mainfrom
luyua9:fix/preserve-sync-rpc-param-shape-luyua9
Open

fix: preserve sync RPC empty params shape#3847
luyua9 wants to merge 1 commit into
ApeWorX:mainfrom
luyua9:fix/preserve-sync-rpc-param-shape-luyua9

Conversation

@luyua9
Copy link
Copy Markdown

@luyua9 luyua9 commented May 19, 2026

What was wrong?

Follow-up to #3823 / #3825.

#3825 fixed the async persistent-provider path by replacing params or [] with [] if params is None else params, preserving empty tuple/dict params for cache-key consistency.

The sync JSONBaseProvider.encode_rpc_request() path still used params or [], so an empty named-params payload ({}) was serialized as positional params ([]). That changes JSON-RPC request shape before the request is sent.

How was it fixed?

  • Update sync JSON-RPC encoding to only default None to [].
  • Add a regression test for empty dict vs None on sync encoding.
  • Add a bugfix newsfragment.

Validation

  • git diff --check
  • python -m pytest -q tests/core/caching-utils/test_request_caching.py -k 'sync_encode_rpc_request_preserves_params_shape or async_form_request_preserves_params_shape' could not run in this local checkout because cached_property is not installed in the environment (ModuleNotFoundError).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant