From 4ea9a1da8352200acf042b3332fea678b50921e2 Mon Sep 17 00:00:00 2001 From: Danno Ferrin Date: Fri, 25 Jul 2025 16:34:26 -0600 Subject: [PATCH 1/6] Add eth_config API definitions for EIP-7910 Implements the eth_config JSON-RPC method as specified in EIP-7910 to provide comprehensive fork configuration details including current, next, and last fork configurations with their respective hashes and fork IDs. Changes: - Add eth_config method definition in src/eth/client.yaml - Add ConfigurationResponse, ConfigObject, and BlobSchedule schemas - Add bytes4 base type for CRC-32 hashes and fork IDs - Add test cases for different scenarios --- src/eth/client.yaml | 49 ++++++++ src/schemas/base-types.yaml | 4 + src/schemas/client.yaml | 109 ++++++++++++++++++ tests/eth_config/get-config-with-next-fork.io | 3 + tests/eth_config/get-current-config.io | 3 + 5 files changed, 168 insertions(+) create mode 100644 tests/eth_config/get-config-with-next-fork.io create mode 100644 tests/eth_config/get-current-config.io diff --git a/src/eth/client.yaml b/src/eth/client.yaml index 416df4c0a..113e65b85 100644 --- a/src/eth/client.yaml +++ b/src/eth/client.yaml @@ -70,3 +70,52 @@ result: name: Block number value: '0x2377' +- name: eth_config + summary: Returns the client's current configuration including fork information. + externalDocs: + description: EIP-7910 specification + url: https://eips.ethereum.org/EIPS/eip-7910 + params: [] + result: + name: Configuration + schema: + $ref: '#/components/schemas/ConfigurationResponse' + examples: + - name: eth_config example + params: [] + result: + name: Configuration + value: + current: + activationTime: 1746612311 + blobSchedule: + baseFeeUpdateFraction: 5007716 + max: 9 + target: 6 + chainId: '0x1' + precompiles: + - '0x0000000000000000000000000000000000000001': 'ECREC' + - '0x0000000000000000000000000000000000000002': 'SHA256' + - '0x0000000000000000000000000000000000000003': 'RIPEMD160' + - '0x0000000000000000000000000000000000000004': 'ID' + - '0x0000000000000000000000000000000000000005': 'MODEXP' + - '0x0000000000000000000000000000000000000006': 'BN254_ADD' + - '0x0000000000000000000000000000000000000007': 'BN254_MUL' + - '0x0000000000000000000000000000000000000008': 'BN254_PAIRING' + - '0x0000000000000000000000000000000000000009': 'BLAKE2F' + - '0x000000000000000000000000000000000000000a': 'KZG_POINT_EVALUATION' + - '0x000000000000000000000000000000000000000b': 'BLS12_G1ADD' + - '0x000000000000000000000000000000000000000c': 'BLS12_G1MSM' + - '0x000000000000000000000000000000000000000d': 'BLS12_G2ADD' + - '0x000000000000000000000000000000000000000e': 'BLS12_G2MSM' + - '0x000000000000000000000000000000000000000f': 'BLS12_PAIRING_CHECK' + - '0x0000000000000000000000000000000000000010': 'BLS12_MAP_FP_TO_G1' + - '0x0000000000000000000000000000000000000011': 'BLS12_MAP_FP2_TO_G2' + systemContracts: + - 'BEACON_ROOTS_ADDRESS': '0x000f3df6d732807ef1319fb7b8bb8522d0beac02' + - 'CONSOLIDATION_REQUEST_PREDEPLOY_ADDRESS': '0x0000bbddc7ce488642fb579f8b00f3a590007251' + - 'DEPOSIT_CONTRACT_ADDRESS': '0x00000000219ab540356cbb839cbe05303d7705fa' + - 'HISTORY_STORAGE_ADDRESS': '0x0000f90827f1c53a10cb7a02335b175320002935' + - 'WITHDRAWAL_REQUEST_PREDEPLOY_ADDRESS': '0x00000961ef480eb55e80d19ad83579a64c007002' + currentHash: '0xc376cf8b' + currentForkId: '0x3ff0e375' \ No newline at end of file diff --git a/src/schemas/base-types.yaml b/src/schemas/base-types.yaml index 500d6c358..f4811942c 100644 --- a/src/schemas/base-types.yaml +++ b/src/schemas/base-types.yaml @@ -19,6 +19,10 @@ bytesMax32: title: 32 hex encoded bytes type: string pattern: ^0x[0-9a-f]{0,64}$ +bytes4: + title: 4 hex encoded bytes + type: string + pattern: ^0x[0-9a-f]{8}$ bytes8: title: 8 hex encoded bytes type: string diff --git a/src/schemas/client.yaml b/src/schemas/client.yaml index e1163d03d..431e11585 100644 --- a/src/schemas/client.yaml +++ b/src/schemas/client.yaml @@ -17,3 +17,112 @@ SyncingStatus: - title: Not syncing description: Should always return false if not syncing. type: boolean +ConfigurationResponse: + title: Configuration response + description: Response object for eth_config method containing current, next, and last fork configurations + type: object + additionalProperties: false + properties: + current: + title: Current configuration + $ref: '#/components/schemas/ConfigObject' + currentHash: + title: Current configuration hash + description: CRC-32 hash of the canonical JSON of the current configuration + $ref: '#/components/schemas/bytes4' + currentForkId: + title: Current fork ID + description: Fork identifier for the current configuration + $ref: '#/components/schemas/bytes4' + next: + title: Next configuration + description: Configuration for the next scheduled fork, absent if no future forks scheduled + $ref: '#/components/schemas/ConfigObject' + nextHash: + title: Next configuration hash + description: CRC-32 hash of the the canonical JSON of the next configuration, absent if no future forks scheduled + $ref: '#/components/schemas/bytes4' + nextForkId: + title: Next fork ID + description: Fork identifier for the next configuration, absent if no future forks scheduled + $ref: '#/components/schemas/bytes4' + last: + title: Last configuration + description: Configuration for the last configured fork, absent if no future forks scheduled + $ref: '#/components/schemas/ConfigObject' + lastHash: + title: Last configuration hash + description: CRC-32 hash of the the canonical JSON of the last configured fork, absent if no future forks scheduled + $ref: '#/components/schemas/bytes4' + lastForkId: + title: Last fork ID + description: Fork identifier for the last configured fork, absent if no future forks scheduled + $ref: '#/components/schemas/bytes4' + required: + - current + - currentHash + - currentForkId +ConfigObject: + title: Configuration object + description: Represents a specific fork configuration + type: object + additionalProperties: false + properties: + activationTime: + title: Activation time + description: Unix timestamp when this configuration becomes active + type: number + blobSchedule: + title: Blob schedule + description: Configuration for blob fee schedule + $ref: '#/components/schemas/BlobSchedule' + chainId: + title: Chain ID + description: The chain ID for this configuration + $ref: '#/components/schemas/uint' + precompiles: + title: Precompiles + description: Mapping of precompile addresses to their names + type: object + additionalProperties: + type: string + patternProperties: + '^0x[0-9a-fA-F]{40}$': + type: string + systemContracts: + title: System contracts + description: Mapping of system contract names to their addresses + type: object + additionalProperties: + $ref: '#/components/schemas/address' + required: + - activationTime + - blobSchedule + - chainId + - precompiles + - systemContracts +BlobSchedule: + title: Blob schedule + description: Configuration parameters for blob fee scheduling + type: object + additionalProperties: false + properties: + baseFeeUpdateFraction: + title: Base fee update fraction + description: Fraction used for updating blob base fees + type: integer + minimum: 0 + max: + title: Maximum blobs + description: Maximum number of blobs per block + type: integer + minimum: 0 + target: + title: Target blobs + description: Target number of blobs per block + type: integer + minimum: 0 + required: + - baseFeeUpdateFraction + - max + - target diff --git a/tests/eth_config/get-config-with-next-fork.io b/tests/eth_config/get-config-with-next-fork.io new file mode 100644 index 000000000..91945de9b --- /dev/null +++ b/tests/eth_config/get-config-with-next-fork.io @@ -0,0 +1,3 @@ +// retrieves configuration when a fork is scheduled (EIP-7910 example with expanded next config) +>> {"jsonrpc":"2.0","id":1,"method":"eth_config"} +<< {"jsonrpc":"2.0","id":1,"result":{"current":{"activationTime":0,"blobSchedule":{"baseFeeUpdateFraction":3338477,"max":6,"target":3},"chainId":"0x88bb0","precompiles":{"0x0000000000000000000000000000000000000001":"ECREC","0x0000000000000000000000000000000000000002":"SHA256","0x0000000000000000000000000000000000000003":"RIPEMD160","0x0000000000000000000000000000000000000004":"ID","0x0000000000000000000000000000000000000005":"MODEXP","0x0000000000000000000000000000000000000006":"BN254_ADD","0x0000000000000000000000000000000000000007":"BN254_MUL","0x0000000000000000000000000000000000000008":"BN254_PAIRING","0x0000000000000000000000000000000000000009":"BLAKE2F","0x000000000000000000000000000000000000000a":"KZG_POINT_EVALUATION"},"systemContracts":{"BEACON_ROOTS_ADDRESS":"0x000f3df6d732807ef1319fb7b8bb8522d0beac02"}},"currentHash":"0x2eedf329","currentForkId":"0xbef71d30","next":{"activationTime":1742999832,"blobSchedule":{"baseFeeUpdateFraction":5007716,"max":9,"target":6},"chainId":"0x88bb0","precompiles":{"0x0000000000000000000000000000000000000001":"ECREC","0x0000000000000000000000000000000000000002":"SHA256","0x0000000000000000000000000000000000000003":"RIPEMD160","0x0000000000000000000000000000000000000004":"ID","0x0000000000000000000000000000000000000005":"MODEXP","0x0000000000000000000000000000000000000006":"BN254_ADD","0x0000000000000000000000000000000000000007":"BN254_MUL","0x0000000000000000000000000000000000000008":"BN254_PAIRING","0x0000000000000000000000000000000000000009":"BLAKE2F","0x000000000000000000000000000000000000000a":"KZG_POINT_EVALUATION","0x000000000000000000000000000000000000000b":"BLS12_G1ADD","0x000000000000000000000000000000000000000c":"BLS12_G1MSM","0x000000000000000000000000000000000000000d":"BLS12_G2ADD","0x000000000000000000000000000000000000000e":"BLS12_G2MSM","0x000000000000000000000000000000000000000f":"BLS12_PAIRING_CHECK","0x0000000000000000000000000000000000000010":"BLS12_MAP_FP_TO_G1","0x0000000000000000000000000000000000000011":"BLS12_MAP_FP2_TO_G2"},"systemContracts":{"BEACON_ROOTS_ADDRESS":"0x000f3df6d732807ef1319fb7b8bb8522d0beac02","CONSOLIDATION_REQUEST_PREDEPLOY_ADDRESS":"0x0000bbddc7ce488642fb579f8b00f3a590007251","DEPOSIT_CONTRACT_ADDRESS":"0x00000000219ab540356cbb839cbe05303d7705fa","HISTORY_STORAGE_ADDRESS":"0x0000f90827f1c53a10cb7a02335b175320002935","WITHDRAWAL_REQUEST_PREDEPLOY_ADDRESS":"0x00000961ef480eb55e80d19ad83579a64c007002"}},"nextHash":"0x0d82a81f","nextForkId":"0x0929e24e","last":{"activationTime":1742999832,"blobSchedule":{"baseFeeUpdateFraction":5007716,"max":9,"target":6},"chainId":"0x88bb0","precompiles":{"0x0000000000000000000000000000000000000001":"ECREC","0x0000000000000000000000000000000000000002":"SHA256","0x0000000000000000000000000000000000000003":"RIPEMD160","0x0000000000000000000000000000000000000004":"ID","0x0000000000000000000000000000000000000005":"MODEXP","0x0000000000000000000000000000000000000006":"BN254_ADD","0x0000000000000000000000000000000000000007":"BN254_MUL","0x0000000000000000000000000000000000000008":"BN254_PAIRING","0x0000000000000000000000000000000000000009":"BLAKE2F","0x000000000000000000000000000000000000000a":"KZG_POINT_EVALUATION","0x000000000000000000000000000000000000000b":"BLS12_G1ADD","0x000000000000000000000000000000000000000c":"BLS12_G1MSM","0x000000000000000000000000000000000000000d":"BLS12_G2ADD","0x000000000000000000000000000000000000000e":"BLS12_G2MSM","0x000000000000000000000000000000000000000f":"BLS12_PAIRING_CHECK","0x0000000000000000000000000000000000000010":"BLS12_MAP_FP_TO_G1","0x0000000000000000000000000000000000000011":"BLS12_MAP_FP2_TO_G2"},"systemContracts":{"BEACON_ROOTS_ADDRESS":"0x000f3df6d732807ef1319fb7b8bb8522d0beac02","CONSOLIDATION_REQUEST_PREDEPLOY_ADDRESS":"0x0000bbddc7ce488642fb579f8b00f3a590007251","DEPOSIT_CONTRACT_ADDRESS":"0x00000000219ab540356cbb839cbe05303d7705fa","HISTORY_STORAGE_ADDRESS":"0x0000f90827f1c53a10cb7a02335b175320002935","WITHDRAWAL_REQUEST_PREDEPLOY_ADDRESS":"0x00000961ef480eb55e80d19ad83579a64c007002"}},"lastHash":"0x0d82a81f","lastForkId":"0x0929e24e"}} \ No newline at end of file diff --git a/tests/eth_config/get-current-config.io b/tests/eth_config/get-current-config.io new file mode 100644 index 000000000..c4ea6e3da --- /dev/null +++ b/tests/eth_config/get-current-config.io @@ -0,0 +1,3 @@ +// retrieves the client's current fork configuration +>> {"jsonrpc":"2.0","id":1,"method":"eth_config"} +<< {"jsonrpc":"2.0","id":1,"result":{"current":{"activationTime":1746612311,"blobSchedule":{"baseFeeUpdateFraction":5007716,"max":9,"target":6},"chainId":"0x1","precompiles":{"0x0000000000000000000000000000000000000001":"ECREC","0x0000000000000000000000000000000000000002":"SHA256","0x0000000000000000000000000000000000000003":"RIPEMD160","0x0000000000000000000000000000000000000004":"ID","0x0000000000000000000000000000000000000005":"MODEXP","0x0000000000000000000000000000000000000006":"BN254_ADD","0x0000000000000000000000000000000000000007":"BN254_MUL","0x0000000000000000000000000000000000000008":"BN254_PAIRING","0x0000000000000000000000000000000000000009":"BLAKE2F","0x000000000000000000000000000000000000000a":"KZG_POINT_EVALUATION","0x000000000000000000000000000000000000000b":"BLS12_G1ADD","0x000000000000000000000000000000000000000c":"BLS12_G1MSM","0x000000000000000000000000000000000000000d":"BLS12_G2ADD","0x000000000000000000000000000000000000000e":"BLS12_G2MSM","0x000000000000000000000000000000000000000f":"BLS12_PAIRING_CHECK","0x0000000000000000000000000000000000000010":"BLS12_MAP_FP_TO_G1","0x0000000000000000000000000000000000000011":"BLS12_MAP_FP2_TO_G2"},"systemContracts":{"BEACON_ROOTS_ADDRESS":"0x000f3df6d732807ef1319fb7b8bb8522d0beac02","CONSOLIDATION_REQUEST_PREDEPLOY_ADDRESS":"0x0000bbddc7ce488642fb579f8b00f3a590007251","DEPOSIT_CONTRACT_ADDRESS":"0x00000000219ab540356cbb839cbe05303d7705fa","HISTORY_STORAGE_ADDRESS":"0x0000f90827f1c53a10cb7a02335b175320002935","WITHDRAWAL_REQUEST_PREDEPLOY_ADDRESS":"0x00000961ef480eb55e80d19ad83579a64c007002"}},"currentForkId":"0xc376cf8b","currentHash":"0x3ff0e375"}} \ No newline at end of file From d614eba821157c70fe667ab6a04ae3a67dbc9287 Mon Sep 17 00:00:00 2001 From: Danno Ferrin Date: Fri, 25 Jul 2025 20:43:49 -0600 Subject: [PATCH 2/6] Fix speling Signed-off-by: Danno Ferrin --- wordlist.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/wordlist.txt b/wordlist.txt index cf5f76c62..a1469ef3f 100644 --- a/wordlist.txt +++ b/wordlist.txt @@ -80,3 +80,9 @@ txs UX simulateV EOA's +BLS +BN +FP +MSM +MUL +CRC From 8becb49aefcf1e28258d8bf8fddaad5bb41d554e Mon Sep 17 00:00:00 2001 From: Danno Ferrin Date: Sun, 27 Jul 2025 20:41:41 -0600 Subject: [PATCH 3/6] Update src/schemas/client.yaml Co-authored-by: Mercy Boma Naps Nkari <96525594+bomanaps@users.noreply.github.com> --- src/schemas/client.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/schemas/client.yaml b/src/schemas/client.yaml index 431e11585..92c08e3a7 100644 --- a/src/schemas/client.yaml +++ b/src/schemas/client.yaml @@ -40,7 +40,7 @@ ConfigurationResponse: $ref: '#/components/schemas/ConfigObject' nextHash: title: Next configuration hash - description: CRC-32 hash of the the canonical JSON of the next configuration, absent if no future forks scheduled + description: CRC-32 hash of the canonical JSON of the next configuration, absent if no future forks scheduled $ref: '#/components/schemas/bytes4' nextForkId: title: Next fork ID From ac52114267b7ae76f5d1f38a65f57b602b22acb2 Mon Sep 17 00:00:00 2001 From: Danno Ferrin Date: Sun, 27 Jul 2025 20:41:48 -0600 Subject: [PATCH 4/6] Update src/schemas/client.yaml Co-authored-by: Mercy Boma Naps Nkari <96525594+bomanaps@users.noreply.github.com> --- src/schemas/client.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/schemas/client.yaml b/src/schemas/client.yaml index 92c08e3a7..7d3afcf87 100644 --- a/src/schemas/client.yaml +++ b/src/schemas/client.yaml @@ -52,7 +52,7 @@ ConfigurationResponse: $ref: '#/components/schemas/ConfigObject' lastHash: title: Last configuration hash - description: CRC-32 hash of the the canonical JSON of the last configured fork, absent if no future forks scheduled + description: CRC-32 hash of the canonical JSON of the last configured fork, absent if no future forks scheduled $ref: '#/components/schemas/bytes4' lastForkId: title: Last fork ID From 15cfa6608f343f7dbd6dbacdeac607de1de0c3ac Mon Sep 17 00:00:00 2001 From: Danno Ferrin Date: Mon, 28 Jul 2025 10:11:19 -0600 Subject: [PATCH 5/6] Update eth_config to match final EIP-7910 specification - Remove configHash fields from ConfigurationResponse - Move forkId fields into ConfigObject - Invert precompiles map: name->address mapping with alphabetical sorting - Update test cases to match EIP specification format Signed-off-by: Danno Ferrin --- src/eth/client.yaml | 47 +++++++++---------- src/schemas/client.yaml | 38 +++------------ tests/eth_config/get-config-with-next-fork.io | 2 +- tests/eth_config/get-current-config.io | 2 +- 4 files changed, 32 insertions(+), 57 deletions(-) diff --git a/src/eth/client.yaml b/src/eth/client.yaml index 113e65b85..2a8ef19fa 100644 --- a/src/eth/client.yaml +++ b/src/eth/client.yaml @@ -93,29 +93,28 @@ max: 9 target: 6 chainId: '0x1' + forkId: '0x3ff0e375' precompiles: - - '0x0000000000000000000000000000000000000001': 'ECREC' - - '0x0000000000000000000000000000000000000002': 'SHA256' - - '0x0000000000000000000000000000000000000003': 'RIPEMD160' - - '0x0000000000000000000000000000000000000004': 'ID' - - '0x0000000000000000000000000000000000000005': 'MODEXP' - - '0x0000000000000000000000000000000000000006': 'BN254_ADD' - - '0x0000000000000000000000000000000000000007': 'BN254_MUL' - - '0x0000000000000000000000000000000000000008': 'BN254_PAIRING' - - '0x0000000000000000000000000000000000000009': 'BLAKE2F' - - '0x000000000000000000000000000000000000000a': 'KZG_POINT_EVALUATION' - - '0x000000000000000000000000000000000000000b': 'BLS12_G1ADD' - - '0x000000000000000000000000000000000000000c': 'BLS12_G1MSM' - - '0x000000000000000000000000000000000000000d': 'BLS12_G2ADD' - - '0x000000000000000000000000000000000000000e': 'BLS12_G2MSM' - - '0x000000000000000000000000000000000000000f': 'BLS12_PAIRING_CHECK' - - '0x0000000000000000000000000000000000000010': 'BLS12_MAP_FP_TO_G1' - - '0x0000000000000000000000000000000000000011': 'BLS12_MAP_FP2_TO_G2' + BLS12_G1ADD: '0x000000000000000000000000000000000000000b' + BLS12_G1MSM: '0x000000000000000000000000000000000000000c' + BLS12_G2ADD: '0x000000000000000000000000000000000000000d' + BLS12_G2MSM: '0x000000000000000000000000000000000000000e' + BLS12_MAP_FP2_TO_G2: '0x0000000000000000000000000000000000000011' + BLS12_MAP_FP_TO_G1: '0x0000000000000000000000000000000000000010' + BLS12_PAIRING_CHECK: '0x000000000000000000000000000000000000000f' + BLAKE2F: '0x0000000000000000000000000000000000000009' + BN254_ADD: '0x0000000000000000000000000000000000000006' + BN254_MUL: '0x0000000000000000000000000000000000000007' + BN254_PAIRING: '0x0000000000000000000000000000000000000008' + ECREC: '0x0000000000000000000000000000000000000001' + ID: '0x0000000000000000000000000000000000000004' + KZG_POINT_EVALUATION: '0x000000000000000000000000000000000000000a' + MODEXP: '0x0000000000000000000000000000000000000005' + RIPEMD160: '0x0000000000000000000000000000000000000003' + SHA256: '0x0000000000000000000000000000000000000002' systemContracts: - - 'BEACON_ROOTS_ADDRESS': '0x000f3df6d732807ef1319fb7b8bb8522d0beac02' - - 'CONSOLIDATION_REQUEST_PREDEPLOY_ADDRESS': '0x0000bbddc7ce488642fb579f8b00f3a590007251' - - 'DEPOSIT_CONTRACT_ADDRESS': '0x00000000219ab540356cbb839cbe05303d7705fa' - - 'HISTORY_STORAGE_ADDRESS': '0x0000f90827f1c53a10cb7a02335b175320002935' - - 'WITHDRAWAL_REQUEST_PREDEPLOY_ADDRESS': '0x00000961ef480eb55e80d19ad83579a64c007002' - currentHash: '0xc376cf8b' - currentForkId: '0x3ff0e375' \ No newline at end of file + BEACON_ROOTS_ADDRESS: '0x000f3df6d732807ef1319fb7b8bb8522d0beac02' + CONSOLIDATION_REQUEST_PREDEPLOY_ADDRESS: '0x0000bbddc7ce488642fb579f8b00f3a590007251' + DEPOSIT_CONTRACT_ADDRESS: '0x00000000219ab540356cbb839cbe05303d7705fa' + HISTORY_STORAGE_ADDRESS: '0x0000f90827f1c53a10cb7a02335b175320002935' + WITHDRAWAL_REQUEST_PREDEPLOY_ADDRESS: '0x00000961ef480eb55e80d19ad83579a64c007002' \ No newline at end of file diff --git a/src/schemas/client.yaml b/src/schemas/client.yaml index 431e11585..638dc1505 100644 --- a/src/schemas/client.yaml +++ b/src/schemas/client.yaml @@ -26,42 +26,16 @@ ConfigurationResponse: current: title: Current configuration $ref: '#/components/schemas/ConfigObject' - currentHash: - title: Current configuration hash - description: CRC-32 hash of the canonical JSON of the current configuration - $ref: '#/components/schemas/bytes4' - currentForkId: - title: Current fork ID - description: Fork identifier for the current configuration - $ref: '#/components/schemas/bytes4' next: title: Next configuration description: Configuration for the next scheduled fork, absent if no future forks scheduled $ref: '#/components/schemas/ConfigObject' - nextHash: - title: Next configuration hash - description: CRC-32 hash of the the canonical JSON of the next configuration, absent if no future forks scheduled - $ref: '#/components/schemas/bytes4' - nextForkId: - title: Next fork ID - description: Fork identifier for the next configuration, absent if no future forks scheduled - $ref: '#/components/schemas/bytes4' last: title: Last configuration description: Configuration for the last configured fork, absent if no future forks scheduled $ref: '#/components/schemas/ConfigObject' - lastHash: - title: Last configuration hash - description: CRC-32 hash of the the canonical JSON of the last configured fork, absent if no future forks scheduled - $ref: '#/components/schemas/bytes4' - lastForkId: - title: Last fork ID - description: Fork identifier for the last configured fork, absent if no future forks scheduled - $ref: '#/components/schemas/bytes4' required: - current - - currentHash - - currentForkId ConfigObject: title: Configuration object description: Represents a specific fork configuration @@ -80,15 +54,16 @@ ConfigObject: title: Chain ID description: The chain ID for this configuration $ref: '#/components/schemas/uint' + forkId: + title: Fork ID + description: The FORK_HASH value as specified in EIP-6122 of the specific fork + $ref: '#/components/schemas/bytes4' precompiles: title: Precompiles - description: Mapping of precompile addresses to their names + description: Mapping of precompile names to their addresses type: object additionalProperties: - type: string - patternProperties: - '^0x[0-9a-fA-F]{40}$': - type: string + $ref: '#/components/schemas/address' systemContracts: title: System contracts description: Mapping of system contract names to their addresses @@ -99,6 +74,7 @@ ConfigObject: - activationTime - blobSchedule - chainId + - forkId - precompiles - systemContracts BlobSchedule: diff --git a/tests/eth_config/get-config-with-next-fork.io b/tests/eth_config/get-config-with-next-fork.io index 91945de9b..327de5dd9 100644 --- a/tests/eth_config/get-config-with-next-fork.io +++ b/tests/eth_config/get-config-with-next-fork.io @@ -1,3 +1,3 @@ // retrieves configuration when a fork is scheduled (EIP-7910 example with expanded next config) >> {"jsonrpc":"2.0","id":1,"method":"eth_config"} -<< {"jsonrpc":"2.0","id":1,"result":{"current":{"activationTime":0,"blobSchedule":{"baseFeeUpdateFraction":3338477,"max":6,"target":3},"chainId":"0x88bb0","precompiles":{"0x0000000000000000000000000000000000000001":"ECREC","0x0000000000000000000000000000000000000002":"SHA256","0x0000000000000000000000000000000000000003":"RIPEMD160","0x0000000000000000000000000000000000000004":"ID","0x0000000000000000000000000000000000000005":"MODEXP","0x0000000000000000000000000000000000000006":"BN254_ADD","0x0000000000000000000000000000000000000007":"BN254_MUL","0x0000000000000000000000000000000000000008":"BN254_PAIRING","0x0000000000000000000000000000000000000009":"BLAKE2F","0x000000000000000000000000000000000000000a":"KZG_POINT_EVALUATION"},"systemContracts":{"BEACON_ROOTS_ADDRESS":"0x000f3df6d732807ef1319fb7b8bb8522d0beac02"}},"currentHash":"0x2eedf329","currentForkId":"0xbef71d30","next":{"activationTime":1742999832,"blobSchedule":{"baseFeeUpdateFraction":5007716,"max":9,"target":6},"chainId":"0x88bb0","precompiles":{"0x0000000000000000000000000000000000000001":"ECREC","0x0000000000000000000000000000000000000002":"SHA256","0x0000000000000000000000000000000000000003":"RIPEMD160","0x0000000000000000000000000000000000000004":"ID","0x0000000000000000000000000000000000000005":"MODEXP","0x0000000000000000000000000000000000000006":"BN254_ADD","0x0000000000000000000000000000000000000007":"BN254_MUL","0x0000000000000000000000000000000000000008":"BN254_PAIRING","0x0000000000000000000000000000000000000009":"BLAKE2F","0x000000000000000000000000000000000000000a":"KZG_POINT_EVALUATION","0x000000000000000000000000000000000000000b":"BLS12_G1ADD","0x000000000000000000000000000000000000000c":"BLS12_G1MSM","0x000000000000000000000000000000000000000d":"BLS12_G2ADD","0x000000000000000000000000000000000000000e":"BLS12_G2MSM","0x000000000000000000000000000000000000000f":"BLS12_PAIRING_CHECK","0x0000000000000000000000000000000000000010":"BLS12_MAP_FP_TO_G1","0x0000000000000000000000000000000000000011":"BLS12_MAP_FP2_TO_G2"},"systemContracts":{"BEACON_ROOTS_ADDRESS":"0x000f3df6d732807ef1319fb7b8bb8522d0beac02","CONSOLIDATION_REQUEST_PREDEPLOY_ADDRESS":"0x0000bbddc7ce488642fb579f8b00f3a590007251","DEPOSIT_CONTRACT_ADDRESS":"0x00000000219ab540356cbb839cbe05303d7705fa","HISTORY_STORAGE_ADDRESS":"0x0000f90827f1c53a10cb7a02335b175320002935","WITHDRAWAL_REQUEST_PREDEPLOY_ADDRESS":"0x00000961ef480eb55e80d19ad83579a64c007002"}},"nextHash":"0x0d82a81f","nextForkId":"0x0929e24e","last":{"activationTime":1742999832,"blobSchedule":{"baseFeeUpdateFraction":5007716,"max":9,"target":6},"chainId":"0x88bb0","precompiles":{"0x0000000000000000000000000000000000000001":"ECREC","0x0000000000000000000000000000000000000002":"SHA256","0x0000000000000000000000000000000000000003":"RIPEMD160","0x0000000000000000000000000000000000000004":"ID","0x0000000000000000000000000000000000000005":"MODEXP","0x0000000000000000000000000000000000000006":"BN254_ADD","0x0000000000000000000000000000000000000007":"BN254_MUL","0x0000000000000000000000000000000000000008":"BN254_PAIRING","0x0000000000000000000000000000000000000009":"BLAKE2F","0x000000000000000000000000000000000000000a":"KZG_POINT_EVALUATION","0x000000000000000000000000000000000000000b":"BLS12_G1ADD","0x000000000000000000000000000000000000000c":"BLS12_G1MSM","0x000000000000000000000000000000000000000d":"BLS12_G2ADD","0x000000000000000000000000000000000000000e":"BLS12_G2MSM","0x000000000000000000000000000000000000000f":"BLS12_PAIRING_CHECK","0x0000000000000000000000000000000000000010":"BLS12_MAP_FP_TO_G1","0x0000000000000000000000000000000000000011":"BLS12_MAP_FP2_TO_G2"},"systemContracts":{"BEACON_ROOTS_ADDRESS":"0x000f3df6d732807ef1319fb7b8bb8522d0beac02","CONSOLIDATION_REQUEST_PREDEPLOY_ADDRESS":"0x0000bbddc7ce488642fb579f8b00f3a590007251","DEPOSIT_CONTRACT_ADDRESS":"0x00000000219ab540356cbb839cbe05303d7705fa","HISTORY_STORAGE_ADDRESS":"0x0000f90827f1c53a10cb7a02335b175320002935","WITHDRAWAL_REQUEST_PREDEPLOY_ADDRESS":"0x00000961ef480eb55e80d19ad83579a64c007002"}},"lastHash":"0x0d82a81f","lastForkId":"0x0929e24e"}} \ No newline at end of file +<< {"jsonrpc":"2.0","id":1,"result":{"current":{"activationTime":0,"blobSchedule":{"baseFeeUpdateFraction":3338477,"max":6,"target":3},"chainId":"0x88bb0","forkId":"0xbef71d30","precompiles":{"BLAKE2F":"0x0000000000000000000000000000000000000009","BN254_ADD":"0x0000000000000000000000000000000000000006","BN254_MUL":"0x0000000000000000000000000000000000000007","BN254_PAIRING":"0x0000000000000000000000000000000000000008","ECREC":"0x0000000000000000000000000000000000000001","ID":"0x0000000000000000000000000000000000000004","KZG_POINT_EVALUATION":"0x000000000000000000000000000000000000000a","MODEXP":"0x0000000000000000000000000000000000000005","RIPEMD160":"0x0000000000000000000000000000000000000003","SHA256":"0x0000000000000000000000000000000000000002"},"systemContracts":{"BEACON_ROOTS_ADDRESS":"0x000f3df6d732807ef1319fb7b8bb8522d0beac02"}},"next":{"activationTime":1742999832,"blobSchedule":{"baseFeeUpdateFraction":5007716,"max":9,"target":6},"chainId":"0x88bb0","forkId":"0x0929e24e","precompiles":{"BLS12_G1ADD":"0x000000000000000000000000000000000000000b","BLS12_G1MSM":"0x000000000000000000000000000000000000000c","BLS12_G2ADD":"0x000000000000000000000000000000000000000d","BLS12_G2MSM":"0x000000000000000000000000000000000000000e","BLS12_MAP_FP2_TO_G2":"0x0000000000000000000000000000000000000011","BLS12_MAP_FP_TO_G1":"0x0000000000000000000000000000000000000010","BLS12_PAIRING_CHECK":"0x000000000000000000000000000000000000000f","BLAKE2F":"0x0000000000000000000000000000000000000009","BN254_ADD":"0x0000000000000000000000000000000000000006","BN254_MUL":"0x0000000000000000000000000000000000000007","BN254_PAIRING":"0x0000000000000000000000000000000000000008","ECREC":"0x0000000000000000000000000000000000000001","ID":"0x0000000000000000000000000000000000000004","KZG_POINT_EVALUATION":"0x000000000000000000000000000000000000000a","MODEXP":"0x0000000000000000000000000000000000000005","RIPEMD160":"0x0000000000000000000000000000000000000003","SHA256":"0x0000000000000000000000000000000000000002"},"systemContracts":{"BEACON_ROOTS_ADDRESS":"0x000f3df6d732807ef1319fb7b8bb8522d0beac02","CONSOLIDATION_REQUEST_PREDEPLOY_ADDRESS":"0x0000bbddc7ce488642fb579f8b00f3a590007251","DEPOSIT_CONTRACT_ADDRESS":"0x00000000219ab540356cbb839cbe05303d7705fa","HISTORY_STORAGE_ADDRESS":"0x0000f90827f1c53a10cb7a02335b175320002935","WITHDRAWAL_REQUEST_PREDEPLOY_ADDRESS":"0x00000961ef480eb55e80d19ad83579a64c007002"}},"last":{"activationTime":1742999832,"blobSchedule":{"baseFeeUpdateFraction":5007716,"max":9,"target":6},"chainId":"0x88bb0","forkId":"0x0929e24e","precompiles":{"BLS12_G1ADD":"0x000000000000000000000000000000000000000b","BLS12_G1MSM":"0x000000000000000000000000000000000000000c","BLS12_G2ADD":"0x000000000000000000000000000000000000000d","BLS12_G2MSM":"0x000000000000000000000000000000000000000e","BLS12_MAP_FP2_TO_G2":"0x0000000000000000000000000000000000000011","BLS12_MAP_FP_TO_G1":"0x0000000000000000000000000000000000000010","BLS12_PAIRING_CHECK":"0x000000000000000000000000000000000000000f","BLAKE2F":"0x0000000000000000000000000000000000000009","BN254_ADD":"0x0000000000000000000000000000000000000006","BN254_MUL":"0x0000000000000000000000000000000000000007","BN254_PAIRING":"0x0000000000000000000000000000000000000008","ECREC":"0x0000000000000000000000000000000000000001","ID":"0x0000000000000000000000000000000000000004","KZG_POINT_EVALUATION":"0x000000000000000000000000000000000000000a","MODEXP":"0x0000000000000000000000000000000000000005","RIPEMD160":"0x0000000000000000000000000000000000000003","SHA256":"0x0000000000000000000000000000000000000002"},"systemContracts":{"BEACON_ROOTS_ADDRESS":"0x000f3df6d732807ef1319fb7b8bb8522d0beac02","CONSOLIDATION_REQUEST_PREDEPLOY_ADDRESS":"0x0000bbddc7ce488642fb579f8b00f3a590007251","DEPOSIT_CONTRACT_ADDRESS":"0x00000000219ab540356cbb839cbe05303d7705fa","HISTORY_STORAGE_ADDRESS":"0x0000f90827f1c53a10cb7a02335b175320002935","WITHDRAWAL_REQUEST_PREDEPLOY_ADDRESS":"0x00000961ef480eb55e80d19ad83579a64c007002"}}}} \ No newline at end of file diff --git a/tests/eth_config/get-current-config.io b/tests/eth_config/get-current-config.io index c4ea6e3da..8c343b843 100644 --- a/tests/eth_config/get-current-config.io +++ b/tests/eth_config/get-current-config.io @@ -1,3 +1,3 @@ // retrieves the client's current fork configuration >> {"jsonrpc":"2.0","id":1,"method":"eth_config"} -<< {"jsonrpc":"2.0","id":1,"result":{"current":{"activationTime":1746612311,"blobSchedule":{"baseFeeUpdateFraction":5007716,"max":9,"target":6},"chainId":"0x1","precompiles":{"0x0000000000000000000000000000000000000001":"ECREC","0x0000000000000000000000000000000000000002":"SHA256","0x0000000000000000000000000000000000000003":"RIPEMD160","0x0000000000000000000000000000000000000004":"ID","0x0000000000000000000000000000000000000005":"MODEXP","0x0000000000000000000000000000000000000006":"BN254_ADD","0x0000000000000000000000000000000000000007":"BN254_MUL","0x0000000000000000000000000000000000000008":"BN254_PAIRING","0x0000000000000000000000000000000000000009":"BLAKE2F","0x000000000000000000000000000000000000000a":"KZG_POINT_EVALUATION","0x000000000000000000000000000000000000000b":"BLS12_G1ADD","0x000000000000000000000000000000000000000c":"BLS12_G1MSM","0x000000000000000000000000000000000000000d":"BLS12_G2ADD","0x000000000000000000000000000000000000000e":"BLS12_G2MSM","0x000000000000000000000000000000000000000f":"BLS12_PAIRING_CHECK","0x0000000000000000000000000000000000000010":"BLS12_MAP_FP_TO_G1","0x0000000000000000000000000000000000000011":"BLS12_MAP_FP2_TO_G2"},"systemContracts":{"BEACON_ROOTS_ADDRESS":"0x000f3df6d732807ef1319fb7b8bb8522d0beac02","CONSOLIDATION_REQUEST_PREDEPLOY_ADDRESS":"0x0000bbddc7ce488642fb579f8b00f3a590007251","DEPOSIT_CONTRACT_ADDRESS":"0x00000000219ab540356cbb839cbe05303d7705fa","HISTORY_STORAGE_ADDRESS":"0x0000f90827f1c53a10cb7a02335b175320002935","WITHDRAWAL_REQUEST_PREDEPLOY_ADDRESS":"0x00000961ef480eb55e80d19ad83579a64c007002"}},"currentForkId":"0xc376cf8b","currentHash":"0x3ff0e375"}} \ No newline at end of file +<< {"jsonrpc":"2.0","id":1,"result":{"current":{"activationTime":1746612311,"blobSchedule":{"baseFeeUpdateFraction":5007716,"max":9,"target":6},"chainId":"0x1","forkId":"0x3ff0e375","precompiles":{"BLS12_G1ADD":"0x000000000000000000000000000000000000000b","BLS12_G1MSM":"0x000000000000000000000000000000000000000c","BLS12_G2ADD":"0x000000000000000000000000000000000000000d","BLS12_G2MSM":"0x000000000000000000000000000000000000000e","BLS12_MAP_FP2_TO_G2":"0x0000000000000000000000000000000000000011","BLS12_MAP_FP_TO_G1":"0x0000000000000000000000000000000000000010","BLS12_PAIRING_CHECK":"0x000000000000000000000000000000000000000f","BLAKE2F":"0x0000000000000000000000000000000000000009","BN254_ADD":"0x0000000000000000000000000000000000000006","BN254_MUL":"0x0000000000000000000000000000000000000007","BN254_PAIRING":"0x0000000000000000000000000000000000000008","ECREC":"0x0000000000000000000000000000000000000001","ID":"0x0000000000000000000000000000000000000004","KZG_POINT_EVALUATION":"0x000000000000000000000000000000000000000a","MODEXP":"0x0000000000000000000000000000000000000005","RIPEMD160":"0x0000000000000000000000000000000000000003","SHA256":"0x0000000000000000000000000000000000000002"},"systemContracts":{"BEACON_ROOTS_ADDRESS":"0x000f3df6d732807ef1319fb7b8bb8522d0beac02","CONSOLIDATION_REQUEST_PREDEPLOY_ADDRESS":"0x0000bbddc7ce488642fb579f8b00f3a590007251","DEPOSIT_CONTRACT_ADDRESS":"0x00000000219ab540356cbb839cbe05303d7705fa","HISTORY_STORAGE_ADDRESS":"0x0000f90827f1c53a10cb7a02335b175320002935","WITHDRAWAL_REQUEST_PREDEPLOY_ADDRESS":"0x00000961ef480eb55e80d19ad83579a64c007002"}}}} \ No newline at end of file From d6d2672633b6ac1375a0c24985fce82e50cf222c Mon Sep 17 00:00:00 2001 From: Danno Ferrin Date: Mon, 28 Jul 2025 11:13:18 -0600 Subject: [PATCH 6/6] next and last must be present, and will be null if no future fork is scheduled. Signed-off-by: Danno Ferrin --- src/eth/client.yaml | 6 ++++-- src/schemas/client.yaml | 14 ++++++++++---- tests/eth_config/get-current-config.io | 4 ++-- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/eth/client.yaml b/src/eth/client.yaml index 2a8ef19fa..9883c34a0 100644 --- a/src/eth/client.yaml +++ b/src/eth/client.yaml @@ -81,7 +81,7 @@ schema: $ref: '#/components/schemas/ConfigurationResponse' examples: - - name: eth_config example + - name: eth_config example with no future fork scheduled params: [] result: name: Configuration @@ -117,4 +117,6 @@ CONSOLIDATION_REQUEST_PREDEPLOY_ADDRESS: '0x0000bbddc7ce488642fb579f8b00f3a590007251' DEPOSIT_CONTRACT_ADDRESS: '0x00000000219ab540356cbb839cbe05303d7705fa' HISTORY_STORAGE_ADDRESS: '0x0000f90827f1c53a10cb7a02335b175320002935' - WITHDRAWAL_REQUEST_PREDEPLOY_ADDRESS: '0x00000961ef480eb55e80d19ad83579a64c007002' \ No newline at end of file + WITHDRAWAL_REQUEST_PREDEPLOY_ADDRESS: '0x00000961ef480eb55e80d19ad83579a64c007002' + next: null + last: null \ No newline at end of file diff --git a/src/schemas/client.yaml b/src/schemas/client.yaml index 638dc1505..d35155749 100644 --- a/src/schemas/client.yaml +++ b/src/schemas/client.yaml @@ -28,14 +28,20 @@ ConfigurationResponse: $ref: '#/components/schemas/ConfigObject' next: title: Next configuration - description: Configuration for the next scheduled fork, absent if no future forks scheduled - $ref: '#/components/schemas/ConfigObject' + description: Configuration for the next scheduled fork, null if no future forks scheduled + oneOf: + - $ref: '#/components/schemas/ConfigObject' + - type: 'null' last: title: Last configuration - description: Configuration for the last configured fork, absent if no future forks scheduled - $ref: '#/components/schemas/ConfigObject' + description: Configuration for the last configured fork, null if no future forks scheduled + oneOf: + - $ref: '#/components/schemas/ConfigObject' + - type: 'null' required: - current + - next + - last ConfigObject: title: Configuration object description: Represents a specific fork configuration diff --git a/tests/eth_config/get-current-config.io b/tests/eth_config/get-current-config.io index 8c343b843..74f09d2f2 100644 --- a/tests/eth_config/get-current-config.io +++ b/tests/eth_config/get-current-config.io @@ -1,3 +1,3 @@ -// retrieves the client's current fork configuration +// retrieves the client's current fork configuration when no future forks are scheduled >> {"jsonrpc":"2.0","id":1,"method":"eth_config"} -<< {"jsonrpc":"2.0","id":1,"result":{"current":{"activationTime":1746612311,"blobSchedule":{"baseFeeUpdateFraction":5007716,"max":9,"target":6},"chainId":"0x1","forkId":"0x3ff0e375","precompiles":{"BLS12_G1ADD":"0x000000000000000000000000000000000000000b","BLS12_G1MSM":"0x000000000000000000000000000000000000000c","BLS12_G2ADD":"0x000000000000000000000000000000000000000d","BLS12_G2MSM":"0x000000000000000000000000000000000000000e","BLS12_MAP_FP2_TO_G2":"0x0000000000000000000000000000000000000011","BLS12_MAP_FP_TO_G1":"0x0000000000000000000000000000000000000010","BLS12_PAIRING_CHECK":"0x000000000000000000000000000000000000000f","BLAKE2F":"0x0000000000000000000000000000000000000009","BN254_ADD":"0x0000000000000000000000000000000000000006","BN254_MUL":"0x0000000000000000000000000000000000000007","BN254_PAIRING":"0x0000000000000000000000000000000000000008","ECREC":"0x0000000000000000000000000000000000000001","ID":"0x0000000000000000000000000000000000000004","KZG_POINT_EVALUATION":"0x000000000000000000000000000000000000000a","MODEXP":"0x0000000000000000000000000000000000000005","RIPEMD160":"0x0000000000000000000000000000000000000003","SHA256":"0x0000000000000000000000000000000000000002"},"systemContracts":{"BEACON_ROOTS_ADDRESS":"0x000f3df6d732807ef1319fb7b8bb8522d0beac02","CONSOLIDATION_REQUEST_PREDEPLOY_ADDRESS":"0x0000bbddc7ce488642fb579f8b00f3a590007251","DEPOSIT_CONTRACT_ADDRESS":"0x00000000219ab540356cbb839cbe05303d7705fa","HISTORY_STORAGE_ADDRESS":"0x0000f90827f1c53a10cb7a02335b175320002935","WITHDRAWAL_REQUEST_PREDEPLOY_ADDRESS":"0x00000961ef480eb55e80d19ad83579a64c007002"}}}} \ No newline at end of file +<< {"jsonrpc":"2.0","id":1,"result":{"current":{"activationTime":1746612311,"blobSchedule":{"baseFeeUpdateFraction":5007716,"max":9,"target":6},"chainId":"0x1","forkId":"0x3ff0e375","precompiles":{"BLS12_G1ADD":"0x000000000000000000000000000000000000000b","BLS12_G1MSM":"0x000000000000000000000000000000000000000c","BLS12_G2ADD":"0x000000000000000000000000000000000000000d","BLS12_G2MSM":"0x000000000000000000000000000000000000000e","BLS12_MAP_FP2_TO_G2":"0x0000000000000000000000000000000000000011","BLS12_MAP_FP_TO_G1":"0x0000000000000000000000000000000000000010","BLS12_PAIRING_CHECK":"0x000000000000000000000000000000000000000f","BLAKE2F":"0x0000000000000000000000000000000000000009","BN254_ADD":"0x0000000000000000000000000000000000000006","BN254_MUL":"0x0000000000000000000000000000000000000007","BN254_PAIRING":"0x0000000000000000000000000000000000000008","ECREC":"0x0000000000000000000000000000000000000001","ID":"0x0000000000000000000000000000000000000004","KZG_POINT_EVALUATION":"0x000000000000000000000000000000000000000a","MODEXP":"0x0000000000000000000000000000000000000005","RIPEMD160":"0x0000000000000000000000000000000000000003","SHA256":"0x0000000000000000000000000000000000000002"},"systemContracts":{"BEACON_ROOTS_ADDRESS":"0x000f3df6d732807ef1319fb7b8bb8522d0beac02","CONSOLIDATION_REQUEST_PREDEPLOY_ADDRESS":"0x0000bbddc7ce488642fb579f8b00f3a590007251","DEPOSIT_CONTRACT_ADDRESS":"0x00000000219ab540356cbb839cbe05303d7705fa","HISTORY_STORAGE_ADDRESS":"0x0000f90827f1c53a10cb7a02335b175320002935","WITHDRAWAL_REQUEST_PREDEPLOY_ADDRESS":"0x00000961ef480eb55e80d19ad83579a64c007002"}},"next":null,"last":null}} \ No newline at end of file