Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add eth_simulateV1 #484

Open
wants to merge 34 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
31fcbe5
eth_multicallv1
KillariDev Nov 4, 2023
8b020ce
fix some issues with the spec
KillariDev Nov 20, 2023
aaab3f8
Merge remote-tracking branch 'upstream/main' into eth_multicallv1
KillariDev Nov 20, 2023
8ab6539
fix refs, fix styling
KillariDev Nov 20, 2023
61fb231
Update docs/multicall-notes.md
KillariDev Nov 27, 2023
45313dd
Update docs/multicall-notes.md
KillariDev Nov 27, 2023
d9411e0
feedback according to comments, and a 30mb limit
KillariDev Nov 27, 2023
06d27bd
Merge branch 'eth_multicallv1' of https://github.com/DarkFlorist/exec…
KillariDev Nov 27, 2023
b4ce098
use 0xee.. address instead of 0x0 address for eth transfer logs
KillariDev Dec 12, 2023
0043e12
add withdrawals to input and output
KillariDev Dec 12, 2023
3095c08
add support for EIP-4844
KillariDev Dec 19, 2023
c7ec336
rename eth_multicallV1 to eth_simulateV1
KillariDev Jan 11, 2024
c20052c
update according to meeting (nonce calculation, blobBaseFee, gasLimit…
KillariDev Jan 21, 2024
7aee5b3
add note that when targeting non-precompiles with MovePrecompileToAdd…
KillariDev Feb 1, 2024
8996847
rename focument to be eth simulate related because of the name change
KillariDev Feb 26, 2024
e76cb57
add transaction hash and index to the logs
KillariDev Feb 26, 2024
dde3124
Update docs/ethsimulatev1-notes.md
KillariDev Mar 5, 2024
db721c4
fix blobgasPrices
KillariDev Mar 7, 2024
aef37eb
use blobBaseFee for now
KillariDev Mar 8, 2024
85ad1a4
remove blobBaseFee, not part of header
KillariDev Mar 20, 2024
21c6dfa
blobBaseFee to uint64 and validator_index -> `validatorIndex`
KillariDev Mar 20, 2024
e27cf9a
Merge remote-tracking branch 'upstream/main' into eth_multicallv1
KillariDev Mar 20, 2024
b597a7f
Merge remote-tracking branch 'upstream/main' into eth_multicallv1
KillariDev Apr 24, 2024
1ccfd37
remove phantom blocks :(
KillariDev Apr 24, 2024
f297b4f
rename multicall stuff to ethsimulate stuff. Add `returnFullTransacti…
KillariDev May 29, 2024
e3332ea
use `allOf`
KillariDev May 29, 2024
e913466
when validation mode is false, baseFeePerGas and blobBaseFee are set…
KillariDev Jun 4, 2024
8141886
multicall -> eth_simulate, add chain id, add default rsv values, add…
KillariDev Jun 12, 2024
2ee9fc2
add rationale for pre-computed calls
s1na Sep 17, 2024
42d1249
update with flexibility
s1na Sep 17, 2024
55f657c
Merge pull request #3 from s1na/eth_multicallv1
KillariDev Sep 18, 2024
0256a4b
added removed field to logs which should have been there
KillariDev Sep 25, 2024
de3e3f5
make "removed" an optional field
KillariDev Oct 7, 2024
d7b4616
relax time requirement so that time can stay still
KillariDev Oct 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions docs/multicall-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ Unlike `eth_call`, `eth_multicallV1`'s calls are conducted inside blocks. We don
| hash | Calculated normally, except for phantom blocks, see below Phantom block section |
| parentHash | Previous blocks hash (the real hash, or phantom blocks hash) |
| timestamp | The timestamp of previous block + 1 |
| baseFeePerGas | Calculated on what it should be according to ethereum's spec. Note: baseFeePerGas is not adjusted in the phantom blocks. |
| baseFeePerGas | Calculated on what it should be according to Ethereum's spec. Note: baseFeePerGas is not adjusted in the phantom blocks. |
| sha3Uncles | Empty trie root |
| withdrawals | Empty array |
| uncles | Empty array |
| blobGasPrice | Calculated on what it should be according to EIP-4844 spec. Note: blobGasPrice is not adjusted in the phantom blocks. |
| number | Previous block number + 1 |
| logsBloom | Calculated normally. ETH logs are not part of the calculation |
| receiptsRoot | Calculated normally |
Expand Down Expand Up @@ -92,17 +93,19 @@ As multicall is an extension to `eth_call` we want to enable the nice user exper
| 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
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 |
| blobVersionedHashes | 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`:
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`, `baseFeePerGas` and `blobGasPrice`:
```json
"blockOverrides": {
"number": "0x14",
"time": "0xc8",
"gasLimit": "0x2e631",
"feeRecipient": "0xc100000000000000000000000000000000000000",
"prevRandao": "0x0000000000000000000000000000000000000000000000000000000000001234",
"baseFeePerGas": "0x14"
"baseFeePerGas": "0x14",
"blobGasPrice": "0x15"
},
```
All the other fields are computed automatically (eg, `stateRoot` and `gasUsed`) or kept as their default values (eg. `uncles` or `withdrawals`). When overriding `number` and `time` variables for blocks, we automatically check that the block numbers and time fields are strictly increasing (we don't allow decreasing, or duplicated block numbers or times). If the block number is increased more than `1` compared to the previous block, phantom blocks are created to fill the gaps.
Expand Down
18 changes: 18 additions & 0 deletions src/schemas/execute.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@ BlockOverrides:
withdrawals:
title: Withdrawals made by validators
$ref: '#/components/schemas/Withdrawals'
blobGasPrice:
KillariDev marked this conversation as resolved.
Show resolved Hide resolved
title: Blob gas price
$ref: '#/components/schemas/uint256'
Withdrawals:
title: Withdrawals made by validators
description: This array can have a maximum length of 16.
Expand Down Expand Up @@ -202,6 +205,15 @@ MultiCallBlockResultSingleSuccess:
withdrawals:
title: Withdrawals made by validators
$ref: '#/components/schemas/Withdrawals'
blobGasUsed:
title: The total amount of blob gas consumed by the transactions within the block.
$ref: '#/components/schemas/uint256'
KillariDev marked this conversation as resolved.
Show resolved Hide resolved
excessBlobGas:
title: The running total of blob gas consumed in excess of the target, prior to the block.
$ref: '#/components/schemas/uint256'
blobGasPrice:
title: Blob gas price
$ref: '#/components/schemas/uint256'
MultiCallBlockResultInvalid:
title: Result of multicall not being valid
description: The error messages are suggestions and a client might decide to return a different errror message than specified here. However, the error codes are enforced by this specification.
Expand Down Expand Up @@ -401,3 +413,9 @@ GenericCallTransaction:
EIP-2930 access list
Default: []
$ref: '#/components/schemas/AccessList'
blobVersionedHashes:
title: Blob versioned hashes
description: |-
EIP-4844 versioned hashes
Default: []
$ref: '#/components/schemas/bytes32'