Commit 148b89a
authored
fix: resolve tree hash calculation for IndexedAttestation and Attestation types (#698)
* fix: resolve tree hash calculation for IndexedAttestation and Attestation types
Fixed incorrect variant ordering in superstruct definitions that was causing
tree hash mismatches for beacon blocks. The Electra variant must be listed
first before Base variant to ensure proper deserialization and hash calculation.
Changes made:
- Reordered IndexedAttestation variants to list Electra before Base
- Reordered Attestation variants to list Electra before Base
- Added test case for slot 12557247 to verify tree hash calculation
- Added reqwest and serde_json dependencies for the new test
This resolves issues with beacon block hash verification where the calculated
tree hash did not match the expected value.
* fmt1 parent eda05b3 commit 148b89a
File tree
4 files changed
+163
-28
lines changed- ethereum/consensus-core
- src/types
- tests
4 files changed
+163
-28
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
| 41 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
277 | 277 | | |
278 | 278 | | |
279 | 279 | | |
280 | | - | |
| 280 | + | |
281 | 281 | | |
282 | 282 | | |
283 | 283 | | |
| |||
288 | 288 | | |
289 | 289 | | |
290 | 290 | | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
| 291 | + | |
295 | 292 | | |
296 | 293 | | |
297 | 294 | | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
298 | 298 | | |
299 | 299 | | |
300 | 300 | | |
| |||
306 | 306 | | |
307 | 307 | | |
308 | 308 | | |
309 | | - | |
| 309 | + | |
310 | 310 | | |
311 | 311 | | |
312 | 312 | | |
| |||
318 | 318 | | |
319 | 319 | | |
320 | 320 | | |
321 | | - | |
322 | | - | |
323 | 321 | | |
324 | 322 | | |
| 323 | + | |
| 324 | + | |
325 | 325 | | |
326 | 326 | | |
327 | 327 | | |
| |||
0 commit comments