Skip to content

Commit

Permalink
Fix case where slot equals finalized block slot
Browse files Browse the repository at this point in the history
  • Loading branch information
nflaig committed Apr 9, 2024
1 parent 8e53054 commit 98ab107
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/beacon-node/src/chain/chain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ export class BeaconChain implements IBeaconChain {
{dontTransferCache: true},
RegenCaller.restApi
);
return {state, executionOptimistic: isOptimisticBlock(block), finalized: false};
return {state, executionOptimistic: isOptimisticBlock(block), finalized: slot === finalizedBlock.slot};
} else {
// Just check if state is already in the cache. If it's not dialed to the correct slot,
// do not bother in advancing the state. restApiCanTriggerRegen == false means do no work
Expand All @@ -427,7 +427,7 @@ export class BeaconChain implements IBeaconChain {
}

const state = this.regen.getStateSync(block.stateRoot);
return state && {state, executionOptimistic: isOptimisticBlock(block), finalized: false};
return state && {state, executionOptimistic: isOptimisticBlock(block), finalized: slot === finalizedBlock.slot};
}
} else {
// request for finalized state
Expand Down

0 comments on commit 98ab107

Please sign in to comment.