From 4a609cec574eca635a9e0980fe448089f8690ce1 Mon Sep 17 00:00:00 2001 From: dapplion <35266934+dapplion@users.noreply.github.com> Date: Wed, 1 Nov 2023 15:57:41 +0200 Subject: [PATCH] rename to kzg_commitment_inclusion_proof --- specs/deneb/p2p-interface.md | 4 ++-- specs/deneb/validator.md | 2 +- .../test/deneb/merkle_proof/test_single_merkle_proof.py | 6 +++--- .../test/deneb/unittests/validator/test_validator.py | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/specs/deneb/p2p-interface.md b/specs/deneb/p2p-interface.md index 2cfdcde74..748a3f0d8 100644 --- a/specs/deneb/p2p-interface.md +++ b/specs/deneb/p2p-interface.md @@ -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` @@ -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, diff --git a/specs/deneb/validator.md b/specs/deneb/validator.md index 3dc2e90f0..3e2c91f81 100644 --- a/specs/deneb/validator.md +++ b/specs/deneb/validator.md @@ -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), ), diff --git a/tests/core/pyspec/eth2spec/test/deneb/merkle_proof/test_single_merkle_proof.py b/tests/core/pyspec/eth2spec/test/deneb/merkle_proof/test_single_merkle_proof.py index bcc25a89d..75bcacc7f 100644 --- a/tests/core/pyspec/eth2spec/test/deneb/merkle_proof/test_single_merkle_proof.py +++ b/tests/core/pyspec/eth2spec/test/deneb/merkle_proof/test_single_merkle_proof.py @@ -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, diff --git a/tests/core/pyspec/eth2spec/test/deneb/unittests/validator/test_validator.py b/tests/core/pyspec/eth2spec/test/deneb/unittests/validator/test_validator.py index 77ae90067..7ed88cba4 100644 --- a/tests/core/pyspec/eth2spec/test/deneb/unittests/validator/test_validator.py +++ b/tests/core/pyspec/eth2spec/test/deneb/unittests/validator/test_validator.py @@ -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)