Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions packages/beacon-node/test/spec/utils/specTestIterator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,6 @@ export const defaultSkipOpts: SkipOpts = {
// TODO-GLOAS: re-enable after gloas light client is implemented
/\/gloas_fork$/,
/\/heze_fork$/,
// TODO GLOAS: Proposer-boost dependent-root gate uses stale cached head across epoch-boundary ticks;
// boost wrongly denied. Fails identically on every pre-gloas fork.
// Enable this after https://github.com/ChainSafe/lodestar/issues/9666 is resolved
// The case name embeds the generation seed, so it changes whenever comptests are regenerated.
/fork_choice_compliance\/block_tree_test\/pyspec_tests\/block_tree_test_17_381675768_1$/,
// TODO GLOAS: gloas/heze take ~23-24s on the mainnet preset (~7.5x pre-gloas) because every
// post-gloas slot writes into the SLOTS_PER_HISTORICAL_ROOT-wide executionPayloadAvailability
// bitvector, and this suite steps 8192 slots. That is 76-81% of the 30s sanity/slots timeout,
Expand Down
14 changes: 11 additions & 3 deletions packages/fork-choice/src/forkChoice/forkChoice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,7 @@ export class ForkChoice implements IForkChoice {
isTimely &&
// only boost the first block we see
this.proposerBoostRoot === null &&
this.isProposerBoostSameDependentRoot(this.head.blockRoot, parentRootHex);
this.isProposerBoostSameDependentRoot(parentRootHex);
// Candidate boost root used for protoArray.onBlock's best-child weighting. Committed to the
// store only after the insertion succeeds.
const proposerBoostRoot = isProposerBoostBlock ? blockRootHex : this.proposerBoostRoot;
Expand Down Expand Up @@ -1565,17 +1565,25 @@ export class ForkChoice implements IForkChoice {
* The block is not yet in the proto-array when this runs, so its dependent root is traced from
* its parent
*/
private isProposerBoostSameDependentRoot(headRootHex: RootHex, blockParentRootHex: RootHex): boolean {
private isProposerBoostSameDependentRoot(blockParentRootHex: RootHex): boolean {
const epoch = computeEpochAtSlot(this.fcStore.currentSlot);
// Genesis block parent
if (epoch <= MIN_SEED_LOOKAHEAD) {
return true;
}

const dependentSlot = computeStartSlotAtEpoch(epoch - MIN_SEED_LOOKAHEAD) - 1;
const justifiedRootHex = this.fcStore.justified.checkpoint.rootHex;
const justifiedBlock = this.protoArray.getNodeDefaultStatus(justifiedRootHex);
// Every viable head descends from the justified checkpoint. If that block is at or after the
// dependent slot, its dependent root is canonical without recomputing fork choice.
const headRootHex =
justifiedBlock !== undefined && justifiedBlock.slot >= dependentSlot
? justifiedRootHex
: this.updateHead().blockRoot;
const headDependentRoot = this.protoArray.getAncestorOrNull(headRootHex, dependentSlot)?.blockRoot;
const blockDependentRoot = this.protoArray.getAncestorOrNull(blockParentRootHex, dependentSlot)?.blockRoot;
// On lookup failure, we lean on the conservative side and withold the boost
// On lookup failure, we lean on the conservative side and withhold the boost
if (headDependentRoot === undefined || blockDependentRoot === undefined) {
return false;
}
Expand Down
Loading