Skip to content

Commit

Permalink
fix: clone states to compute block rewards
Browse files Browse the repository at this point in the history
  • Loading branch information
twoeths committed Feb 20, 2024
1 parent 719ab1d commit 51bbf5e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/beacon-node/src/chain/chain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1001,6 +1001,6 @@ export class BeaconChain implements IBeaconChain {
throw Error(`Pre-state is unavailable given block's parent root ${toHexString(block.parentRoot)}`);
}

return computeBlockRewards(block, preState, postState);
return computeBlockRewards(block, preState.clone(), postState?.clone());
}
}
1 change: 1 addition & 0 deletions packages/beacon-node/src/chain/rewards/blockRewards.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ function computeSyncAggregateReward(block: altair.BeaconBlock, preState: CachedB
return 0; // phase0 block does not have syncAggregate
}
}

/**
* Calculate rewards received by block proposer for including proposer slashings.
* All proposer slashing rewards go to block proposer and none to whistleblower as of Deneb
Expand Down

0 comments on commit 51bbf5e

Please sign in to comment.