Skip to content

Commit

Permalink
rename to kzg_commitment_inclusion_proof
Browse files Browse the repository at this point in the history
  • Loading branch information
dapplion committed Nov 1, 2023
1 parent 7f63f00 commit 4a609ce
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions specs/deneb/p2p-interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class BlobSidecar(Container):
kzg_commitment: KZGCommitment
kzg_proof: KZGProof # Allows for quick verification of kzg_commitment
signed_block_header: SignedBeaconBlockHeader
commitment_inclusion_proof: Vector[Bytes32, KZG_COMMITMENT_INCLUSION_PROOF_DEPTH]
kzg_commitment_inclusion_proof: Vector[Bytes32, KZG_COMMITMENT_INCLUSION_PROOF_DEPTH]
```

#### `BlobIdentifier`
Expand All @@ -104,7 +104,7 @@ def verify_blob_sidecar_inclusion_proof(blob_sidecar: BlobSidecar) -> bool:
gindex = get_generalized_index(BeaconBlockBody, 'blob_kzg_commitments', blob_sidecar.index)
return is_valid_merkle_branch(
leaf=blob_sidecar.kzg_commitment.hash_tree_root(),
branch=blob_sidecar.commitment_inclusion_proof,
branch=blob_sidecar.kzg_commitment_inclusion_proof,
depth=floorlog2(gindex),
index=get_subtree_index(gindex),
root=blob_sidecar.signed_block_header.message.body_root,
Expand Down
2 changes: 1 addition & 1 deletion specs/deneb/validator.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def get_blob_sidecars(signed_block: SignedBeaconBlock,
kzg_commitment=block.body.blob_kzg_commitments[index],
kzg_proof=blob_kzg_proofs[index],
signed_block_header=signed_block_header,
commitment_inclusion_proof=compute_merkle_proof(
kzg_commitment_inclusion_proof=compute_merkle_proof(
block.body,
get_generalized_index(BeaconBlockBody, 'blob_kzg_commitments', index),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,16 @@ def test_blob_kzg_commitment_merkle_proof(spec, state):
blob_sidecar = blob_sidecars[blob_index]

yield "object", block.body
commitment_inclusion_proof = blob_sidecar.commitment_inclusion_proof
kzg_commitment_inclusion_proof = blob_sidecar.kzg_commitment_inclusion_proof
gindex = spec.get_generalized_index(spec.BeaconBlockBody, 'blob_kzg_commitments', blob_index)
yield "proof", {
"leaf": "0x" + blob_sidecar.kzg_commitment.hash_tree_root().hex(),
"leaf_index": gindex,
"branch": ['0x' + root.hex() for root in commitment_inclusion_proof]
"branch": ['0x' + root.hex() for root in kzg_commitment_inclusion_proof]
}
assert spec.is_valid_merkle_branch(
leaf=blob_sidecar.kzg_commitment.hash_tree_root(),
branch=blob_sidecar.commitment_inclusion_proof,
branch=blob_sidecar.kzg_commitment_inclusion_proof,
depth=spec.floorlog2(gindex),
index=spec.get_subtree_index(gindex),
root=blob_sidecar.signed_block_header.message.body_root,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,5 @@ def test_blob_sidecar_inclusion_proof_incorrect_wrong_proof(spec, state):

for blob_sidecar in blob_sidecars:
# wrong proof
blob_sidecar.commitment_inclusion_proof = spec.compute_merkle_proof(spec.BeaconBlockBody(), 0)
blob_sidecar.kzg_commitment_inclusion_proof = spec.compute_merkle_proof(spec.BeaconBlockBody(), 0)
assert not spec.verify_blob_sidecar_inclusion_proof(blob_sidecar)

0 comments on commit 4a609ce

Please sign in to comment.