Skip to content

Conversation

@KillariDev
Copy link
Contributor

@KillariDev KillariDev commented Nov 4, 2023

eth_simulateV1

This PR is a cleaned up version from #383. The #383 is based heavily on #312 from @s1na (eth_batchCall). This spec encompasses some of the ideas presented by @MicahZoltu @OlegJakushkin, @LukaszRozmej, @KillariDev, @epheph and others.

Summary

This introduces a new RPC method eth_multicallV1 allows users to make complex RPC calls to Ethereum nodes. Compared to eth_call, eth_multicallV1 has following extra features:

  • You can encapsulate multiple dependent calls in a single call
  • The calls happen inside blocks. You can simulate multiple blocks that can be arbitrary far from each other
  • Block variables can be overridden (e.g. time)
  • Account state can be overridden for every block (e.g. code and balance)
  • It is possible to override precompiles (e.g. ecrecover) with arbitrary EVM code
  • ETH transfers produce logs similar to ERC20 logs
  • Validation mode. You can choose to do very strict simulation or more relaxed one similar to eth_call

Motivation

The features of eth_multicallV1 allow many interesting simulation use cases such as:

  • To simulate simple erc20 approval & swap feature in a wallet, we need to be able to send multiple transactions
  • Searchers need to trigger oracle update and wait a number of blocks
  • Researchers need to trigger a price change and wait a number of blocks for a TWAP adjustment
  • Wallets are beginning to provide advanced simulation to the user
  • Block builders are beginning to explore multi-block MEV
  • Fake Permit2 or other EIP-712 approvals

This blog post also explains motivation around eth_simulate: https://mirror.xyz/killaridev.eth/NXR9v4r8b4SWl-hbqJqRQyIAcE4GACobzMObREvL0fo and a PEEPanEIP episode: https://www.youtube.com/watch?v=4uZyQQ6qz4U

Implementation

Geth: https://github.com/s1na/go-ethereum/tree/multicall
Nethermind: https://github.com/NethermindEth/nethermind

@KillariDev
Copy link
Contributor Author

Here's slides for multicall presentation: https://docs.google.com/presentation/d/1lEaqHTY3ud8pe6VAFwLkb-jdoHpTMBfuF1K9OKy-azs

Copy link
Member

@jochem-brouwer jochem-brouwer left a comment

Choose a reason for hiding this comment

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

Got some comments :) I love this idea, this will make UX so much better!

| input | no data |
| gasPrice | `0x0` |
| maxPriorityFeePerGas | `0x0` |
| maxFeePerGas | `0x0` |
Copy link
Member

Choose a reason for hiding this comment

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

These default values will crash, since baseFeePerGas is always 7 or higher. These default values will be rejected by blockchain spec, since tx is not willing to pay base fee. Note that the default block baseFeePerGas is calculated according to spec, so this will be 7 or higher always.

Copy link
Member

Choose a reason for hiding this comment

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

Suggestion: change maxFeePerGas and gasPrice (in case of tx type 0/1) to baseFeePerGas of the block and keep maxPriorityFeePerGas 0.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These default values will crash, since baseFeePerGas is always 7 or higher. These default values will be rejected by blockchain spec, since tx is not willing to pay base fee. Note that the default block baseFeePerGas is calculated according to spec, so this will be 7 or higher always.

yeah, this will crash on validation mode. On non-validation mode, we will allow you to make transactions that have zero basefee (similar to eth_call)

| accessList | empty array |

## Overriding default values
The default values of blocks and transactions can be overriden. For Transactions we allow overriding of variables `type`, `nonce`, `to`, `from`, `gas limit`, `value`, `input`, `gasPrice`, `maxPriorityFeePerGas`, `maxFeePerGas`, `accessList`, and for blocks we allow modifications of `number`, `time`, `gasLimit`, `feeRecipient`, `prevRandao` and `baseFeePerGas`:
Copy link
Member

Choose a reason for hiding this comment

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

Slight nit: for completeness, withdrawals should also be able to be overridden (to simulate withdrawals).

ETH logs are not part of the calculation for logs bloom filter. Also, similar to normal logs, if the transaction sends ETH but the execution reverts, no log gets issued.

## Validation
The multicall has a feature to enable or disable validation with setting `Validation`, by default, the validation is off, and the multicall mimics `eth_call` with reduced number of checks. Validation enabled mode is intended to give as close as possible simulation of real EVM block creation, except there's no checks for transaction signatures and we also allow one to send a direct transaction from a contract.
Copy link
Member

Choose a reason for hiding this comment

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

I am not entirely sure what this would remove/add. If I turn this on, in what situation would this be useful, and what would change if I would have kept it off? 🤔

Copy link
Member

Choose a reason for hiding this comment

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

For instance, if validation is set to off, are tx gas limits not checked? (So I can include a tx with gas limit higher than the block gas limit?).

Copy link
Member

@jochem-brouwer jochem-brouwer Nov 27, 2023

Choose a reason for hiding this comment

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

Never mind, it is in execute.yaml

    validation:
      title: Validation
      description: |-
        When true, the multicall does all validations that a normal EVM would do, except contract sender and signature checks. When false, multicall behaves like eth_call.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is bit ill defined (as discussed in todays call). Because Nethermind and Geth behave bit differently with eth_call and we have been trying to figure out the differences so we could document them. The intention that is that when validation is enabled, the clients would behave exactly the same, while not fixing the issue that with non-validation, the validation rules might differ a bit.

Copy link
Member

Choose a reason for hiding this comment

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

Then I think this spec should explicitly state what should be not be validated if the validation is off. For instance, currently it only seems that you can override the sender (so you can create unsigned txs). But, it also seems that it is possible to set base fee to zero (so do not validate this as well). It should be clearly defined what should be validated and what not. (And this is non-trivial since there is a huge ruleset of what should be validated in transactions/blocks)

Choose a reason for hiding this comment

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

For validation mode, I'm fine with base fee not being allowed to go below 7.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think it makes sense that much to validate base fee in validation mode if the user specifically sets the base fee to something. Otherwise we could remove all overrides for validation mode, as none of them can happen on mainnet.

Copy link
Contributor

@s1na s1na Nov 30, 2023

Choose a reason for hiding this comment

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

possibly also create multiple validation modes / flags if necessary?

Please no! In fact I want to argue that we should remove validation flag and default to relax-mode. My argument is that this is easy to add in later since we have designed the API param to be an object. It will be a backwards-compatible change. I'd personally like to hear from some people to say they need this first.

That said, we should still define exactly what is not validated in relax-mode. So I think that convo is important to have. And I will share here exactly what geth is validating:

For block validation, only these fields are validated:

  • Only block number and timestamp are validated to be incremental.

As for tx validation, these are NOT validated:

  • Signature is not validated
  • Nonce too high, too low, out of bounds are not validated
  • Sender is EoA is not validated
  • If gas price fields are 0, then sender doesn't need to have enough balance for gas (only value)
  • If blobGasFeeCap is 0, then blob gas requirement is skipped

Copy link
Contributor

@s1na s1na Nov 30, 2023

Choose a reason for hiding this comment

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

I'd like to add that these relaxations are all cause for a transaction not to go through. I.e. if I have a call that works in the relax-mode, sign it and submit it to a node, it will not be gossiped to the network at all.

I'd argue if there is any danger to a user it's from all of the flexibility we're providing through state and precompile overrides. E.g. they assume in the simulation to be in a certain condition by using overrides, and submit the transaction when that is not met. That tx will be mined and will revert (most probably).

Choose a reason for hiding this comment

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

I'd personally like to hear from some people to say they need this first.

Our team would like it because it allows us to verify that the transaction is properly constructed and will execute against mainnet without error. In some cases we ship a set of transactions as a "bundle" to searchers, and they need to all execute properly in sequence (including things like balance checks), and in other cases we ship a single transaction to a signer and we want a high degree of confidence that it will execute on-chain just like it did during simulation.

An interesting note here is that an user can specify block numbers and times of some blocks, but not for others. When block numbers of times are left unspecified, the default values will be used. After the blocks have been constructed, and default values are calculated, the blocks are checked that their block numbers and times are still valid.

## ETH transfer logs
When `traceTransfers` setting is enabled on `eth_multicallV1` The multical will return logs for ethereum transfers along with the normal logs sent by contracts. The ETH transfers are identical to ERC20 transfers, except the "sending contract" is address `0x0`.
Copy link

@mds1 mds1 Dec 2, 2023

Choose a reason for hiding this comment

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

I'd suggest using 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE as the sending contract, since that's become a de facto approach for representing ETH as a token address within contracts.

Here's a simple sourcegraph search showing usage: https://sourcegraph.com/search?q=0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE&groupBy=repo

Choose a reason for hiding this comment

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

I suspect if you were to do a similar search of 0x000... you would get even more results. "A lot of people use X" is quite different from "Most people use X".

If we ignore any past precedence, I feel like 0x000... makes it a tad more explicit that this is special, and not some precompile or something. For parameters, 0xEee... makes a bit of sense because 0 is the default value for a lot of stuff (e.g., null, missing, etc.) and thus often passed on accident, so using nonzero helps protect against a class of bugs. In the case of event sourcing, 0x000... isn't provided by user/developer so they cannot get it wrong.

That being said, I don't have a strong argument against 0xEeee..., only that I think 0x000... is marginally better and I suspect more widely used.

Copy link

Choose a reason for hiding this comment

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

I agree a search for the zero address would yield more results, but only because the zero address is used for a much wider range of cases, whereas 0xEee... seems to only be used to represent ETH. This is anecdotal and it's hard to know concretely, but in my experience 0xEee... is more common for representing ETH than the zero address.

Personally, if I didn't know about the special ETH logs, seeing 0xEee... would make the log's meaning more intuitive and apparent than seeing 0x000....

Choose a reason for hiding this comment

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

I agree a search for the zero address would yield more results, but only because the zero address is used for a much wider range of cases

Sorry, I meant if you could somehow limit the search of 0x0000... to only places where it was being used as a representation of ETH I suspect it would be more/bigger. That being said, perhaps the searchability of 0xEeee... is a significant selling point.

Personally, if I didn't know about the special ETH logs, seeing 0xEee... would make the log's meaning more intuitive and apparent than seeing 0x000....

For what it is worth, this feature is disabled by default and you need to set a flag to turn it on. I'm not sure that is a meaningful argument though.

Copy link

@mmsaki mmsaki Dec 25, 2023

Choose a reason for hiding this comment

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

I agree a search for the zero address would yield more results, but only because the zero address is used for a much wider range of cases, whereas 0xEee... seems to only be used to represent ETH. This is anecdotal and it's hard to know concretely, but in my experience 0xEee... is more common for representing ETH than the zero address.

I agree with @mds1 that 0xEee.. seems more appropriate for Eth transfer logs

Choose a reason for hiding this comment

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

I believe the spec has since been updated to use 0xEee.....

Copy link
Contributor

Choose a reason for hiding this comment

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

The notes still mentions 0x0 here: https://github.com/ethereum/execution-apis/pull/484/files#diff-1e4727bbfb75c5cc85054abbf972a1cd472e9e512a9d8bbc8152210a0062182bR116

Aside: It still feels "unclean" to me using a specific non-reserved address, but in researching this I was surprised to learn that EIP-1352 was never officially adopted.

Copy link

@sambacha sambacha Apr 2, 2024

Choose a reason for hiding this comment

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

0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE is not correct if you're using EIP-1191, the correct chainId encoded address would be 0xeeeEEEeEEeeeEeEeEEEeEeeeeEEEEeEEeEeeeeeE

having it as 0x00... would be agnostic to chainId encoding.

Edit: this is a purely aesthetic choice, though I would find it helpful

Choose a reason for hiding this comment

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

I and others have argued against EIP-1191 in the discussion for it: ethereum/EIPs#1121

My position is still largely the same. It is backward incompatible with EIP-55 checksumming, so I generally don't recommend apps checksum to 1191 until long after almost all tooling supports reading 1191 checksums.

Copy link

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

This endpoint sounds very useful. I believe this is very similar to eth_callMany that some clients support: erigontech/erigon#4471

imo it makes sense to introduce a standardized endpoint.
If I understood this currently, then the calls in the batch are treated as separate transactions.
I think multicall could potentially be confusing because "mutlicall" is already widely used as

Multicall allows multiple smart contract constant function calls to be grouped into a single call and the results aggregated into a single result.

https://github.com/joshstevens19/ethereum-multicall#readme

@MicahZoltu
Copy link

You are correct, this allows you to run multiple calls against one or more blocks in sequence (all building up the same state). Maybe eth_simulateTransactions or eth_simulateBlocks would be better?

@mds1
Copy link

mds1 commented Dec 19, 2023

I'm mostly indifferent to the name, but eth_batchCall or eth_simulateCalls are other alternatives that don't overload the multicall usage.

On this topic, why is the method proposed as eth_multicallV1 instead of eth_multicall? Most RPC methods do not have versioning in their name so this seems to deviate from convention. eth_signTypedData_v4 is the only one I know of with versioning

@MicahZoltu
Copy link

On this topic, why is the method proposed as eth_multicallV1 instead of eth_multicall? Most RPC methods do not have versioning in their name so this seems to deviate from convention. eth_signTypedData_v4 is the only one I know of with versioning

The lack of versioning in existing JSON-RPC methods has been a thorn in the side of people wanting to make changes to them since essentially the beginning of Ethereum. Rather than continue to cause our future selves suffering to maintain a naming convention, we felt it would be wise to break the cycle and introduce versioning.

As for the naming convention, it follows the Engine API's naming convention (the communication channel between execution and consensus clients).

@mattsse
Copy link

mattsse commented Dec 20, 2023

but eth_batchCall or eth_simulateCalls

these are great alternative suggestions, would lean towards eth_simulateCalls, because batchCalls could be mistaken as batched eth_call

Using versioning for this sgtm!

@KillariDev
Copy link
Contributor Author

but eth_batchCall or eth_simulateCalls

these are great alternative suggestions, would lean towards eth_simulateCalls, because batchCalls could be mistaken as batched eth_call

Using versioning for this sgtm!

I think eth_simulateTransactionsV1 would the best. As you can simulate more than just calls, you can simulate transactions

@KillariDev KillariDev changed the title add eth_multicallV1 add eth_simulateV1 Jan 11, 2024
chiphamskymavis pushed a commit to ronin-chain/ronin that referenced this pull request May 15, 2025
This is a successor PR to #25743. This PR is based on a new iteration of
the spec: ethereum/execution-apis#484.

`eth_multicall` takes in a list of blocks, each optionally overriding
fields like number, timestamp, etc. of a base block. Each block can
include calls. At each block users can override the state. There are
extra features, such as:

- Include ether transfers as part of the logs
- Overriding precompile codes with evm bytecode
- Redirecting accounts to another address

This PR includes the following breaking changes:

- Block override fields of eth_call and debug_traceCall have had the
following fields renamed
  - `coinbase` -> `feeRecipient`
  - `random` -> `prevRandao`
  - `baseFee` -> `baseFeePerGas`

---------

Co-authored-by: Gary Rong <[email protected]>
Co-authored-by: Martin Holst Swende <[email protected]>
chiphamskymavis added a commit to ronin-chain/ronin that referenced this pull request May 16, 2025
This is a successor PR to #25743. This PR is based on a new iteration of
the spec: ethereum/execution-apis#484.

`eth_multicall` takes in a list of blocks, each optionally overriding
fields like number, timestamp, etc. of a base block. Each block can
include calls. At each block users can override the state. There are
extra features, such as:

- Include ether transfers as part of the logs
- Overriding precompile codes with evm bytecode
- Redirecting accounts to another address

This PR includes the following breaking changes:

- Block override fields of eth_call and debug_traceCall have had the
following fields renamed
  - `coinbase` -> `feeRecipient`
  - `random` -> `prevRandao`
  - `baseFee` -> `baseFeePerGas`

---------

Co-authored-by: Gary Rong <[email protected]>
Co-authored-by: Martin Holst Swende <[email protected]>
chiphamskymavis added a commit to ronin-chain/ronin that referenced this pull request May 20, 2025
This is a successor PR to #25743. This PR is based on a new iteration of
the spec: ethereum/execution-apis#484.

`eth_multicall` takes in a list of blocks, each optionally overriding
fields like number, timestamp, etc. of a base block. Each block can
include calls. At each block users can override the state. There are
extra features, such as:

- Include ether transfers as part of the logs
- Overriding precompile codes with evm bytecode
- Redirecting accounts to another address

This PR includes the following breaking changes:

- Block override fields of eth_call and debug_traceCall have had the
following fields renamed
  - `coinbase` -> `feeRecipient`
  - `random` -> `prevRandao`
  - `baseFee` -> `baseFeePerGas`

---------

Co-authored-by: Gary Rong <[email protected]>
Co-authored-by: Martin Holst Swende <[email protected]>
@fjl
Copy link
Contributor

fjl commented Jun 2, 2025

Since almost all clients have this implemented on their default branch now, and the effort to add this feature has been ongoing for a long time, I am merging the PR. The test generator has also been updated and tests will be added in a subsequent commit.

@fjl fjl merged commit 8f3251f into ethereum:main Jun 2, 2025
1 check passed
chiphamskymavis added a commit to ronin-chain/ronin that referenced this pull request Jul 2, 2025
This is a successor PR to #25743. This PR is based on a new iteration of
the spec: ethereum/execution-apis#484.

`eth_multicall` takes in a list of blocks, each optionally overriding
fields like number, timestamp, etc. of a base block. Each block can
include calls. At each block users can override the state. There are
extra features, such as:

- Include ether transfers as part of the logs
- Overriding precompile codes with evm bytecode
- Redirecting accounts to another address

This PR includes the following breaking changes:

- Block override fields of eth_call and debug_traceCall have had the
following fields renamed
  - `coinbase` -> `feeRecipient`
  - `random` -> `prevRandao`
  - `baseFee` -> `baseFeePerGas`

---------

Co-authored-by: Gary Rong <[email protected]>
Co-authored-by: Martin Holst Swende <[email protected]>
qianhh pushed a commit to bane-labs/go-ethereum that referenced this pull request Jul 2, 2025
This is a successor PR to #25743. This PR is based on a new iteration of
the spec: ethereum/execution-apis#484.

`eth_multicall` takes in a list of blocks, each optionally overriding
fields like number, timestamp, etc. of a base block. Each block can
include calls. At each block users can override the state. There are
extra features, such as:

- Include ether transfers as part of the logs
- Overriding precompile codes with evm bytecode
- Redirecting accounts to another address

This PR includes the following breaking changes:

- Block override fields of eth_call and debug_traceCall have had the
following fields renamed
  - `coinbase` -> `feeRecipient`
  - `random` -> `prevRandao`
  - `baseFee` -> `baseFeePerGas`

---------

Co-authored-by: Gary Rong <[email protected]>
Co-authored-by: Martin Holst Swende <[email protected]>
jakub-freebit pushed a commit to fblch/go-ethereum that referenced this pull request Jul 3, 2025
This is a successor PR to ethereum#25743. This PR is based on a new iteration of
the spec: ethereum/execution-apis#484.

`eth_multicall` takes in a list of blocks, each optionally overriding
fields like number, timestamp, etc. of a base block. Each block can
include calls. At each block users can override the state. There are
extra features, such as:

- Include ether transfers as part of the logs
- Overriding precompile codes with evm bytecode
- Redirecting accounts to another address

## Breaking changes

This PR includes the following breaking changes:

- Block override fields of eth_call and debug_traceCall have had the
following fields renamed
  - `coinbase` -> `feeRecipient`
  - `random` -> `prevRandao`
  - `baseFee` -> `baseFeePerGas`

---------

Co-authored-by: Gary Rong <[email protected]>
Co-authored-by: Martin Holst Swende <[email protected]>
qianhh pushed a commit to bane-labs/go-ethereum that referenced this pull request Jul 10, 2025
This is a successor PR to #25743. This PR is based on a new iteration of
the spec: ethereum/execution-apis#484.

`eth_multicall` takes in a list of blocks, each optionally overriding
fields like number, timestamp, etc. of a base block. Each block can
include calls. At each block users can override the state. There are
extra features, such as:

- Include ether transfers as part of the logs
- Overriding precompile codes with evm bytecode
- Redirecting accounts to another address

This PR includes the following breaking changes:

- Block override fields of eth_call and debug_traceCall have had the
following fields renamed
  - `coinbase` -> `feeRecipient`
  - `random` -> `prevRandao`
  - `baseFee` -> `baseFeePerGas`

---------

Co-authored-by: Gary Rong <[email protected]>
Co-authored-by: Martin Holst Swende <[email protected]>
qianhh pushed a commit to bane-labs/go-ethereum that referenced this pull request Jul 15, 2025
This is a successor PR to #25743. This PR is based on a new iteration of
the spec: ethereum/execution-apis#484.

`eth_multicall` takes in a list of blocks, each optionally overriding
fields like number, timestamp, etc. of a base block. Each block can
include calls. At each block users can override the state. There are
extra features, such as:

- Include ether transfers as part of the logs
- Overriding precompile codes with evm bytecode
- Redirecting accounts to another address

This PR includes the following breaking changes:

- Block override fields of eth_call and debug_traceCall have had the
following fields renamed
  - `coinbase` -> `feeRecipient`
  - `random` -> `prevRandao`
  - `baseFee` -> `baseFeePerGas`

---------

Co-authored-by: Gary Rong <[email protected]>
Co-authored-by: Martin Holst Swende <[email protected]>
qianhh pushed a commit to bane-labs/go-ethereum that referenced this pull request Jul 15, 2025
This is a successor PR to #25743. This PR is based on a new iteration of
the spec: ethereum/execution-apis#484.

`eth_multicall` takes in a list of blocks, each optionally overriding
fields like number, timestamp, etc. of a base block. Each block can
include calls. At each block users can override the state. There are
extra features, such as:

- Include ether transfers as part of the logs
- Overriding precompile codes with evm bytecode
- Redirecting accounts to another address

This PR includes the following breaking changes:

- Block override fields of eth_call and debug_traceCall have had the
following fields renamed
  - `coinbase` -> `feeRecipient`
  - `random` -> `prevRandao`
  - `baseFee` -> `baseFeePerGas`

---------

Co-authored-by: Gary Rong <[email protected]>
Co-authored-by: Martin Holst Swende <[email protected]>
qianhh pushed a commit to bane-labs/go-ethereum that referenced this pull request Jul 16, 2025
This is a successor PR to #25743. This PR is based on a new iteration of
the spec: ethereum/execution-apis#484.

`eth_multicall` takes in a list of blocks, each optionally overriding
fields like number, timestamp, etc. of a base block. Each block can
include calls. At each block users can override the state. There are
extra features, such as:

- Include ether transfers as part of the logs
- Overriding precompile codes with evm bytecode
- Redirecting accounts to another address

This PR includes the following breaking changes:

- Block override fields of eth_call and debug_traceCall have had the
following fields renamed
  - `coinbase` -> `feeRecipient`
  - `random` -> `prevRandao`
  - `baseFee` -> `baseFeePerGas`

---------

Co-authored-by: Gary Rong <[email protected]>
Co-authored-by: Martin Holst Swende <[email protected]>
qianhh pushed a commit to bane-labs/go-ethereum that referenced this pull request Aug 8, 2025
This is a successor PR to #25743. This PR is based on a new iteration of
the spec: ethereum/execution-apis#484.

`eth_multicall` takes in a list of blocks, each optionally overriding
fields like number, timestamp, etc. of a base block. Each block can
include calls. At each block users can override the state. There are
extra features, such as:

- Include ether transfers as part of the logs
- Overriding precompile codes with evm bytecode
- Redirecting accounts to another address

This PR includes the following breaking changes:

- Block override fields of eth_call and debug_traceCall have had the
following fields renamed
  - `coinbase` -> `feeRecipient`
  - `random` -> `prevRandao`
  - `baseFee` -> `baseFeePerGas`

---------

Co-authored-by: Gary Rong <[email protected]>
Co-authored-by: Martin Holst Swende <[email protected]>
sonhv0212 pushed a commit to ronin-chain/ronin that referenced this pull request Aug 11, 2025
This is a successor PR to #25743. This PR is based on a new iteration of
the spec: ethereum/execution-apis#484.

`eth_multicall` takes in a list of blocks, each optionally overriding
fields like number, timestamp, etc. of a base block. Each block can
include calls. At each block users can override the state. There are
extra features, such as:

- Include ether transfers as part of the logs
- Overriding precompile codes with evm bytecode
- Redirecting accounts to another address

This PR includes the following breaking changes:

- Block override fields of eth_call and debug_traceCall have had the
following fields renamed
  - `coinbase` -> `feeRecipient`
  - `random` -> `prevRandao`
  - `baseFee` -> `baseFeePerGas`

---------

Co-authored-by: Gary Rong <[email protected]>
Co-authored-by: Martin Holst Swende <[email protected]>
qianhh pushed a commit to bane-labs/go-ethereum that referenced this pull request Aug 19, 2025
This is a successor PR to #25743. This PR is based on a new iteration of
the spec: ethereum/execution-apis#484.

`eth_multicall` takes in a list of blocks, each optionally overriding
fields like number, timestamp, etc. of a base block. Each block can
include calls. At each block users can override the state. There are
extra features, such as:

- Include ether transfers as part of the logs
- Overriding precompile codes with evm bytecode
- Redirecting accounts to another address

This PR includes the following breaking changes:

- Block override fields of eth_call and debug_traceCall have had the
following fields renamed
  - `coinbase` -> `feeRecipient`
  - `random` -> `prevRandao`
  - `baseFee` -> `baseFeePerGas`

---------

Co-authored-by: Gary Rong <[email protected]>
Co-authored-by: Martin Holst Swende <[email protected]>
qianhh pushed a commit to bane-labs/go-ethereum that referenced this pull request Aug 21, 2025
This is a successor PR to #25743. This PR is based on a new iteration of
the spec: ethereum/execution-apis#484.

`eth_multicall` takes in a list of blocks, each optionally overriding
fields like number, timestamp, etc. of a base block. Each block can
include calls. At each block users can override the state. There are
extra features, such as:

- Include ether transfers as part of the logs
- Overriding precompile codes with evm bytecode
- Redirecting accounts to another address

This PR includes the following breaking changes:

- Block override fields of eth_call and debug_traceCall have had the
following fields renamed
  - `coinbase` -> `feeRecipient`
  - `random` -> `prevRandao`
  - `baseFee` -> `baseFeePerGas`

---------

Co-authored-by: Gary Rong <[email protected]>
Co-authored-by: Martin Holst Swende <[email protected]>
qianhh pushed a commit to bane-labs/go-ethereum that referenced this pull request Sep 1, 2025
This is a successor PR to #25743. This PR is based on a new iteration of
the spec: ethereum/execution-apis#484.

`eth_multicall` takes in a list of blocks, each optionally overriding
fields like number, timestamp, etc. of a base block. Each block can
include calls. At each block users can override the state. There are
extra features, such as:

- Include ether transfers as part of the logs
- Overriding precompile codes with evm bytecode
- Redirecting accounts to another address

This PR includes the following breaking changes:

- Block override fields of eth_call and debug_traceCall have had the
following fields renamed
  - `coinbase` -> `feeRecipient`
  - `random` -> `prevRandao`
  - `baseFee` -> `baseFeePerGas`

---------

Co-authored-by: Gary Rong <[email protected]>
Co-authored-by: Martin Holst Swende <[email protected]>
trantienduchn pushed a commit to ronin-chain/ronin that referenced this pull request Sep 3, 2025
This is a successor PR to #25743. This PR is based on a new iteration of
the spec: ethereum/execution-apis#484.

`eth_multicall` takes in a list of blocks, each optionally overriding
fields like number, timestamp, etc. of a base block. Each block can
include calls. At each block users can override the state. There are
extra features, such as:

- Include ether transfers as part of the logs
- Overriding precompile codes with evm bytecode
- Redirecting accounts to another address

This PR includes the following breaking changes:

- Block override fields of eth_call and debug_traceCall have had the
following fields renamed
  - `coinbase` -> `feeRecipient`
  - `random` -> `prevRandao`
  - `baseFee` -> `baseFeePerGas`

---------

Co-authored-by: Gary Rong <[email protected]>
Co-authored-by: Martin Holst Swende <[email protected]>
trantienduchn added a commit to ronin-chain/ronin that referenced this pull request Sep 3, 2025
* all: remove Message interface

* core: renaming isFake to skipAccountChecks

* all: expose message fields to remove getter func

* simulate: call apply message for short

* light: remove unused callmsg struct

* core: refactor TransactionToMessage to use NewMessage constructor

* ci: update job name in EVM tests

* core: enhance TransactionToMessage to include ExpiredTime field

* core: update NewMessage constructor to include SetCodeAuthorizations

* core: rename TransactionToMessage function for clarity

* core: update TransactionToMessage to utilize SetCodeAuthorizations

* core/tracing: add hooks for live tracing of block processing and transaction execution

* core: add VM new tracing support with new configuration options

* core/state: add tracing hook to state db and state object (#73)

* core/state: add tracing hook to state db

* core/state: add tracing hook to state object

* workflows: enable unit test

* core/state: add BalanceChangeReason to state db and state object (#74)

* core/state: add BalanceChangeReason to state object

* core/state: add BalanceChangeReason to StateDB.AddBalance

* core/state: add BalanceChangeReason to StateDB.SubBalance

* core/state: add BalanceChangeReason to StateDB.SetBalance

* core: state transition, processor, evm support live tracer (#75)

* core/vm: add VMError

* core/vm: use live tracer in EVMInterpreter.Run

* core: add live tracer to applyTransaction

* core: add live tracer to state transition flow

* core/vm: run precompiled contract with live tracer

* core/vm/runtime: add live tracer for runtime execution

* core: blockchain supports live tracer (#77)

* all: replace the older tracer by live tracer (#78)

* core/vm: remove usages of older tracer from interpreter

* core: remove usages of older tracer from state transition

* core/vm: remove usages of older tracer from evm

* core/vm: remove usages of older tracer from instructions

* all: replace the older tracer by live tracer

* eth/tracer/logger,internal/ethapi: update access list tracer

* all: replace LiveTracer by Tracer

* all: support calltracer2

* eth/tracer/internal/tracetest: fix test

* core, tests: add missing usages of live tracer in blockchain and statetest (#83)

* core: set logger for blockchain

* tests: state test supports live tracer

* eth/tracer/live: add supply live tracer (#84)

* eth/tracer/live: add supply live tracer

* eth/tracers: fix supply live tracer test

* core: Close all tracers when stop blockchain

* eth/tracers: fix supply live tracer test

* core, eth/tracers: move chainconfig to tracers and some refactors (#86)

* core, eth/tracers: move chainconfig to tracers

* eth/tracer/live: add noop live tracer

* core/tracers/live: rename supply to supplyTracer

* cmd/utils, eth/tracers: set default tracer config to empty object

* evm: remove EVMLogger interface (#91)

* core: minor cleanup in stateDB and Call (#96)

* core/vm/runtime: call OnTxStart before prepare state DB in Call

* core/state: simplify state selfdestruct

* core/vm: update gas usage to use Tracer instead of LiveTracer in EIP-7702 gas call variant

* eth/tracers/internal/tracetest: disable KotaroBlock in pre-Cancun tests

* core/vm/runtime: fix type error

* core/tracing: extends tracing.Hooks with OnSystemCallStartV2 (#30786)

This PR extends the Hooks interface with a new method,
`OnSystemCallStartV2`, which takes `VMContext` as its parameter.

Motivation

By including `VMContext` as a parameter, the `OnSystemCallStartV2` hook
achieves parity with the `OnTxStart` hook in terms of provided insights.
This alignment simplifies the inner tracer logic, enabling consistent
handling of state changes and internal calls within the same framework.

---------

Co-authored-by: Sina Mahmoodi <[email protected]>

* core: capture on gas change when applying eip-7623

Ref PR: ethereum/go-ethereum#30946

* all: remove Message interface

* core/state: add BalanceChangeReason to state db and state object (#74)

* core/state: add BalanceChangeReason to state object

* core/state: add BalanceChangeReason to StateDB.AddBalance

* core/state: add BalanceChangeReason to StateDB.SubBalance

* core/state: add BalanceChangeReason to StateDB.SetBalance

* core: state transition, processor, evm support live tracer (#75)

* core/vm: add VMError

* core/vm: use live tracer in EVMInterpreter.Run

* core: add live tracer to applyTransaction

* core: add live tracer to state transition flow

* core/vm: run precompiled contract with live tracer

* core/vm/runtime: add live tracer for runtime execution

* all: replace the older tracer by live tracer (#78)

* core/vm: remove usages of older tracer from interpreter

* core: remove usages of older tracer from state transition

* core/vm: remove usages of older tracer from evm

* core/vm: remove usages of older tracer from instructions

* all: replace the older tracer by live tracer

* eth/tracer/logger,internal/ethapi: update access list tracer

* all: replace LiveTracer by Tracer

* all: support calltracer2

* eth/tracer/internal/tracetest: fix test

* internal/ethapi: eth_multicall (#27720)

This is a successor PR to #25743. This PR is based on a new iteration of
the spec: ethereum/execution-apis#484.

`eth_multicall` takes in a list of blocks, each optionally overriding
fields like number, timestamp, etc. of a base block. Each block can
include calls. At each block users can override the state. There are
extra features, such as:

- Include ether transfers as part of the logs
- Overriding precompile codes with evm bytecode
- Redirecting accounts to another address

This PR includes the following breaking changes:

- Block override fields of eth_call and debug_traceCall have had the
following fields renamed
  - `coinbase` -> `feeRecipient`
  - `random` -> `prevRandao`
  - `baseFee` -> `baseFeePerGas`

---------

Co-authored-by: Gary Rong <[email protected]>
Co-authored-by: Martin Holst Swende <[email protected]>

* core/vm: init precompile logic, update tests

* core/vm: init precompile logic, update tests

* gethclient: update block overwrite json

* ethapi: move validation from ToMessage to CallDefault

* ethapi: remove un-used fee logic

* ci: try enable test report

* internal/ethapi/api: for simulated calls, set gaspool to max value if global gascap is 0 (#30474)

In #27720, we introduced RPC global gas cap. A value of `0` means an unlimited gas cap. However, this was not the case for simulated calls. This PR fixes the behaviour.

* core/types: remove redundance hashes

* ethapi: correct simulate blocktime to 3s

* ethapi: add tests for simulate

* genesis: support nil balance when init genesis

* eth/api: remove err unmarshal block rpc

* simulate: apply evm txcontext, fix state hook

* internal/ethapi: fix simulate tests related to gas, base fee (#95)

* internal/ethapi: fix simulate tests related to gas, base fee

* ethapi: fix simulate validation tests

* ethapi: pass nonce to message

---------

Co-authored-by: chiphamskymavis <[email protected]>

* core: remove redundant receipt bloom

* eth: lower blob basefee for gasestimator

* eth, internal: remove err in transaction to msg func

* core: remove receipt generator

* simulate: skip system transactions during simulation when signTxFn is unavailable (#110)

* ethapi: update gas used values in simulation tests for accuracy

* ci: trigger build nightly for simulate

* eth: Fix movePrecompileToAddress ignored on debug_traceCall (#114)

* eth/tracers: set logger hooks for stateDB (#115)

* eth/tracers: set logger hooks for stateDB

* core/state: ensure logger is included in StateDB copy

* cmd: add vm trace flags

* eth: add tracer initialization

* cmd: init live tracer

* internal/ethapi: remove hard code timeout

* ci: revert custom actions

* ci: revert custom trigger condition

* ethapi: remove duplicated code

* consensus,ethapi: remove skip system tx when simulate, remove unused allLogs, changed from engine FinalizeAndAssemble to manual types.NewBlock

* ci: trigger build nightly for simulate

* internal/ethapi: process EIP-2935 in simulation

* ci: revert build nightly

* internal/ethapi: use skipChecks in applyMessage()

* internal/ethapi: use vmConfig

* eth/gasestimator: use gasLimit

* internal/ethapi: fix test fails

* internal/ethapi: resolve comments

---------

Co-authored-by: sonhv0212 <[email protected]>
Co-authored-by: Sina Mahmoodi <[email protected]>
Co-authored-by: Gary Rong <[email protected]>
Co-authored-by: Martin Holst Swende <[email protected]>
Co-authored-by: jwasinger <[email protected]>
Co-authored-by: Tran Tien Duc <[email protected]>
Co-authored-by: TuDo1403 <[email protected]>
qianhh pushed a commit to bane-labs/go-ethereum that referenced this pull request Sep 3, 2025
This is a successor PR to #25743. This PR is based on a new iteration of
the spec: ethereum/execution-apis#484.

`eth_multicall` takes in a list of blocks, each optionally overriding
fields like number, timestamp, etc. of a base block. Each block can
include calls. At each block users can override the state. There are
extra features, such as:

- Include ether transfers as part of the logs
- Overriding precompile codes with evm bytecode
- Redirecting accounts to another address

This PR includes the following breaking changes:

- Block override fields of eth_call and debug_traceCall have had the
following fields renamed
  - `coinbase` -> `feeRecipient`
  - `random` -> `prevRandao`
  - `baseFee` -> `baseFeePerGas`

---------

Co-authored-by: Gary Rong <[email protected]>
Co-authored-by: Martin Holst Swende <[email protected]>
gballet pushed a commit to gballet/go-ethereum that referenced this pull request Sep 11, 2025
This is a successor PR to ethereum#25743. This PR is based on a new iteration of
the spec: ethereum/execution-apis#484.

`eth_multicall` takes in a list of blocks, each optionally overriding
fields like number, timestamp, etc. of a base block. Each block can
include calls. At each block users can override the state. There are
extra features, such as:

- Include ether transfers as part of the logs
- Overriding precompile codes with evm bytecode
- Redirecting accounts to another address

## Breaking changes

This PR includes the following breaking changes:

- Block override fields of eth_call and debug_traceCall have had the
following fields renamed
  - `coinbase` -> `feeRecipient`
  - `random` -> `prevRandao`
  - `baseFee` -> `baseFeePerGas`

---------

Co-authored-by: Gary Rong <[email protected]>
Co-authored-by: Martin Holst Swende <[email protected]>
Copy link

@Hardikgosai1 Hardikgosai1 left a comment

Choose a reason for hiding this comment

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

Tq

Copy link

@Hardikgosai1 Hardikgosai1 left a comment

Choose a reason for hiding this comment

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

Hardikgosai1

evadav-663 added a commit to evadav-663/revminc that referenced this pull request Oct 27, 2025
ref ethereum/execution-apis#484
paradigmxyz/reth#10829

Also added hook for `eofcreate` and moved all handling away from `_env`
hooks to ensure correct ordering.

We don't yet insert logs for selfdestructs, would need update on revm
side to pass journaled state into the hook
arublee8052-9 added a commit to arublee8052-9/revminc that referenced this pull request Oct 27, 2025
ref ethereum/execution-apis#484
paradigmxyz/reth#10829

Also added hook for `eofcreate` and moved all handling away from `_env`
hooks to ensure correct ordering.

We don't yet insert logs for selfdestructs, would need update on revm
side to pass journaled state into the hook
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.