Commit 8a3df1d
authored
Fix payload availability lookup using the parent block's slot (#5473)
In `get_attestation_participation_flag_indices`, the payload
availability bit was looked up at `data.slot`, which is not the slot of
the attested block when there are skipped slots. As a result, an
attestation to a skipped slot with `data.index == 1` always failed
payload matching and missed out on the timely head reward.
Since the timely head flag requires both the minimum inclusion delay and
a head root that matches the block root at the attestation slot, an
attestation can only receive the flag if it attests to the parent block
of the block that includes it. The availability bit for the attested
block therefore lives at the parent block's slot, which
`process_execution_payload_bid` now returns (read from the bid in the
state before it is overwritten) and `process_block` passes down to
`process_attestation`.
This is a loop-free alternative to #5442, as suggested in
#5442 (comment).
Unlike the walk back through the historical block roots, there is no
special case when the attested block is more than
`SLOTS_PER_HISTORICAL_ROOT` slots old. The availability bit at the
parent block's slot is always up to date, because the including block's
parent payload processing is what last wrote it.
Fixes #5399.1 parent b87d580 commit 8a3df1d
5 files changed
Lines changed: 130 additions & 28 deletions
File tree
- specs/gloas
- tests/core/pyspec/eth_consensus_specs/test
- gloas/block_processing
- helpers
- phase0/sanity
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
872 | 872 | | |
873 | 873 | | |
874 | 874 | | |
875 | | - | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
876 | 882 | | |
877 | 883 | | |
878 | 884 | | |
879 | | - | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
880 | 890 | | |
881 | 891 | | |
882 | 892 | | |
| |||
898 | 908 | | |
899 | 909 | | |
900 | 910 | | |
901 | | - | |
| 911 | + | |
902 | 912 | | |
903 | 913 | | |
904 | 914 | | |
| |||
1251 | 1261 | | |
1252 | 1262 | | |
1253 | 1263 | | |
1254 | | - | |
| 1264 | + | |
1255 | 1265 | | |
1256 | 1266 | | |
1257 | 1267 | | |
1258 | | - | |
| 1268 | + | |
1259 | 1269 | | |
1260 | 1270 | | |
1261 | 1271 | | |
| |||
1607 | 1617 | | |
1608 | 1618 | | |
1609 | 1619 | | |
| 1620 | + | |
| 1621 | + | |
| 1622 | + | |
| 1623 | + | |
1610 | 1624 | | |
1611 | 1625 | | |
1612 | 1626 | | |
1613 | | - | |
| 1627 | + | |
1614 | 1628 | | |
1615 | 1629 | | |
1616 | 1630 | | |
| |||
1658 | 1672 | | |
1659 | 1673 | | |
1660 | 1674 | | |
| 1675 | + | |
| 1676 | + | |
| 1677 | + | |
1661 | 1678 | | |
1662 | 1679 | | |
| 1680 | + | |
| 1681 | + | |
1663 | 1682 | | |
1664 | 1683 | | |
1665 | 1684 | | |
1666 | 1685 | | |
1667 | 1686 | | |
1668 | 1687 | | |
1669 | | - | |
1670 | | - | |
| 1688 | + | |
| 1689 | + | |
| 1690 | + | |
1671 | 1691 | | |
1672 | 1692 | | |
1673 | 1693 | | |
1674 | | - | |
| 1694 | + | |
| 1695 | + | |
| 1696 | + | |
| 1697 | + | |
| 1698 | + | |
| 1699 | + | |
1675 | 1700 | | |
1676 | 1701 | | |
1677 | | - | |
| 1702 | + | |
| 1703 | + | |
1678 | 1704 | | |
1679 | | - | |
| 1705 | + | |
1680 | 1706 | | |
1681 | 1707 | | |
1682 | 1708 | | |
| |||
1690 | 1716 | | |
1691 | 1717 | | |
1692 | 1718 | | |
1693 | | - | |
| 1719 | + | |
1694 | 1720 | | |
1695 | 1721 | | |
1696 | 1722 | | |
| |||
1827 | 1853 | | |
1828 | 1854 | | |
1829 | 1855 | | |
1830 | | - | |
| 1856 | + | |
| 1857 | + | |
1831 | 1858 | | |
1832 | 1859 | | |
1833 | | - | |
| 1860 | + | |
| 1861 | + | |
| 1862 | + | |
| 1863 | + | |
| 1864 | + | |
| 1865 | + | |
1834 | 1866 | | |
1835 | 1867 | | |
1836 | 1868 | | |
| |||
1855 | 1887 | | |
1856 | 1888 | | |
1857 | 1889 | | |
| 1890 | + | |
1858 | 1891 | | |
1859 | | - | |
| 1892 | + | |
1860 | 1893 | | |
1861 | 1894 | | |
1862 | 1895 | | |
| |||
Lines changed: 58 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| 12 | + | |
11 | 13 | | |
12 | 14 | | |
13 | 15 | | |
| |||
348 | 350 | | |
349 | 351 | | |
350 | 352 | | |
351 | | - | |
352 | | - | |
353 | | - | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
354 | 357 | | |
355 | 358 | | |
356 | 359 | | |
357 | 360 | | |
358 | | - | |
359 | | - | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
360 | 366 | | |
361 | 367 | | |
362 | 368 | | |
| |||
388 | 394 | | |
389 | 395 | | |
390 | 396 | | |
391 | | - | |
392 | | - | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
393 | 402 | | |
394 | 403 | | |
395 | 404 | | |
| |||
411 | 420 | | |
412 | 421 | | |
413 | 422 | | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
414 | 461 | | |
415 | 462 | | |
416 | 463 | | |
| |||
438 | 485 | | |
439 | 486 | | |
440 | 487 | | |
441 | | - | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
442 | 492 | | |
443 | 493 | | |
444 | 494 | | |
| |||
Lines changed: 12 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
21 | 30 | | |
22 | 31 | | |
23 | 32 | | |
| |||
33 | 42 | | |
34 | 43 | | |
35 | 44 | | |
36 | | - | |
| 45 | + | |
37 | 46 | | |
38 | 47 | | |
39 | 48 | | |
| |||
42 | 51 | | |
43 | 52 | | |
44 | 53 | | |
45 | | - | |
| 54 | + | |
46 | 55 | | |
47 | 56 | | |
48 | 57 | | |
| |||
253 | 262 | | |
254 | 263 | | |
255 | 264 | | |
256 | | - | |
| 265 | + | |
257 | 266 | | |
258 | 267 | | |
259 | 268 | | |
| |||
Lines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
1 | 4 | | |
2 | 5 | | |
3 | 6 | | |
| |||
19 | 22 | | |
20 | 23 | | |
21 | 24 | | |
22 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
23 | 28 | | |
24 | 29 | | |
25 | 30 | | |
| |||
Lines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
188 | | - | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
189 | 194 | | |
190 | 195 | | |
191 | 196 | | |
| |||
0 commit comments