Commit 2740f92
authored
fix: correct proposer boost logic and getParentNodeIndex for gloas (#9165)
**Motivation**
Two fork-choice bugs in the Gloas (ePBS) protoArray implementation:
1. **Proposer boost double-counting** — In Gloas, PENDING/EMPTY/FULL
variants share the same blockRoot. The proposer boost was applied to
every matching variant, causing a 2x boost that propagated up to PENDING
via delta back-propagation.
2. **getParentNodeIndex() crash at finalized boundary** —
getParentPayloadStatus() throws UNKNOWN_PARENT_BLOCK when traversal
reaches the finalized ProtoBlock (whose parent has been pruned). This
caused unexpected errors during score propagation and ancestor
iteration.
**Description**
- Only apply proposer boost to the EMPTY variant (for Gloas) or FULL
(for pre-Gloas) — the variant that validator votes target — to avoid
double-counting.
- Catch UNKNOWN_PARENT_BLOCK in getParentNodeIndex() and return
undefined (consistent with the method's number | undefined return type),
re-throw all other errors.
**AI Assistance Disclosure**
Used Claude Code to assist with the PR creation.
---------
Co-authored-by: Tuyen Nguyen <[email protected]>1 parent aef3645 commit 2740f92
1 file changed
Lines changed: 18 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
362 | 362 | | |
363 | 363 | | |
364 | 364 | | |
365 | | - | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
366 | 372 | | |
367 | | - | |
| 373 | + | |
368 | 374 | | |
369 | 375 | | |
370 | 376 | | |
| |||
1486 | 1492 | | |
1487 | 1493 | | |
1488 | 1494 | | |
1489 | | - | |
1490 | | - | |
1491 | | - | |
| 1495 | + | |
| 1496 | + | |
| 1497 | + | |
| 1498 | + | |
| 1499 | + | |
| 1500 | + | |
| 1501 | + | |
| 1502 | + | |
| 1503 | + | |
| 1504 | + | |
1492 | 1505 | | |
1493 | 1506 | | |
1494 | 1507 | | |
| |||
0 commit comments