You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
_prepare_transaction sends chainId as an int to eth_estimateGas; Bradbury rejects every deploy and write #142
Version: genlayer-py 0.19.1 (tag v0.19.1). The same line is on main: genlayer_py/contracts/actions.py, "chainId": self.chain.id. Network:testnet_bradbury (chain 4221).
What happens
Every deploy_contract and write_contract on Bradbury fails before anything is sent:
GenLayerError: Transaction failed: eth_estimateGas failed (code=-32602): invalid argument 0: json: cannot unmarshal non-string into Go struct field TransactionArgs.chainId of type *hexutil.Big
_prepare_transaction builds the transaction with "chainId": self.chain.id (an int) and passes it straight to eth_estimateGas. Bradbury's node only accepts a hex quantity there. Studio accepts the int, so this does not show up on Studionet.
Repro
fromgenlayer_pyimportcreate_client, create_accountfromgenlayer_py.chainsimporttestnet_bradburyclient=create_client(chain=testnet_bradbury, account=create_account(PRIVATE_KEY)) # any funded accountest=client.estimate_transaction_fees({})
client.deploy_contract(
code=open("contract.py").read(),
args=[],
fees={"distribution": est["distribution"], "feeValue": est["feeValue"]},
)
# -> eth_estimateGas failed (code=-32602) ... TransactionArgs.chainId of type *hexutil.Big
Suggested fix
Send it as a hex quantity, like nonce, value and the fee caps in the same dict:
"chainId": hex(self.chain.id),
With only that change, deploys, writes and a full contract call with LLM consensus work on Bradbury. Each ends ACCEPTED / FINISHED_WITH_RETURN, and the call finalizes about 30 minutes later. sign_transaction accepts either form, so signing is unaffected.
Activity