From 5b5edc4451b0ebb89ada4d3d4913fb6a93d9223a Mon Sep 17 00:00:00 2001 From: Roman Dvorkin Date: Tue, 3 Oct 2023 14:45:24 +0300 Subject: [PATCH] feat: support "input" param for verifiable tx Using contract calls in web3js, the transaction data can either be filled in the "data" parameter or "input" parameter, default is "input" The current verified execution provider supports only "data" parameter, so code like this const contract = new web3.eth.Contract(balanceOfABI, tokenContract) let result = await contract.methods.balanceOf(tokenHolder).call(); doesn't work --- packages/prover/src/utils/evm.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/prover/src/utils/evm.ts b/packages/prover/src/utils/evm.ts index fa5f5ec3feb2..ecebda78b8ad 100644 --- a/packages/prover/src/utils/evm.ts +++ b/packages/prover/src/utils/evm.ts @@ -166,7 +166,7 @@ export async function executeVMCall({ executionPayload: allForks.ExecutionPayload; network: NetworkName; }): Promise { - const {from, to, gas, gasPrice, maxPriorityFeePerGas, value, data} = tx; + const {from, to, gas, gasPrice, maxPriorityFeePerGas, value, data, input} = tx; const {result: block} = await rpc.request("eth_getBlockByHash", [bufferToHex(executionPayload.blockHash), true], { raiseError: true, }); @@ -181,7 +181,7 @@ export async function executeVMCall({ gasLimit: hexToBigInt(gas ?? block.gasLimit), gasPrice: hexToBigInt(gasPrice ?? maxPriorityFeePerGas ?? "0x0"), value: hexToBigInt(value ?? "0x0"), - data: data ? hexToBuffer(data) : undefined, + data: input ? hexToBuffer(input) : data ? hexToBuffer(data) : undefined, block: { header: getVMBlockHeaderFromELBlock(block, executionPayload, network), },