Skip to content

Commit

Permalink
Fixed comments (#422)
Browse files Browse the repository at this point in the history
* fix: fixed comment

* fix: removed dead space

* fix: removed extraneous the

* fix: edited another comment
  • Loading branch information
Sidu28 authored Feb 6, 2024
1 parent 2071ffa commit 607f69a
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/contracts/libraries/BeaconChainProofs.sol
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ library BeaconChainProofs {
"BeaconChainProofs.verifyWithdrawal: historicalSummaryIndex is too large"
);

//Note: post deneb hard fork, the exection payload header fields increased, adding an extra level to the tree height
//Note: post deneb hard fork, the number of exection payload header fields increased from 15->17, adding an extra level to the tree height
uint256 executionPayloadHeaderFieldTreeHeight = (getWithdrawalTimestamp(withdrawalProof) < denebForkTimestamp) ? EXECUTION_PAYLOAD_HEADER_FIELD_TREE_HEIGHT_CAPELLA : EXECUTION_PAYLOAD_HEADER_FIELD_TREE_HEIGHT_DENEB;
require(
withdrawalProof.withdrawalProof.length ==
Expand Down Expand Up @@ -325,12 +325,9 @@ library BeaconChainProofs {

{
/**
* Next we verify the withdrawal fields against the blockRoot:
* First we compute the withdrawal_index relative to the blockRoot by concatenating the indexes of all the
* intermediate root indexes from the bottom of the sub trees (the withdrawal container) to the top, the blockRoot.
* Then we calculate merkleize the withdrawalFields container to calculate the the withdrawalRoot.
* Finally we verify the withdrawalRoot against the executionPayloadRoot.
*
* Next we verify the withdrawal fields against the executionPayloadRoot:
* First we compute the withdrawal_index, then we merkleize the
* withdrawalFields container to calculate the withdrawalRoot.
*
* Note: Merkleization of the withdrawals root tree uses MerkleizeWithMixin, i.e., the length of the array is hashed with the root of
* the array. Thus we shift the WITHDRAWALS_INDEX over by WITHDRAWALS_TREE_HEIGHT + 1 and not just WITHDRAWALS_TREE_HEIGHT.
Expand Down

0 comments on commit 607f69a

Please sign in to comment.