Skip to content

estimate gas support for 7702 (#9939)#42

Merged
matthew1001 merged 1 commit into
kaleido-besu-release-26.2.0from
kaleido-besu-release-26.2.0-7702-estimate-gas
Apr 17, 2026
Merged

estimate gas support for 7702 (#9939)#42
matthew1001 merged 1 commit into
kaleido-besu-release-26.2.0from
kaleido-besu-release-26.2.0-7702-estimate-gas

Conversation

@matthew1001

@matthew1001 matthew1001 commented Apr 17, 2026

Copy link
Copy Markdown

Cherry picking OSS PR besu-eth#9939 onto our Besu 26.2.0 release.

I've tested with a viem EIP 7702 delegation before and after:

Before fix:

const authorization = await client.signAuthorization({
    contractAddress: DELEGATE_ADDRESS,
    executor: 'self',
  });

...

  const hash = await client.sendTransaction({
    to: account.address, // Usually EOAs send to themselves to activate delegation
    authorizationList: [authorization],
    // gas: 900000, <<-- With this commented out, the EIP 7702 transaction fails because gas estimation fails
  });
Estimate Gas Arguments:
  from:                  0xA7A488E933780Ba835C888BB0363F7605a01CD5a
  to:                    0xA7A488E933780Ba835C888BB0363F7605a01CD5a
  maxFeePerGas:          0 gwei
  maxPriorityFeePerGas:  0 gwei
  nonce:                 0
 
Request Arguments:
  from:  0xA7A488E933780Ba835C888BB0363F7605a01CD5a
  to:    0xA7A488E933780Ba835C888BB0363F7605a01CD5a

Details: Invalid call params
Version: viem@2.48.0
    at getTransactionError (file:///Users/mwhitehead/node_modules/viem/_esm/utils/errors/getTransactionError.js:11:12)
    at sendTransaction (file:///Users/mwhitehead/node_modules/viem/_esm/actions/wallet/sendTransaction.js:210:15)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async delegate (file:///Users/mwhitehead/local-eip7702.mjs:40:16) {
  cause: EstimateGasExecutionError: Invalid parameters were provided to the RPC method.

After fix (same viem script with gas commented out):

Preparing EIP-7702 Delegation...
{
  address: '0xB0152F70383Fa032f331C000F628BB6DFE51492F',
  chainId: 1337,
  nonce: 1,
  r: '0x200cb9dd319b344c22f8bc1c9fd5dc4eb3f41dd5509e97b5f8a8acb8d5dcd3a3',
  s: '0x40b80b74aa1a4d6fea58f0110492cf6740c3229a2100389b30aa4621c0aecbec',
  v: 27n,
  yParity: 0
}
Transaction sent! Hash: 0x8ab2c64e1c811aee8c91613ecfd4770de40460839f501412e6198f3571bd526e

and eth_getCode test against the EOA correctly returns the delegation contract + prefix:

{
    "jsonrpc": "2.0",
    "id": 1,
    "result": "0xef0100b0152f70383fa032f331c000f628bb6dfe51492f".  <<-- delegated contract address
}

* yParity for code delegation

Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>

---------

Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
@jimthematrix

jimthematrix commented Apr 17, 2026

Copy link
Copy Markdown

Cool, it looks like this one is somewhat specific to the 7702 support because of the externally provided signature format with variations that must be all handled properly. So it warrants inclusion in the Kaleido release.

Also a request to add 7702 styled transactions to the besu release pipeline test buckets.

@matthew1001 matthew1001 merged commit 95a2658 into kaleido-besu-release-26.2.0 Apr 17, 2026
1 check passed
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.

3 participants