ethspecify 0.2.4__py3-none-any.whl → 0.3.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ethspecify/cli.py +103 -20
- ethspecify/core.py +1073 -25
- ethspecify-0.3.2.dist-info/METADATA +237 -0
- ethspecify-0.3.2.dist-info/RECORD +9 -0
- ethspecify-0.2.4.dist-info/METADATA +0 -351
- ethspecify-0.2.4.dist-info/RECORD +0 -9
- {ethspecify-0.2.4.dist-info → ethspecify-0.3.2.dist-info}/WHEEL +0 -0
- {ethspecify-0.2.4.dist-info → ethspecify-0.3.2.dist-info}/entry_points.txt +0 -0
- {ethspecify-0.2.4.dist-info → ethspecify-0.3.2.dist-info}/licenses/LICENSE +0 -0
- {ethspecify-0.2.4.dist-info → ethspecify-0.3.2.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: ethspecify
|
|
3
|
+
Version: 0.3.2
|
|
4
|
+
Summary: A utility for processing Ethereum specification tags.
|
|
5
|
+
Home-page: https://github.com/jtraglia/ethspecify
|
|
6
|
+
Author: Justin Traglia
|
|
7
|
+
Author-email: jtraglia@pm.me
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Requires-Python: >=3.6
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
License-File: LICENSE
|
|
14
|
+
Requires-Dist: requests==2.32.3
|
|
15
|
+
Requires-Dist: PyYAML>=6.0
|
|
16
|
+
Dynamic: author
|
|
17
|
+
Dynamic: author-email
|
|
18
|
+
Dynamic: classifier
|
|
19
|
+
Dynamic: description
|
|
20
|
+
Dynamic: description-content-type
|
|
21
|
+
Dynamic: home-page
|
|
22
|
+
Dynamic: license-file
|
|
23
|
+
Dynamic: requires-dist
|
|
24
|
+
Dynamic: requires-python
|
|
25
|
+
Dynamic: summary
|
|
26
|
+
|
|
27
|
+
# ethspecify
|
|
28
|
+
|
|
29
|
+
A tool for referencing the Ethereum specifications in clients.
|
|
30
|
+
|
|
31
|
+
The idea is that ethspecify will help developers keep track of when the specification changes. It
|
|
32
|
+
will also help auditors verify that the client implementations match the specifications. Ideally,
|
|
33
|
+
this is configured as a CI check which notifies client developers when the specification changes.
|
|
34
|
+
When that happens, they can update the implementations appropriately.
|
|
35
|
+
|
|
36
|
+
## Getting started
|
|
37
|
+
|
|
38
|
+
### Installation
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
pipx install ethspecify
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Initialize specrefs
|
|
45
|
+
|
|
46
|
+
From the root of the client source directory, initialize a directory for specrefs:
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
$ ethspecify init v1.6.0-beta.0
|
|
50
|
+
Initializing specrefs directory: v1.6.0-beta.0
|
|
51
|
+
Successfully created specrefs directory at: specrefs
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
This creates a `specrefs` directory with `.ethspecify.yml` and YAML files for each spec category
|
|
55
|
+
(constants, configs, presets, functions, containers, dataclasses, types).
|
|
56
|
+
|
|
57
|
+
### Map sources
|
|
58
|
+
|
|
59
|
+
Edit the YAML files to add sources for where each spec item is implemented.
|
|
60
|
+
|
|
61
|
+
If it's the entire file:
|
|
62
|
+
|
|
63
|
+
```yaml
|
|
64
|
+
- name: BlobParameters
|
|
65
|
+
sources:
|
|
66
|
+
- file: ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/versions/fulu/helpers/BlobParameters.java
|
|
67
|
+
spec: |
|
|
68
|
+
<spec dataclass="BlobParameters" fork="fulu" hash="a4575aa8">
|
|
69
|
+
class BlobParameters:
|
|
70
|
+
epoch: Epoch
|
|
71
|
+
max_blobs_per_block: uint64
|
|
72
|
+
</spec>
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
If it's multiple entire files:
|
|
76
|
+
|
|
77
|
+
```yaml
|
|
78
|
+
- name: BlobsBundleDeneb
|
|
79
|
+
sources:
|
|
80
|
+
- file: ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/BlobsBundle.java
|
|
81
|
+
- file: ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/builder/BlobsBundleSchema.java
|
|
82
|
+
- file: ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/builder/versions/deneb/BlobsBundleDeneb.java
|
|
83
|
+
- file: ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/builder/versions/deneb/BlobsBundleSchemaDeneb.java
|
|
84
|
+
spec: |
|
|
85
|
+
<spec dataclass="BlobsBundle" fork="deneb" hash="8d6e7be6">
|
|
86
|
+
class BlobsBundle(object):
|
|
87
|
+
commitments: List[KZGCommitment, MAX_BLOB_COMMITMENTS_PER_BLOCK]
|
|
88
|
+
proofs: List[KZGProof, MAX_BLOB_COMMITMENTS_PER_BLOCK]
|
|
89
|
+
blobs: List[Blob, MAX_BLOB_COMMITMENTS_PER_BLOCK]
|
|
90
|
+
</spec>
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
If it's a specific part of a file:
|
|
94
|
+
|
|
95
|
+
```yaml
|
|
96
|
+
- name: EFFECTIVE_BALANCE_INCREMENT
|
|
97
|
+
sources:
|
|
98
|
+
- file: ethereum/spec/src/main/resources/tech/pegasys/teku/spec/config/presets/mainnet/phase0.yaml
|
|
99
|
+
search: "EFFECTIVE_BALANCE_INCREMENT:"
|
|
100
|
+
spec: |
|
|
101
|
+
<spec preset_var="EFFECTIVE_BALANCE_INCREMENT" fork="phase0" hash="23dfe52c">
|
|
102
|
+
EFFECTIVE_BALANCE_INCREMENT: Gwei = 1000000000
|
|
103
|
+
</spec>
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
You can also use regex in the searches if that is necessary:
|
|
107
|
+
|
|
108
|
+
```yaml
|
|
109
|
+
- name: ATTESTATION_DUE_BPS
|
|
110
|
+
sources:
|
|
111
|
+
- file: ethereum/spec/src/main/resources/tech/pegasys/teku/spec/config/configs/mainnet.yaml
|
|
112
|
+
search: "^ATTESTATION_DUE_BPS:"
|
|
113
|
+
regex: true
|
|
114
|
+
spec: |
|
|
115
|
+
<spec config_var="ATTESTATION_DUE_BPS" fork="phase0" hash="929dd1c9">
|
|
116
|
+
ATTESTATION_DUE_BPS: uint64 = 3333
|
|
117
|
+
</spec>
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### Check specrefs
|
|
121
|
+
|
|
122
|
+
Run the check command in CI to verify all spec items are properly mapped:
|
|
123
|
+
|
|
124
|
+
```
|
|
125
|
+
$ ethspecify check --path=specrefs
|
|
126
|
+
MISSING: constants.BLS_MODULUS#deneb
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### Add exceptions
|
|
130
|
+
|
|
131
|
+
Some spec items may not be implemented in your client. Add them to the exceptions list in
|
|
132
|
+
`specrefs/.ethspecify.yml`:
|
|
133
|
+
|
|
134
|
+
```yaml
|
|
135
|
+
specrefs:
|
|
136
|
+
files:
|
|
137
|
+
- containers.yml
|
|
138
|
+
- functions.yml
|
|
139
|
+
# ...
|
|
140
|
+
|
|
141
|
+
exceptions:
|
|
142
|
+
containers:
|
|
143
|
+
# Not defined, unnecessary
|
|
144
|
+
- Eth1Block
|
|
145
|
+
|
|
146
|
+
functions:
|
|
147
|
+
# No light client support
|
|
148
|
+
- is_valid_light_client_header
|
|
149
|
+
- process_light_client_update
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
## Style Options
|
|
153
|
+
|
|
154
|
+
This attribute can be used to change how the specification content is shown.
|
|
155
|
+
|
|
156
|
+
### `hash` (default)
|
|
157
|
+
|
|
158
|
+
This style adds a hash of the specification content to the spec tag, without showing the content.
|
|
159
|
+
|
|
160
|
+
```
|
|
161
|
+
<spec fn="apply_deposit" fork="electra" hash="c723ce7b" />
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
> [!NOTE]
|
|
165
|
+
> The hash is the first 8 characters of the specification content's SHA256 digest.
|
|
166
|
+
|
|
167
|
+
### `full`
|
|
168
|
+
|
|
169
|
+
This style displays the whole content of this specification item, including comments.
|
|
170
|
+
|
|
171
|
+
```
|
|
172
|
+
<spec fn="is_fully_withdrawable_validator" fork="deneb" style="full">
|
|
173
|
+
def is_fully_withdrawable_validator(validator: Validator, balance: Gwei, epoch: Epoch) -> bool:
|
|
174
|
+
"""
|
|
175
|
+
Check if ``validator`` is fully withdrawable.
|
|
176
|
+
"""
|
|
177
|
+
return (
|
|
178
|
+
has_eth1_withdrawal_credential(validator)
|
|
179
|
+
and validator.withdrawable_epoch <= epoch
|
|
180
|
+
and balance > 0
|
|
181
|
+
)
|
|
182
|
+
</spec>
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
### `link`
|
|
186
|
+
|
|
187
|
+
This style displays a GitHub link to the specification item.
|
|
188
|
+
|
|
189
|
+
```
|
|
190
|
+
<spec fn="apply_pending_deposit" fork="electra" style="link" hash="83ee9126">
|
|
191
|
+
https://github.com/ethereum/consensus-specs/blob/dev/specs/electra/beacon-chain.md#new-apply_pending_deposit
|
|
192
|
+
</spec>
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
### `diff`
|
|
196
|
+
|
|
197
|
+
This style displays a diff with the previous fork's version of the specification.
|
|
198
|
+
|
|
199
|
+
```
|
|
200
|
+
<spec ssz_object="BeaconState" fork="electra" style="diff">
|
|
201
|
+
--- deneb
|
|
202
|
+
+++ electra
|
|
203
|
+
@@ -27,3 +27,12 @@
|
|
204
|
+
next_withdrawal_index: WithdrawalIndex
|
|
205
|
+
next_withdrawal_validator_index: ValidatorIndex
|
|
206
|
+
historical_summaries: List[HistoricalSummary, HISTORICAL_ROOTS_LIMIT]
|
|
207
|
+
+ deposit_requests_start_index: uint64
|
|
208
|
+
+ deposit_balance_to_consume: Gwei
|
|
209
|
+
+ exit_balance_to_consume: Gwei
|
|
210
|
+
+ earliest_exit_epoch: Epoch
|
|
211
|
+
+ consolidation_balance_to_consume: Gwei
|
|
212
|
+
+ earliest_consolidation_epoch: Epoch
|
|
213
|
+
+ pending_deposits: List[PendingDeposit, PENDING_DEPOSITS_LIMIT]
|
|
214
|
+
+ pending_partial_withdrawals: List[PendingPartialWithdrawal, PENDING_PARTIAL_WITHDRAWALS_LIMIT]
|
|
215
|
+
+ pending_consolidations: List[PendingConsolidation, PENDING_CONSOLIDATIONS_LIMIT]
|
|
216
|
+
</spec>
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
> [!NOTE]
|
|
220
|
+
> Comments are stripped from the specifications when the `diff` style is used. We do this because
|
|
221
|
+
> these complicate the diff; the "[Modified in Fork]" comments aren't valuable here.
|
|
222
|
+
|
|
223
|
+
This can be used with any specification item, like functions too:
|
|
224
|
+
|
|
225
|
+
```
|
|
226
|
+
<spec fn="is_eligible_for_activation_queue" fork="electra" style="diff">
|
|
227
|
+
--- phase0
|
|
228
|
+
+++ electra
|
|
229
|
+
@@ -4,5 +4,5 @@
|
|
230
|
+
"""
|
|
231
|
+
return (
|
|
232
|
+
validator.activation_eligibility_epoch == FAR_FUTURE_EPOCH
|
|
233
|
+
- and validator.effective_balance == MAX_EFFECTIVE_BALANCE
|
|
234
|
+
+ and validator.effective_balance >= MIN_ACTIVATION_BALANCE
|
|
235
|
+
)
|
|
236
|
+
</spec>
|
|
237
|
+
```
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
ethspecify/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
ethspecify/cli.py,sha256=a0-PKvXgZRtKAn5zJnMA1yRebKufvIVy1Xd2GJhMRPk,11021
|
|
3
|
+
ethspecify/core.py,sha256=WCODgPeKf0yzJvx6REqZfAJ_6ndL5bdtOdE6XS6UfV0,80651
|
|
4
|
+
ethspecify-0.3.2.dist-info/licenses/LICENSE,sha256=Awxsr73mm9YMBVhBYnzeI7bNdRd-bH6RDtO5ItG0DaM,1071
|
|
5
|
+
ethspecify-0.3.2.dist-info/METADATA,sha256=TRP92m9WbcCo7yCuturBO5DriDdtFeEwRhDbJ8txYWk,6996
|
|
6
|
+
ethspecify-0.3.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
7
|
+
ethspecify-0.3.2.dist-info/entry_points.txt,sha256=09viGkCg9J3h0c9BFRN-BKaJUEaIc4JyULNgBP5EL_g,51
|
|
8
|
+
ethspecify-0.3.2.dist-info/top_level.txt,sha256=0klaMvlVyOkXW09fwZTijJpdybITEp2c9zQKV5v30VM,11
|
|
9
|
+
ethspecify-0.3.2.dist-info/RECORD,,
|
|
@@ -1,351 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: ethspecify
|
|
3
|
-
Version: 0.2.4
|
|
4
|
-
Summary: A utility for processing Ethereum specification tags.
|
|
5
|
-
Home-page: https://github.com/jtraglia/ethspecify
|
|
6
|
-
Author: Justin Traglia
|
|
7
|
-
Author-email: jtraglia@pm.me
|
|
8
|
-
Classifier: Programming Language :: Python :: 3
|
|
9
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
-
Classifier: Operating System :: OS Independent
|
|
11
|
-
Requires-Python: >=3.6
|
|
12
|
-
Description-Content-Type: text/markdown
|
|
13
|
-
License-File: LICENSE
|
|
14
|
-
Requires-Dist: requests==2.32.3
|
|
15
|
-
Requires-Dist: PyYAML>=6.0
|
|
16
|
-
Dynamic: author
|
|
17
|
-
Dynamic: author-email
|
|
18
|
-
Dynamic: classifier
|
|
19
|
-
Dynamic: description
|
|
20
|
-
Dynamic: description-content-type
|
|
21
|
-
Dynamic: home-page
|
|
22
|
-
Dynamic: license-file
|
|
23
|
-
Dynamic: requires-dist
|
|
24
|
-
Dynamic: requires-python
|
|
25
|
-
Dynamic: summary
|
|
26
|
-
|
|
27
|
-
# ethspecify
|
|
28
|
-
|
|
29
|
-
A tool for referencing the Ethereum specifications in clients.
|
|
30
|
-
|
|
31
|
-
The idea is that ethspecify will help developers keep track of when the specification changes. It
|
|
32
|
-
will also help auditors verify that the client implementations match the specifications. Ideally,
|
|
33
|
-
this is configured as a CI check which notifies client developers when the specification changes.
|
|
34
|
-
When that happens, they can update the implementations appropriately.
|
|
35
|
-
|
|
36
|
-
## Getting Started
|
|
37
|
-
|
|
38
|
-
### Installation
|
|
39
|
-
|
|
40
|
-
```
|
|
41
|
-
python3 -mpip install ethspecify
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
### Adding Spec Tags
|
|
45
|
-
|
|
46
|
-
In your client, add HTML tags like this:
|
|
47
|
-
|
|
48
|
-
```
|
|
49
|
-
/*
|
|
50
|
-
* <spec fn="is_fully_withdrawable_validator" fork="deneb" />
|
|
51
|
-
*/
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
```
|
|
55
|
-
/*
|
|
56
|
-
* <spec ssz_object="BeaconState" fork="electra" style="diff" />
|
|
57
|
-
*/
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
### Populating Spec Tags
|
|
61
|
-
|
|
62
|
-
Then, navigate to your codebase and run `ethspecify`:
|
|
63
|
-
|
|
64
|
-
```
|
|
65
|
-
ethspecify
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
## Specification Options
|
|
69
|
-
|
|
70
|
-
### Version
|
|
71
|
-
|
|
72
|
-
This attribute specifies which version of the consensus specifications to use. Default is `nightly`.
|
|
73
|
-
|
|
74
|
-
- `nightly` (default) - Uses the latest nightly build from the master branch
|
|
75
|
-
- `v1.6.0-alpha.2`, `v1.6.0-alpha.3`, etc. - Uses a specific tagged release version
|
|
76
|
-
|
|
77
|
-
Example:
|
|
78
|
-
```
|
|
79
|
-
/*
|
|
80
|
-
* <spec fn="apply_deposit" fork="electra" version="v1.6.0-alpha.3" />
|
|
81
|
-
*/
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
### Fork
|
|
85
|
-
|
|
86
|
-
This attribute can be any of the [executable
|
|
87
|
-
specifications](https://github.com/ethereum/consensus-specs/blob/e6bddd966214a19d2b97199bbe3c02577a22a8b4/Makefile#L3-L15)
|
|
88
|
-
in the consensus-specs. At the time of writing, these are: phase0, altair, bellatrix, capella,
|
|
89
|
-
deneb, electra, fulu, whisk, eip6800, and eip7732.
|
|
90
|
-
|
|
91
|
-
### Style
|
|
92
|
-
|
|
93
|
-
This attribute can be used to change how the specification content is shown.
|
|
94
|
-
|
|
95
|
-
#### `hash` (default)
|
|
96
|
-
|
|
97
|
-
This style adds a hash of the specification content to the spec tag, without showing the content.
|
|
98
|
-
|
|
99
|
-
```
|
|
100
|
-
/*
|
|
101
|
-
* <spec fn="apply_deposit" fork="electra" hash="c723ce7b" />
|
|
102
|
-
*/
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
> [!NOTE]
|
|
106
|
-
> The hash is the first 8 characters of the specification content's SHA256 digest.
|
|
107
|
-
|
|
108
|
-
#### `full`
|
|
109
|
-
|
|
110
|
-
This style displays the whole content of this specification item, including comments.
|
|
111
|
-
|
|
112
|
-
```
|
|
113
|
-
/*
|
|
114
|
-
* <spec fn="is_fully_withdrawable_validator" fork="deneb" style="full">
|
|
115
|
-
* def is_fully_withdrawable_validator(validator: Validator, balance: Gwei, epoch: Epoch) -> bool:
|
|
116
|
-
* """
|
|
117
|
-
* Check if ``validator`` is fully withdrawable.
|
|
118
|
-
* """
|
|
119
|
-
* return (
|
|
120
|
-
* has_eth1_withdrawal_credential(validator)
|
|
121
|
-
* and validator.withdrawable_epoch <= epoch
|
|
122
|
-
* and balance > 0
|
|
123
|
-
* )
|
|
124
|
-
* </spec>
|
|
125
|
-
*/
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
#### `link`
|
|
129
|
-
|
|
130
|
-
This style displays a GitHub link to the specification item.
|
|
131
|
-
|
|
132
|
-
```
|
|
133
|
-
/*
|
|
134
|
-
* <spec fn="apply_pending_deposit" fork="electra" style="link" hash="83ee9126">
|
|
135
|
-
* https://github.com/ethereum/consensus-specs/blob/dev/specs/electra/beacon-chain.md#new-apply_pending_deposit
|
|
136
|
-
* </spec>
|
|
137
|
-
*/
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
#### `diff`
|
|
141
|
-
|
|
142
|
-
This style displays a diff with the previous fork's version of the specification.
|
|
143
|
-
|
|
144
|
-
```
|
|
145
|
-
/*
|
|
146
|
-
* <spec ssz_object="BeaconState" fork="electra" style="diff">
|
|
147
|
-
* --- deneb
|
|
148
|
-
* +++ electra
|
|
149
|
-
* @@ -27,3 +27,12 @@
|
|
150
|
-
* next_withdrawal_index: WithdrawalIndex
|
|
151
|
-
* next_withdrawal_validator_index: ValidatorIndex
|
|
152
|
-
* historical_summaries: List[HistoricalSummary, HISTORICAL_ROOTS_LIMIT]
|
|
153
|
-
* + deposit_requests_start_index: uint64
|
|
154
|
-
* + deposit_balance_to_consume: Gwei
|
|
155
|
-
* + exit_balance_to_consume: Gwei
|
|
156
|
-
* + earliest_exit_epoch: Epoch
|
|
157
|
-
* + consolidation_balance_to_consume: Gwei
|
|
158
|
-
* + earliest_consolidation_epoch: Epoch
|
|
159
|
-
* + pending_deposits: List[PendingDeposit, PENDING_DEPOSITS_LIMIT]
|
|
160
|
-
* + pending_partial_withdrawals: List[PendingPartialWithdrawal, PENDING_PARTIAL_WITHDRAWALS_LIMIT]
|
|
161
|
-
* + pending_consolidations: List[PendingConsolidation, PENDING_CONSOLIDATIONS_LIMIT]
|
|
162
|
-
* </spec>
|
|
163
|
-
*/
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
> [!NOTE]
|
|
167
|
-
> Comments are stripped from the specifications when the `diff` style is used. We do this because
|
|
168
|
-
> these complicate the diff; the "[Modified in Fork]" comments aren't valuable here.
|
|
169
|
-
|
|
170
|
-
This can be used with any specification item, like functions too:
|
|
171
|
-
|
|
172
|
-
```
|
|
173
|
-
/*
|
|
174
|
-
* <spec fn="is_eligible_for_activation_queue" fork="electra" style="diff">
|
|
175
|
-
* --- phase0
|
|
176
|
-
* +++ electra
|
|
177
|
-
* @@ -4,5 +4,5 @@
|
|
178
|
-
* """
|
|
179
|
-
* return (
|
|
180
|
-
* validator.activation_eligibility_epoch == FAR_FUTURE_EPOCH
|
|
181
|
-
* - and validator.effective_balance == MAX_EFFECTIVE_BALANCE
|
|
182
|
-
* + and validator.effective_balance >= MIN_ACTIVATION_BALANCE
|
|
183
|
-
* )
|
|
184
|
-
* </spec>
|
|
185
|
-
*/
|
|
186
|
-
```
|
|
187
|
-
|
|
188
|
-
## Supported Specification Items
|
|
189
|
-
|
|
190
|
-
### Constants
|
|
191
|
-
|
|
192
|
-
These are items found in the `Constants` section of the specifications.
|
|
193
|
-
|
|
194
|
-
```
|
|
195
|
-
/*
|
|
196
|
-
* <spec constant_var="COMPOUNDING_WITHDRAWAL_PREFIX" fork="electra" style="full">
|
|
197
|
-
* COMPOUNDING_WITHDRAWAL_PREFIX: Bytes1 = '0x02'
|
|
198
|
-
* </spec>
|
|
199
|
-
*/
|
|
200
|
-
```
|
|
201
|
-
|
|
202
|
-
### Custom Types
|
|
203
|
-
|
|
204
|
-
These are items found in the `Custom types` section of the specifications.
|
|
205
|
-
|
|
206
|
-
```
|
|
207
|
-
/*
|
|
208
|
-
* <spec custom_type="Blob" fork="electra" style="full">
|
|
209
|
-
* Blob = ByteVector[BYTES_PER_FIELD_ELEMENT * FIELD_ELEMENTS_PER_BLOB]
|
|
210
|
-
* </spec>
|
|
211
|
-
*/
|
|
212
|
-
```
|
|
213
|
-
|
|
214
|
-
### Preset Variables
|
|
215
|
-
|
|
216
|
-
These are items found in the
|
|
217
|
-
[`presets`](https://github.com/ethereum/consensus-specs/tree/dev/presets) directory.
|
|
218
|
-
|
|
219
|
-
For preset variables, in addition to the `preset_var` attribute, you can specify a `preset`
|
|
220
|
-
attribute: minimal or mainnet.
|
|
221
|
-
|
|
222
|
-
```
|
|
223
|
-
/*
|
|
224
|
-
* <spec preset="minimal" preset_var="PENDING_CONSOLIDATIONS_LIMIT" fork="electra" style="full">
|
|
225
|
-
* PENDING_CONSOLIDATIONS_LIMIT: uint64 = 64
|
|
226
|
-
* </spec>
|
|
227
|
-
*
|
|
228
|
-
* <spec preset="mainnet" preset_var="PENDING_CONSOLIDATIONS_LIMIT" fork="electra" style="full">
|
|
229
|
-
* PENDING_CONSOLIDATIONS_LIMIT: uint64 = 262144
|
|
230
|
-
* </spec>
|
|
231
|
-
*/
|
|
232
|
-
```
|
|
233
|
-
|
|
234
|
-
It's not strictly necessary to specify the preset attribute. The default preset is mainnet.
|
|
235
|
-
|
|
236
|
-
```
|
|
237
|
-
/*
|
|
238
|
-
* <spec preset_var="FIELD_ELEMENTS_PER_BLOB" fork="electra" style="full">
|
|
239
|
-
* FIELD_ELEMENTS_PER_BLOB: uint64 = 4096
|
|
240
|
-
* </spec>
|
|
241
|
-
*/
|
|
242
|
-
```
|
|
243
|
-
|
|
244
|
-
### Config Variables
|
|
245
|
-
|
|
246
|
-
These are items found in the
|
|
247
|
-
[`configs`](https://github.com/ethereum/consensus-specs/tree/dev/presets) directory.
|
|
248
|
-
|
|
249
|
-
```
|
|
250
|
-
/*
|
|
251
|
-
* <spec config_var="MAX_REQUEST_BLOB_SIDECARS" fork="electra" style="full">
|
|
252
|
-
* MAX_REQUEST_BLOB_SIDECARS = 768
|
|
253
|
-
* </spec>
|
|
254
|
-
*/
|
|
255
|
-
```
|
|
256
|
-
|
|
257
|
-
### SSZ Objects
|
|
258
|
-
|
|
259
|
-
These are items found in the `Containers` section of the specifications.
|
|
260
|
-
|
|
261
|
-
```
|
|
262
|
-
/*
|
|
263
|
-
* <spec ssz_object="ConsolidationRequest" fork="electra" style="full">
|
|
264
|
-
* class ConsolidationRequest(Container):
|
|
265
|
-
* source_address: ExecutionAddress
|
|
266
|
-
* source_pubkey: BLSPubkey
|
|
267
|
-
* target_pubkey: BLSPubkey
|
|
268
|
-
* </spec>
|
|
269
|
-
*/
|
|
270
|
-
```
|
|
271
|
-
|
|
272
|
-
### Dataclasses
|
|
273
|
-
|
|
274
|
-
These are classes with the `@dataclass` decorator.
|
|
275
|
-
|
|
276
|
-
```
|
|
277
|
-
/*
|
|
278
|
-
* <spec dataclass="PayloadAttributes" fork="electra" style="full">
|
|
279
|
-
* class PayloadAttributes(object):
|
|
280
|
-
* timestamp: uint64
|
|
281
|
-
* prev_randao: Bytes32
|
|
282
|
-
* suggested_fee_recipient: ExecutionAddress
|
|
283
|
-
* withdrawals: Sequence[Withdrawal]
|
|
284
|
-
* parent_beacon_block_root: Root # [New in Deneb:EIP4788]
|
|
285
|
-
* </spec>
|
|
286
|
-
*/
|
|
287
|
-
```
|
|
288
|
-
|
|
289
|
-
### Functions
|
|
290
|
-
|
|
291
|
-
These are all the functions found in the specifications.
|
|
292
|
-
|
|
293
|
-
For example, two versions of the same function:
|
|
294
|
-
|
|
295
|
-
```
|
|
296
|
-
/*
|
|
297
|
-
* <spec fn="is_fully_withdrawable_validator" fork="deneb" style="full">
|
|
298
|
-
* def is_fully_withdrawable_validator(validator: Validator, balance: Gwei, epoch: Epoch) -> bool:
|
|
299
|
-
* """
|
|
300
|
-
* Check if ``validator`` is fully withdrawable.
|
|
301
|
-
* """
|
|
302
|
-
* return (
|
|
303
|
-
* has_eth1_withdrawal_credential(validator)
|
|
304
|
-
* and validator.withdrawable_epoch <= epoch
|
|
305
|
-
* and balance > 0
|
|
306
|
-
* )
|
|
307
|
-
* </spec>
|
|
308
|
-
*/
|
|
309
|
-
```
|
|
310
|
-
|
|
311
|
-
```
|
|
312
|
-
/*
|
|
313
|
-
* <spec fn="is_fully_withdrawable_validator" fork="electra" style="full">
|
|
314
|
-
* def is_fully_withdrawable_validator(validator: Validator, balance: Gwei, epoch: Epoch) -> bool:
|
|
315
|
-
* """
|
|
316
|
-
* Check if ``validator`` is fully withdrawable.
|
|
317
|
-
* """
|
|
318
|
-
* return (
|
|
319
|
-
* has_execution_withdrawal_credential(validator) # [Modified in Electra:EIP7251]
|
|
320
|
-
* and validator.withdrawable_epoch <= epoch
|
|
321
|
-
* and balance > 0
|
|
322
|
-
* )
|
|
323
|
-
* </spec>
|
|
324
|
-
*/
|
|
325
|
-
```
|
|
326
|
-
|
|
327
|
-
With functions, it's possible to specify which line/lines should be displayed. For example:
|
|
328
|
-
|
|
329
|
-
```
|
|
330
|
-
/*
|
|
331
|
-
* <spec fn="is_fully_withdrawable_validator" fork="electra" style="full" lines="5-9">
|
|
332
|
-
* return (
|
|
333
|
-
* has_execution_withdrawal_credential(validator) # [Modified in Electra:EIP7251]
|
|
334
|
-
* and validator.withdrawable_epoch <= epoch
|
|
335
|
-
* and balance > 0
|
|
336
|
-
* )
|
|
337
|
-
* </spec>
|
|
338
|
-
*/
|
|
339
|
-
```
|
|
340
|
-
|
|
341
|
-
Note that the content is automatically dedented.
|
|
342
|
-
|
|
343
|
-
Or, to display just a single line, only specify a single number. For example:
|
|
344
|
-
|
|
345
|
-
```
|
|
346
|
-
/*
|
|
347
|
-
* <spec fn="is_fully_withdrawable_validator" fork="electra" style="full" lines="6">
|
|
348
|
-
* has_execution_withdrawal_credential(validator) # [Modified in Electra:EIP7251]
|
|
349
|
-
* </spec>
|
|
350
|
-
*/
|
|
351
|
-
```
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
ethspecify/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
ethspecify/cli.py,sha256=SZ47-lgfeDHmzXCE-rx8ydM66N9NfNAA2GDxoC4DE7E,7641
|
|
3
|
-
ethspecify/core.py,sha256=kOu8avxvFnDt8uRuIK4bbl0zjIciXk_8jvlE1cu23J0,37884
|
|
4
|
-
ethspecify-0.2.4.dist-info/licenses/LICENSE,sha256=Awxsr73mm9YMBVhBYnzeI7bNdRd-bH6RDtO5ItG0DaM,1071
|
|
5
|
-
ethspecify-0.2.4.dist-info/METADATA,sha256=DzopppX63lH3ykj6H1nq5mNbRV1mA1XkhAX8bzJhkVw,9212
|
|
6
|
-
ethspecify-0.2.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
7
|
-
ethspecify-0.2.4.dist-info/entry_points.txt,sha256=09viGkCg9J3h0c9BFRN-BKaJUEaIc4JyULNgBP5EL_g,51
|
|
8
|
-
ethspecify-0.2.4.dist-info/top_level.txt,sha256=0klaMvlVyOkXW09fwZTijJpdybITEp2c9zQKV5v30VM,11
|
|
9
|
-
ethspecify-0.2.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|