Skip to content

Commit 4ea9a1d

Browse files
committed
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
1 parent bbf817f commit 4ea9a1d

File tree

5 files changed

+168
-0
lines changed

5 files changed

+168
-0
lines changed

src/eth/client.yaml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,52 @@
7070
result:
7171
name: Block number
7272
value: '0x2377'
73+
- name: eth_config
74+
summary: Returns the client's current configuration including fork information.
75+
externalDocs:
76+
description: EIP-7910 specification
77+
url: https://eips.ethereum.org/EIPS/eip-7910
78+
params: []
79+
result:
80+
name: Configuration
81+
schema:
82+
$ref: '#/components/schemas/ConfigurationResponse'
83+
examples:
84+
- name: eth_config example
85+
params: []
86+
result:
87+
name: Configuration
88+
value:
89+
current:
90+
activationTime: 1746612311
91+
blobSchedule:
92+
baseFeeUpdateFraction: 5007716
93+
max: 9
94+
target: 6
95+
chainId: '0x1'
96+
precompiles:
97+
- '0x0000000000000000000000000000000000000001': 'ECREC'
98+
- '0x0000000000000000000000000000000000000002': 'SHA256'
99+
- '0x0000000000000000000000000000000000000003': 'RIPEMD160'
100+
- '0x0000000000000000000000000000000000000004': 'ID'
101+
- '0x0000000000000000000000000000000000000005': 'MODEXP'
102+
- '0x0000000000000000000000000000000000000006': 'BN254_ADD'
103+
- '0x0000000000000000000000000000000000000007': 'BN254_MUL'
104+
- '0x0000000000000000000000000000000000000008': 'BN254_PAIRING'
105+
- '0x0000000000000000000000000000000000000009': 'BLAKE2F'
106+
- '0x000000000000000000000000000000000000000a': 'KZG_POINT_EVALUATION'
107+
- '0x000000000000000000000000000000000000000b': 'BLS12_G1ADD'
108+
- '0x000000000000000000000000000000000000000c': 'BLS12_G1MSM'
109+
- '0x000000000000000000000000000000000000000d': 'BLS12_G2ADD'
110+
- '0x000000000000000000000000000000000000000e': 'BLS12_G2MSM'
111+
- '0x000000000000000000000000000000000000000f': 'BLS12_PAIRING_CHECK'
112+
- '0x0000000000000000000000000000000000000010': 'BLS12_MAP_FP_TO_G1'
113+
- '0x0000000000000000000000000000000000000011': 'BLS12_MAP_FP2_TO_G2'
114+
systemContracts:
115+
- 'BEACON_ROOTS_ADDRESS': '0x000f3df6d732807ef1319fb7b8bb8522d0beac02'
116+
- 'CONSOLIDATION_REQUEST_PREDEPLOY_ADDRESS': '0x0000bbddc7ce488642fb579f8b00f3a590007251'
117+
- 'DEPOSIT_CONTRACT_ADDRESS': '0x00000000219ab540356cbb839cbe05303d7705fa'
118+
- 'HISTORY_STORAGE_ADDRESS': '0x0000f90827f1c53a10cb7a02335b175320002935'
119+
- 'WITHDRAWAL_REQUEST_PREDEPLOY_ADDRESS': '0x00000961ef480eb55e80d19ad83579a64c007002'
120+
currentHash: '0xc376cf8b'
121+
currentForkId: '0x3ff0e375'

src/schemas/base-types.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ bytesMax32:
1919
title: 32 hex encoded bytes
2020
type: string
2121
pattern: ^0x[0-9a-f]{0,64}$
22+
bytes4:
23+
title: 4 hex encoded bytes
24+
type: string
25+
pattern: ^0x[0-9a-f]{8}$
2226
bytes8:
2327
title: 8 hex encoded bytes
2428
type: string

src/schemas/client.yaml

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,112 @@ SyncingStatus:
1717
- title: Not syncing
1818
description: Should always return false if not syncing.
1919
type: boolean
20+
ConfigurationResponse:
21+
title: Configuration response
22+
description: Response object for eth_config method containing current, next, and last fork configurations
23+
type: object
24+
additionalProperties: false
25+
properties:
26+
current:
27+
title: Current configuration
28+
$ref: '#/components/schemas/ConfigObject'
29+
currentHash:
30+
title: Current configuration hash
31+
description: CRC-32 hash of the canonical JSON of the current configuration
32+
$ref: '#/components/schemas/bytes4'
33+
currentForkId:
34+
title: Current fork ID
35+
description: Fork identifier for the current configuration
36+
$ref: '#/components/schemas/bytes4'
37+
next:
38+
title: Next configuration
39+
description: Configuration for the next scheduled fork, absent if no future forks scheduled
40+
$ref: '#/components/schemas/ConfigObject'
41+
nextHash:
42+
title: Next configuration hash
43+
description: CRC-32 hash of the the canonical JSON of the next configuration, absent if no future forks scheduled
44+
$ref: '#/components/schemas/bytes4'
45+
nextForkId:
46+
title: Next fork ID
47+
description: Fork identifier for the next configuration, absent if no future forks scheduled
48+
$ref: '#/components/schemas/bytes4'
49+
last:
50+
title: Last configuration
51+
description: Configuration for the last configured fork, absent if no future forks scheduled
52+
$ref: '#/components/schemas/ConfigObject'
53+
lastHash:
54+
title: Last configuration hash
55+
description: CRC-32 hash of the the canonical JSON of the last configured fork, absent if no future forks scheduled
56+
$ref: '#/components/schemas/bytes4'
57+
lastForkId:
58+
title: Last fork ID
59+
description: Fork identifier for the last configured fork, absent if no future forks scheduled
60+
$ref: '#/components/schemas/bytes4'
61+
required:
62+
- current
63+
- currentHash
64+
- currentForkId
65+
ConfigObject:
66+
title: Configuration object
67+
description: Represents a specific fork configuration
68+
type: object
69+
additionalProperties: false
70+
properties:
71+
activationTime:
72+
title: Activation time
73+
description: Unix timestamp when this configuration becomes active
74+
type: number
75+
blobSchedule:
76+
title: Blob schedule
77+
description: Configuration for blob fee schedule
78+
$ref: '#/components/schemas/BlobSchedule'
79+
chainId:
80+
title: Chain ID
81+
description: The chain ID for this configuration
82+
$ref: '#/components/schemas/uint'
83+
precompiles:
84+
title: Precompiles
85+
description: Mapping of precompile addresses to their names
86+
type: object
87+
additionalProperties:
88+
type: string
89+
patternProperties:
90+
'^0x[0-9a-fA-F]{40}$':
91+
type: string
92+
systemContracts:
93+
title: System contracts
94+
description: Mapping of system contract names to their addresses
95+
type: object
96+
additionalProperties:
97+
$ref: '#/components/schemas/address'
98+
required:
99+
- activationTime
100+
- blobSchedule
101+
- chainId
102+
- precompiles
103+
- systemContracts
104+
BlobSchedule:
105+
title: Blob schedule
106+
description: Configuration parameters for blob fee scheduling
107+
type: object
108+
additionalProperties: false
109+
properties:
110+
baseFeeUpdateFraction:
111+
title: Base fee update fraction
112+
description: Fraction used for updating blob base fees
113+
type: integer
114+
minimum: 0
115+
max:
116+
title: Maximum blobs
117+
description: Maximum number of blobs per block
118+
type: integer
119+
minimum: 0
120+
target:
121+
title: Target blobs
122+
description: Target number of blobs per block
123+
type: integer
124+
minimum: 0
125+
required:
126+
- baseFeeUpdateFraction
127+
- max
128+
- target
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// retrieves configuration when a fork is scheduled (EIP-7910 example with expanded next config)
2+
>> {"jsonrpc":"2.0","id":1,"method":"eth_config"}
3+
<< {"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"}}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// retrieves the client's current fork configuration
2+
>> {"jsonrpc":"2.0","id":1,"method":"eth_config"}
3+
<< {"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"}}

0 commit comments

Comments
 (0)