Skip to content

Fix/zksync rpc deprecations#3819

Merged
tmm merged 15 commits intowevm:mainfrom
uF4No:fix/zksync-rpc-deprecations
Jul 29, 2025
Merged

Fix/zksync rpc deprecations#3819
tmm merged 15 commits intowevm:mainfrom
uF4No:fix/zksync-rpc-deprecations

Conversation

@uF4No
Copy link
Contributor

@uF4No uF4No commented Jul 23, 2025

ZKsync has deprecated and announced the future deprecation of multiple RPC methods (see here and here)

  • Add deprecation warnings for method getAllBalances and its correspondent L2 action

  • Adds documentation for getGasPerPubData, added in feat: add getGasPerPubdata action to use zks_gasPerPubdata #3817

  • Updates docs to reflect upcoming RPC deprecated methods:

    getMainContract
    [x] docs deprecation warning
    [x] down in sidebar
    [x] add TS deprecation comment to the function

    getBaseTokenL1Address
    [x] docs deprecation warning
    [x] down in sidebar
    [x] add TS deprecation comment to the function

    getL1ChainId
    [x] docs deprecation warning
    [x] down in sidebar
    [x] add TS deprecation comment to the function

    getTestnetPaymaster
    [x] docs deprecation warning
    [x] down in sidebar
    [x] add TS deprecation comment to the function

    estimateFee
    [x] docs deprecation warning
    [x] down in sidebar
    [x] add TS deprecation comment to the function

    getRawBlockTransactions
    [x] docs deprecation warning
    [x] down in sidebar
    [x] add TS deprecation comment to the function

@changeset-bot
Copy link

changeset-bot bot commented Jul 23, 2025

⚠️ No Changeset found

Latest commit: 01bad5e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Comment on lines 18 to 19
- `gasLimit`: use `eth_estimateGas` or its correspondent viem action..
- `maxFeePerGas`: use `eth_gasPrice` or its correspondent viem action..
Copy link
Member

Choose a reason for hiding this comment

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

Can we link to these Viem action doc pages?

- `gasLimit`: use `eth_estimateGas` or its correspondent viem action..
- `maxFeePerGas`: use `eth_gasPrice` or its correspondent viem action..
- `maxPriorityFeePerGas`: set to `0`.
- `gasPerPubData`: use `zks_gasPerPubdata` or its correspondent viem action.
Copy link
Member

Choose a reason for hiding this comment

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

Should this PR add a Viem action for this? (So it can be linked to here.)

Copy link
Contributor Author

@uF4No uF4No Jul 29, 2025

Choose a reason for hiding this comment

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

I was going to do it but this new action (getGasPerPubData) was added in #3817 . Just noticed that #3817 only added the action but not the documentation so I'm adding it in this PR

Copy link
Member

Choose a reason for hiding this comment

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

Let's add the deprecation notice instead of deleting this page outright.


export type GetTestnetPaymasterAddressReturnType = Address | null

/* @deprecated Check the ZKsync chain technical documentation to find the testnet paymaster address */
Copy link
Member

Choose a reason for hiding this comment

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

Is there a link to the technical docs we can use here?

Suggested change
/* @deprecated Check the ZKsync chain technical documentation to find the testnet paymaster address */
/* @deprecated Check the [ZKsync chain technical documentation](TODO) to find the testnet paymaster address */

Copy link
Contributor Author

Choose a reason for hiding this comment

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

there's not really a single link for all, as this will depend if the dev is using ZKsync Era, Abstract, Sophon etc. Each ZKsync chain has its own. I'm updating the wording slightly to better reflect that.

Copy link
Member

Choose a reason for hiding this comment

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

Let's keep this code during the deprecation period and we can remove in the next major version.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

files restored

Copy link
Member

Choose a reason for hiding this comment

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

Let's keep this code during the deprecation period and we can remove in the next major version.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

files restored

*
* const balances = await client.getAllBalances({account: "0x36615Cf349d7F6344891B1e7CA7C72883F5dc049"});
*/
getAllBalances: (
Copy link
Member

Choose a reason for hiding this comment

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

Add a @deprecated comment instead of removing.

Copy link
Contributor Author

@uF4No uF4No Jul 29, 2025

Choose a reason for hiding this comment

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

original code restored and added deprecation

Copy link
Member

Choose a reason for hiding this comment

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

Let's keep this code during the deprecation period and we can remove in the next major version.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

restored

@tmm tmm merged commit 84c340b into wevm:main Jul 29, 2025
11 of 24 checks passed
@tmm tmm mentioned this pull request Oct 23, 2025
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.

2 participants