From cb233228a2502328f85dc167455fce440df23226 Mon Sep 17 00:00:00 2001 From: Sina Mahmoodi Date: Mon, 26 Sep 2022 10:48:34 -0500 Subject: [PATCH 1/9] Add eth_batchCall schema --- src/eth/execute.yaml | 11 ++++++ src/schemas/execute.yaml | 84 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 95 insertions(+) create mode 100644 src/schemas/execute.yaml diff --git a/src/eth/execute.yaml b/src/eth/execute.yaml index c5e52707..ab5235fb 100644 --- a/src/eth/execute.yaml +++ b/src/eth/execute.yaml @@ -54,3 +54,14 @@ gasUsed: title: Gas used $ref: '#/components/schemas/uint' +- name: eth_batchCall + summary: Executes a sequence of message calls building on eachother's state immediately without creating transactions on the block chain. + params: + - name: Arguments + required: true + schema: + $ref: '#/components/schemas/BatchCallArgs' + result: + name: Result of calls + schema: + $ref: '#/components/schemas/CallResults' diff --git a/src/schemas/execute.yaml b/src/schemas/execute.yaml new file mode 100644 index 00000000..7aae7be3 --- /dev/null +++ b/src/schemas/execute.yaml @@ -0,0 +1,84 @@ +BatchCallArgs: + title: Arguments for batch call + type: object + required: + - block + - calls + properties: + block: + title: Block tag + $ref: '#/components/schemas/BlockNumberOrTag' + stateOverrides: + title: State overrides + $ref: '#/components/schemas/StateOverrides' + calls: + title: List of calls + $ref: '#/components/schemas/Calls' +Calls: + title: List of message calls + type: array + items: + $ref: '#/components/schemas/GenericTransaction' +StateOverrides: + title: Accounts in state to be overridden + type: object + additionalProperties: + $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 + properties: + nonce: + title: Nonce + $ref: '#/components/schemas/uint64' + balance: + title: Balance + $ref: '#/components/schemas/uint256' + code: + title: Code + $ref: '#/components/schemas/bytes' + state: + title: Storage + $ref: '#/components/schemas/AccountStorage' +AccountOverrideStateDiff: + title: Account override with partial storage modification + properties: + nonce: + title: Nonce + $ref: '#/components/schemas/uint64' + balance: + title: Balance + $ref: '#/components/schemas/uint256' + code: + title: Code + $ref: '#/components/schemas/bytes' + stateDiff: + title: Storage difference + $ref: '#/components/schemas/AccountStorage' +AccountStorage: + title: Storage slots for an account + type: object + additionalProperties: + - $ref: '#/components/schemas/bytes256' +CallResults: + title: Results of batch call + type: array + items: + $ref: '#/components/schemas/CallResult' +CallResult: + title: Result of a call + type: object + required: + - return + properties: + return: + title: Return data + $ref: '#/components/schemas/bytes' + error: + title: Execution error + type: string From d7bb95fd5f08a1d3b72d27f9faf275a1f1abdfee Mon Sep 17 00:00:00 2001 From: Sina Mahmoodi Date: Mon, 26 Sep 2022 13:15:46 -0500 Subject: [PATCH 2/9] add block override --- src/schemas/execute.yaml | 41 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/src/schemas/execute.yaml b/src/schemas/execute.yaml index 7aae7be3..eda83cd5 100644 --- a/src/schemas/execute.yaml +++ b/src/schemas/execute.yaml @@ -18,7 +18,19 @@ Calls: title: List of message calls type: array items: - $ref: '#/components/schemas/GenericTransaction' + $ref: '#/components/schemas/Call' +Call: + title: Call + block overrides + type: object + required: + - transactionArgs + properties: + transactionArgs: + title: Call args + $ref: '#/components/schemas/GenericTransaction' + blockOverrides: + title: Overrides for block metadata + $ref: '#/components/schemas/BlockOverrides' StateOverrides: title: Accounts in state to be overridden type: object @@ -64,7 +76,32 @@ AccountStorage: title: Storage slots for an account type: object additionalProperties: - - $ref: '#/components/schemas/bytes256' + - $ref: '#/components/schemas/hash32' +BlockOverrides: + title: Context fields related to the block being executed + type: object + properties: + number: + title: Number + $ref: '#/components/schemas/uint256' + difficulty: + title: Difficulty + $ref: '#/components/schemas/uint256' + time: + title: Time + $ref: '#/components/schemas/uint256' + gasLimit: + title: Gas limit + $ref: '#/components/schemas/uint64' + coinbase: + title: Coinbase + $ref: '#/components/schemas/address' + random: + title: Random + $ref: '#/components/schemas/hash32' + baseFee: + title: Base fee + $ref: '#/components/schemas/uint256' CallResults: title: Results of batch call type: array From f8c2444e593b39e3acac50e9109d1e6e553550e5 Mon Sep 17 00:00:00 2001 From: Sina Mahmoodi Date: Mon, 26 Sep 2022 13:17:20 -0500 Subject: [PATCH 3/9] fix spelling --- src/schemas/execute.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/schemas/execute.yaml b/src/schemas/execute.yaml index eda83cd5..11d5f9c6 100644 --- a/src/schemas/execute.yaml +++ b/src/schemas/execute.yaml @@ -26,7 +26,7 @@ Call: - transactionArgs properties: transactionArgs: - title: Call args + title: Call arguments $ref: '#/components/schemas/GenericTransaction' blockOverrides: title: Overrides for block metadata From 9bf49706246eb51bf6fedac976b2394fcbb5d4d2 Mon Sep 17 00:00:00 2001 From: Sina Mahmoodi Date: Thu, 27 Oct 2022 15:57:13 +0330 Subject: [PATCH 4/9] rename to multicall --- src/eth/execute.yaml | 4 ++-- src/schemas/execute.yaml | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/eth/execute.yaml b/src/eth/execute.yaml index ab5235fb..e7ceeb08 100644 --- a/src/eth/execute.yaml +++ b/src/eth/execute.yaml @@ -54,13 +54,13 @@ gasUsed: title: Gas used $ref: '#/components/schemas/uint' -- name: eth_batchCall +- name: eth_multicall summary: Executes a sequence of message calls building on eachother's state immediately without creating transactions on the block chain. params: - name: Arguments required: true schema: - $ref: '#/components/schemas/BatchCallArgs' + $ref: '#/components/schemas/MulticallArgs' result: name: Result of calls schema: diff --git a/src/schemas/execute.yaml b/src/schemas/execute.yaml index 11d5f9c6..161820dd 100644 --- a/src/schemas/execute.yaml +++ b/src/schemas/execute.yaml @@ -1,5 +1,5 @@ -BatchCallArgs: - title: Arguments for batch call +MulticallArgs: + title: Arguments for multi call type: object required: - block @@ -103,7 +103,7 @@ BlockOverrides: title: Base fee $ref: '#/components/schemas/uint256' CallResults: - title: Results of batch call + title: Results of multi call type: array items: $ref: '#/components/schemas/CallResult' From 7aba9c386a031e5557bfb000896628f4eeeae3e8 Mon Sep 17 00:00:00 2001 From: Sina Mahmoodi Date: Thu, 27 Oct 2022 16:02:43 +0330 Subject: [PATCH 5/9] allow one block overrides per multicall --- src/schemas/execute.yaml | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/src/schemas/execute.yaml b/src/schemas/execute.yaml index 161820dd..c90ce47e 100644 --- a/src/schemas/execute.yaml +++ b/src/schemas/execute.yaml @@ -11,6 +11,9 @@ MulticallArgs: stateOverrides: title: State overrides $ref: '#/components/schemas/StateOverrides' + blockOverrides: + title: Overrides for block metadata + $ref: '#/components/schemas/BlockOverrides' calls: title: List of calls $ref: '#/components/schemas/Calls' @@ -18,19 +21,7 @@ Calls: title: List of message calls type: array items: - $ref: '#/components/schemas/Call' -Call: - title: Call + block overrides - type: object - required: - - transactionArgs - properties: - transactionArgs: - title: Call arguments - $ref: '#/components/schemas/GenericTransaction' - blockOverrides: - title: Overrides for block metadata - $ref: '#/components/schemas/BlockOverrides' + $ref: '#/components/schemas/GenericTransaction' StateOverrides: title: Accounts in state to be overridden type: object From 9861fd866afaa4b574f8233a562f9605bf21c776 Mon Sep 17 00:00:00 2001 From: Sina Mahmoodi Date: Thu, 27 Oct 2022 16:33:13 +0330 Subject: [PATCH 6/9] fix err desc --- src/schemas/execute.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/schemas/execute.yaml b/src/schemas/execute.yaml index c90ce47e..8d236f4f 100644 --- a/src/schemas/execute.yaml +++ b/src/schemas/execute.yaml @@ -108,5 +108,5 @@ CallResult: title: Return data $ref: '#/components/schemas/bytes' error: - title: Execution error + title: Errors arising during processing of request type: string From 12e530f257c8ae63ac5454680f36fc6a277525ec Mon Sep 17 00:00:00 2001 From: Sina Mahmoodi Date: Thu, 27 Oct 2022 16:35:02 +0330 Subject: [PATCH 7/9] Revert "fix err desc" This reverts commit 9861fd866afaa4b574f8233a562f9605bf21c776. --- src/schemas/execute.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/schemas/execute.yaml b/src/schemas/execute.yaml index 8d236f4f..c90ce47e 100644 --- a/src/schemas/execute.yaml +++ b/src/schemas/execute.yaml @@ -108,5 +108,5 @@ CallResult: title: Return data $ref: '#/components/schemas/bytes' error: - title: Errors arising during processing of request + title: Execution error type: string From 57697c3ce256044d79c18ce2b9c96942c82fcbe7 Mon Sep 17 00:00:00 2001 From: Sina Mahmoodi Date: Fri, 28 Oct 2022 13:52:03 +0330 Subject: [PATCH 8/9] rename difficulty to prevrandao --- src/schemas/execute.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/schemas/execute.yaml b/src/schemas/execute.yaml index c90ce47e..25871407 100644 --- a/src/schemas/execute.yaml +++ b/src/schemas/execute.yaml @@ -75,8 +75,8 @@ BlockOverrides: number: title: Number $ref: '#/components/schemas/uint256' - difficulty: - title: Difficulty + prevRandao: + title: Randomness beacon $ref: '#/components/schemas/uint256' time: title: Time From 4e680a66f81f4c35738684b24f9cf5f6e749bb13 Mon Sep 17 00:00:00 2001 From: Sina Mahmoodi Date: Fri, 28 Oct 2022 16:43:36 +0330 Subject: [PATCH 9/9] add prevRandao to wordlist --- wordlist.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/wordlist.txt b/wordlist.txt index b941e83a..69d0611f 100644 --- a/wordlist.txt +++ b/wordlist.txt @@ -42,3 +42,4 @@ ipc cli besu graphql +prevRandao