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_multicall , support array of eth_call for simulation across multiple blocks #383

Closed
wants to merge 76 commits into from
Closed
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
5556499
Add eth_multicall
epheph Feb 20, 2023
95822af
Remove chain-id from call-type (no replay protection necessary for ca…
epheph Feb 20, 2023
602d2bf
Merge remote-tracking branch 'origin/main' into eth_multicall
epheph Mar 27, 2023
6ce85e2
Add tests
epheph Mar 28, 2023
2fcbf1d
Add test error case
epheph Mar 28, 2023
046502a
Fix account override adding address to target
epheph Mar 30, 2023
e4ec926
Add example resetting WETH to 1ETH totalSupply and assigning that 1ET…
epheph Mar 30, 2023
0fbdf40
Add another account delta
epheph Mar 30, 2023
ccfc70b
Add example resetting WETH to 1ETH totalSupply and assigning that 1ET…
epheph Apr 3, 2023
7590b80
block override with simple contract that just returns block number
epheph Apr 5, 2023
bbf34e8
Change response to keep the block-based structure similar to request …
epheph May 11, 2023
c147f92
Update src/schemas/execute.yaml
epheph Jun 6, 2023
23ef5b8
Update src/schemas/execute.yaml
epheph Jun 6, 2023
73897a7
Update src/schemas/execute.yaml
epheph Jun 6, 2023
152cf09
Update src/schemas/execute.yaml
epheph Jun 6, 2023
c8abc82
Get rid of version, consider standard solution in #408 for the future
epheph Jun 8, 2023
14e9b35
Even though it's only 1 block you are overriding in this context, you…
epheph Jun 8, 2023
94786e2
Addressing feedback related to return being reserved word
epheph Jun 8, 2023
4b63f49
if no logs, empty array.
epheph Jun 8, 2023
dc38150
Most restrictive data type for blockNumber i could find elsewhere
epheph Jun 8, 2023
9463ba6
Most restrictive data type for gas I could find elsewhere in repo
epheph Jun 8, 2023
51fad35
Apply suggestions from code review
epheph Jun 8, 2023
1802812
Update src/eth/execute.yaml
epheph Jun 8, 2023
6bd8e50
Update src/eth/execute.yaml
epheph Jun 8, 2023
2cf1b8e
Add Trace Transfers argument
epheph Jun 15, 2023
ff39b4a
Add moveToAddress, a way to displace code or precompile at a specific…
epheph Jun 15, 2023
81e6730
Add tiny documentation inline concerning requirement that block numbe…
epheph Jun 15, 2023
4a42aa2
Apply suggestions from code review
epheph Jun 22, 2023
7d159f8
Merge remote-tracking branch 'origin/main' into eth_multicall
epheph Jul 5, 2023
7787ce8
Using `errors` style, as seen in more modern api error definitions. S…
epheph Jul 5, 2023
d8ca0a4
Merge remote-tracking branch 'df/eth_multicall' into eth_multicall
epheph Jul 5, 2023
90016c0
Update src/schemas/execute.yaml
MicahZoltu Jul 20, 2023
d596116
Update src/schemas/execute.yaml
KillariDev Jul 21, 2023
0f8426a
Removes `int` type.
MicahZoltu Jul 25, 2023
6928d24
Typo: errors -> error
MicahZoltu Jul 25, 2023
9528d89
Fixes error object type for CallResultFailure.
MicahZoltu Jul 25, 2023
c6a3397
Changes BlockOverrides.number to a uint64.
MicahZoltu Jul 25, 2023
b587f7f
Another `errors => error` typo
MicahZoltu Jul 25, 2023
818ef4a
Timestamp to uint64
MicahZoltu Jul 25, 2023
3c7c14e
Timestamp to uint64
MicahZoltu Jul 25, 2023
1814075
Block number to uint64
MicahZoltu Jul 25, 2023
c3999c2
Fixes bug in spec (error was both object and list).
MicahZoltu Jul 25, 2023
1a92538
add multicall object
KillariDev Jul 25, 2023
41213eb
fix error unions
KillariDev Jul 25, 2023
e785349
add descriptions
KillariDev Jul 25, 2023
024958c
fix account override
KillariDev Jul 25, 2023
385791c
use blockStateCalls instead of of "calls"
KillariDev Jul 25, 2023
557038a
Now builds without errors, but fails lint script / schema checks
0xjimmy Jul 26, 2023
e2ae78f
Apply suggestions from code review
MicahZoltu Jul 26, 2023
d1cce31
Update src/schemas/execute.yaml
KillariDev Jul 28, 2023
dfdab76
move errors to root, add couple standard errors, add more clarifying …
KillariDev Jul 31, 2023
2dde369
clarify statediff/state/moveToAddress params
KillariDev Aug 1, 2023
dd0fe15
make StateOverrides a dictionary
KillariDev Aug 3, 2023
6cde1ab
Update execute.yaml
KillariDev Aug 3, 2023
62ab430
update prevRandao, baseFeePerGas and feeRecipient back. Add descripti…
KillariDev Aug 7, 2023
bde1830
change `moveToAddress` to `movePrecompileToAddress`
KillariDev Sep 11, 2023
8d8725a
Add suggested default values for transactions
KillariDev Sep 11, 2023
dc4017b
fix according to comments
KillariDev Oct 11, 2023
a3f89ad
move call invalid errors to top level of multicall
KillariDev Oct 20, 2023
28d995f
multicall notes
KillariDev Oct 24, 2023
50c09b8
update document
KillariDev Oct 24, 2023
be26261
Update docs/multicall-notes.md
KillariDev Oct 24, 2023
0630df2
Update docs/multicall-notes.md
KillariDev Oct 24, 2023
e861a4a
Update docs/multicall-notes.md
KillariDev Oct 24, 2023
cba6d4e
Update docs/multicall-notes.md
KillariDev Oct 24, 2023
2196a29
Update docs/multicall-notes.md
KillariDev Oct 24, 2023
40daadb
Update docs/multicall-notes.md
KillariDev Oct 24, 2023
d831c5f
fix according to comments
KillariDev Oct 25, 2023
995acb2
add new error for gas limit and block number limits
KillariDev Oct 25, 2023
88f1f7b
add failures comment
KillariDev Oct 25, 2023
235c40c
Update docs/multicall-notes.md
KillariDev Oct 30, 2023
e817b74
Update docs/multicall-notes.md
KillariDev Oct 30, 2023
78b3a92
Update docs/multicall-notes.md
KillariDev Oct 30, 2023
cb5d419
Update docs/multicall-notes.md
KillariDev Oct 30, 2023
8d3b4d4
add info about overriding default values and restrictions on them
KillariDev Nov 3, 2023
5f09367
add note
KillariDev Nov 3, 2023
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
21 changes: 21 additions & 0 deletions src/eth/execute.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,24 @@
gasUsed:
title: Gas used
$ref: '#/components/schemas/uint'
- name: eth_multicallV1
summary: Executes a sequence of message calls building on each other's state without creating transactions on the block chain, optionally overriding block and state data
params:
- name: Block state calls
schema:
title: Arguments for multi call
type: array
items:
$ref: '#/components/schemas/BlockStateCalls'
- name: Block tag
required: false
schema:
type: boolean
- name: Trace Transfers - Add ETH transfers as fake events to the event log response
required: false
schema:
$ref: '#/components/schemas/BlockNumberOrTagOrHash'
Copy link
Contributor

Choose a reason for hiding this comment

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

We need to add a parameter for validation-mode on/off.

result:
name: Result of calls
schema:
$ref: '#/components/schemas/MultiCallResult'

Choose a reason for hiding this comment

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

Suggested change
- name: eth_multicallV1
summary: Executes a sequence of message calls building on each other's state without creating transactions on the block chain, optionally overriding block and state data
params:
- name: Block state calls
schema:
title: Arguments for multi call
type: array
items:
$ref: '#/components/schemas/BlockStateCalls'
- name: Block tag
required: false
schema:
type: boolean
- name: Trace Transfers - Add ETH transfers as fake events to the event log response
required: false
schema:
$ref: '#/components/schemas/BlockNumberOrTagOrHash'
result:
name: Result of calls
schema:
$ref: '#/components/schemas/MultiCallResult'
- name: eth_multicallV1
summary: Executes a sequence of message calls building on each other's state without creating transactions on the block chain, optionally overriding block and state data
params:
- name: Details
required: true
schema:
- name: Calls
schema:
title: Arguments for multi call
type: array
items:
$ref: '#/components/schemas/BlockStateCalls'
- name: TraceTransfers
required: false
schema:
$ref: boolean
- name: Validation
required: false
schema:
$ref: boolean
- name: Block tag
required: false
schema:
type: '#/components/schemas/BlockNumberOrTagOrHash'
result:
name: Result of calls
schema:
$ref: '#/components/schemas/MultiCallResult'

not sure if I understood the syntax correctly. But this is about wrapping the arguments into an object

Choose a reason for hiding this comment

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

There's also add to teh validation mode. We also need to agree on names for these

Copy link
Contributor

Choose a reason for hiding this comment

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

I believe an object needs title, type: 'object', and properties on it, and the properties should then contain the list of properties. I believe schema is used instead of these if the schema is defined elsewhere, but in this case you are defining it inline so there would be no schema property.

4 changes: 4 additions & 0 deletions src/schemas/base-types.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ uint256:
title: hex encoded 256 bit unsigned integer
type: string
pattern: ^0x([1-9a-f]+[0-9a-f]{0,31})|0$
int:
title: decimal signed integer
type: string
pattern: ^-?[0-9]+$
Copy link
Contributor

Choose a reason for hiding this comment

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

This does not match uint definition above it. either both should be decimal or both hex encoded. I understand that this will decrees readability but it has to be done for the sake of consistency.

Suggested change
int:
title: decimal signed integer
type: string
pattern: ^-?[0-9]+$
int:
title: hex encoded signed integer
type: string
pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$

Copy link
Author

@epheph epheph Jul 4, 2023

Choose a reason for hiding this comment

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

This is only used for error codes, consistent with how other errors are returned (but in general don't have proper error responses/types defined). As an example, eth_call can return:

{
  "jsonrpc": "2.0",
  "id": 1,
  "error": {
    "code": -32000,
    "message": "missing trie node 3a3d6059576515928999d764cbf49a2358ba38af3f399b6363d33f85e07ec5ce (path ) <nil>"
  }
}

but eth_call's definition gives no indication about error response/format and it does return a negative decimal

- name: eth_call
summary: Executes a new message call immediately without creating a transaction on the block chain.
params:
- name: Transaction
required: true
schema:
$ref: '#/components/schemas/GenericTransaction'
- name: Block
required: false
schema:
$ref: '#/components/schemas/BlockNumberOrTagOrHash'
result:
name: Return data
schema:
$ref: '#/components/schemas/bytes'
- name: eth_estimateGas

Copy link
Contributor

@smartprogrammer93 smartprogrammer93 Jul 4, 2023

Choose a reason for hiding this comment

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

I understand, but since it is "base-type", shouldn't it follow the same format as other types around it. What if future API calls needed this type outside of the error codes scope? I think defining this should follow convention, and if you want to define another type for decimal int then you probably should.
Also in this case, type should be number and not string. because afaik string type means there is quotations around it. and in the code example shown, it does not have a quotation around it.
maybe it should be something like this:

Suggested change
int:
title: decimal signed integer
type: string
pattern: ^-?[0-9]+$
errorCode:
title: decimal signed integer
type: number

Copy link
Author

Choose a reason for hiding this comment

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

You are correct about it being incorrectly specified as string, that should be changed (and tested thoroughly, only arrays and and strings have ever been defined before).

We could rename to errorCode, although nothing else in that file is prescriptive about how that data type is being used, it's low-level types and it's up to the actual definition of the api to say:

    errorCode:
      title: Error Code
      $ref: '#/components/schemas/int'

Copy link
Contributor

@smartprogrammer93 smartprogrammer93 Jul 4, 2023

Choose a reason for hiding this comment

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

number have been defined before
you can see similar approach here:

title: rewardPercentile
description: Floating point value between 0 and 100.
type: number

Copy link
Contributor

@smartprogrammer93 smartprogrammer93 Jul 4, 2023

Choose a reason for hiding this comment

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

Keep in mind this is only a spec. What matters is the client implementations to be tested and make sure that they match the spec. the more descriptive the spec the better for all clients. One issue with number is it allows not only integers but also numbers with decimal point (float for example) so the description should make sure to outline this validation well to client implementers.

Copy link
Author

Choose a reason for hiding this comment

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

Number has been used before, as applied to a field, but not as a base-type (and i'm not sure it would be clear it is signed, and should not be float). Ideally, this would be defined as an array of possible, explicit values, as here, and just drop the entire notion of signed int, although this has only been done for newer endpoints, it seems:

Copy link
Contributor

Choose a reason for hiding this comment

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

Agree with the above approach. lets drop this int base type then and go with the above ^^^

Copy link
Contributor

@smartprogrammer93 smartprogrammer93 Jul 4, 2023

Choose a reason for hiding this comment

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

This is even better because it produces a specific list of numbers and defines what each error code means explicitly. much more prefered

Copy link
Contributor

Choose a reason for hiding this comment

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

Can we mark this as resolved now? I think we agree that there should not be an int type, and instead we should just use literals for specific errors?

MicahZoltu marked this conversation as resolved.
Show resolved Hide resolved
hash32:
title: 32 byte hex value
type: string
Expand Down
284 changes: 284 additions & 0 deletions src/schemas/execute.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,284 @@
BlockStateCalls:
title: Array of calls to be executed at specific, optional block/state.
properties:
blockOverrides:
title: Block override. When overriding block number across multiple blocks, block number not decrease or remain the same between block overrides, but skipping block numbers is acceptable.
$ref: '#/components/schemas/BlockOverrides'
stateOverrides:
title: State overrides
$ref: '#/components/schemas/StateOverrides'
calls:

Choose a reason for hiding this comment

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

I guess blockOverride and calls should be mandatory variables here and stateOverrides optional?

Copy link
Contributor

Choose a reason for hiding this comment

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

No I'd leave blockOverride also optional. For a multi-call single-block simulation users shouldn't need to override block fields.

Copy link
Contributor

Choose a reason for hiding this comment

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

I personally prefer empty arrays over missing/null arrays. I find it leads to improved developer ergonomics (no need for conditional branching on presence, you can just map/loop over the array). Functionally, I think both are fine though.

Choose a reason for hiding this comment

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

if blockoverride is empty, which block is used? latest I guess?

Copy link
Contributor

Choose a reason for hiding this comment

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

The third parameter is a "block tag" which serves to determine the fallback block fields (as well as base state). Something we have to consider is when there are multiple batches of calls (without block override fields):

  • They all inherit the "base block" fields. In this case if user provides 2 batches without fields, it will be equivalent to appending the second batch of calls to the first.
  • We magically update the fields of future batches

I'm in favor of 1. I think we should keep this method dumb rather than do something unexpected for users.

type: array
title: List of transactions to execute at this block/state
items:
$ref: '#/components/schemas/GenericCallTransaction'
StateOverrides:
title: Accounts in state to be overridden
type: array
items:
$ref: '#/components/schemas/AccountOverride'
AccountOverride:
title: Details of an account to be overridden
type: object
oneOf:
- $ref: '#/components/schemas/AccountOverrideState'
- $ref: '#/components/schemas/AccountOverrideStateDiff'
AccountOverrideState:
title: Account override with whole storage replacement
required:
- state
properties:
address:
title: Address
$ref: '#/components/schemas/address'
nonce:
title: Nonce
$ref: '#/components/schemas/uint64'
balance:
title: Balance
$ref: '#/components/schemas/uint256'
code:
title: Code
$ref: '#/components/schemas/bytes'
moveToAddress:

Choose a reason for hiding this comment

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

Suggested change
moveToAddress:
movePrecompileToAddress:

title: MoveToAddress
$ref: '#/components/schemas/address'
state:
title: Storage
$ref: '#/components/schemas/AccountStorage'
AccountOverrideStateDiff:
title: Account override with partial storage modification
required:
- stateDiff
properties:
address:
title: Address
$ref: '#/components/schemas/address'
nonce:
title: Nonce
$ref: '#/components/schemas/uint64'
balance:
title: Balance
$ref: '#/components/schemas/uint256'
code:
title: Code
$ref: '#/components/schemas/bytes'
moveToAddress:
title: MoveToAddress
$ref: '#/components/schemas/address'
stateDiff:
title: Storage difference
$ref: '#/components/schemas/AccountStorage'
AccountStorage:
title: Storage slots for an account
type: object
additionalProperties:
- $ref: '#/components/schemas/hash32'
BlockOverrides:
title: Context fields related to the block being executed
type: object
properties:
number:
title: Number
$ref: '#/components/schemas/uint256'
MicahZoltu marked this conversation as resolved.
Show resolved Hide resolved
prevRandao:
title: Randomness beacon
$ref: '#/components/schemas/uint256'
time:
title: Time
$ref: '#/components/schemas/uint256'
MicahZoltu marked this conversation as resolved.
Show resolved Hide resolved
gasLimit:
title: Gas limit
$ref: '#/components/schemas/uint64'
feeRecipient:
title: feeRecipient
$ref: '#/components/schemas/address'
baseFeePerGas:
title: Base fee per gas
$ref: '#/components/schemas/uint256'
MultiCallResult:
title: Full results of multi call
type: array
items:
$ref: '#/components/schemas/MultiCallBlockResult'
MultiCallBlockResult:
title: Result of multicall block-level, with array of calls
type: object
properties:
number:
title: Number
$ref: '#/components/schemas/uint256'
MicahZoltu marked this conversation as resolved.
Show resolved Hide resolved
hash:
Copy link
Contributor

Choose a reason for hiding this comment

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

If possible I'd like us to remove this field. I feel it'll be a random hash that doesn't have a use-case anyway and to produce it we have to merkleize the state as well as receipts and withdrawals.

Copy link
Contributor

Choose a reason for hiding this comment

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

I believe blocks still need a hash, because the BLOCKHASH(number) opcode has to return something. I think there is value in letting the caller know what value would have been returned by that opcode is useful.

title: block hash
$ref: '#/components/schemas/hash32'
timestamp:
title: Time
$ref: '#/components/schemas/uint256'
MicahZoltu marked this conversation as resolved.
Show resolved Hide resolved
gasLimit:
title: Gas limit
$ref: '#/components/schemas/uint64'
gasUsed:
title: Gas used
$ref: '#/components/schemas/uint64'
feeRecipient:
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick: I realize the engine API and CL folks call this feeRecipient but on the EL side we have eth_coinbase or eth_getBlockBy* returns a miner field. Now miner is outdated but I have a slight preference towards coinbase instead of introducing a 3rd name for it.

Copy link
Author

Choose a reason for hiding this comment

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

I agree with this, it seemed like feeRecipient was going to be the one that everyone ran with right after 1559, but it slowly made its way back to coinbase. Any disagreement @MicahZoltu ?

Copy link
Contributor

Choose a reason for hiding this comment

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

I pretty strongly favor accurate names rather than names that match internal implementation details that exist for legacy reasons. In this case, coinbase dates back to early Bitcoin days and I think it was when your client held your private keys (not sure on that last part). feeRecipient on the other hand is a term that most accurately reflects what the field means.

That being said, if eth_getBlockBy* returns the feeRecpient address in a field called coinbase, I can see the value in being consistent across calls. It just strikes me as incredibly unfortunate that we seem to be stuck using terrible names forever, making it harder for every new developer in Ethereum to figure out how things work.

title: feeRecipient
$ref: '#/components/schemas/address'
baseFeePerGas:
title: Base fee
$ref: '#/components/schemas/uint256'
calls:
$ref: '#/components/schemas/CallResults'
KillariDev marked this conversation as resolved.
Show resolved Hide resolved
CallResults:
title: Results of multi call within block
type: array
items:
anyOf:
- $ref: '#/components/schemas/CallResultFailure'
- $ref: '#/components/schemas/CallResultSuccess'
- $ref: '#/components/schemas/CallResultInvalid'
CallResultFailure:
title: Result of call failure
type: object
required:
- status
- returnData
- error
- gasUsed
properties:
status:
title: Call Status Failure
type: string
pattern: ^0x0$
returnData:
title: Return data
$ref: '#/components/schemas/bytes'
gasUsed:
title: Return gasUsed
$ref: '#/components/schemas/uint64'
error:
title: Error Object
type: object
properties:
code:
title: Error code
type: number
$ref: '#/components/schemas/int'
message:
title: Error Message (execution reverted, out of gas, etc)
type: string
data:
title: Reverted, with optional message
type: string
CallResultSuccess:
title: Result of call success
type: object
required:
- status
- returnData
- gasUsed
epheph marked this conversation as resolved.
Show resolved Hide resolved
- logs
properties:
status:
title: Call Status Success
type: string
pattern: ^0x1$
returnData:
title: Return data
$ref: '#/components/schemas/bytes'
gasUsed:
title: Return gasUsed
$ref: '#/components/schemas/uint64'
logs:
title: Return logs
type: array
items:
$ref: '#/components/schemas/CallResultLog'
CallResultInvalid:
title: Result of call not being valid (nonce, baseFee, etc)
type: object
required:
- status
- error
properties:
status:
title: Call Status Invalid
type: string
pattern: ^0x2$
error:
title: Error Object
type: object
properties:
message:
title: Reason the transaction could not be included on-chain (baseFee, nonce too high, etc)
type: string
code:

Choose a reason for hiding this comment

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

Do we have standardized error codes for these? We could try to utilize them as much as possible

Copy link
Author

Choose a reason for hiding this comment

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

There is no example elsewhere for error code standardizataion. We could add but i think it should be a separate initiative applied to all API's and not added to a single API

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think that just because everyone else pees in the pool it means we should also pee in the pool. I agree that having a standard set of error codes would be valuable to have clearly specified here. Is the issue that it isn't clear how exactly to format such a thing in OpenRPC?

type: number
$ref: '#/components/schemas/int'
CallResultLog:
title: log
type: object
required:
- logIndex
- address
KillariDev marked this conversation as resolved.
Show resolved Hide resolved
properties:
logIndex:
title: log index
$ref: '#/components/schemas/uint256'
blockHash:
title: block hash
$ref: '#/components/schemas/hash32'
blockNumber:

Choose a reason for hiding this comment

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

inconsistent with BlockOverrides.number where it is uint256 and here uint64, I would change BlockOverrides.number to be uint64.

Copy link
Contributor

Choose a reason for hiding this comment

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

Fixed (changed to uint64).

title: block number
$ref: '#/components/schemas/uint64'
address:
title: address
$ref: '#/components/schemas/address'
data:
title: data
$ref: '#/components/schemas/bytes'
topics:
title: topics
type: array
items:
$ref: '#/components/schemas/bytes32'
GenericCallTransaction:

Choose a reason for hiding this comment

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

why not to use #/components/schemas/GenericTransaction - it has same fields...

Choose a reason for hiding this comment

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

We could use the same, but its missing default values

type: object
title: Transaction object type for call
properties:
type:
title: type
$ref: '#/components/schemas/byte'
nonce:
title: nonce
$ref: '#/components/schemas/uint64'
to:
title: to address
$ref: '#/components/schemas/address'
from:
title: from address
$ref: '#/components/schemas/address'
gas:
title: gas limit
$ref: '#/components/schemas/uint64'
value:
title: value
$ref: '#/components/schemas/uint256'
input:
title: input data
$ref: '#/components/schemas/bytes'
gasPrice:
title: gas price
description: The gas price willing to be paid by the sender in wei
$ref: '#/components/schemas/uint256'
maxPriorityFeePerGas:
title: max priority fee per gas
description: Maximum fee per gas the sender is willing to pay to miners in wei
$ref: '#/components/schemas/uint256'
maxFeePerGas:
title: max fee per gas
description: The maximum total fee per gas the sender is willing to pay (includes the network / base fee and miner / priority fee) in wei
$ref: '#/components/schemas/uint256'
accessList:
title: accessList
description: EIP-2930 access list
$ref: '#/components/schemas/AccessList'
2 changes: 2 additions & 0 deletions tests/eth_multicall/multicall-account-add-state.io
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
>> {"jsonrpc":"2.0","id":1,"method":"eth_multicallV1","params":[[],"latest"]}
<< {"jsonrpc":"2.0","id":1,"result":[]}
2 changes: 2 additions & 0 deletions tests/eth_multicall/multicall-account-override-state.io
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
>> {"jsonrpc":"2.0","id":1,"method":"eth_multicallV1","params":[[{"stateOverrides":[{"nonce":"0x1", "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", "balance": "0xde0b6b3a7640000", "state": {"0x2292f0db49e1af24fbcac7f32b7537f334244455ad0ed0b46a78202982e7b70d": "0xde0b6b3a7640000", "0x877bd4632ef8c8ddc43b67e5a4511d939eadb612553c8a060670e05ebb1bb83c": "0xde0b6b3a7640000"}}],"calls":[{"from":"0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","to":"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2","data":"0x18160ddd"}]}],"latest"]}
<< {"jsonrpc":"2.0","id":1,"result":[{"status":"0x1","returnData":"0x0000000000000000000000000000000000000000000000000de0b6b3a7640000","gasUsed":"0x5338","logs":[]}]}
2 changes: 2 additions & 0 deletions tests/eth_multicall/multicall-block-override.io
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
>> {"jsonrpc": "2.0", "id": 1, "method": "eth_multicallV1", "params": [ [ { "calls": [ { "to": "0x4B62D7C9C4e5c7150Eda45F7552a25C7Cd726bF6", "data": "0x42cbb15c" } ] }, { "blockOverrides": { "number": "0x4999999" }, "calls": [ { "to": "0x4B62D7C9C4e5c7150Eda45F7552a25C7Cd726bF6", "data": "0x42cbb15c" } ] } ], "latest" ] }
<< {"jsonrpc":"2.0","id":1,"result":[{"status":"0x1","returnData":"0x0000000000000000000000000000000000000000000000000000000001031b64","gasUsed":"0x5338","logs":[]},{"status":"0x1","returnData":"0x0000000000000000000000000000000000000000000000000000000004999999","gasUsed":"0x5338","logs":[]}]}
2 changes: 2 additions & 0 deletions tests/eth_multicall/multicall-empty.io
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
>> {"jsonrpc":"2.0","id":1,"method":"eth_multicallV1","params":[[],"latest", false]}
<< {"jsonrpc":"2.0","id":1,"result":[]}
2 changes: 2 additions & 0 deletions tests/eth_multicall/multicall-simple-error.io
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
>> {"jsonrpc":"2.0","id":1,"method":"eth_multicallV1","params":[[{"calls":[{"from":"0xde67356daf70aba7582d9b313d29de02681dfbd8","to":"0x5cd267914528e83422cafa6718153eafc67a9e6c","data":"0xef41d20800000000000000000000000000000000000000000000000000000000000000017691e8f7c821ff647ecb48aab3c593b316d7c705fa9ccc61778ceab57acd1bb200000000000000000000000000000000000000000000000000000002540be40000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000"}]}],"latest"]}
<< {"jsonrpc":"2.0","id":1,"result":[{"status":"0x0","returnData":"0x0000000000000000000000000000000000000000000000000000000000000012","gasUsed":"0x5338","error":{"code":-32015,"message":"VM execution error.","data":"Reverted 0x5472616e7366657248656c7065723a3a7472616e7366657246726f6d3a207472616e7366657246726f6d206661696c6564"}}]}
2 changes: 2 additions & 0 deletions tests/eth_multicall/multicall-simple.io
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
>> {"jsonrpc":"2.0","id":1,"method":"eth_multicallV1","params":[[{"calls":[{"to":"0x6b175474e89094c44da98b954eedeac495271d0f","data":"0x313ce567"}]}],"latest"]}
<< {"jsonrpc":"2.0","id":1,"result":[ { "number": "0x1", "hash": "0x2222222222222222222222222222222222222222222222222222222222222222", "timestamp": "0x929292", "gasLimit": "0x2000", "gasUsed": "0x1000", "feeRecipient": "0x1111111111111111111111111111111111111111", "baseFeePerGas": "0x827129", "calls": [ { "status": "0x1", "returnData": "0x0000000000000000000000000000000000000000000000000000000000000012", "gasUsed": "0x5338", "logs": [] } ] } ]}
1 change: 1 addition & 0 deletions wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,4 @@ randao
src
https
forkchoiceupdatedresponsev
feeRecipient