Skip to content

Method eth_estimate_gas used in SDK example raises ValueError #53

Description

@Humble255

Using Python SDK example transaction function I have encontered problem with eth_estimate_gas method, it raises exception.
It was chcecked on Era mainnet using existing valid addresses.

` tx_func_call = TxFunctionCall(chain_id=chain_id,
nonce=nonce,
from_=from_account.address,
to=to_account.address,
value=Web3.toWei(amount_eth, 'ether'),
data=HexStr("0x"),
gas_limit=0, # unknown at this state, will be replaced by estimate_gas
gas_price=gas_price,
max_priority_fee_per_gas=100000000
)

estimate_gas = zksync_web3.zksync.eth_estimate_gas(tx_func_call.tx)`

Traceback:

Traceback (most recent call last): File "D:\GIT\Python\zkSync\main.py", line 113, in <module> transfer_eth_(amount_eth=0.001,from_account=MAIN_ACCOUNT, to_account=ACC1_ACCOUNT) File "D:\GIT\Python\zkSync\main.py", line 78, in transfer_eth_ estimate_gas = zksync_web3.zksync.eth_estimate_gas(tx_func_call.tx) File "D:\GIT\Python\zkSync\venv\lib\site-packages\zksync2\module\zksync_module.py", line 284, in eth_estimate_gas return self._eth_estimate_gas(tx) File "D:\GIT\Python\zkSync\venv\lib\site-packages\web3\module.py", line 57, in caller result = w3.manager.request_blocking(method_str, File "D:\GIT\Python\zkSync\venv\lib\site-packages\web3\manager.py", line 198, in request_blocking return self.formatted_response(response, File "D:\GIT\Python\zkSync\venv\lib\site-packages\web3\manager.py", line 171, in formatted_response raise ValueError(response["error"]) ValueError: {'code': -32602, 'message': 'Invalid params: missing field gasPerPubdata.'}

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions