Skip to content

Commit

Permalink
Return the correct light client payload proof (#14565)
Browse files Browse the repository at this point in the history
* Return the correct payload proof

* changelog <3
  • Loading branch information
rkapka committed Nov 3, 2024
1 parent 7a0862e commit 4e5f72b
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions consensus-types/blocks/proofs.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,23 +240,13 @@ func PayloadProof(ctx context.Context, block interfaces.ReadOnlyBeaconBlock) ([]
return nil, errors.New("failed to cast block body")
}

blockBodyFieldRoots, err := ComputeBlockBodyFieldRoots(ctx, blockBody)
fieldRoots, err := ComputeBlockBodyFieldRoots(ctx, blockBody)
if err != nil {
return nil, err
}

blockBodyFieldRootsTrie := stateutil.Merkleize(blockBodyFieldRoots)
blockBodyProof := trie.ProofFromMerkleLayers(blockBodyFieldRootsTrie, payloadFieldIndex)
fieldRootsTrie := stateutil.Merkleize(fieldRoots)
proof := trie.ProofFromMerkleLayers(fieldRootsTrie, payloadFieldIndex)

beaconBlockFieldRoots, err := ComputeBlockFieldRoots(ctx, block)
if err != nil {
return nil, err
}

beaconBlockFieldRootsTrie := stateutil.Merkleize(beaconBlockFieldRoots)
beaconBlockProof := trie.ProofFromMerkleLayers(beaconBlockFieldRootsTrie, bodyFieldIndex)

finalProof := append(blockBodyProof, beaconBlockProof...)

return finalProof, nil
return proof, nil
}

0 comments on commit 4e5f72b

Please sign in to comment.