From 03f4b8fa4dbb0f5de4541cf435fee8b5a5badc0c Mon Sep 17 00:00:00 2001 From: Dankrad Feist Date: Fri, 27 Jan 2023 14:23:38 +0000 Subject: [PATCH 01/29] Add KZG multi verify function --- specs/eip4844/polynomial-commitments.md | 98 +++++++++++++++++++++++-- 1 file changed, 93 insertions(+), 5 deletions(-) diff --git a/specs/eip4844/polynomial-commitments.md b/specs/eip4844/polynomial-commitments.md index 9a0500d96..8ef1fc419 100644 --- a/specs/eip4844/polynomial-commitments.md +++ b/specs/eip4844/polynomial-commitments.md @@ -83,6 +83,7 @@ Public functions MUST accept raw bytes as input and perform the required cryptog | - | - | | `FIELD_ELEMENTS_PER_BLOB` | `uint64(4096)` | | `FIAT_SHAMIR_PROTOCOL_DOMAIN` | `b'FSBLOBVERIFY_V1_'` | +| `RANDOM_CHALLENGE_KZG_MULTI_DOMAIN` | `b'RCKZGMULTI___V1_'` | ### Crypto @@ -414,6 +415,51 @@ def verify_kzg_proof_impl(commitment: KZGCommitment, ]) ``` +#### `verify_kzg_proof_multi` + +```python +def verify_kzg_proof_multi(commitments: Sequence[KZGCommitment], + zs: Sequence[BLSFieldElement], + ys: Sequence[BLSFieldElement], + proofs: Sequence[KZGProof]) -> bool: + """ + Verify multiple KZG proofs efficiently. + """ + + assert len(commitments) == len(zs) == len(ys) == len(proofs) + + # Compute a random challenge. Note that it does not have to be computed from a hash, + # r just has to be random. + degree_poly = int.to_bytes(FIELD_ELEMENTS_PER_BLOB, 8, ENDIANNESS) + num_commitments = int.to_bytes(len(commitments), 8, ENDIANNESS) + data = RANDOM_CHALLENGE_KZG_MULTI_DOMAIN + degree_poly + num_commitments + + # Append each polynomial which is composed by field elements + for commitment, z, y, proof in zip(commitments, zs, ys, proofs): + data += commitment \ + + int.to_bytes(z, BYTES_PER_FIELD_ELEMENT, ENDIANNESS) \ + + int.to_bytes(y, BYTES_PER_FIELD_ELEMENT, ENDIANNESS) \ + + proof + + hashed_data = hash(data) + r = hash_to_bls_field(hashed_data + b'\x00') + r_powers = compute_powers(r, len(commitments)) + + # Verify: e(sum r^i proof_i, [s]) == + # e(sum r^i (commitment_i - [y_i]) + sum r^i z_i proof_i, [1]) + proof_lincomb = g1_lincomb(proofs, r_powers) + proof_z_lincomb = g1_lincomb(proofs, [z * r_power for z, r_power in zip(zs, r_powers)]) + C_minus_ys = [bls.G1_to_bytes48(bls.add(bls.bytes48_to_G1(commitment), bls.multiply(bls.G1, BLS_MODULUS - y))) + for commitment, y in zip(commitments, ys)] + C_minus_y_as_KZGCommitments = [KZGCommitment(x) for x in C_minus_ys] + C_minus_y_lincomb = g1_lincomb(C_minus_y_as_KZGCommitments, r_powers) + + return bls.pairing_check([ + [proof_lincomb, bls.neg(KZG_SETUP_G2[1])], + [bls.add(C_minus_y_lincomb, proof_z_lincomb), bls.G2] + ]) +``` + #### `compute_kzg_proof` ```python @@ -491,12 +537,12 @@ def compute_aggregate_kzg_proof(blobs: Sequence[Blob]) -> KZGProof: return compute_kzg_proof_impl(aggregated_poly, evaluation_challenge) ``` -#### `verify_aggregate_kzg_proof` +#### `verify_aggregate_kzg_proof_aggregation` ```python -def verify_aggregate_kzg_proof(blobs: Sequence[Blob], - commitments_bytes: Sequence[Bytes48], - aggregated_proof_bytes: Bytes48) -> bool: +def verify_aggregate_kzg_proof_aggregation(blobs: Sequence[Blob], + commitments_bytes: Sequence[Bytes48]) \ + -> Tuple[KZGCommitment, BLSFieldElement, BLSFieldElement]: """ Given a list of blobs and an aggregated KZG proof, verify that they correspond to the provided commitments. @@ -512,7 +558,49 @@ def verify_aggregate_kzg_proof(blobs: Sequence[Blob], # Evaluate aggregated polynomial at `evaluation_challenge` (evaluation function checks for div-by-zero) y = evaluate_polynomial_in_evaluation_form(aggregated_poly, evaluation_challenge) - # Verify aggregated proof + return (aggregated_poly_commitment, evaluation_challenge, y) +``` + +#### `verify_aggregate_kzg_proof` + +```python +def verify_aggregate_kzg_proof(blobs: Sequence[Blob], + commitments_bytes: Sequence[Bytes48], + aggregated_proof_bytes: Bytes48) -> bool: + """ + Given a list of blobs and an aggregated KZG proof, verify that they correspond to the provided commitments. + + Public method. + """ + aggregated_poly_commitment, evaluation_challenge, y = \ + verify_aggregate_kzg_proof_aggregation(blobs, commitments_bytes) + aggregated_proof = bytes_to_kzg_proof(aggregated_proof_bytes) + return verify_kzg_proof_impl(aggregated_poly_commitment, evaluation_challenge, y, aggregated_proof) ``` + +#### `verify_aggregate_kzg_proof_multi` + +```python +def verify_aggregate_kzg_proof_multi(list_blobs: Sequence[Sequence[Blob]], + list_commitments_bytes: Sequence[Sequence[Bytes48]], + list_aggregated_proof_bytes: Sequence[Bytes48]) -> bool: + """ + Given a list of blobs and an aggregated KZG proof, verify that they correspond to the provided commitments. + + Public method. + """ + + aggregated_poly_commitments, evaluation_challenges, ys = [], [], [] + for blobs, commitments_bytes in zip(list_blobs, list_commitments_bytes): + aggregated_poly_commitment, evaluation_challenge, y = \ + verify_aggregate_kzg_proof_aggregation(blobs, commitments_bytes) + aggregated_poly_commitments.append(aggregated_poly_commitment) + evaluation_challenges.append(evaluation_challenge) + ys.append(y) + + list_aggregated_proof = [bytes_to_kzg_proof(proof) for proof in list_aggregated_proof_bytes] + + return verify_kzg_proof_multi(aggregated_poly_commitments, evaluation_challenges, ys, list_aggregated_proof) +``` From d89e57908973bb9b2916a22fdf453d3cb3ecea14 Mon Sep 17 00:00:00 2001 From: Dankrad Feist Date: Fri, 27 Jan 2023 14:33:43 +0000 Subject: [PATCH 02/29] Updater toc --- specs/eip4844/polynomial-commitments.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/specs/eip4844/polynomial-commitments.md b/specs/eip4844/polynomial-commitments.md index 8ef1fc419..c6e15f65e 100644 --- a/specs/eip4844/polynomial-commitments.md +++ b/specs/eip4844/polynomial-commitments.md @@ -37,11 +37,14 @@ - [`blob_to_kzg_commitment`](#blob_to_kzg_commitment) - [`verify_kzg_proof`](#verify_kzg_proof) - [`verify_kzg_proof_impl`](#verify_kzg_proof_impl) + - [`verify_kzg_proof_multi`](#verify_kzg_proof_multi) - [`compute_kzg_proof`](#compute_kzg_proof) - [`compute_kzg_proof_impl`](#compute_kzg_proof_impl) - [`compute_aggregated_poly_and_commitment`](#compute_aggregated_poly_and_commitment) - [`compute_aggregate_kzg_proof`](#compute_aggregate_kzg_proof) + - [`verify_aggregate_kzg_proof_aggregation`](#verify_aggregate_kzg_proof_aggregation) - [`verify_aggregate_kzg_proof`](#verify_aggregate_kzg_proof) + - [`verify_aggregate_kzg_proof_multi`](#verify_aggregate_kzg_proof_multi) From 659c7f513f74494371b8b478fe2d930536306e5d Mon Sep 17 00:00:00 2001 From: Dankrad Feist Date: Sun, 29 Jan 2023 13:05:02 +0000 Subject: [PATCH 03/29] Change blob verification fiat-shamir to single blob --- specs/eip4844/polynomial-commitments.md | 177 +++++++----------------- 1 file changed, 49 insertions(+), 128 deletions(-) diff --git a/specs/eip4844/polynomial-commitments.md b/specs/eip4844/polynomial-commitments.md index c6e15f65e..63217c0bc 100644 --- a/specs/eip4844/polynomial-commitments.md +++ b/specs/eip4844/polynomial-commitments.md @@ -25,11 +25,10 @@ - [`bytes_to_kzg_commitment`](#bytes_to_kzg_commitment) - [`bytes_to_kzg_proof`](#bytes_to_kzg_proof) - [`blob_to_polynomial`](#blob_to_polynomial) - - [`compute_challenges`](#compute_challenges) + - [`compute_challenge`](#compute_challenge) - [`bls_modular_inverse`](#bls_modular_inverse) - [`div`](#div) - [`g1_lincomb`](#g1_lincomb) - - [`poly_lincomb`](#poly_lincomb) - [`compute_powers`](#compute_powers) - [Polynomials](#polynomials) - [`evaluate_polynomial_in_evaluation_form`](#evaluate_polynomial_in_evaluation_form) @@ -40,11 +39,9 @@ - [`verify_kzg_proof_multi`](#verify_kzg_proof_multi) - [`compute_kzg_proof`](#compute_kzg_proof) - [`compute_kzg_proof_impl`](#compute_kzg_proof_impl) - - [`compute_aggregated_poly_and_commitment`](#compute_aggregated_poly_and_commitment) - - [`compute_aggregate_kzg_proof`](#compute_aggregate_kzg_proof) - - [`verify_aggregate_kzg_proof_aggregation`](#verify_aggregate_kzg_proof_aggregation) - - [`verify_aggregate_kzg_proof`](#verify_aggregate_kzg_proof) - - [`verify_aggregate_kzg_proof_multi`](#verify_aggregate_kzg_proof_multi) + - [`compute_blob_kzg_proof`](#compute_blob_kzg_proof) + - [`verify_blob_kzg_proof`](#verify_blob_kzg_proof) + - [`verify_blob_kzg_proof_multi`](#verify_blob_kzg_proof_multi) @@ -226,44 +223,34 @@ def blob_to_polynomial(blob: Blob) -> Polynomial: return polynomial ``` -#### `compute_challenges` +#### `compute_challenge` ```python -def compute_challenges(polynomials: Sequence[Polynomial], - commitments: Sequence[KZGCommitment]) -> Tuple[Sequence[BLSFieldElement], BLSFieldElement]: +def compute_challenge(polynomial: Polynomial, + commitment: KZGCommitment) -> BLSFieldElement: """ Return the Fiat-Shamir challenges required by the rest of the protocol. The Fiat-Shamir logic works as per the following pseudocode: - hashed_data = hash(DOMAIN_SEPARATOR, polynomials, commitments) - r = hash(hashed_data, 0) - r_powers = [1, r, r**2, r**3, ...] - eval_challenge = hash(hashed_data, 1) - - Then return `r_powers` and `eval_challenge` after converting them to BLS field elements. - The resulting field elements are not uniform over the BLS field. + hashed_data = hash(DOMAIN_SEPARATOR, polynomial, commitment) + eval_challenge = hash(hashed_data, 0) """ + # Append the number of polynomials and the degree of each polynomial as a domain separator - num_polynomials = int.to_bytes(len(polynomials), 8, ENDIANNESS) + num_polynomials = int.to_bytes(1, 8, ENDIANNESS) degree_poly = int.to_bytes(FIELD_ELEMENTS_PER_BLOB, 8, ENDIANNESS) data = FIAT_SHAMIR_PROTOCOL_DOMAIN + degree_poly + num_polynomials # Append each polynomial which is composed by field elements - for poly in polynomials: - for field_element in poly: - data += int.to_bytes(field_element, BYTES_PER_FIELD_ELEMENT, ENDIANNESS) + for field_element in polynomial: + data += int.to_bytes(field_element, BYTES_PER_FIELD_ELEMENT, ENDIANNESS) # Append serialized G1 points - for commitment in commitments: - data += commitment + data += commitment # Transcript has been prepared: time to create the challenges hashed_data = hash(data) - r = hash_to_bls_field(hashed_data + b'\x00') - r_powers = compute_powers(r, len(commitments)) - eval_challenge = hash_to_bls_field(hashed_data + b'\x01') - - return r_powers, eval_challenge + return hash_to_bls_field(hashed_data + b'\x00') ``` #### `bls_modular_inverse` @@ -301,23 +288,6 @@ def g1_lincomb(points: Sequence[KZGCommitment], scalars: Sequence[BLSFieldElemen return KZGCommitment(bls.G1_to_bytes48(result)) ``` -#### `poly_lincomb` - -```python -def poly_lincomb(polys: Sequence[Polynomial], - scalars: Sequence[BLSFieldElement]) -> Polynomial: - """ - Given a list of ``polynomials``, interpret it as a 2D matrix and compute the linear combination - of each column with `scalars`: return the resulting polynomials. - """ - assert len(polys) == len(scalars) - result = [0] * FIELD_ELEMENTS_PER_BLOB - for v, s in zip(polys, scalars): - for i, x in enumerate(v): - result[i] = (result[i] + int(s) * int(x)) % BLS_MODULUS - return Polynomial([BLSFieldElement(x) for x in result]) -``` - #### `compute_powers` ```python @@ -496,114 +466,65 @@ def compute_kzg_proof_impl(polynomial: Polynomial, z: BLSFieldElement) -> KZGPro return KZGProof(g1_lincomb(bit_reversal_permutation(KZG_SETUP_LAGRANGE), quotient_polynomial)) ``` -#### `compute_aggregated_poly_and_commitment` +#### `compute_blob_kzg_proof` ```python -def compute_aggregated_poly_and_commitment( - blobs: Sequence[Blob], - kzg_commitments: Sequence[KZGCommitment]) -> Tuple[Polynomial, KZGCommitment, BLSFieldElement]: +def compute_blob_kzg_proof(blob: Blob) -> KZGProof: """ - Return (1) the aggregated polynomial, (2) the aggregated KZG commitment, - and (3) the polynomial evaluation random challenge. - This function should also work with blobs == [] and kzg_commitments == [] - """ - assert len(blobs) == len(kzg_commitments) - - # Convert blobs to polynomials - polynomials = [blob_to_polynomial(blob) for blob in blobs] - - # Generate random linear combination and evaluation challenges - r_powers, evaluation_challenge = compute_challenges(polynomials, kzg_commitments) - - # Create aggregated polynomial in evaluation form - aggregated_poly = poly_lincomb(polynomials, r_powers) - - # Compute commitment to aggregated polynomial - aggregated_poly_commitment = KZGCommitment(g1_lincomb(kzg_commitments, r_powers)) - - return aggregated_poly, aggregated_poly_commitment, evaluation_challenge -``` - -#### `compute_aggregate_kzg_proof` - -```python -def compute_aggregate_kzg_proof(blobs: Sequence[Blob]) -> KZGProof: - """ - Given a list of blobs, return the aggregated KZG proof that is used to verify them against their commitments. + Given a blob, return the KZG proof that is used to verify it against the commitment. Public method. """ - commitments = [blob_to_kzg_commitment(blob) for blob in blobs] - aggregated_poly, aggregated_poly_commitment, evaluation_challenge = compute_aggregated_poly_and_commitment( - blobs, - commitments - ) - return compute_kzg_proof_impl(aggregated_poly, evaluation_challenge) + commitment = blob_to_kzg_commitment(blob) + evaluation_challenge = compute_challenge(blob, commitment) + polynomial = blob_to_polynomial(blob) + return compute_kzg_proof_impl(polynomial, evaluation_challenge) ``` -#### `verify_aggregate_kzg_proof_aggregation` +#### `verify_blob_kzg_proof` ```python -def verify_aggregate_kzg_proof_aggregation(blobs: Sequence[Blob], - commitments_bytes: Sequence[Bytes48]) \ - -> Tuple[KZGCommitment, BLSFieldElement, BLSFieldElement]: +def verify_blob_kzg_proof(blob: Blob, + commitment_bytes: Bytes48, + proof_bytes: Bytes48) -> bool: """ - Given a list of blobs and an aggregated KZG proof, verify that they correspond to the provided commitments. + Given a blob and a KZG proof, verify that the blob data corresponds to the provided commitment. Public method. """ - commitments = [bytes_to_kzg_commitment(c) for c in commitments_bytes] + commitment = bytes_to_kzg_commitment(commitment_bytes) - aggregated_poly, aggregated_poly_commitment, evaluation_challenge = compute_aggregated_poly_and_commitment( - blobs, - commitments - ) + evaluation_challenge = compute_challenge(blob, commitment) + polynomial = blob_to_polynomial(blob) - # Evaluate aggregated polynomial at `evaluation_challenge` (evaluation function checks for div-by-zero) - y = evaluate_polynomial_in_evaluation_form(aggregated_poly, evaluation_challenge) + # Evaluate polynomial at `evaluation_challenge` (evaluation function checks for div-by-zero) + y = evaluate_polynomial_in_evaluation_form(polynomial, evaluation_challenge) - return (aggregated_poly_commitment, evaluation_challenge, y) + # Verify proof + proof = bytes_to_kzg_proof(proof_bytes) + return verify_kzg_proof_impl(commitment, evaluation_challenge, y, proof) ``` -#### `verify_aggregate_kzg_proof` +#### `verify_blob_kzg_proof_multi` ```python -def verify_aggregate_kzg_proof(blobs: Sequence[Blob], - commitments_bytes: Sequence[Bytes48], - aggregated_proof_bytes: Bytes48) -> bool: +def verify_blob_kzg_proof_multi(blobs: Sequence[Blob], + commitments_bytes: Sequence[Bytes48], + proofs_bytes: Sequence[Bytes48]) -> bool: """ - Given a list of blobs and an aggregated KZG proof, verify that they correspond to the provided commitments. - - Public method. - """ - aggregated_poly_commitment, evaluation_challenge, y = \ - verify_aggregate_kzg_proof_aggregation(blobs, commitments_bytes) - - aggregated_proof = bytes_to_kzg_proof(aggregated_proof_bytes) - - return verify_kzg_proof_impl(aggregated_poly_commitment, evaluation_challenge, y, aggregated_proof) -``` - -#### `verify_aggregate_kzg_proof_multi` - -```python -def verify_aggregate_kzg_proof_multi(list_blobs: Sequence[Sequence[Blob]], - list_commitments_bytes: Sequence[Sequence[Bytes48]], - list_aggregated_proof_bytes: Sequence[Bytes48]) -> bool: - """ - Given a list of blobs and an aggregated KZG proof, verify that they correspond to the provided commitments. + Given a list of blobs and blob KZG proofs, verify that they correspond to the provided commitments. Public method. """ - aggregated_poly_commitments, evaluation_challenges, ys = [], [], [] - for blobs, commitments_bytes in zip(list_blobs, list_commitments_bytes): - aggregated_poly_commitment, evaluation_challenge, y = \ - verify_aggregate_kzg_proof_aggregation(blobs, commitments_bytes) - aggregated_poly_commitments.append(aggregated_poly_commitment) + commitments, evaluation_challenges, ys, proofs = [], [], [], [] + for blob, commitment_bytes, proof_bytes in zip(blobs, commitments_bytes, proofs_bytes): + commitment = bytes_to_kzg_commitment(commitment_bytes) + commitments.append(commitment) + evaluation_challenge = compute_challenge(blob, commitment) evaluation_challenges.append(evaluation_challenge) - ys.append(y) + polynomial = blob_to_polynomial(blob) + ys.append(evaluate_polynomial_in_evaluation_form(polynomial, evaluation_challenge)) + proofs.append(bytes_to_kzg_proof(proof_bytes)) - list_aggregated_proof = [bytes_to_kzg_proof(proof) for proof in list_aggregated_proof_bytes] - - return verify_kzg_proof_multi(aggregated_poly_commitments, evaluation_challenges, ys, list_aggregated_proof) + return verify_kzg_proof_multi(commitments, evaluation_challenges, ys, proofs) ``` From f6b8827eca8b0b7a1ced3bddd6a721f8f31cfca1 Mon Sep 17 00:00:00 2001 From: protolambda Date: Mon, 23 Jan 2023 22:51:55 +0100 Subject: [PATCH 04/29] eip4844: move excess data gas field to end of execution payload for merkle proof path compat --- specs/deneb/beacon-chain.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/specs/deneb/beacon-chain.md b/specs/deneb/beacon-chain.md index e82fdfdcb..aba3b3df4 100644 --- a/specs/deneb/beacon-chain.md +++ b/specs/deneb/beacon-chain.md @@ -108,11 +108,11 @@ class ExecutionPayload(Container): timestamp: uint64 extra_data: ByteList[MAX_EXTRA_DATA_BYTES] base_fee_per_gas: uint256 - excess_data_gas: uint256 # [New in Deneb] # Extra payload fields block_hash: Hash32 # Hash of execution block transactions: List[Transaction, MAX_TRANSACTIONS_PER_PAYLOAD] withdrawals: List[Withdrawal, MAX_WITHDRAWALS_PER_PAYLOAD] + excess_data_gas: uint256 # [New in Deneb] ``` #### `ExecutionPayloadHeader` @@ -132,11 +132,11 @@ class ExecutionPayloadHeader(Container): timestamp: uint64 extra_data: ByteList[MAX_EXTRA_DATA_BYTES] base_fee_per_gas: uint256 - excess_data_gas: uint256 # [New in Deneb] # Extra payload fields block_hash: Hash32 # Hash of execution block transactions_root: Root withdrawals_root: Root + excess_data_gas: uint256 # [New in Deneb] ``` ## Helper functions @@ -230,10 +230,10 @@ def process_execution_payload(state: BeaconState, payload: ExecutionPayload, exe timestamp=payload.timestamp, extra_data=payload.extra_data, base_fee_per_gas=payload.base_fee_per_gas, - excess_data_gas=payload.excess_data_gas, # [New in Deneb] block_hash=payload.block_hash, transactions_root=hash_tree_root(payload.transactions), withdrawals_root=hash_tree_root(payload.withdrawals), + excess_data_gas=payload.excess_data_gas, # [New in Deneb] ) ``` From 832e96412ce8bc0d3d6f93e8048825db576bf562 Mon Sep 17 00:00:00 2001 From: protolambda Date: Tue, 24 Jan 2023 15:30:33 +0100 Subject: [PATCH 05/29] fix container fork check with remerkleable v0.1.26 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index f87ed5a6c..45dd635d3 100644 --- a/setup.py +++ b/setup.py @@ -1169,7 +1169,7 @@ setup( "pycryptodome==3.15.0", "py_ecc==6.0.0", "milagro_bls_binding==1.9.0", - "remerkleable==0.1.25", + "remerkleable==0.1.26", "trie==2.0.2", RUAMEL_YAML_VERSION, "lru-dict==1.1.8", From 902a9c996784334a02891936417db88400c19c9b Mon Sep 17 00:00:00 2001 From: protolambda Date: Thu, 26 Jan 2023 11:57:47 +0100 Subject: [PATCH 06/29] remerkleable: fix container dict key hashing --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 45dd635d3..34a1083d6 100644 --- a/setup.py +++ b/setup.py @@ -1169,7 +1169,7 @@ setup( "pycryptodome==3.15.0", "py_ecc==6.0.0", "milagro_bls_binding==1.9.0", - "remerkleable==0.1.26", + "remerkleable==0.1.27", "trie==2.0.2", RUAMEL_YAML_VERSION, "lru-dict==1.1.8", From 7b5acbfd21d0b0fd7a46034f43362124e2f88899 Mon Sep 17 00:00:00 2001 From: Hsiao-Wei Wang Date: Fri, 27 Jan 2023 11:00:37 +0100 Subject: [PATCH 07/29] Fix Capella fork test assertions --- specs/capella/beacon-chain.md | 2 +- tests/core/pyspec/eth2spec/test/helpers/capella/fork.py | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/specs/capella/beacon-chain.md b/specs/capella/beacon-chain.md index 1be41e7eb..1df617daa 100644 --- a/specs/capella/beacon-chain.md +++ b/specs/capella/beacon-chain.md @@ -242,7 +242,7 @@ class BeaconState(Container): current_sync_committee: SyncCommittee next_sync_committee: SyncCommittee # Execution - latest_execution_payload_header: ExecutionPayloadHeader + latest_execution_payload_header: ExecutionPayloadHeader # [Modified in Capella] # Withdrawals next_withdrawal_index: WithdrawalIndex # [New in Capella] next_withdrawal_validator_index: ValidatorIndex # [New in Capella] diff --git a/tests/core/pyspec/eth2spec/test/helpers/capella/fork.py b/tests/core/pyspec/eth2spec/test/helpers/capella/fork.py index 8e0aec9c6..bca8ddb8d 100644 --- a/tests/core/pyspec/eth2spec/test/helpers/capella/fork.py +++ b/tests/core/pyspec/eth2spec/test/helpers/capella/fork.py @@ -29,14 +29,12 @@ def run_fork_test(post_spec, pre_state): 'inactivity_scores', # Sync 'current_sync_committee', 'next_sync_committee', - # Execution - 'latest_execution_payload_header', ] for field in stable_fields: assert getattr(pre_state, field) == getattr(post_state, field) # Modified fields - modified_fields = ['fork'] + modified_fields = ['fork', 'latest_execution_payload_header'] for field in modified_fields: assert getattr(pre_state, field) != getattr(post_state, field) From 86962b94377f549989ff7273fec8dc7faee70627 Mon Sep 17 00:00:00 2001 From: Potuz Date: Fri, 10 Feb 2023 11:43:38 -0300 Subject: [PATCH 08/29] Simplify commitee weight computation --- specs/phase0/fork-choice.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/specs/phase0/fork-choice.md b/specs/phase0/fork-choice.md index e535184af..f2ccc24b9 100644 --- a/specs/phase0/fork-choice.md +++ b/specs/phase0/fork-choice.md @@ -194,10 +194,7 @@ def get_latest_attesting_balance(store: Store, root: Root) -> Gwei: proposer_score = Gwei(0) # Boost is applied if ``root`` is an ancestor of ``proposer_boost_root`` if get_ancestor(store, store.proposer_boost_root, store.blocks[root].slot) == root: - num_validators = len(get_active_validator_indices(state, get_current_epoch(state))) - avg_balance = get_total_active_balance(state) // num_validators - committee_size = num_validators // SLOTS_PER_EPOCH - committee_weight = committee_size * avg_balance + committee_weight = get_total_active_balance(state) // SLOTS_PER_EPOCH proposer_score = (committee_weight * PROPOSER_SCORE_BOOST) // 100 return attestation_score + proposer_score From fc10714f42888a26a52f17a0ba7dabfdc83811cd Mon Sep 17 00:00:00 2001 From: Dankrad Feist Date: Mon, 13 Feb 2023 14:32:50 +0000 Subject: [PATCH 09/29] Call compute_challenge with polynomial as argument --- specs/eip4844/polynomial-commitments.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/specs/eip4844/polynomial-commitments.md b/specs/eip4844/polynomial-commitments.md index 63217c0bc..0e2c671da 100644 --- a/specs/eip4844/polynomial-commitments.md +++ b/specs/eip4844/polynomial-commitments.md @@ -475,8 +475,8 @@ def compute_blob_kzg_proof(blob: Blob) -> KZGProof: Public method. """ commitment = blob_to_kzg_commitment(blob) - evaluation_challenge = compute_challenge(blob, commitment) polynomial = blob_to_polynomial(blob) + evaluation_challenge = compute_challenge(polynomial, commitment) return compute_kzg_proof_impl(polynomial, evaluation_challenge) ``` @@ -493,8 +493,8 @@ def verify_blob_kzg_proof(blob: Blob, """ commitment = bytes_to_kzg_commitment(commitment_bytes) - evaluation_challenge = compute_challenge(blob, commitment) polynomial = blob_to_polynomial(blob) + evaluation_challenge = compute_challenge(polynomial, commitment) # Evaluate polynomial at `evaluation_challenge` (evaluation function checks for div-by-zero) y = evaluate_polynomial_in_evaluation_form(polynomial, evaluation_challenge) @@ -520,9 +520,9 @@ def verify_blob_kzg_proof_multi(blobs: Sequence[Blob], for blob, commitment_bytes, proof_bytes in zip(blobs, commitments_bytes, proofs_bytes): commitment = bytes_to_kzg_commitment(commitment_bytes) commitments.append(commitment) - evaluation_challenge = compute_challenge(blob, commitment) - evaluation_challenges.append(evaluation_challenge) polynomial = blob_to_polynomial(blob) + evaluation_challenge = compute_challenge(polynomial, commitment) + evaluation_challenges.append(evaluation_challenge) ys.append(evaluate_polynomial_in_evaluation_form(polynomial, evaluation_challenge)) proofs.append(bytes_to_kzg_proof(proof_bytes)) From 7b642a2884189e821254b596db29ab0cc4c892ec Mon Sep 17 00:00:00 2001 From: Dankrad Feist Date: Mon, 13 Feb 2023 14:57:04 +0000 Subject: [PATCH 10/29] compute_challenge takes blobs + linter --- specs/eip4844/fork-choice.md | 5 +++-- specs/eip4844/polynomial-commitments.md | 11 +++++------ specs/eip4844/validator.md | 3 ++- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/specs/eip4844/fork-choice.md b/specs/eip4844/fork-choice.md index 8dea28ded..962987907 100644 --- a/specs/eip4844/fork-choice.md +++ b/specs/eip4844/fork-choice.md @@ -45,10 +45,11 @@ def validate_blobs_sidecar(slot: Slot, assert slot == blobs_sidecar.beacon_block_slot assert beacon_block_root == blobs_sidecar.beacon_block_root blobs = blobs_sidecar.blobs - kzg_aggregated_proof = blobs_sidecar.kzg_aggregated_proof + # kzg_aggregated_proof = blobs_sidecar.kzg_aggregated_proof assert len(expected_kzg_commitments) == len(blobs) - assert verify_aggregate_kzg_proof(blobs, expected_kzg_commitments, kzg_aggregated_proof) + # Disabled because not available before switch to single blob sidecars + # assert verify_aggregate_kzg_proof(blobs, expected_kzg_commitments, kzg_aggregated_proof) ``` #### `is_data_available` diff --git a/specs/eip4844/polynomial-commitments.md b/specs/eip4844/polynomial-commitments.md index 0e2c671da..ac99313ce 100644 --- a/specs/eip4844/polynomial-commitments.md +++ b/specs/eip4844/polynomial-commitments.md @@ -226,7 +226,7 @@ def blob_to_polynomial(blob: Blob) -> Polynomial: #### `compute_challenge` ```python -def compute_challenge(polynomial: Polynomial, +def compute_challenge(blob: Blob, commitment: KZGCommitment) -> BLSFieldElement: """ Return the Fiat-Shamir challenges required by the rest of the protocol. @@ -242,8 +242,7 @@ def compute_challenge(polynomial: Polynomial, data = FIAT_SHAMIR_PROTOCOL_DOMAIN + degree_poly + num_polynomials # Append each polynomial which is composed by field elements - for field_element in polynomial: - data += int.to_bytes(field_element, BYTES_PER_FIELD_ELEMENT, ENDIANNESS) + data += blob # Append serialized G1 points data += commitment @@ -476,7 +475,7 @@ def compute_blob_kzg_proof(blob: Blob) -> KZGProof: """ commitment = blob_to_kzg_commitment(blob) polynomial = blob_to_polynomial(blob) - evaluation_challenge = compute_challenge(polynomial, commitment) + evaluation_challenge = compute_challenge(blob, commitment) return compute_kzg_proof_impl(polynomial, evaluation_challenge) ``` @@ -494,7 +493,7 @@ def verify_blob_kzg_proof(blob: Blob, commitment = bytes_to_kzg_commitment(commitment_bytes) polynomial = blob_to_polynomial(blob) - evaluation_challenge = compute_challenge(polynomial, commitment) + evaluation_challenge = compute_challenge(blob, commitment) # Evaluate polynomial at `evaluation_challenge` (evaluation function checks for div-by-zero) y = evaluate_polynomial_in_evaluation_form(polynomial, evaluation_challenge) @@ -521,7 +520,7 @@ def verify_blob_kzg_proof_multi(blobs: Sequence[Blob], commitment = bytes_to_kzg_commitment(commitment_bytes) commitments.append(commitment) polynomial = blob_to_polynomial(blob) - evaluation_challenge = compute_challenge(polynomial, commitment) + evaluation_challenge = compute_challenge(blob, commitment) evaluation_challenges.append(evaluation_challenge) ys.append(evaluate_polynomial_in_evaluation_form(polynomial, evaluation_challenge)) proofs.append(bytes_to_kzg_proof(proof_bytes)) diff --git a/specs/eip4844/validator.md b/specs/eip4844/validator.md index bfdd69370..413e315fc 100644 --- a/specs/eip4844/validator.md +++ b/specs/eip4844/validator.md @@ -95,7 +95,8 @@ def get_blobs_sidecar(block: BeaconBlock, blobs: Sequence[Blob]) -> BlobsSidecar beacon_block_root=hash_tree_root(block), beacon_block_slot=block.slot, blobs=blobs, - kzg_aggregated_proof=compute_aggregate_kzg_proof(blobs), + # Disabled because not available before switch to single blob sidecars + kzg_aggregated_proof=KZGProof(), # compute_aggregate_kzg_proof(blobs), ) ``` From 901303f14fbb2153393fd2b5d7b88f160ba569ac Mon Sep 17 00:00:00 2001 From: Paul Harris Date: Mon, 23 Jan 2023 15:08:34 +0100 Subject: [PATCH 11/29] Replaced EIP4844 references with Deneb Fixes #3207 --- .circleci/config.yml | 6 +- .github/workflows/run-tests.yml | 2 +- .gitignore | 2 +- Makefile | 12 +- README.md | 2 +- configs/mainnet.yaml | 6 +- configs/minimal.yaml | 6 +- presets/mainnet/{eip4844.yaml => deneb.yaml} | 0 presets/minimal/{eip4844.yaml => deneb.yaml} | 0 setup.py | 40 +++--- specs/{eip4844 => deneb}/beacon-chain.md | 6 +- specs/{eip4844 => deneb}/fork-choice.md | 0 specs/{eip4844 => deneb}/fork.md | 20 +-- specs/{eip4844 => deneb}/light-client/fork.md | 38 ++--- .../light-client/full-node.md | 8 +- .../light-client/p2p-interface.md | 60 ++++---- .../light-client/sync-protocol.md | 14 +- specs/{eip4844 => deneb}/p2p-interface.md | 8 +- .../polynomial-commitments.md | 0 specs/{eip4844 => deneb}/validator.md | 0 .../test/altair/light_client/test_sync.py | 52 +++---- tests/core/pyspec/eth2spec/test/context.py | 10 +- .../test/{eip4844 => deneb}/__init__.py | 0 .../test/{eip4844 => deneb}/fork/__init__.py | 0 .../fork/test_deneb_fork_basic.py} | 48 +++---- .../test/deneb/fork/test_deneb_fork_random.py | 84 +++++++++++ .../{eip4844 => deneb}/random/__init__.py | 0 .../{eip4844 => deneb}/random/test_random.py | 130 +++++++++--------- .../{eip4844 => deneb}/sanity/__init__.py | 0 .../{eip4844 => deneb}/sanity/test_blocks.py | 6 +- .../{eip4844 => deneb}/unittests/__init__.py | 0 .../unittests/fork_choice/__init__.py | 0 .../test_validate_blobs_sidecar.py | 10 +- .../polynomial_commitments/__init__.py | 0 .../test_polynomial_commitments.py | 8 +- .../{eip4844 => deneb}/unittests/test_kzg.py | 4 +- .../unittests/test_offset.py | 4 +- .../eip4844/fork/test_eip4844_fork_random.py | 84 ----------- .../pyspec/eth2spec/test/helpers/constants.py | 10 +- .../helpers/{eip4844 => deneb}/__init__.py | 0 .../test/helpers/{eip4844 => deneb}/fork.py | 10 +- .../test/helpers/execution_payload.py | 6 +- .../eth2spec/test/helpers/fork_transition.py | 10 +- .../pyspec/eth2spec/test/helpers/forks.py | 10 +- .../pyspec/eth2spec/test/helpers/genesis.py | 6 +- .../test/utils/randomized_block_tests.py | 4 +- tests/generators/epoch_processing/main.py | 6 +- tests/generators/finality/main.py | 6 +- tests/generators/fork_choice/main.py | 6 +- tests/generators/forks/main.py | 8 +- tests/generators/genesis/main.py | 6 +- tests/generators/light_client/main.py | 6 +- tests/generators/operations/main.py | 6 +- tests/generators/random/Makefile | 4 +- tests/generators/random/generate.py | 14 +- tests/generators/random/main.py | 6 +- tests/generators/rewards/main.py | 6 +- tests/generators/sanity/main.py | 8 +- tests/generators/sync/main.py | 6 +- 59 files changed, 407 insertions(+), 407 deletions(-) rename presets/mainnet/{eip4844.yaml => deneb.yaml} (100%) rename presets/minimal/{eip4844.yaml => deneb.yaml} (100%) rename specs/{eip4844 => deneb}/beacon-chain.md (98%) rename specs/{eip4844 => deneb}/fork-choice.md (100%) rename specs/{eip4844 => deneb}/fork.md (86%) rename specs/{eip4844 => deneb}/light-client/fork.md (62%) rename specs/{eip4844 => deneb}/light-client/full-node.md (94%) rename specs/{eip4844 => deneb}/light-client/p2p-interface.md (65%) rename specs/{eip4844 => deneb}/light-client/sync-protocol.md (84%) rename specs/{eip4844 => deneb}/p2p-interface.md (95%) rename specs/{eip4844 => deneb}/polynomial-commitments.md (100%) rename specs/{eip4844 => deneb}/validator.md (100%) rename tests/core/pyspec/eth2spec/test/{eip4844 => deneb}/__init__.py (100%) rename tests/core/pyspec/eth2spec/test/{eip4844 => deneb}/fork/__init__.py (100%) rename tests/core/pyspec/eth2spec/test/{eip4844/fork/test_eip4844_fork_basic.py => deneb/fork/test_deneb_fork_basic.py} (55%) create mode 100644 tests/core/pyspec/eth2spec/test/deneb/fork/test_deneb_fork_random.py rename tests/core/pyspec/eth2spec/test/{eip4844 => deneb}/random/__init__.py (100%) rename tests/core/pyspec/eth2spec/test/{eip4844 => deneb}/random/test_random.py (63%) rename tests/core/pyspec/eth2spec/test/{eip4844 => deneb}/sanity/__init__.py (100%) rename tests/core/pyspec/eth2spec/test/{eip4844 => deneb}/sanity/test_blocks.py (95%) rename tests/core/pyspec/eth2spec/test/{eip4844 => deneb}/unittests/__init__.py (100%) rename tests/core/pyspec/eth2spec/test/{eip4844 => deneb}/unittests/fork_choice/__init__.py (100%) rename tests/core/pyspec/eth2spec/test/{eip4844 => deneb}/unittests/fork_choice/test_validate_blobs_sidecar.py (93%) rename tests/core/pyspec/eth2spec/test/{eip4844 => deneb}/unittests/polynomial_commitments/__init__.py (100%) rename tests/core/pyspec/eth2spec/test/{eip4844 => deneb}/unittests/polynomial_commitments/test_polynomial_commitments.py (96%) rename tests/core/pyspec/eth2spec/test/{eip4844 => deneb}/unittests/test_kzg.py (91%) rename tests/core/pyspec/eth2spec/test/{eip4844 => deneb}/unittests/test_offset.py (94%) delete mode 100644 tests/core/pyspec/eth2spec/test/eip4844/fork/test_eip4844_fork_random.py rename tests/core/pyspec/eth2spec/test/helpers/{eip4844 => deneb}/__init__.py (100%) rename tests/core/pyspec/eth2spec/test/helpers/{eip4844 => deneb}/fork.py (90%) diff --git a/.circleci/config.yml b/.circleci/config.yml index 94065d0bb..665207bdd 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -142,7 +142,7 @@ jobs: command: make citest fork=capella - store_test_results: path: tests/core/pyspec/test-reports - test-eip4844: + test-deneb: docker: - image: circleci/python:3.8 working_directory: ~/specs-repo @@ -152,7 +152,7 @@ jobs: - restore_pyspec_cached_venv - run: name: Run py-tests - command: make citest fork=eip4844 + command: make citest fork=deneb - store_test_results: path: tests/core/pyspec/test-reports table_of_contents: @@ -272,7 +272,7 @@ workflows: - test-capella: requires: - install_pyspec_test - - test-eip4844: + - test-deneb: requires: - install_pyspec_test - table_of_contents diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 2c7b9d883..926c3fbbf 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -83,7 +83,7 @@ jobs: needs: [preclear,lint,codespell,table_of_contents] strategy: matrix: - version: ["phase0", "altair", "bellatrix", "capella", "eip4844"] + version: ["phase0", "altair", "bellatrix", "capella", "deneb"] steps: - name: Checkout this repo uses: actions/checkout@v3.2.0 diff --git a/.gitignore b/.gitignore index 219251599..c49e6c006 100644 --- a/.gitignore +++ b/.gitignore @@ -19,7 +19,7 @@ tests/core/pyspec/eth2spec/phase0/ tests/core/pyspec/eth2spec/altair/ tests/core/pyspec/eth2spec/bellatrix/ tests/core/pyspec/eth2spec/capella/ -tests/core/pyspec/eth2spec/eip4844/ +tests/core/pyspec/eth2spec/deneb/ # coverage reports .htmlcov diff --git a/Makefile b/Makefile index 8604fac27..854f42ce3 100644 --- a/Makefile +++ b/Makefile @@ -30,7 +30,7 @@ MARKDOWN_FILES = $(wildcard $(SPEC_DIR)/phase0/*.md) \ $(wildcard $(SPEC_DIR)/custody/*.md) \ $(wildcard $(SPEC_DIR)/das/*.md) \ $(wildcard $(SPEC_DIR)/sharding/*.md) \ - $(wildcard $(SPEC_DIR)/eip4844/*.md) $(wildcard $(SPEC_DIR)/eip4844/**/*.md) \ + $(wildcard $(SPEC_DIR)/deneb/*.md) $(wildcard $(SPEC_DIR)/deneb/**/*.md) \ $(wildcard $(SSZ_DIR)/*.md) COV_HTML_OUT=.htmlcov @@ -67,7 +67,7 @@ partial_clean: rm -rf $(ETH2SPEC_MODULE_DIR)/altair rm -rf $(ETH2SPEC_MODULE_DIR)/bellatrix rm -rf $(ETH2SPEC_MODULE_DIR)/capella - rm -rf $(ETH2SPEC_MODULE_DIR)/eip4844 + rm -rf $(ETH2SPEC_MODULE_DIR)/deneb rm -rf $(COV_HTML_OUT_DIR) rm -rf $(TEST_REPORT_DIR) rm -rf eth2spec.egg-info dist build @@ -105,12 +105,12 @@ install_test: # Testing against `minimal` or `mainnet` config by default test: pyspec . venv/bin/activate; cd $(PY_SPEC_DIR); \ - python3 -m pytest -n 4 --disable-bls --cov=eth2spec.phase0.$(TEST_PRESET_TYPE) --cov=eth2spec.altair.$(TEST_PRESET_TYPE) --cov=eth2spec.bellatrix.$(TEST_PRESET_TYPE) --cov=eth2spec.capella.$(TEST_PRESET_TYPE) --cov=eth2spec.eip4844.$(TEST_PRESET_TYPE) --cov-report="html:$(COV_HTML_OUT)" --cov-branch eth2spec + python3 -m pytest -n 4 --disable-bls --cov=eth2spec.phase0.$(TEST_PRESET_TYPE) --cov=eth2spec.altair.$(TEST_PRESET_TYPE) --cov=eth2spec.bellatrix.$(TEST_PRESET_TYPE) --cov=eth2spec.capella.$(TEST_PRESET_TYPE) --cov=eth2spec.deneb.$(TEST_PRESET_TYPE) --cov-report="html:$(COV_HTML_OUT)" --cov-branch eth2spec # Testing against `minimal` or `mainnet` config by default find_test: pyspec . venv/bin/activate; cd $(PY_SPEC_DIR); \ - python3 -m pytest -k=$(K) --disable-bls --cov=eth2spec.phase0.$(TEST_PRESET_TYPE) --cov=eth2spec.altair.$(TEST_PRESET_TYPE) --cov=eth2spec.bellatrix.$(TEST_PRESET_TYPE) --cov=eth2spec.capella.$(TEST_PRESET_TYPE) --cov=eth2spec.eip4844.$(TEST_PRESET_TYPE) --cov-report="html:$(COV_HTML_OUT)" --cov-branch eth2spec + python3 -m pytest -k=$(K) --disable-bls --cov=eth2spec.phase0.$(TEST_PRESET_TYPE) --cov=eth2spec.altair.$(TEST_PRESET_TYPE) --cov=eth2spec.bellatrix.$(TEST_PRESET_TYPE) --cov=eth2spec.capella.$(TEST_PRESET_TYPE) --cov=eth2spec.deneb.$(TEST_PRESET_TYPE) --cov-report="html:$(COV_HTML_OUT)" --cov-branch eth2spec citest: pyspec mkdir -p $(TEST_REPORT_DIR); @@ -142,8 +142,8 @@ codespell: lint: pyspec . venv/bin/activate; cd $(PY_SPEC_DIR); \ flake8 --config $(LINTER_CONFIG_FILE) ./eth2spec \ - && pylint --rcfile $(LINTER_CONFIG_FILE) ./eth2spec/phase0 ./eth2spec/altair ./eth2spec/bellatrix ./eth2spec/capella ./eth2spec/eip4844 \ - && mypy --config-file $(LINTER_CONFIG_FILE) -p eth2spec.phase0 -p eth2spec.altair -p eth2spec.bellatrix -p eth2spec.capella -p eth2spec.eip4844 + && pylint --rcfile $(LINTER_CONFIG_FILE) ./eth2spec/phase0 ./eth2spec/altair ./eth2spec/bellatrix ./eth2spec/capella ./eth2spec/deneb \ + && mypy --config-file $(LINTER_CONFIG_FILE) -p eth2spec.phase0 -p eth2spec.altair -p eth2spec.bellatrix -p eth2spec.capella -p eth2spec.deneb lint_generators: pyspec . venv/bin/activate; cd $(TEST_GENERATORS_DIR); \ diff --git a/README.md b/README.md index ed8771cb0..466c15193 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ Features are researched and developed in parallel, and then consolidated into se | Code Name or Topic | Specs | Notes | | - | - | - | | Capella (tentative) |
  • Core
    • [Beacon chain changes](specs/capella/beacon-chain.md)
    • [Capella fork](specs/capella/fork.md)
  • Additions
    • [Light client sync protocol changes](specs/capella/light-client/sync-protocol.md) ([fork](specs/capella/light-client/fork.md), [full node](specs/capella/light-client/full-node.md), [networking](specs/capella/light-client/p2p-interface.md))
    • [Validator additions](specs/capella/validator.md)
    • [P2P networking](specs/capella/p2p-interface.md)
| -| EIP4844 (tentative) |
  • Core
    • [Beacon Chain changes](specs/eip4844/beacon-chain.md)
    • [EIP-4844 fork](specs/eip4844/fork.md)
    • [Polynomial commitments](specs/eip4844/polynomial-commitments.md)
    • [Fork choice changes](specs/eip4844/fork-choice.md)
  • Additions
    • [Light client sync protocol changes](specs/eip4844/light-client/sync-protocol.md) ([fork](specs/eip4844/light-client/fork.md), [full node](specs/eip4844/light-client/full-node.md), [networking](specs/eip4844/light-client/p2p-interface.md))
    • [Honest validator guide changes](specs/eip4844/validator.md)
    • [P2P networking](specs/eip4844/p2p-interface.md)
| +| Deneb (tentative) |
  • Core
    • [Beacon Chain changes](specs/deneb/beacon-chain.md)
    • [EIP-4844 fork](specs/deneb/fork.md)
    • [Polynomial commitments](specs/deneb/polynomial-commitments.md)
    • [Fork choice changes](specs/deneb/fork-choice.md)
  • Additions
    • [Light client sync protocol changes](specs/deneb/light-client/sync-protocol.md) ([fork](specs/deneb/light-client/fork.md), [full node](specs/deneb/light-client/full-node.md), [networking](specs/deneb/light-client/p2p-interface.md))
    • [Honest validator guide changes](specs/deneb/validator.md)
    • [P2P networking](specs/deneb/p2p-interface.md)
| | Sharding (outdated) |
  • Core
    • [Beacon Chain changes](specs/sharding/beacon-chain.md)
  • Additions
    • [P2P networking](specs/sharding/p2p-interface.md)
| | Custody Game (outdated) |
  • Core
    • [Beacon Chain changes](specs/custody_game/beacon-chain.md)
  • Additions
    • [Honest validator guide changes](specs/custody_game/validator.md)
| Dependent on sharding | | Data Availability Sampling (outdated) |
  • Core
    • [Core types and functions](specs/das/das-core.md)
    • [Fork choice changes](specs/das/fork-choice.md)
  • Additions
    • [P2P Networking](specs/das/p2p-interface.md)
    • [Sampling process](specs/das/sampling.md)
|
  • Dependent on sharding
  • [Technical explainer](https://hackmd.io/@HWeNw8hNRimMm2m2GH56Cw/B1YJPGkpD)
| diff --git a/configs/mainnet.yaml b/configs/mainnet.yaml index 929d39f8a..f7e53d7e1 100644 --- a/configs/mainnet.yaml +++ b/configs/mainnet.yaml @@ -47,9 +47,9 @@ BELLATRIX_FORK_EPOCH: 144896 # Sept 6, 2022, 11:34:47am UTC # Capella CAPELLA_FORK_VERSION: 0x03000000 CAPELLA_FORK_EPOCH: 18446744073709551615 -# EIP4844 -EIP4844_FORK_VERSION: 0x04000000 -EIP4844_FORK_EPOCH: 18446744073709551615 +# Deneb +DENEB_FORK_VERSION: 0x04000000 +DENEB_FORK_EPOCH: 18446744073709551615 diff --git a/configs/minimal.yaml b/configs/minimal.yaml index 5dde4b749..abecb1881 100644 --- a/configs/minimal.yaml +++ b/configs/minimal.yaml @@ -46,9 +46,9 @@ BELLATRIX_FORK_EPOCH: 18446744073709551615 # Capella CAPELLA_FORK_VERSION: 0x03000001 CAPELLA_FORK_EPOCH: 18446744073709551615 -# EIP4844 -EIP4844_FORK_VERSION: 0x04000001 -EIP4844_FORK_EPOCH: 18446744073709551615 +# DENEB +DENEB_FORK_VERSION: 0x04000001 +DENEB_FORK_EPOCH: 18446744073709551615 # Time parameters diff --git a/presets/mainnet/eip4844.yaml b/presets/mainnet/deneb.yaml similarity index 100% rename from presets/mainnet/eip4844.yaml rename to presets/mainnet/deneb.yaml diff --git a/presets/minimal/eip4844.yaml b/presets/minimal/deneb.yaml similarity index 100% rename from presets/minimal/eip4844.yaml rename to presets/minimal/deneb.yaml diff --git a/setup.py b/setup.py index 9102f819b..f87ed5a6c 100644 --- a/setup.py +++ b/setup.py @@ -46,7 +46,7 @@ PHASE0 = 'phase0' ALTAIR = 'altair' BELLATRIX = 'bellatrix' CAPELLA = 'capella' -EIP4844 = 'eip4844' +DENEB = 'deneb' # The helper functions that are used when defining constants @@ -632,10 +632,10 @@ def compute_merkle_proof_for_block_body(body: BeaconBlockBody, return {**super().hardcoded_ssz_dep_constants(), **constants} # -# EIP4844SpecBuilder +# DenebSpecBuilder # -class EIP4844SpecBuilder(CapellaSpecBuilder): - fork: str = EIP4844 +class DenebSpecBuilder(CapellaSpecBuilder): + fork: str = DENEB @classmethod def imports(cls, preset_name: str): @@ -669,7 +669,7 @@ def retrieve_blobs_sidecar(slot: Slot, beacon_block_root: Root) -> PyUnion[Blobs spec_builders = { builder.fork: builder - for builder in (Phase0SpecBuilder, AltairSpecBuilder, BellatrixSpecBuilder, CapellaSpecBuilder, EIP4844SpecBuilder) + for builder in (Phase0SpecBuilder, AltairSpecBuilder, BellatrixSpecBuilder, CapellaSpecBuilder, DenebSpecBuilder) } @@ -968,14 +968,14 @@ class PySpecCommand(Command): if len(self.md_doc_paths) == 0: print("no paths were specified, using default markdown file paths for pyspec" " build (spec fork: %s)" % self.spec_fork) - if self.spec_fork in (PHASE0, ALTAIR, BELLATRIX, CAPELLA, EIP4844): + if self.spec_fork in (PHASE0, ALTAIR, BELLATRIX, CAPELLA, DENEB): self.md_doc_paths = """ specs/phase0/beacon-chain.md specs/phase0/fork-choice.md specs/phase0/validator.md specs/phase0/weak-subjectivity.md """ - if self.spec_fork in (ALTAIR, BELLATRIX, CAPELLA, EIP4844): + if self.spec_fork in (ALTAIR, BELLATRIX, CAPELLA, DENEB): self.md_doc_paths += """ specs/altair/light-client/full-node.md specs/altair/light-client/light-client.md @@ -987,7 +987,7 @@ class PySpecCommand(Command): specs/altair/validator.md specs/altair/p2p-interface.md """ - if self.spec_fork in (BELLATRIX, CAPELLA, EIP4844): + if self.spec_fork in (BELLATRIX, CAPELLA, DENEB): self.md_doc_paths += """ specs/bellatrix/beacon-chain.md specs/bellatrix/fork.md @@ -996,7 +996,7 @@ class PySpecCommand(Command): specs/bellatrix/p2p-interface.md sync/optimistic.md """ - if self.spec_fork in (CAPELLA, EIP4844): + if self.spec_fork in (CAPELLA, DENEB): self.md_doc_paths += """ specs/capella/light-client/fork.md specs/capella/light-client/full-node.md @@ -1008,18 +1008,18 @@ class PySpecCommand(Command): specs/capella/validator.md specs/capella/p2p-interface.md """ - if self.spec_fork == EIP4844: + if self.spec_fork == DENEB: self.md_doc_paths += """ - specs/eip4844/light-client/fork.md - specs/eip4844/light-client/full-node.md - specs/eip4844/light-client/p2p-interface.md - specs/eip4844/light-client/sync-protocol.md - specs/eip4844/beacon-chain.md - specs/eip4844/fork.md - specs/eip4844/fork-choice.md - specs/eip4844/polynomial-commitments.md - specs/eip4844/p2p-interface.md - specs/eip4844/validator.md + specs/deneb/light-client/fork.md + specs/deneb/light-client/full-node.md + specs/deneb/light-client/p2p-interface.md + specs/deneb/light-client/sync-protocol.md + specs/deneb/beacon-chain.md + specs/deneb/fork.md + specs/deneb/fork-choice.md + specs/deneb/polynomial-commitments.md + specs/deneb/p2p-interface.md + specs/deneb/validator.md """ if len(self.md_doc_paths) == 0: raise Exception('no markdown files specified, and spec fork "%s" is unknown', self.spec_fork) diff --git a/specs/eip4844/beacon-chain.md b/specs/deneb/beacon-chain.md similarity index 98% rename from specs/eip4844/beacon-chain.md rename to specs/deneb/beacon-chain.md index f681ab951..87ebf7a9e 100644 --- a/specs/eip4844/beacon-chain.md +++ b/specs/deneb/beacon-chain.md @@ -249,7 +249,7 @@ def process_blob_kzg_commitments(state: BeaconState, body: BeaconBlockBody) -> N *Note*: The function `initialize_beacon_state_from_eth1` is modified for pure EIP-4844 testing only. -The `BeaconState` initialization is unchanged, except for the use of the updated `eip4844.BeaconBlockBody` type +The `BeaconState` initialization is unchanged, except for the use of the updated `deneb.BeaconBlockBody` type when initializing the first body-root. ```python @@ -259,8 +259,8 @@ def initialize_beacon_state_from_eth1(eth1_block_hash: Hash32, execution_payload_header: ExecutionPayloadHeader=ExecutionPayloadHeader() ) -> BeaconState: fork = Fork( - previous_version=EIP4844_FORK_VERSION, # [Modified in EIP-4844] for testing only - current_version=EIP4844_FORK_VERSION, # [Modified in EIP-4844] + previous_version=DENEB_FORK_VERSION, # [Modified in Deneb] for testing only + current_version=DENEB_FORK_VERSION, # [Modified in Deneb] epoch=GENESIS_EPOCH, ) state = BeaconState( diff --git a/specs/eip4844/fork-choice.md b/specs/deneb/fork-choice.md similarity index 100% rename from specs/eip4844/fork-choice.md rename to specs/deneb/fork-choice.md diff --git a/specs/eip4844/fork.md b/specs/deneb/fork.md similarity index 86% rename from specs/eip4844/fork.md rename to specs/deneb/fork.md index 39521879a..864e28888 100644 --- a/specs/eip4844/fork.md +++ b/specs/deneb/fork.md @@ -28,8 +28,8 @@ Warning: this configuration is not definitive. | Name | Value | | - | - | -| `EIP4844_FORK_VERSION` | `Version('0x04000000')` | -| `EIP4844_FORK_EPOCH` | `Epoch(18446744073709551615)` **TBD** | +| `DENEB_FORK_VERSION` | `Version('0x04000000')` | +| `DENEB_FORK_EPOCH` | `Epoch(18446744073709551615)` **TBD** | ## Helper functions @@ -42,8 +42,8 @@ def compute_fork_version(epoch: Epoch) -> Version: """ Return the fork version at the given ``epoch``. """ - if epoch >= EIP4844_FORK_EPOCH: - return EIP4844_FORK_VERSION + if epoch >= DENEB_FORK_EPOCH: + return DENEB_FORK_VERSION if epoch >= CAPELLA_FORK_EPOCH: return CAPELLA_FORK_VERSION if epoch >= BELLATRIX_FORK_EPOCH: @@ -58,16 +58,16 @@ def compute_fork_version(epoch: Epoch) -> Version: ### Fork trigger TBD. This fork is defined for testing purposes, the EIP may be combined with other consensus-layer upgrade. -For now, we assume the condition will be triggered at epoch `EIP4844_FORK_EPOCH`. +For now, we assume the condition will be triggered at epoch `DENEB_FORK_EPOCH`. -Note that for the pure EIP-4844 networks, we don't apply `upgrade_to_eip4844` since it starts with EIP-4844 version logic. +Note that for the pure Deneb networks, we don't apply `upgrade_to_deneb` since it starts with Deneb version logic. ### Upgrading the state -Since the `eip4844.BeaconState` format is equal to the `capella.BeaconState` format, we only have to update `BeaconState.fork`. +Since the `deneb.BeaconState` format is equal to the `capella.BeaconState` format, we only have to update `BeaconState.fork`. ```python -def upgrade_to_eip4844(pre: capella.BeaconState) -> BeaconState: +def upgrade_to_deneb(pre: capella.BeaconState) -> BeaconState: epoch = capella.get_current_epoch(pre) latest_execution_payload_header = ExecutionPayloadHeader( parent_hash=pre.latest_execution_payload_header.parent_hash, @@ -94,7 +94,7 @@ def upgrade_to_eip4844(pre: capella.BeaconState) -> BeaconState: slot=pre.slot, fork=Fork( previous_version=pre.fork.current_version, - current_version=EIP4844_FORK_VERSION, # [Modified in EIP4844] + current_version=DENEB_FORK_VERSION, # [Modified in Deneb] epoch=epoch, ), # History @@ -127,7 +127,7 @@ def upgrade_to_eip4844(pre: capella.BeaconState) -> BeaconState: current_sync_committee=pre.current_sync_committee, next_sync_committee=pre.next_sync_committee, # Execution-layer - latest_execution_payload_header=latest_execution_payload_header, # [Modified in EIP4844] + latest_execution_payload_header=latest_execution_payload_header, # [Modified in Deneb] # Withdrawals next_withdrawal_index=pre.next_withdrawal_index, next_withdrawal_validator_index=pre.next_withdrawal_validator_index, diff --git a/specs/eip4844/light-client/fork.md b/specs/deneb/light-client/fork.md similarity index 62% rename from specs/eip4844/light-client/fork.md rename to specs/deneb/light-client/fork.md index 2d5f74f46..8c552937a 100644 --- a/specs/eip4844/light-client/fork.md +++ b/specs/deneb/light-client/fork.md @@ -1,4 +1,4 @@ -# EIP4844 Light Client -- Fork Logic +# Deneb Light Client -- Fork Logic ## Table of contents @@ -15,14 +15,14 @@ ## Introduction -This document describes how to upgrade existing light client objects based on the [Capella specification](../../capella/light-client/sync-protocol.md) to EIP4844. This is necessary when processing pre-EIP4844 data with a post-EIP4844 `LightClientStore`. Note that the data being exchanged over the network protocols uses the original format. +This document describes how to upgrade existing light client objects based on the [Capella specification](../../capella/light-client/sync-protocol.md) to Deneb. This is necessary when processing pre-Deneb data with a post-Deneb `LightClientStore`. Note that the data being exchanged over the network protocols uses the original format. ### Upgrading light client data -A EIP4844 `LightClientStore` can still process earlier light client data. In order to do so, that pre-EIP4844 data needs to be locally upgraded to EIP4844 before processing. +A Deneb `LightClientStore` can still process earlier light client data. In order to do so, that pre-Deneb data needs to be locally upgraded to Deneb before processing. ```python -def upgrade_lc_header_to_eip4844(pre: capella.LightClientHeader) -> LightClientHeader: +def upgrade_lc_header_to_deneb(pre: capella.LightClientHeader) -> LightClientHeader: return LightClientHeader( beacon=pre.beacon, execution=ExecutionPayloadHeader( @@ -47,21 +47,21 @@ def upgrade_lc_header_to_eip4844(pre: capella.LightClientHeader) -> LightClientH ``` ```python -def upgrade_lc_bootstrap_to_eip4844(pre: capella.LightClientBootstrap) -> LightClientBootstrap: +def upgrade_lc_bootstrap_to_deneb(pre: capella.LightClientBootstrap) -> LightClientBootstrap: return LightClientBootstrap( - header=upgrade_lc_header_to_eip4844(pre.header), + header=upgrade_lc_header_to_deneb(pre.header), current_sync_committee=pre.current_sync_committee, current_sync_committee_branch=pre.current_sync_committee_branch, ) ``` ```python -def upgrade_lc_update_to_eip4844(pre: capella.LightClientUpdate) -> LightClientUpdate: +def upgrade_lc_update_to_deneb(pre: capella.LightClientUpdate) -> LightClientUpdate: return LightClientUpdate( - attested_header=upgrade_lc_header_to_eip4844(pre.attested_header), + attested_header=upgrade_lc_header_to_deneb(pre.attested_header), next_sync_committee=pre.next_sync_committee, next_sync_committee_branch=pre.next_sync_committee_branch, - finalized_header=upgrade_lc_header_to_eip4844(pre.finalized_header), + finalized_header=upgrade_lc_header_to_deneb(pre.finalized_header), finality_branch=pre.finality_branch, sync_aggregate=pre.sync_aggregate, signature_slot=pre.signature_slot, @@ -69,10 +69,10 @@ def upgrade_lc_update_to_eip4844(pre: capella.LightClientUpdate) -> LightClientU ``` ```python -def upgrade_lc_finality_update_to_eip4844(pre: capella.LightClientFinalityUpdate) -> LightClientFinalityUpdate: +def upgrade_lc_finality_update_to_deneb(pre: capella.LightClientFinalityUpdate) -> LightClientFinalityUpdate: return LightClientFinalityUpdate( - attested_header=upgrade_lc_header_to_eip4844(pre.attested_header), - finalized_header=upgrade_lc_header_to_eip4844(pre.finalized_header), + attested_header=upgrade_lc_header_to_deneb(pre.attested_header), + finalized_header=upgrade_lc_header_to_deneb(pre.finalized_header), finality_branch=pre.finality_branch, sync_aggregate=pre.sync_aggregate, signature_slot=pre.signature_slot, @@ -80,9 +80,9 @@ def upgrade_lc_finality_update_to_eip4844(pre: capella.LightClientFinalityUpdate ``` ```python -def upgrade_lc_optimistic_update_to_eip4844(pre: capella.LightClientOptimisticUpdate) -> LightClientOptimisticUpdate: +def upgrade_lc_optimistic_update_to_deneb(pre: capella.LightClientOptimisticUpdate) -> LightClientOptimisticUpdate: return LightClientOptimisticUpdate( - attested_header=upgrade_lc_header_to_eip4844(pre.attested_header), + attested_header=upgrade_lc_header_to_deneb(pre.attested_header), sync_aggregate=pre.sync_aggregate, signature_slot=pre.signature_slot, ) @@ -90,20 +90,20 @@ def upgrade_lc_optimistic_update_to_eip4844(pre: capella.LightClientOptimisticUp ### Upgrading the store -Existing `LightClientStore` objects based on Capella MUST be upgraded to EIP4844 before EIP4844 based light client data can be processed. The `LightClientStore` upgrade MAY be performed before `EIP4844_FORK_EPOCH`. +Existing `LightClientStore` objects based on Capella MUST be upgraded to Deneb before Deneb based light client data can be processed. The `LightClientStore` upgrade MAY be performed before `DENEB_FORK_EPOCH`. ```python -def upgrade_lc_store_to_eip4844(pre: capella.LightClientStore) -> LightClientStore: +def upgrade_lc_store_to_deneb(pre: capella.LightClientStore) -> LightClientStore: if pre.best_valid_update is None: best_valid_update = None else: - best_valid_update = upgrade_lc_update_to_eip4844(pre.best_valid_update) + best_valid_update = upgrade_lc_update_to_deneb(pre.best_valid_update) return LightClientStore( - finalized_header=upgrade_lc_header_to_eip4844(pre.finalized_header), + finalized_header=upgrade_lc_header_to_deneb(pre.finalized_header), current_sync_committee=pre.current_sync_committee, next_sync_committee=pre.next_sync_committee, best_valid_update=best_valid_update, - optimistic_header=upgrade_lc_header_to_eip4844(pre.optimistic_header), + optimistic_header=upgrade_lc_header_to_deneb(pre.optimistic_header), previous_max_active_participants=pre.previous_max_active_participants, current_max_active_participants=pre.current_max_active_participants, ) diff --git a/specs/eip4844/light-client/full-node.md b/specs/deneb/light-client/full-node.md similarity index 94% rename from specs/eip4844/light-client/full-node.md rename to specs/deneb/light-client/full-node.md index 70983e1b3..275194036 100644 --- a/specs/eip4844/light-client/full-node.md +++ b/specs/deneb/light-client/full-node.md @@ -1,4 +1,4 @@ -# EIP4844 Light Client -- Full Node +# Deneb Light Client -- Full Node **Notice**: This document is a work-in-progress for researchers and implementers. @@ -17,7 +17,7 @@ ## Introduction -This upgrade adds information about the execution payload to light client data as part of the EIP4844 upgrade. +This upgrade adds information about the execution payload to light client data as part of the Deneb upgrade. ## Helper functions @@ -47,8 +47,8 @@ def block_to_light_client_header(block: SignedBeaconBlock) -> LightClientHeader: withdrawals_root=hash_tree_root(payload.withdrawals), ) - # [New in EIP4844] - if epoch >= EIP4844_FORK_EPOCH: + # [New in Deneb] + if epoch >= DENEB_FORK_EPOCH: execution_header.excess_data_gas = payload.excess_data_gas execution_branch = compute_merkle_proof_for_block_body(block.message.body, EXECUTION_PAYLOAD_INDEX) diff --git a/specs/eip4844/light-client/p2p-interface.md b/specs/deneb/light-client/p2p-interface.md similarity index 65% rename from specs/eip4844/light-client/p2p-interface.md rename to specs/deneb/light-client/p2p-interface.md index f3d89c130..0ca53056a 100644 --- a/specs/eip4844/light-client/p2p-interface.md +++ b/specs/deneb/light-client/p2p-interface.md @@ -1,4 +1,4 @@ -# EIP4844 Light Client -- Networking +# Deneb Light Client -- Networking **Notice**: This document is a work-in-progress for researchers and implementers. @@ -26,7 +26,7 @@ ## Networking -The [Capella light client networking specification](../../capella/light-client/p2p-interface.md) is extended to exchange [EIP4844 light client data](./sync-protocol.md). +The [Capella light client networking specification](../../capella/light-client/p2p-interface.md) is extended to exchange [Deneb light client data](./sync-protocol.md). ### The gossip domain: gossipsub @@ -38,23 +38,23 @@ The [Capella light client networking specification](../../capella/light-client/p [0]: # (eth2spec: skip) -| `fork_version` | Message SSZ type | -| ------------------------------------------------------ | ------------------------------------- | -| `GENESIS_FORK_VERSION` | n/a | -| `ALTAIR_FORK_VERSION` through `BELLATRIX_FORK_VERSION` | `altair.LightClientFinalityUpdate` | -| `CAPELLA_FORK_VERSION` | `capella.LightClientFinalityUpdate` | -| `EIP4844_FORK_VERSION` and later | `eip4844.LightClientFinalityUpdate` | +| `fork_version` | Message SSZ type | +|--------------------------------------------------------|-------------------------------------| +| `GENESIS_FORK_VERSION` | n/a | +| `ALTAIR_FORK_VERSION` through `BELLATRIX_FORK_VERSION` | `altair.LightClientFinalityUpdate` | +| `CAPELLA_FORK_VERSION` | `capella.LightClientFinalityUpdate` | +| `DENEB_FORK_VERSION` and later | `deneb.LightClientFinalityUpdate` | ###### `light_client_optimistic_update` [0]: # (eth2spec: skip) | `fork_version` | Message SSZ type | -| ------------------------------------------------------ | ------------------------------------- | +|--------------------------------------------------------|---------------------------------------| | `GENESIS_FORK_VERSION` | n/a | | `ALTAIR_FORK_VERSION` through `BELLATRIX_FORK_VERSION` | `altair.LightClientOptimisticUpdate` | | `CAPELLA_FORK_VERSION` | `capella.LightClientOptimisticUpdate` | -| `EIP4844_FORK_VERSION` and later | `eip4844.LightClientOptimisticUpdate` | +| `DENEB_FORK_VERSION` and later | `deneb.LightClientOptimisticUpdate` | ### The Req/Resp domain @@ -64,42 +64,42 @@ The [Capella light client networking specification](../../capella/light-client/p [0]: # (eth2spec: skip) -| `fork_version` | Response SSZ type | -| ------------------------------------------------------ | ------------------------------------- | -| `GENESIS_FORK_VERSION` | n/a | -| `ALTAIR_FORK_VERSION` through `BELLATRIX_FORK_VERSION` | `altair.LightClientBootstrap` | -| `CAPELLA_FORK_VERSION` | `capella.LightClientBootstrap` | -| `EIP4844_FORK_VERSION` and later | `eip4844.LightClientBootstrap` | +| `fork_version` | Response SSZ type | +|--------------------------------------------------------|------------------------------------| +| `GENESIS_FORK_VERSION` | n/a | +| `ALTAIR_FORK_VERSION` through `BELLATRIX_FORK_VERSION` | `altair.LightClientBootstrap` | +| `CAPELLA_FORK_VERSION` | `capella.LightClientBootstrap` | +| `DENEB_FORK_VERSION` and later | `deneb.LightClientBootstrap` | ##### LightClientUpdatesByRange [0]: # (eth2spec: skip) -| `fork_version` | Response chunk SSZ type | -| ------------------------------------------------------ | ------------------------------------- | -| `GENESIS_FORK_VERSION` | n/a | -| `ALTAIR_FORK_VERSION` through `BELLATRIX_FORK_VERSION` | `altair.LightClientUpdate` | -| `CAPELLA_FORK_VERSION` | `capella.LightClientUpdate` | -| `EIP4844_FORK_VERSION` and later | `eip4844.LightClientUpdate` | +| `fork_version` | Response chunk SSZ type | +|--------------------------------------------------------|----------------------------------| +| `GENESIS_FORK_VERSION` | n/a | +| `ALTAIR_FORK_VERSION` through `BELLATRIX_FORK_VERSION` | `altair.LightClientUpdate` | +| `CAPELLA_FORK_VERSION` | `capella.LightClientUpdate` | +| `DENEB_FORK_VERSION` and later | `deneb.LightClientUpdate` | ##### GetLightClientFinalityUpdate [0]: # (eth2spec: skip) -| `fork_version` | Response SSZ type | -| ------------------------------------------------------ | ------------------------------------- | -| `GENESIS_FORK_VERSION` | n/a | -| `ALTAIR_FORK_VERSION` through `BELLATRIX_FORK_VERSION` | `altair.LightClientFinalityUpdate` | -| `CAPELLA_FORK_VERSION` | `capella.LightClientFinalityUpdate` | -| `EIP4844_FORK_VERSION` and later | `eip4844.LightClientFinalityUpdate` | +| `fork_version` | Response SSZ type | +|--------------------------------------------------------|-------------------------------------| +| `GENESIS_FORK_VERSION` | n/a | +| `ALTAIR_FORK_VERSION` through `BELLATRIX_FORK_VERSION` | `altair.LightClientFinalityUpdate` | +| `CAPELLA_FORK_VERSION` | `capella.LightClientFinalityUpdate` | +| `DENEB_FORK_VERSION` and later | `deneb.LightClientFinalityUpdate` | ##### GetLightClientOptimisticUpdate [0]: # (eth2spec: skip) | `fork_version` | Response SSZ type | -| ------------------------------------------------------ | ------------------------------------- | +|--------------------------------------------------------|---------------------------------------| | `GENESIS_FORK_VERSION` | n/a | | `ALTAIR_FORK_VERSION` through `BELLATRIX_FORK_VERSION` | `altair.LightClientOptimisticUpdate` | | `CAPELLA_FORK_VERSION` | `capella.LightClientOptimisticUpdate` | -| `EIP4844_FORK_VERSION` and later | `eip4844.LightClientOptimisticUpdate` | +| `DENEB_FORK_VERSION` and later | `deneb.LightClientOptimisticUpdate` | diff --git a/specs/eip4844/light-client/sync-protocol.md b/specs/deneb/light-client/sync-protocol.md similarity index 84% rename from specs/eip4844/light-client/sync-protocol.md rename to specs/deneb/light-client/sync-protocol.md index 181ca14eb..6f948257b 100644 --- a/specs/eip4844/light-client/sync-protocol.md +++ b/specs/deneb/light-client/sync-protocol.md @@ -1,4 +1,4 @@ -# EIP4844 Light Client -- Sync Protocol +# Deneb Light Client -- Sync Protocol **Notice**: This document is a work-in-progress for researchers and implementers. @@ -18,7 +18,7 @@ ## Introduction -This upgrade updates light client data to include the EIP4844 changes to the [`ExecutionPayload`](../beacon-chain.md) structure. It extends the [Capella Light Client specifications](../../capella/light-client/sync-protocol.md). The [fork document](./fork.md) explains how to upgrade existing Capella based deployments to EIP4844. +This upgrade updates light client data to include the Denbeb changes to the [`ExecutionPayload`](../beacon-chain.md) structure. It extends the [Capella Light Client specifications](../../capella/light-client/sync-protocol.md). The [fork document](./fork.md) explains how to upgrade existing Capella based deployments to Deneb. Additional documents describes the impact of the upgrade on certain roles: - [Full node](./full-node.md) @@ -32,11 +32,11 @@ Additional documents describes the impact of the upgrade on certain roles: def get_lc_execution_root(header: LightClientHeader) -> Root: epoch = compute_epoch_at_slot(header.beacon.slot) - # [New in EIP4844] - if epoch >= EIP4844_FORK_EPOCH: + # [New in Deneb] + if epoch >= DENEB_FORK_EPOCH: return hash_tree_root(header.execution) - # [Modified in EIP4844] + # [Modified in Deneb] if epoch >= CAPELLA_FORK_EPOCH: execution_header = capella.ExecutionPayloadHeader( parent_hash=header.execution.parent_hash, @@ -66,8 +66,8 @@ def get_lc_execution_root(header: LightClientHeader) -> Root: def is_valid_light_client_header(header: LightClientHeader) -> bool: epoch = compute_epoch_at_slot(header.beacon.slot) - # [New in EIP4844] - if epoch < EIP4844_FORK_EPOCH: + # [New in Deneb] + if epoch < DENEB_FORK_EPOCH: if header.execution.excess_data_gas != uint256(0): return False diff --git a/specs/eip4844/p2p-interface.md b/specs/deneb/p2p-interface.md similarity index 95% rename from specs/eip4844/p2p-interface.md rename to specs/deneb/p2p-interface.md index ae9380f7a..852597b09 100644 --- a/specs/eip4844/p2p-interface.md +++ b/specs/deneb/p2p-interface.md @@ -119,13 +119,13 @@ Per `context = compute_fork_digest(fork_version, genesis_validators_root)`: | `ALTAIR_FORK_VERSION` | `altair.SignedBeaconBlock` | | `BELLATRIX_FORK_VERSION` | `bellatrix.SignedBeaconBlock` | | `CAPELLA_FORK_VERSION` | `capella.SignedBeaconBlock` | -| `EIP4844_FORK_VERSION` | `eip4844.SignedBeaconBlock` | +| `DENEB_FORK_VERSION` | `deneb.SignedBeaconBlock` | #### BeaconBlocksByRoot v2 **Protocol ID:** `/eth2/beacon_chain/req/beacon_blocks_by_root/2/` -After `EIP4844_FORK_EPOCH`, `BeaconBlocksByRootV2` is replaced by `BeaconBlockAndBlobsSidecarByRootV1`. +After `DENEB_FORK_EPOCH`, `BeaconBlocksByRootV2` is replaced by `BeaconBlockAndBlobsSidecarByRootV1`. Clients MUST support requesting blocks by root for pre-fork-epoch blocks. Per `context = compute_fork_digest(fork_version, genesis_validators_root)`: @@ -170,7 +170,7 @@ No more than `MAX_REQUEST_BLOCKS` may be requested at a time. The response MUST consist of zero or more `response_chunk`. Each _successful_ `response_chunk` MUST contain a single `SignedBeaconBlockAndBlobsSidecar` payload. -Clients MUST support requesting blocks and sidecars since `minimum_request_epoch`, where `minimum_request_epoch = max(finalized_epoch, current_epoch - MIN_EPOCHS_FOR_BLOBS_SIDECARS_REQUESTS, EIP4844_FORK_EPOCH)`. If any root in the request content references a block earlier than `minimum_request_epoch`, peers SHOULD respond with error code `3: ResourceUnavailable`. +Clients MUST support requesting blocks and sidecars since `minimum_request_epoch`, where `minimum_request_epoch = max(finalized_epoch, current_epoch - MIN_EPOCHS_FOR_BLOBS_SIDECARS_REQUESTS, DENEB_FORK_EPOCH)`. If any root in the request content references a block earlier than `minimum_request_epoch`, peers SHOULD respond with error code `3: ResourceUnavailable`. Clients MUST respond with at least one block and sidecar, if they have it. Clients MAY limit the number of blocks and sidecars in the response. @@ -211,7 +211,7 @@ The response MUST consist of zero or more `response_chunk`. Each _successful_ `response_chunk` MUST contain a single `BlobsSidecar` payload. Clients MUST keep a record of signed blobs sidecars seen on the epoch range -`[max(current_epoch - MIN_EPOCHS_FOR_BLOBS_SIDECARS_REQUESTS, EIP4844_FORK_EPOCH), current_epoch]` +`[max(current_epoch - MIN_EPOCHS_FOR_BLOBS_SIDECARS_REQUESTS, DENEB_FORK_EPOCH), current_epoch]` where `current_epoch` is defined by the current wall-clock time, and clients MUST support serving requests of blobs on this range. diff --git a/specs/eip4844/polynomial-commitments.md b/specs/deneb/polynomial-commitments.md similarity index 100% rename from specs/eip4844/polynomial-commitments.md rename to specs/deneb/polynomial-commitments.md diff --git a/specs/eip4844/validator.md b/specs/deneb/validator.md similarity index 100% rename from specs/eip4844/validator.md rename to specs/deneb/validator.md diff --git a/tests/core/pyspec/eth2spec/test/altair/light_client/test_sync.py b/tests/core/pyspec/eth2spec/test/altair/light_client/test_sync.py index 664b4fb44..63bec26b0 100644 --- a/tests/core/pyspec/eth2spec/test/altair/light_client/test_sync.py +++ b/tests/core/pyspec/eth2spec/test/altair/light_client/test_sync.py @@ -16,7 +16,7 @@ from eth2spec.test.helpers.attestations import ( state_transition_with_full_block, ) from eth2spec.test.helpers.constants import ( - PHASE0, ALTAIR, BELLATRIX, CAPELLA, EIP4844, + PHASE0, ALTAIR, BELLATRIX, CAPELLA, DENEB, MINIMAL, ALL_PHASES, ) @@ -24,7 +24,7 @@ from eth2spec.test.helpers.fork_transition import ( do_fork, ) from eth2spec.test.helpers.forks import ( - is_post_capella, is_post_eip4844, + is_post_capella, is_post_deneb, is_post_fork, ) from eth2spec.test.helpers.light_client import ( @@ -53,8 +53,8 @@ def needs_upgrade_to_capella(d_spec, s_spec): return is_post_capella(s_spec) and not is_post_capella(d_spec) -def needs_upgrade_to_eip4844(d_spec, s_spec): - return is_post_eip4844(s_spec) and not is_post_eip4844(d_spec) +def needs_upgrade_to_deneb(d_spec, s_spec): + return is_post_deneb(s_spec) and not is_post_deneb(d_spec) def check_lc_header_equal(d_spec, s_spec, data, upgraded): @@ -80,8 +80,8 @@ def upgrade_lc_bootstrap_to_store(d_spec, s_spec, data): upgraded = s_spec.upgrade_lc_bootstrap_to_capella(upgraded) check_lc_bootstrap_equal(d_spec, s_spec, data, upgraded) - if needs_upgrade_to_eip4844(d_spec, s_spec): - upgraded = s_spec.upgrade_lc_bootstrap_to_eip4844(upgraded) + if needs_upgrade_to_deneb(d_spec, s_spec): + upgraded = s_spec.upgrade_lc_bootstrap_to_deneb(upgraded) check_lc_bootstrap_equal(d_spec, s_spec, data, upgraded) return upgraded @@ -103,8 +103,8 @@ def upgrade_lc_update_to_store(d_spec, s_spec, data): upgraded = s_spec.upgrade_lc_update_to_capella(upgraded) check_lc_update_equal(d_spec, s_spec, data, upgraded) - if needs_upgrade_to_eip4844(d_spec, s_spec): - upgraded = s_spec.upgrade_lc_update_to_eip4844(upgraded) + if needs_upgrade_to_deneb(d_spec, s_spec): + upgraded = s_spec.upgrade_lc_update_to_deneb(upgraded) check_lc_update_equal(d_spec, s_spec, data, upgraded) return upgraded @@ -130,8 +130,8 @@ def upgrade_lc_store_to_new_spec(d_spec, s_spec, data): upgraded = s_spec.upgrade_lc_store_to_capella(upgraded) check_lc_store_equal(d_spec, s_spec, data, upgraded) - if needs_upgrade_to_eip4844(d_spec, s_spec): - upgraded = s_spec.upgrade_lc_store_to_eip4844(upgraded) + if needs_upgrade_to_deneb(d_spec, s_spec): + upgraded = s_spec.upgrade_lc_store_to_deneb(upgraded) check_lc_store_equal(d_spec, s_spec, data, upgraded) return upgraded @@ -145,8 +145,8 @@ class LightClientSyncTest(object): def get_store_fork_version(s_spec): - if is_post_eip4844(s_spec): - return s_spec.config.EIP4844_FORK_VERSION + if is_post_deneb(s_spec): + return s_spec.config.DENEB_FORK_VERSION if is_post_capella(s_spec): return s_spec.config.CAPELLA_FORK_VERSION return s_spec.config.ALTAIR_FORK_VERSION @@ -731,16 +731,16 @@ def test_capella_fork(spec, phases, state): yield from run_test_single_fork(spec, phases, state, CAPELLA) -@with_phases(phases=[CAPELLA], other_phases=[EIP4844]) +@with_phases(phases=[CAPELLA], other_phases=[DENEB]) @spec_test @with_config_overrides({ - 'EIP4844_FORK_EPOCH': 3, # `setup_test` advances to epoch 2 + 'DENEB_FORK_EPOCH': 3, # `setup_test` advances to epoch 2 }, emit=False) @with_state -@with_matching_spec_config(emitted_fork=EIP4844) +@with_matching_spec_config(emitted_fork=DENEB) @with_presets([MINIMAL], reason="too slow") -def test_eip4844_fork(spec, phases, state): - yield from run_test_single_fork(spec, phases, state, EIP4844) +def test_deneb_fork(spec, phases, state): + yield from run_test_single_fork(spec, phases, state, DENEB) def run_test_multi_fork(spec, phases, state, fork_1, fork_2): @@ -779,17 +779,17 @@ def run_test_multi_fork(spec, phases, state, fork_1, fork_2): yield from finish_test(test) -@with_phases(phases=[BELLATRIX], other_phases=[CAPELLA, EIP4844]) +@with_phases(phases=[BELLATRIX], other_phases=[CAPELLA, DENEB]) @spec_test @with_config_overrides({ 'CAPELLA_FORK_EPOCH': 3, # `setup_test` advances to epoch 2 - 'EIP4844_FORK_EPOCH': 4, + 'DENEB_FORK_EPOCH': 4, }, emit=False) @with_state -@with_matching_spec_config(emitted_fork=EIP4844) +@with_matching_spec_config(emitted_fork=DENEB) @with_presets([MINIMAL], reason="too slow") -def test_capella_eip4844_fork(spec, phases, state): - yield from run_test_multi_fork(spec, phases, state, CAPELLA, EIP4844) +def test_capella_deneb_fork(spec, phases, state): + yield from run_test_multi_fork(spec, phases, state, CAPELLA, DENEB) def run_test_upgraded_store_with_legacy_data(spec, phases, state, fork): @@ -823,10 +823,10 @@ def test_capella_store_with_legacy_data(spec, phases, state): yield from run_test_upgraded_store_with_legacy_data(spec, phases, state, CAPELLA) -@with_phases(phases=[ALTAIR, BELLATRIX, CAPELLA], other_phases=[EIP4844]) +@with_phases(phases=[ALTAIR, BELLATRIX, CAPELLA], other_phases=[DENEB]) @spec_test @with_state -@with_matching_spec_config(emitted_fork=EIP4844) +@with_matching_spec_config(emitted_fork=DENEB) @with_presets([MINIMAL], reason="too slow") -def test_eip4844_store_with_legacy_data(spec, phases, state): - yield from run_test_upgraded_store_with_legacy_data(spec, phases, state, EIP4844) +def test_deneb_store_with_legacy_data(spec, phases, state): + yield from run_test_upgraded_store_with_legacy_data(spec, phases, state, DENEB) diff --git a/tests/core/pyspec/eth2spec/test/context.py b/tests/core/pyspec/eth2spec/test/context.py index 8401b973e..38e7f0b71 100644 --- a/tests/core/pyspec/eth2spec/test/context.py +++ b/tests/core/pyspec/eth2spec/test/context.py @@ -7,12 +7,12 @@ from eth2spec.phase0 import mainnet as spec_phase0_mainnet, minimal as spec_phas from eth2spec.altair import mainnet as spec_altair_mainnet, minimal as spec_altair_minimal from eth2spec.bellatrix import mainnet as spec_bellatrix_mainnet, minimal as spec_bellatrix_minimal from eth2spec.capella import mainnet as spec_capella_mainnet, minimal as spec_capella_minimal -from eth2spec.eip4844 import mainnet as spec_eip4844_mainnet, minimal as spec_eip4844_minimal +from eth2spec.deneb import mainnet as spec_deneb_mainnet, minimal as spec_deneb_minimal from eth2spec.utils import bls from .exceptions import SkippedTest from .helpers.constants import ( - PHASE0, ALTAIR, BELLATRIX, CAPELLA, EIP4844, + PHASE0, ALTAIR, BELLATRIX, CAPELLA, DENEB, MINIMAL, MAINNET, ALL_PHASES, ALL_FORK_UPGRADES, @@ -78,14 +78,14 @@ spec_targets: Dict[PresetBaseName, Dict[SpecForkName, Spec]] = { ALTAIR: spec_altair_minimal, BELLATRIX: spec_bellatrix_minimal, CAPELLA: spec_capella_minimal, - EIP4844: spec_eip4844_minimal, + DENEB: spec_deneb_minimal, }, MAINNET: { PHASE0: spec_phase0_mainnet, ALTAIR: spec_altair_mainnet, BELLATRIX: spec_bellatrix_mainnet, CAPELLA: spec_capella_mainnet, - EIP4844: spec_eip4844_mainnet + DENEB: spec_deneb_mainnet }, } @@ -427,7 +427,7 @@ def with_all_phases_except(exclusion_phases): with_altair_and_later = with_all_phases_from(ALTAIR) with_bellatrix_and_later = with_all_phases_from(BELLATRIX) with_capella_and_later = with_all_phases_from(CAPELLA) -with_eip4844_and_later = with_all_phases_from(EIP4844) +with_deneb_and_later = with_all_phases_from(DENEB) def _get_preset_targets(kw): diff --git a/tests/core/pyspec/eth2spec/test/eip4844/__init__.py b/tests/core/pyspec/eth2spec/test/deneb/__init__.py similarity index 100% rename from tests/core/pyspec/eth2spec/test/eip4844/__init__.py rename to tests/core/pyspec/eth2spec/test/deneb/__init__.py diff --git a/tests/core/pyspec/eth2spec/test/eip4844/fork/__init__.py b/tests/core/pyspec/eth2spec/test/deneb/fork/__init__.py similarity index 100% rename from tests/core/pyspec/eth2spec/test/eip4844/fork/__init__.py rename to tests/core/pyspec/eth2spec/test/deneb/fork/__init__.py diff --git a/tests/core/pyspec/eth2spec/test/eip4844/fork/test_eip4844_fork_basic.py b/tests/core/pyspec/eth2spec/test/deneb/fork/test_deneb_fork_basic.py similarity index 55% rename from tests/core/pyspec/eth2spec/test/eip4844/fork/test_eip4844_fork_basic.py rename to tests/core/pyspec/eth2spec/test/deneb/fork/test_deneb_fork_basic.py index aca7cb852..1666fdd71 100644 --- a/tests/core/pyspec/eth2spec/test/eip4844/fork/test_eip4844_fork_basic.py +++ b/tests/core/pyspec/eth2spec/test/deneb/fork/test_deneb_fork_basic.py @@ -7,76 +7,76 @@ from eth2spec.test.context import ( ) from eth2spec.test.utils import with_meta_tags from eth2spec.test.helpers.constants import ( - CAPELLA, EIP4844, + CAPELLA, DENEB, MINIMAL, ) from eth2spec.test.helpers.state import ( next_epoch, next_epoch_via_block, ) -from eth2spec.test.helpers.eip4844.fork import ( - EIP4844_FORK_TEST_META_TAGS, +from eth2spec.test.helpers.deneb.fork import ( + DENEB_FORK_TEST_META_TAGS, run_fork_test, ) -@with_phases(phases=[CAPELLA], other_phases=[EIP4844]) +@with_phases(phases=[CAPELLA], other_phases=[DENEB]) @spec_test @with_state -@with_meta_tags(EIP4844_FORK_TEST_META_TAGS) +@with_meta_tags(DENEB_FORK_TEST_META_TAGS) def test_fork_base_state(spec, phases, state): - yield from run_fork_test(phases[EIP4844], state) + yield from run_fork_test(phases[DENEB], state) -@with_phases(phases=[CAPELLA], other_phases=[EIP4844]) +@with_phases(phases=[CAPELLA], other_phases=[DENEB]) @spec_test @with_state -@with_meta_tags(EIP4844_FORK_TEST_META_TAGS) +@with_meta_tags(DENEB_FORK_TEST_META_TAGS) def test_fork_next_epoch(spec, phases, state): next_epoch(spec, state) - yield from run_fork_test(phases[EIP4844], state) + yield from run_fork_test(phases[DENEB], state) -@with_phases(phases=[CAPELLA], other_phases=[EIP4844]) +@with_phases(phases=[CAPELLA], other_phases=[DENEB]) @spec_test @with_state -@with_meta_tags(EIP4844_FORK_TEST_META_TAGS) +@with_meta_tags(DENEB_FORK_TEST_META_TAGS) def test_fork_next_epoch_with_block(spec, phases, state): next_epoch_via_block(spec, state) - yield from run_fork_test(phases[EIP4844], state) + yield from run_fork_test(phases[DENEB], state) -@with_phases(phases=[CAPELLA], other_phases=[EIP4844]) +@with_phases(phases=[CAPELLA], other_phases=[DENEB]) @spec_test @with_state -@with_meta_tags(EIP4844_FORK_TEST_META_TAGS) +@with_meta_tags(DENEB_FORK_TEST_META_TAGS) def test_fork_many_next_epoch(spec, phases, state): for _ in range(3): next_epoch(spec, state) - yield from run_fork_test(phases[EIP4844], state) + yield from run_fork_test(phases[DENEB], state) -@with_phases(phases=[CAPELLA], other_phases=[EIP4844]) +@with_phases(phases=[CAPELLA], other_phases=[DENEB]) @with_custom_state(balances_fn=low_balances, threshold_fn=lambda spec: spec.config.EJECTION_BALANCE) @spec_test -@with_meta_tags(EIP4844_FORK_TEST_META_TAGS) +@with_meta_tags(DENEB_FORK_TEST_META_TAGS) def test_fork_random_low_balances(spec, phases, state): - yield from run_fork_test(phases[EIP4844], state) + yield from run_fork_test(phases[DENEB], state) -@with_phases(phases=[CAPELLA], other_phases=[EIP4844]) +@with_phases(phases=[CAPELLA], other_phases=[DENEB]) @with_custom_state(balances_fn=misc_balances, threshold_fn=lambda spec: spec.config.EJECTION_BALANCE) @spec_test -@with_meta_tags(EIP4844_FORK_TEST_META_TAGS) +@with_meta_tags(DENEB_FORK_TEST_META_TAGS) def test_fork_random_misc_balances(spec, phases, state): - yield from run_fork_test(phases[EIP4844], state) + yield from run_fork_test(phases[DENEB], state) -@with_phases(phases=[CAPELLA], other_phases=[EIP4844]) +@with_phases(phases=[CAPELLA], other_phases=[DENEB]) @with_presets([MINIMAL], reason="mainnet config leads to larger validator set than limit of public/private keys pre-generated") @with_custom_state(balances_fn=large_validator_set, threshold_fn=lambda spec: spec.config.EJECTION_BALANCE) @spec_test -@with_meta_tags(EIP4844_FORK_TEST_META_TAGS) +@with_meta_tags(DENEB_FORK_TEST_META_TAGS) def test_fork_random_large_validator_set(spec, phases, state): - yield from run_fork_test(phases[EIP4844], state) + yield from run_fork_test(phases[DENEB], state) diff --git a/tests/core/pyspec/eth2spec/test/deneb/fork/test_deneb_fork_random.py b/tests/core/pyspec/eth2spec/test/deneb/fork/test_deneb_fork_random.py new file mode 100644 index 000000000..e88b63693 --- /dev/null +++ b/tests/core/pyspec/eth2spec/test/deneb/fork/test_deneb_fork_random.py @@ -0,0 +1,84 @@ +from random import Random + +from eth2spec.test.context import ( + with_phases, + with_custom_state, + with_presets, + spec_test, with_state, + low_balances, misc_balances, large_validator_set, +) +from eth2spec.test.utils import with_meta_tags +from eth2spec.test.helpers.constants import ( + CAPELLA, DENEB, + MINIMAL, +) +from eth2spec.test.helpers.deneb.fork import ( + DENEB_FORK_TEST_META_TAGS, + run_fork_test, +) +from eth2spec.test.helpers.random import randomize_state + + +@with_phases(phases=[CAPELLA], other_phases=[DENEB]) +@spec_test +@with_state +@with_meta_tags(DENEB_FORK_TEST_META_TAGS) +def test_deneb_fork_random_0(spec, phases, state): + randomize_state(spec, state, rng=Random(1010)) + yield from run_fork_test(phases[DENEB], state) + + +@with_phases(phases=[CAPELLA], other_phases=[DENEB]) +@spec_test +@with_state +@with_meta_tags(DENEB_FORK_TEST_META_TAGS) +def test_deneb_fork_random_1(spec, phases, state): + randomize_state(spec, state, rng=Random(2020)) + yield from run_fork_test(phases[DENEB], state) + + +@with_phases(phases=[CAPELLA], other_phases=[DENEB]) +@spec_test +@with_state +@with_meta_tags(DENEB_FORK_TEST_META_TAGS) +def test_deneb_fork_random_2(spec, phases, state): + randomize_state(spec, state, rng=Random(3030)) + yield from run_fork_test(phases[DENEB], state) + + +@with_phases(phases=[CAPELLA], other_phases=[DENEB]) +@spec_test +@with_state +@with_meta_tags(DENEB_FORK_TEST_META_TAGS) +def test_deneb_fork_random_3(spec, phases, state): + randomize_state(spec, state, rng=Random(4040)) + yield from run_fork_test(phases[DENEB], state) + + +@with_phases(phases=[CAPELLA], other_phases=[DENEB]) +@spec_test +@with_custom_state(balances_fn=low_balances, threshold_fn=lambda spec: spec.config.EJECTION_BALANCE) +@with_meta_tags(DENEB_FORK_TEST_META_TAGS) +def test_deneb_fork_random_low_balances(spec, phases, state): + randomize_state(spec, state, rng=Random(5050)) + yield from run_fork_test(phases[DENEB], state) + + +@with_phases(phases=[CAPELLA], other_phases=[DENEB]) +@spec_test +@with_custom_state(balances_fn=misc_balances, threshold_fn=lambda spec: spec.config.EJECTION_BALANCE) +@with_meta_tags(DENEB_FORK_TEST_META_TAGS) +def test_deneb_fork_random_misc_balances(spec, phases, state): + randomize_state(spec, state, rng=Random(6060)) + yield from run_fork_test(phases[DENEB], state) + + +@with_phases(phases=[CAPELLA], other_phases=[DENEB]) +@with_presets([MINIMAL], + reason="mainnet config leads to larger validator set than limit of public/private keys pre-generated") +@spec_test +@with_custom_state(balances_fn=large_validator_set, threshold_fn=lambda spec: spec.config.EJECTION_BALANCE) +@with_meta_tags(DENEB_FORK_TEST_META_TAGS) +def test_deneb_fork_random_large_validator_set(spec, phases, state): + randomize_state(spec, state, rng=Random(7070)) + yield from run_fork_test(phases[DENEB], state) diff --git a/tests/core/pyspec/eth2spec/test/eip4844/random/__init__.py b/tests/core/pyspec/eth2spec/test/deneb/random/__init__.py similarity index 100% rename from tests/core/pyspec/eth2spec/test/eip4844/random/__init__.py rename to tests/core/pyspec/eth2spec/test/deneb/random/__init__.py diff --git a/tests/core/pyspec/eth2spec/test/eip4844/random/test_random.py b/tests/core/pyspec/eth2spec/test/deneb/random/test_random.py similarity index 63% rename from tests/core/pyspec/eth2spec/test/eip4844/random/test_random.py rename to tests/core/pyspec/eth2spec/test/deneb/random/test_random.py index b90b858b2..e8c0a1bb1 100644 --- a/tests/core/pyspec/eth2spec/test/eip4844/random/test_random.py +++ b/tests/core/pyspec/eth2spec/test/deneb/random/test_random.py @@ -4,7 +4,7 @@ Please do not edit this file manually. See the README for that generator for more information. """ -from eth2spec.test.helpers.constants import EIP4844 +from eth2spec.test.helpers.constants import DENEB from eth2spec.test.context import ( misc_balances_in_default_range_with_many_validators, with_phases, @@ -23,7 +23,7 @@ from eth2spec.test.utils.randomized_block_tests import ( @only_generator("randomized test for broad coverage, not point-to-point CI") -@with_phases([EIP4844]) +@with_phases([DENEB]) @with_custom_state( balances_fn=misc_balances_in_default_range_with_many_validators, threshold_fn=zero_activation_threshold @@ -36,11 +36,11 @@ def test_randomized_0(spec, state): # epochs:0,slots:0,with-block:no_block # epochs:0,slots:0,with-block:no_block # epochs:0,slots:0,with-block:no_block - # epochs:0,slots:0,with-block:random_block_eip4844 + # epochs:0,slots:0,with-block:random_block_deneb # epochs:1,slots:0,with-block:no_block # epochs:0,slots:random_slot_in_epoch,with-block:no_block - # epochs:0,slots:0,with-block:random_block_eip4844 - scenario = {'transitions': [{'validation': 'validate_is_not_leaking', 'epochs_to_skip': 0, 'slots_to_skip': 0, 'block_producer': 'no_block'}, {'epochs_to_skip': 0, 'slots_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'slots_to_skip': 0, 'epochs_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'block_producer': 'random_block_eip4844', 'epochs_to_skip': 0, 'slots_to_skip': 0, 'validation': 'no_op_validation'}, {'epochs_to_skip': 1, 'slots_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'slots_to_skip': 'random_slot_in_epoch', 'epochs_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'block_producer': 'random_block_eip4844', 'epochs_to_skip': 0, 'slots_to_skip': 0, 'validation': 'no_op_validation'}], 'state_randomizer': 'randomize_state_eip4844'} # noqa: E501 + # epochs:0,slots:0,with-block:random_block_deneb + scenario = {'transitions': [{'validation': 'validate_is_not_leaking', 'epochs_to_skip': 0, 'slots_to_skip': 0, 'block_producer': 'no_block'}, {'epochs_to_skip': 0, 'slots_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'slots_to_skip': 0, 'epochs_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'block_producer': 'random_block_deneb', 'epochs_to_skip': 0, 'slots_to_skip': 0, 'validation': 'no_op_validation'}, {'epochs_to_skip': 1, 'slots_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'slots_to_skip': 'random_slot_in_epoch', 'epochs_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'block_producer': 'random_block_deneb', 'epochs_to_skip': 0, 'slots_to_skip': 0, 'validation': 'no_op_validation'}], 'state_randomizer': 'randomize_state_deneb'} # noqa: E501 yield from run_generated_randomized_test( spec, state, @@ -49,7 +49,7 @@ def test_randomized_0(spec, state): @only_generator("randomized test for broad coverage, not point-to-point CI") -@with_phases([EIP4844]) +@with_phases([DENEB]) @with_custom_state( balances_fn=misc_balances_in_default_range_with_many_validators, threshold_fn=zero_activation_threshold @@ -62,11 +62,11 @@ def test_randomized_1(spec, state): # epochs:0,slots:0,with-block:no_block # epochs:1,slots:0,with-block:no_block # epochs:0,slots:random_slot_in_epoch,with-block:no_block - # epochs:0,slots:0,with-block:random_block_eip4844 + # epochs:0,slots:0,with-block:random_block_deneb # epochs:0,slots:0,with-block:no_block # epochs:0,slots:0,with-block:no_block - # epochs:0,slots:0,with-block:random_block_eip4844 - scenario = {'transitions': [{'validation': 'validate_is_not_leaking', 'epochs_to_skip': 0, 'slots_to_skip': 0, 'block_producer': 'no_block'}, {'epochs_to_skip': 1, 'slots_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'slots_to_skip': 'random_slot_in_epoch', 'epochs_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'block_producer': 'random_block_eip4844', 'epochs_to_skip': 0, 'slots_to_skip': 0, 'validation': 'no_op_validation'}, {'epochs_to_skip': 0, 'slots_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'slots_to_skip': 0, 'epochs_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'block_producer': 'random_block_eip4844', 'epochs_to_skip': 0, 'slots_to_skip': 0, 'validation': 'no_op_validation'}], 'state_randomizer': 'randomize_state_eip4844'} # noqa: E501 + # epochs:0,slots:0,with-block:random_block_deneb + scenario = {'transitions': [{'validation': 'validate_is_not_leaking', 'epochs_to_skip': 0, 'slots_to_skip': 0, 'block_producer': 'no_block'}, {'epochs_to_skip': 1, 'slots_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'slots_to_skip': 'random_slot_in_epoch', 'epochs_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'block_producer': 'random_block_deneb', 'epochs_to_skip': 0, 'slots_to_skip': 0, 'validation': 'no_op_validation'}, {'epochs_to_skip': 0, 'slots_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'slots_to_skip': 0, 'epochs_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'block_producer': 'random_block_deneb', 'epochs_to_skip': 0, 'slots_to_skip': 0, 'validation': 'no_op_validation'}], 'state_randomizer': 'randomize_state_deneb'} # noqa: E501 yield from run_generated_randomized_test( spec, state, @@ -75,7 +75,7 @@ def test_randomized_1(spec, state): @only_generator("randomized test for broad coverage, not point-to-point CI") -@with_phases([EIP4844]) +@with_phases([DENEB]) @with_custom_state( balances_fn=misc_balances_in_default_range_with_many_validators, threshold_fn=zero_activation_threshold @@ -88,11 +88,11 @@ def test_randomized_2(spec, state): # epochs:0,slots:0,with-block:no_block # epochs:0,slots:0,with-block:no_block # epochs:0,slots:penultimate_slot_in_epoch,with-block:no_block - # epochs:0,slots:0,with-block:random_block_eip4844 + # epochs:0,slots:0,with-block:random_block_deneb # epochs:0,slots:0,with-block:no_block # epochs:0,slots:last_slot_in_epoch,with-block:no_block - # epochs:0,slots:0,with-block:random_block_eip4844 - scenario = {'transitions': [{'validation': 'validate_is_not_leaking', 'epochs_to_skip': 0, 'slots_to_skip': 0, 'block_producer': 'no_block'}, {'epochs_to_skip': 0, 'slots_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'slots_to_skip': 'penultimate_slot_in_epoch', 'epochs_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'block_producer': 'random_block_eip4844', 'epochs_to_skip': 0, 'slots_to_skip': 0, 'validation': 'no_op_validation'}, {'epochs_to_skip': 0, 'slots_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'slots_to_skip': 'last_slot_in_epoch', 'epochs_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'block_producer': 'random_block_eip4844', 'epochs_to_skip': 0, 'slots_to_skip': 0, 'validation': 'no_op_validation'}], 'state_randomizer': 'randomize_state_eip4844'} # noqa: E501 + # epochs:0,slots:0,with-block:random_block_deneb + scenario = {'transitions': [{'validation': 'validate_is_not_leaking', 'epochs_to_skip': 0, 'slots_to_skip': 0, 'block_producer': 'no_block'}, {'epochs_to_skip': 0, 'slots_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'slots_to_skip': 'penultimate_slot_in_epoch', 'epochs_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'block_producer': 'random_block_deneb', 'epochs_to_skip': 0, 'slots_to_skip': 0, 'validation': 'no_op_validation'}, {'epochs_to_skip': 0, 'slots_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'slots_to_skip': 'last_slot_in_epoch', 'epochs_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'block_producer': 'random_block_deneb', 'epochs_to_skip': 0, 'slots_to_skip': 0, 'validation': 'no_op_validation'}], 'state_randomizer': 'randomize_state_deneb'} # noqa: E501 yield from run_generated_randomized_test( spec, state, @@ -101,7 +101,7 @@ def test_randomized_2(spec, state): @only_generator("randomized test for broad coverage, not point-to-point CI") -@with_phases([EIP4844]) +@with_phases([DENEB]) @with_custom_state( balances_fn=misc_balances_in_default_range_with_many_validators, threshold_fn=zero_activation_threshold @@ -114,11 +114,11 @@ def test_randomized_3(spec, state): # epochs:0,slots:0,with-block:no_block # epochs:0,slots:0,with-block:no_block # epochs:0,slots:last_slot_in_epoch,with-block:no_block - # epochs:0,slots:0,with-block:random_block_eip4844 + # epochs:0,slots:0,with-block:random_block_deneb # epochs:1,slots:0,with-block:no_block # epochs:0,slots:last_slot_in_epoch,with-block:no_block - # epochs:0,slots:0,with-block:random_block_eip4844 - scenario = {'transitions': [{'validation': 'validate_is_not_leaking', 'epochs_to_skip': 0, 'slots_to_skip': 0, 'block_producer': 'no_block'}, {'epochs_to_skip': 0, 'slots_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'slots_to_skip': 'last_slot_in_epoch', 'epochs_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'block_producer': 'random_block_eip4844', 'epochs_to_skip': 0, 'slots_to_skip': 0, 'validation': 'no_op_validation'}, {'epochs_to_skip': 1, 'slots_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'slots_to_skip': 'last_slot_in_epoch', 'epochs_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'block_producer': 'random_block_eip4844', 'epochs_to_skip': 0, 'slots_to_skip': 0, 'validation': 'no_op_validation'}], 'state_randomizer': 'randomize_state_eip4844'} # noqa: E501 + # epochs:0,slots:0,with-block:random_block_deneb + scenario = {'transitions': [{'validation': 'validate_is_not_leaking', 'epochs_to_skip': 0, 'slots_to_skip': 0, 'block_producer': 'no_block'}, {'epochs_to_skip': 0, 'slots_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'slots_to_skip': 'last_slot_in_epoch', 'epochs_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'block_producer': 'random_block_deneb', 'epochs_to_skip': 0, 'slots_to_skip': 0, 'validation': 'no_op_validation'}, {'epochs_to_skip': 1, 'slots_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'slots_to_skip': 'last_slot_in_epoch', 'epochs_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'block_producer': 'random_block_deneb', 'epochs_to_skip': 0, 'slots_to_skip': 0, 'validation': 'no_op_validation'}], 'state_randomizer': 'randomize_state_deneb'} # noqa: E501 yield from run_generated_randomized_test( spec, state, @@ -127,7 +127,7 @@ def test_randomized_3(spec, state): @only_generator("randomized test for broad coverage, not point-to-point CI") -@with_phases([EIP4844]) +@with_phases([DENEB]) @with_custom_state( balances_fn=misc_balances_in_default_range_with_many_validators, threshold_fn=zero_activation_threshold @@ -140,11 +140,11 @@ def test_randomized_4(spec, state): # epochs:0,slots:0,with-block:no_block # epochs:1,slots:0,with-block:no_block # epochs:0,slots:last_slot_in_epoch,with-block:no_block - # epochs:0,slots:0,with-block:random_block_eip4844 + # epochs:0,slots:0,with-block:random_block_deneb # epochs:1,slots:0,with-block:no_block # epochs:0,slots:penultimate_slot_in_epoch,with-block:no_block - # epochs:0,slots:0,with-block:random_block_eip4844 - scenario = {'transitions': [{'validation': 'validate_is_not_leaking', 'epochs_to_skip': 0, 'slots_to_skip': 0, 'block_producer': 'no_block'}, {'epochs_to_skip': 1, 'slots_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'slots_to_skip': 'last_slot_in_epoch', 'epochs_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'block_producer': 'random_block_eip4844', 'epochs_to_skip': 0, 'slots_to_skip': 0, 'validation': 'no_op_validation'}, {'epochs_to_skip': 1, 'slots_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'slots_to_skip': 'penultimate_slot_in_epoch', 'epochs_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'block_producer': 'random_block_eip4844', 'epochs_to_skip': 0, 'slots_to_skip': 0, 'validation': 'no_op_validation'}], 'state_randomizer': 'randomize_state_eip4844'} # noqa: E501 + # epochs:0,slots:0,with-block:random_block_deneb + scenario = {'transitions': [{'validation': 'validate_is_not_leaking', 'epochs_to_skip': 0, 'slots_to_skip': 0, 'block_producer': 'no_block'}, {'epochs_to_skip': 1, 'slots_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'slots_to_skip': 'last_slot_in_epoch', 'epochs_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'block_producer': 'random_block_deneb', 'epochs_to_skip': 0, 'slots_to_skip': 0, 'validation': 'no_op_validation'}, {'epochs_to_skip': 1, 'slots_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'slots_to_skip': 'penultimate_slot_in_epoch', 'epochs_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'block_producer': 'random_block_deneb', 'epochs_to_skip': 0, 'slots_to_skip': 0, 'validation': 'no_op_validation'}], 'state_randomizer': 'randomize_state_deneb'} # noqa: E501 yield from run_generated_randomized_test( spec, state, @@ -153,7 +153,7 @@ def test_randomized_4(spec, state): @only_generator("randomized test for broad coverage, not point-to-point CI") -@with_phases([EIP4844]) +@with_phases([DENEB]) @with_custom_state( balances_fn=misc_balances_in_default_range_with_many_validators, threshold_fn=zero_activation_threshold @@ -166,11 +166,11 @@ def test_randomized_5(spec, state): # epochs:0,slots:0,with-block:no_block # epochs:0,slots:0,with-block:no_block # epochs:0,slots:random_slot_in_epoch,with-block:no_block - # epochs:0,slots:0,with-block:random_block_eip4844 + # epochs:0,slots:0,with-block:random_block_deneb # epochs:0,slots:0,with-block:no_block # epochs:0,slots:random_slot_in_epoch,with-block:no_block - # epochs:0,slots:0,with-block:random_block_eip4844 - scenario = {'transitions': [{'validation': 'validate_is_not_leaking', 'epochs_to_skip': 0, 'slots_to_skip': 0, 'block_producer': 'no_block'}, {'epochs_to_skip': 0, 'slots_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'slots_to_skip': 'random_slot_in_epoch', 'epochs_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'block_producer': 'random_block_eip4844', 'epochs_to_skip': 0, 'slots_to_skip': 0, 'validation': 'no_op_validation'}, {'epochs_to_skip': 0, 'slots_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'slots_to_skip': 'random_slot_in_epoch', 'epochs_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'block_producer': 'random_block_eip4844', 'epochs_to_skip': 0, 'slots_to_skip': 0, 'validation': 'no_op_validation'}], 'state_randomizer': 'randomize_state_eip4844'} # noqa: E501 + # epochs:0,slots:0,with-block:random_block_deneb + scenario = {'transitions': [{'validation': 'validate_is_not_leaking', 'epochs_to_skip': 0, 'slots_to_skip': 0, 'block_producer': 'no_block'}, {'epochs_to_skip': 0, 'slots_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'slots_to_skip': 'random_slot_in_epoch', 'epochs_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'block_producer': 'random_block_deneb', 'epochs_to_skip': 0, 'slots_to_skip': 0, 'validation': 'no_op_validation'}, {'epochs_to_skip': 0, 'slots_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'slots_to_skip': 'random_slot_in_epoch', 'epochs_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'block_producer': 'random_block_deneb', 'epochs_to_skip': 0, 'slots_to_skip': 0, 'validation': 'no_op_validation'}], 'state_randomizer': 'randomize_state_deneb'} # noqa: E501 yield from run_generated_randomized_test( spec, state, @@ -179,7 +179,7 @@ def test_randomized_5(spec, state): @only_generator("randomized test for broad coverage, not point-to-point CI") -@with_phases([EIP4844]) +@with_phases([DENEB]) @with_custom_state( balances_fn=misc_balances_in_default_range_with_many_validators, threshold_fn=zero_activation_threshold @@ -192,11 +192,11 @@ def test_randomized_6(spec, state): # epochs:0,slots:0,with-block:no_block # epochs:1,slots:0,with-block:no_block # epochs:0,slots:penultimate_slot_in_epoch,with-block:no_block - # epochs:0,slots:0,with-block:random_block_eip4844 + # epochs:0,slots:0,with-block:random_block_deneb # epochs:0,slots:0,with-block:no_block # epochs:0,slots:penultimate_slot_in_epoch,with-block:no_block - # epochs:0,slots:0,with-block:random_block_eip4844 - scenario = {'transitions': [{'validation': 'validate_is_not_leaking', 'epochs_to_skip': 0, 'slots_to_skip': 0, 'block_producer': 'no_block'}, {'epochs_to_skip': 1, 'slots_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'slots_to_skip': 'penultimate_slot_in_epoch', 'epochs_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'block_producer': 'random_block_eip4844', 'epochs_to_skip': 0, 'slots_to_skip': 0, 'validation': 'no_op_validation'}, {'epochs_to_skip': 0, 'slots_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'slots_to_skip': 'penultimate_slot_in_epoch', 'epochs_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'block_producer': 'random_block_eip4844', 'epochs_to_skip': 0, 'slots_to_skip': 0, 'validation': 'no_op_validation'}], 'state_randomizer': 'randomize_state_eip4844'} # noqa: E501 + # epochs:0,slots:0,with-block:random_block_deneb + scenario = {'transitions': [{'validation': 'validate_is_not_leaking', 'epochs_to_skip': 0, 'slots_to_skip': 0, 'block_producer': 'no_block'}, {'epochs_to_skip': 1, 'slots_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'slots_to_skip': 'penultimate_slot_in_epoch', 'epochs_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'block_producer': 'random_block_deneb', 'epochs_to_skip': 0, 'slots_to_skip': 0, 'validation': 'no_op_validation'}, {'epochs_to_skip': 0, 'slots_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'slots_to_skip': 'penultimate_slot_in_epoch', 'epochs_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'block_producer': 'random_block_deneb', 'epochs_to_skip': 0, 'slots_to_skip': 0, 'validation': 'no_op_validation'}], 'state_randomizer': 'randomize_state_deneb'} # noqa: E501 yield from run_generated_randomized_test( spec, state, @@ -205,7 +205,7 @@ def test_randomized_6(spec, state): @only_generator("randomized test for broad coverage, not point-to-point CI") -@with_phases([EIP4844]) +@with_phases([DENEB]) @with_custom_state( balances_fn=misc_balances_in_default_range_with_many_validators, threshold_fn=zero_activation_threshold @@ -218,11 +218,11 @@ def test_randomized_7(spec, state): # epochs:0,slots:0,with-block:no_block # epochs:1,slots:0,with-block:no_block # epochs:0,slots:0,with-block:no_block - # epochs:0,slots:0,with-block:random_block_eip4844 + # epochs:0,slots:0,with-block:random_block_deneb # epochs:1,slots:0,with-block:no_block # epochs:0,slots:0,with-block:no_block - # epochs:0,slots:0,with-block:random_block_eip4844 - scenario = {'transitions': [{'validation': 'validate_is_not_leaking', 'epochs_to_skip': 0, 'slots_to_skip': 0, 'block_producer': 'no_block'}, {'epochs_to_skip': 1, 'slots_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'slots_to_skip': 0, 'epochs_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'block_producer': 'random_block_eip4844', 'epochs_to_skip': 0, 'slots_to_skip': 0, 'validation': 'no_op_validation'}, {'epochs_to_skip': 1, 'slots_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'slots_to_skip': 0, 'epochs_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'block_producer': 'random_block_eip4844', 'epochs_to_skip': 0, 'slots_to_skip': 0, 'validation': 'no_op_validation'}], 'state_randomizer': 'randomize_state_eip4844'} # noqa: E501 + # epochs:0,slots:0,with-block:random_block_deneb + scenario = {'transitions': [{'validation': 'validate_is_not_leaking', 'epochs_to_skip': 0, 'slots_to_skip': 0, 'block_producer': 'no_block'}, {'epochs_to_skip': 1, 'slots_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'slots_to_skip': 0, 'epochs_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'block_producer': 'random_block_deneb', 'epochs_to_skip': 0, 'slots_to_skip': 0, 'validation': 'no_op_validation'}, {'epochs_to_skip': 1, 'slots_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'slots_to_skip': 0, 'epochs_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'block_producer': 'random_block_deneb', 'epochs_to_skip': 0, 'slots_to_skip': 0, 'validation': 'no_op_validation'}], 'state_randomizer': 'randomize_state_deneb'} # noqa: E501 yield from run_generated_randomized_test( spec, state, @@ -231,7 +231,7 @@ def test_randomized_7(spec, state): @only_generator("randomized test for broad coverage, not point-to-point CI") -@with_phases([EIP4844]) +@with_phases([DENEB]) @with_custom_state( balances_fn=misc_balances_in_default_range_with_many_validators, threshold_fn=zero_activation_threshold @@ -244,11 +244,11 @@ def test_randomized_8(spec, state): # epochs:epochs_until_leak,slots:0,with-block:no_block # epochs:0,slots:0,with-block:no_block # epochs:0,slots:0,with-block:no_block - # epochs:0,slots:0,with-block:random_block_eip4844 + # epochs:0,slots:0,with-block:random_block_deneb # epochs:1,slots:0,with-block:no_block # epochs:0,slots:random_slot_in_epoch,with-block:no_block - # epochs:0,slots:0,with-block:random_block_eip4844 - scenario = {'transitions': [{'epochs_to_skip': 'epochs_until_leak', 'validation': 'validate_is_leaking', 'slots_to_skip': 0, 'block_producer': 'no_block'}, {'epochs_to_skip': 0, 'slots_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'slots_to_skip': 0, 'epochs_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'block_producer': 'random_block_eip4844', 'epochs_to_skip': 0, 'slots_to_skip': 0, 'validation': 'no_op_validation'}, {'epochs_to_skip': 1, 'slots_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'slots_to_skip': 'random_slot_in_epoch', 'epochs_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'block_producer': 'random_block_eip4844', 'epochs_to_skip': 0, 'slots_to_skip': 0, 'validation': 'no_op_validation'}], 'state_randomizer': 'randomize_state_eip4844'} # noqa: E501 + # epochs:0,slots:0,with-block:random_block_deneb + scenario = {'transitions': [{'epochs_to_skip': 'epochs_until_leak', 'validation': 'validate_is_leaking', 'slots_to_skip': 0, 'block_producer': 'no_block'}, {'epochs_to_skip': 0, 'slots_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'slots_to_skip': 0, 'epochs_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'block_producer': 'random_block_deneb', 'epochs_to_skip': 0, 'slots_to_skip': 0, 'validation': 'no_op_validation'}, {'epochs_to_skip': 1, 'slots_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'slots_to_skip': 'random_slot_in_epoch', 'epochs_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'block_producer': 'random_block_deneb', 'epochs_to_skip': 0, 'slots_to_skip': 0, 'validation': 'no_op_validation'}], 'state_randomizer': 'randomize_state_deneb'} # noqa: E501 yield from run_generated_randomized_test( spec, state, @@ -257,7 +257,7 @@ def test_randomized_8(spec, state): @only_generator("randomized test for broad coverage, not point-to-point CI") -@with_phases([EIP4844]) +@with_phases([DENEB]) @with_custom_state( balances_fn=misc_balances_in_default_range_with_many_validators, threshold_fn=zero_activation_threshold @@ -270,11 +270,11 @@ def test_randomized_9(spec, state): # epochs:epochs_until_leak,slots:0,with-block:no_block # epochs:1,slots:0,with-block:no_block # epochs:0,slots:random_slot_in_epoch,with-block:no_block - # epochs:0,slots:0,with-block:random_block_eip4844 + # epochs:0,slots:0,with-block:random_block_deneb # epochs:0,slots:0,with-block:no_block # epochs:0,slots:0,with-block:no_block - # epochs:0,slots:0,with-block:random_block_eip4844 - scenario = {'transitions': [{'epochs_to_skip': 'epochs_until_leak', 'validation': 'validate_is_leaking', 'slots_to_skip': 0, 'block_producer': 'no_block'}, {'epochs_to_skip': 1, 'slots_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'slots_to_skip': 'random_slot_in_epoch', 'epochs_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'block_producer': 'random_block_eip4844', 'epochs_to_skip': 0, 'slots_to_skip': 0, 'validation': 'no_op_validation'}, {'epochs_to_skip': 0, 'slots_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'slots_to_skip': 0, 'epochs_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'block_producer': 'random_block_eip4844', 'epochs_to_skip': 0, 'slots_to_skip': 0, 'validation': 'no_op_validation'}], 'state_randomizer': 'randomize_state_eip4844'} # noqa: E501 + # epochs:0,slots:0,with-block:random_block_deneb + scenario = {'transitions': [{'epochs_to_skip': 'epochs_until_leak', 'validation': 'validate_is_leaking', 'slots_to_skip': 0, 'block_producer': 'no_block'}, {'epochs_to_skip': 1, 'slots_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'slots_to_skip': 'random_slot_in_epoch', 'epochs_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'block_producer': 'random_block_deneb', 'epochs_to_skip': 0, 'slots_to_skip': 0, 'validation': 'no_op_validation'}, {'epochs_to_skip': 0, 'slots_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'slots_to_skip': 0, 'epochs_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'block_producer': 'random_block_deneb', 'epochs_to_skip': 0, 'slots_to_skip': 0, 'validation': 'no_op_validation'}], 'state_randomizer': 'randomize_state_deneb'} # noqa: E501 yield from run_generated_randomized_test( spec, state, @@ -283,7 +283,7 @@ def test_randomized_9(spec, state): @only_generator("randomized test for broad coverage, not point-to-point CI") -@with_phases([EIP4844]) +@with_phases([DENEB]) @with_custom_state( balances_fn=misc_balances_in_default_range_with_many_validators, threshold_fn=zero_activation_threshold @@ -296,11 +296,11 @@ def test_randomized_10(spec, state): # epochs:epochs_until_leak,slots:0,with-block:no_block # epochs:0,slots:0,with-block:no_block # epochs:0,slots:penultimate_slot_in_epoch,with-block:no_block - # epochs:0,slots:0,with-block:random_block_eip4844 + # epochs:0,slots:0,with-block:random_block_deneb # epochs:0,slots:0,with-block:no_block # epochs:0,slots:last_slot_in_epoch,with-block:no_block - # epochs:0,slots:0,with-block:random_block_eip4844 - scenario = {'transitions': [{'epochs_to_skip': 'epochs_until_leak', 'validation': 'validate_is_leaking', 'slots_to_skip': 0, 'block_producer': 'no_block'}, {'epochs_to_skip': 0, 'slots_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'slots_to_skip': 'penultimate_slot_in_epoch', 'epochs_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'block_producer': 'random_block_eip4844', 'epochs_to_skip': 0, 'slots_to_skip': 0, 'validation': 'no_op_validation'}, {'epochs_to_skip': 0, 'slots_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'slots_to_skip': 'last_slot_in_epoch', 'epochs_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'block_producer': 'random_block_eip4844', 'epochs_to_skip': 0, 'slots_to_skip': 0, 'validation': 'no_op_validation'}], 'state_randomizer': 'randomize_state_eip4844'} # noqa: E501 + # epochs:0,slots:0,with-block:random_block_deneb + scenario = {'transitions': [{'epochs_to_skip': 'epochs_until_leak', 'validation': 'validate_is_leaking', 'slots_to_skip': 0, 'block_producer': 'no_block'}, {'epochs_to_skip': 0, 'slots_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'slots_to_skip': 'penultimate_slot_in_epoch', 'epochs_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'block_producer': 'random_block_deneb', 'epochs_to_skip': 0, 'slots_to_skip': 0, 'validation': 'no_op_validation'}, {'epochs_to_skip': 0, 'slots_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'slots_to_skip': 'last_slot_in_epoch', 'epochs_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'block_producer': 'random_block_deneb', 'epochs_to_skip': 0, 'slots_to_skip': 0, 'validation': 'no_op_validation'}], 'state_randomizer': 'randomize_state_deneb'} # noqa: E501 yield from run_generated_randomized_test( spec, state, @@ -309,7 +309,7 @@ def test_randomized_10(spec, state): @only_generator("randomized test for broad coverage, not point-to-point CI") -@with_phases([EIP4844]) +@with_phases([DENEB]) @with_custom_state( balances_fn=misc_balances_in_default_range_with_many_validators, threshold_fn=zero_activation_threshold @@ -322,11 +322,11 @@ def test_randomized_11(spec, state): # epochs:epochs_until_leak,slots:0,with-block:no_block # epochs:0,slots:0,with-block:no_block # epochs:0,slots:last_slot_in_epoch,with-block:no_block - # epochs:0,slots:0,with-block:random_block_eip4844 + # epochs:0,slots:0,with-block:random_block_deneb # epochs:1,slots:0,with-block:no_block # epochs:0,slots:last_slot_in_epoch,with-block:no_block - # epochs:0,slots:0,with-block:random_block_eip4844 - scenario = {'transitions': [{'epochs_to_skip': 'epochs_until_leak', 'validation': 'validate_is_leaking', 'slots_to_skip': 0, 'block_producer': 'no_block'}, {'epochs_to_skip': 0, 'slots_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'slots_to_skip': 'last_slot_in_epoch', 'epochs_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'block_producer': 'random_block_eip4844', 'epochs_to_skip': 0, 'slots_to_skip': 0, 'validation': 'no_op_validation'}, {'epochs_to_skip': 1, 'slots_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'slots_to_skip': 'last_slot_in_epoch', 'epochs_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'block_producer': 'random_block_eip4844', 'epochs_to_skip': 0, 'slots_to_skip': 0, 'validation': 'no_op_validation'}], 'state_randomizer': 'randomize_state_eip4844'} # noqa: E501 + # epochs:0,slots:0,with-block:random_block_deneb + scenario = {'transitions': [{'epochs_to_skip': 'epochs_until_leak', 'validation': 'validate_is_leaking', 'slots_to_skip': 0, 'block_producer': 'no_block'}, {'epochs_to_skip': 0, 'slots_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'slots_to_skip': 'last_slot_in_epoch', 'epochs_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'block_producer': 'random_block_deneb', 'epochs_to_skip': 0, 'slots_to_skip': 0, 'validation': 'no_op_validation'}, {'epochs_to_skip': 1, 'slots_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'slots_to_skip': 'last_slot_in_epoch', 'epochs_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'block_producer': 'random_block_deneb', 'epochs_to_skip': 0, 'slots_to_skip': 0, 'validation': 'no_op_validation'}], 'state_randomizer': 'randomize_state_deneb'} # noqa: E501 yield from run_generated_randomized_test( spec, state, @@ -335,7 +335,7 @@ def test_randomized_11(spec, state): @only_generator("randomized test for broad coverage, not point-to-point CI") -@with_phases([EIP4844]) +@with_phases([DENEB]) @with_custom_state( balances_fn=misc_balances_in_default_range_with_many_validators, threshold_fn=zero_activation_threshold @@ -348,11 +348,11 @@ def test_randomized_12(spec, state): # epochs:epochs_until_leak,slots:0,with-block:no_block # epochs:1,slots:0,with-block:no_block # epochs:0,slots:last_slot_in_epoch,with-block:no_block - # epochs:0,slots:0,with-block:random_block_eip4844 + # epochs:0,slots:0,with-block:random_block_deneb # epochs:1,slots:0,with-block:no_block # epochs:0,slots:penultimate_slot_in_epoch,with-block:no_block - # epochs:0,slots:0,with-block:random_block_eip4844 - scenario = {'transitions': [{'epochs_to_skip': 'epochs_until_leak', 'validation': 'validate_is_leaking', 'slots_to_skip': 0, 'block_producer': 'no_block'}, {'epochs_to_skip': 1, 'slots_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'slots_to_skip': 'last_slot_in_epoch', 'epochs_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'block_producer': 'random_block_eip4844', 'epochs_to_skip': 0, 'slots_to_skip': 0, 'validation': 'no_op_validation'}, {'epochs_to_skip': 1, 'slots_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'slots_to_skip': 'penultimate_slot_in_epoch', 'epochs_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'block_producer': 'random_block_eip4844', 'epochs_to_skip': 0, 'slots_to_skip': 0, 'validation': 'no_op_validation'}], 'state_randomizer': 'randomize_state_eip4844'} # noqa: E501 + # epochs:0,slots:0,with-block:random_block_deneb + scenario = {'transitions': [{'epochs_to_skip': 'epochs_until_leak', 'validation': 'validate_is_leaking', 'slots_to_skip': 0, 'block_producer': 'no_block'}, {'epochs_to_skip': 1, 'slots_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'slots_to_skip': 'last_slot_in_epoch', 'epochs_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'block_producer': 'random_block_deneb', 'epochs_to_skip': 0, 'slots_to_skip': 0, 'validation': 'no_op_validation'}, {'epochs_to_skip': 1, 'slots_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'slots_to_skip': 'penultimate_slot_in_epoch', 'epochs_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'block_producer': 'random_block_deneb', 'epochs_to_skip': 0, 'slots_to_skip': 0, 'validation': 'no_op_validation'}], 'state_randomizer': 'randomize_state_deneb'} # noqa: E501 yield from run_generated_randomized_test( spec, state, @@ -361,7 +361,7 @@ def test_randomized_12(spec, state): @only_generator("randomized test for broad coverage, not point-to-point CI") -@with_phases([EIP4844]) +@with_phases([DENEB]) @with_custom_state( balances_fn=misc_balances_in_default_range_with_many_validators, threshold_fn=zero_activation_threshold @@ -374,11 +374,11 @@ def test_randomized_13(spec, state): # epochs:epochs_until_leak,slots:0,with-block:no_block # epochs:0,slots:0,with-block:no_block # epochs:0,slots:random_slot_in_epoch,with-block:no_block - # epochs:0,slots:0,with-block:random_block_eip4844 + # epochs:0,slots:0,with-block:random_block_deneb # epochs:0,slots:0,with-block:no_block # epochs:0,slots:random_slot_in_epoch,with-block:no_block - # epochs:0,slots:0,with-block:random_block_eip4844 - scenario = {'transitions': [{'epochs_to_skip': 'epochs_until_leak', 'validation': 'validate_is_leaking', 'slots_to_skip': 0, 'block_producer': 'no_block'}, {'epochs_to_skip': 0, 'slots_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'slots_to_skip': 'random_slot_in_epoch', 'epochs_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'block_producer': 'random_block_eip4844', 'epochs_to_skip': 0, 'slots_to_skip': 0, 'validation': 'no_op_validation'}, {'epochs_to_skip': 0, 'slots_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'slots_to_skip': 'random_slot_in_epoch', 'epochs_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'block_producer': 'random_block_eip4844', 'epochs_to_skip': 0, 'slots_to_skip': 0, 'validation': 'no_op_validation'}], 'state_randomizer': 'randomize_state_eip4844'} # noqa: E501 + # epochs:0,slots:0,with-block:random_block_deneb + scenario = {'transitions': [{'epochs_to_skip': 'epochs_until_leak', 'validation': 'validate_is_leaking', 'slots_to_skip': 0, 'block_producer': 'no_block'}, {'epochs_to_skip': 0, 'slots_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'slots_to_skip': 'random_slot_in_epoch', 'epochs_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'block_producer': 'random_block_deneb', 'epochs_to_skip': 0, 'slots_to_skip': 0, 'validation': 'no_op_validation'}, {'epochs_to_skip': 0, 'slots_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'slots_to_skip': 'random_slot_in_epoch', 'epochs_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'block_producer': 'random_block_deneb', 'epochs_to_skip': 0, 'slots_to_skip': 0, 'validation': 'no_op_validation'}], 'state_randomizer': 'randomize_state_deneb'} # noqa: E501 yield from run_generated_randomized_test( spec, state, @@ -387,7 +387,7 @@ def test_randomized_13(spec, state): @only_generator("randomized test for broad coverage, not point-to-point CI") -@with_phases([EIP4844]) +@with_phases([DENEB]) @with_custom_state( balances_fn=misc_balances_in_default_range_with_many_validators, threshold_fn=zero_activation_threshold @@ -400,11 +400,11 @@ def test_randomized_14(spec, state): # epochs:epochs_until_leak,slots:0,with-block:no_block # epochs:1,slots:0,with-block:no_block # epochs:0,slots:penultimate_slot_in_epoch,with-block:no_block - # epochs:0,slots:0,with-block:random_block_eip4844 + # epochs:0,slots:0,with-block:random_block_deneb # epochs:0,slots:0,with-block:no_block # epochs:0,slots:penultimate_slot_in_epoch,with-block:no_block - # epochs:0,slots:0,with-block:random_block_eip4844 - scenario = {'transitions': [{'epochs_to_skip': 'epochs_until_leak', 'validation': 'validate_is_leaking', 'slots_to_skip': 0, 'block_producer': 'no_block'}, {'epochs_to_skip': 1, 'slots_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'slots_to_skip': 'penultimate_slot_in_epoch', 'epochs_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'block_producer': 'random_block_eip4844', 'epochs_to_skip': 0, 'slots_to_skip': 0, 'validation': 'no_op_validation'}, {'epochs_to_skip': 0, 'slots_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'slots_to_skip': 'penultimate_slot_in_epoch', 'epochs_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'block_producer': 'random_block_eip4844', 'epochs_to_skip': 0, 'slots_to_skip': 0, 'validation': 'no_op_validation'}], 'state_randomizer': 'randomize_state_eip4844'} # noqa: E501 + # epochs:0,slots:0,with-block:random_block_deneb + scenario = {'transitions': [{'epochs_to_skip': 'epochs_until_leak', 'validation': 'validate_is_leaking', 'slots_to_skip': 0, 'block_producer': 'no_block'}, {'epochs_to_skip': 1, 'slots_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'slots_to_skip': 'penultimate_slot_in_epoch', 'epochs_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'block_producer': 'random_block_deneb', 'epochs_to_skip': 0, 'slots_to_skip': 0, 'validation': 'no_op_validation'}, {'epochs_to_skip': 0, 'slots_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'slots_to_skip': 'penultimate_slot_in_epoch', 'epochs_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'block_producer': 'random_block_deneb', 'epochs_to_skip': 0, 'slots_to_skip': 0, 'validation': 'no_op_validation'}], 'state_randomizer': 'randomize_state_deneb'} # noqa: E501 yield from run_generated_randomized_test( spec, state, @@ -413,7 +413,7 @@ def test_randomized_14(spec, state): @only_generator("randomized test for broad coverage, not point-to-point CI") -@with_phases([EIP4844]) +@with_phases([DENEB]) @with_custom_state( balances_fn=misc_balances_in_default_range_with_many_validators, threshold_fn=zero_activation_threshold @@ -426,11 +426,11 @@ def test_randomized_15(spec, state): # epochs:epochs_until_leak,slots:0,with-block:no_block # epochs:1,slots:0,with-block:no_block # epochs:0,slots:0,with-block:no_block - # epochs:0,slots:0,with-block:random_block_eip4844 + # epochs:0,slots:0,with-block:random_block_deneb # epochs:1,slots:0,with-block:no_block # epochs:0,slots:0,with-block:no_block - # epochs:0,slots:0,with-block:random_block_eip4844 - scenario = {'transitions': [{'epochs_to_skip': 'epochs_until_leak', 'validation': 'validate_is_leaking', 'slots_to_skip': 0, 'block_producer': 'no_block'}, {'epochs_to_skip': 1, 'slots_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'slots_to_skip': 0, 'epochs_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'block_producer': 'random_block_eip4844', 'epochs_to_skip': 0, 'slots_to_skip': 0, 'validation': 'no_op_validation'}, {'epochs_to_skip': 1, 'slots_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'slots_to_skip': 0, 'epochs_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'block_producer': 'random_block_eip4844', 'epochs_to_skip': 0, 'slots_to_skip': 0, 'validation': 'no_op_validation'}], 'state_randomizer': 'randomize_state_eip4844'} # noqa: E501 + # epochs:0,slots:0,with-block:random_block_deneb + scenario = {'transitions': [{'epochs_to_skip': 'epochs_until_leak', 'validation': 'validate_is_leaking', 'slots_to_skip': 0, 'block_producer': 'no_block'}, {'epochs_to_skip': 1, 'slots_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'slots_to_skip': 0, 'epochs_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'block_producer': 'random_block_deneb', 'epochs_to_skip': 0, 'slots_to_skip': 0, 'validation': 'no_op_validation'}, {'epochs_to_skip': 1, 'slots_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'slots_to_skip': 0, 'epochs_to_skip': 0, 'block_producer': 'no_block', 'validation': 'no_op_validation'}, {'block_producer': 'random_block_deneb', 'epochs_to_skip': 0, 'slots_to_skip': 0, 'validation': 'no_op_validation'}], 'state_randomizer': 'randomize_state_deneb'} # noqa: E501 yield from run_generated_randomized_test( spec, state, diff --git a/tests/core/pyspec/eth2spec/test/eip4844/sanity/__init__.py b/tests/core/pyspec/eth2spec/test/deneb/sanity/__init__.py similarity index 100% rename from tests/core/pyspec/eth2spec/test/eip4844/sanity/__init__.py rename to tests/core/pyspec/eth2spec/test/deneb/sanity/__init__.py diff --git a/tests/core/pyspec/eth2spec/test/eip4844/sanity/test_blocks.py b/tests/core/pyspec/eth2spec/test/deneb/sanity/test_blocks.py similarity index 95% rename from tests/core/pyspec/eth2spec/test/eip4844/sanity/test_blocks.py rename to tests/core/pyspec/eth2spec/test/deneb/sanity/test_blocks.py index 0aeafe052..c7fb708b8 100644 --- a/tests/core/pyspec/eth2spec/test/eip4844/sanity/test_blocks.py +++ b/tests/core/pyspec/eth2spec/test/deneb/sanity/test_blocks.py @@ -6,7 +6,7 @@ from eth2spec.test.helpers.block import ( ) from eth2spec.test.context import ( spec_state_test, - with_eip4844_and_later, + with_deneb_and_later, ) from eth2spec.test.helpers.execution_payload import ( compute_el_block_hash, @@ -16,7 +16,7 @@ from eth2spec.test.helpers.sharding import ( ) -@with_eip4844_and_later +@with_deneb_and_later @spec_state_test def test_one_blob(spec, state): yield 'pre', state @@ -32,7 +32,7 @@ def test_one_blob(spec, state): yield 'post', state -@with_eip4844_and_later +@with_deneb_and_later @spec_state_test def test_max_blobs(spec, state): yield 'pre', state diff --git a/tests/core/pyspec/eth2spec/test/eip4844/unittests/__init__.py b/tests/core/pyspec/eth2spec/test/deneb/unittests/__init__.py similarity index 100% rename from tests/core/pyspec/eth2spec/test/eip4844/unittests/__init__.py rename to tests/core/pyspec/eth2spec/test/deneb/unittests/__init__.py diff --git a/tests/core/pyspec/eth2spec/test/eip4844/unittests/fork_choice/__init__.py b/tests/core/pyspec/eth2spec/test/deneb/unittests/fork_choice/__init__.py similarity index 100% rename from tests/core/pyspec/eth2spec/test/eip4844/unittests/fork_choice/__init__.py rename to tests/core/pyspec/eth2spec/test/deneb/unittests/fork_choice/__init__.py diff --git a/tests/core/pyspec/eth2spec/test/eip4844/unittests/fork_choice/test_validate_blobs_sidecar.py b/tests/core/pyspec/eth2spec/test/deneb/unittests/fork_choice/test_validate_blobs_sidecar.py similarity index 93% rename from tests/core/pyspec/eth2spec/test/eip4844/unittests/fork_choice/test_validate_blobs_sidecar.py rename to tests/core/pyspec/eth2spec/test/deneb/unittests/fork_choice/test_validate_blobs_sidecar.py index dbea9f784..87ed9ff8e 100644 --- a/tests/core/pyspec/eth2spec/test/eip4844/unittests/fork_choice/test_validate_blobs_sidecar.py +++ b/tests/core/pyspec/eth2spec/test/deneb/unittests/fork_choice/test_validate_blobs_sidecar.py @@ -6,7 +6,7 @@ from eth2spec.test.helpers.block import ( ) from eth2spec.test.context import ( spec_state_test, - with_eip4844_and_later, + with_deneb_and_later, ) from eth2spec.test.helpers.execution_payload import ( compute_el_block_hash, @@ -29,25 +29,25 @@ def _run_validate_blobs_sidecar_test(spec, state, blob_count): spec.validate_blobs_sidecar(block.slot, block.hash_tree_root(), expected_commitments, blobs_sidecar) -@with_eip4844_and_later +@with_deneb_and_later @spec_state_test def test_validate_blobs_sidecar_zero_blobs(spec, state): _run_validate_blobs_sidecar_test(spec, state, blob_count=0) -@with_eip4844_and_later +@with_deneb_and_later @spec_state_test def test_validate_blobs_sidecar_one_blob(spec, state): _run_validate_blobs_sidecar_test(spec, state, blob_count=1) -@with_eip4844_and_later +@with_deneb_and_later @spec_state_test def test_validate_blobs_sidecar_two_blobs(spec, state): _run_validate_blobs_sidecar_test(spec, state, blob_count=2) -@with_eip4844_and_later +@with_deneb_and_later @spec_state_test def test_validate_blobs_sidecar_max_blobs(spec, state): _run_validate_blobs_sidecar_test(spec, state, blob_count=spec.MAX_BLOBS_PER_BLOCK) diff --git a/tests/core/pyspec/eth2spec/test/eip4844/unittests/polynomial_commitments/__init__.py b/tests/core/pyspec/eth2spec/test/deneb/unittests/polynomial_commitments/__init__.py similarity index 100% rename from tests/core/pyspec/eth2spec/test/eip4844/unittests/polynomial_commitments/__init__.py rename to tests/core/pyspec/eth2spec/test/deneb/unittests/polynomial_commitments/__init__.py diff --git a/tests/core/pyspec/eth2spec/test/eip4844/unittests/polynomial_commitments/test_polynomial_commitments.py b/tests/core/pyspec/eth2spec/test/deneb/unittests/polynomial_commitments/test_polynomial_commitments.py similarity index 96% rename from tests/core/pyspec/eth2spec/test/eip4844/unittests/polynomial_commitments/test_polynomial_commitments.py rename to tests/core/pyspec/eth2spec/test/deneb/unittests/polynomial_commitments/test_polynomial_commitments.py index 04f5857f3..4d881e3e3 100644 --- a/tests/core/pyspec/eth2spec/test/eip4844/unittests/polynomial_commitments/test_polynomial_commitments.py +++ b/tests/core/pyspec/eth2spec/test/deneb/unittests/polynomial_commitments/test_polynomial_commitments.py @@ -2,7 +2,7 @@ import random from eth2spec.test.context import ( spec_state_test, - with_eip4844_and_later, + with_deneb_and_later, ) from eth2spec.test.helpers.sharding import ( get_sample_blob, @@ -11,7 +11,7 @@ from eth2spec.test.helpers.sharding import ( ) -@with_eip4844_and_later +@with_deneb_and_later @spec_state_test def test_verify_kzg_proof(spec, state): x = 3 @@ -24,7 +24,7 @@ def test_verify_kzg_proof(spec, state): assert spec.verify_kzg_proof_impl(commitment, x, y, proof) -@with_eip4844_and_later +@with_deneb_and_later @spec_state_test def test_barycentric_outside_domain(spec, state): """ @@ -57,7 +57,7 @@ def test_barycentric_outside_domain(spec, state): assert p_z_coeff == p_z_eval -@with_eip4844_and_later +@with_deneb_and_later @spec_state_test def test_barycentric_within_domain(spec, state): """ diff --git a/tests/core/pyspec/eth2spec/test/eip4844/unittests/test_kzg.py b/tests/core/pyspec/eth2spec/test/deneb/unittests/test_kzg.py similarity index 91% rename from tests/core/pyspec/eth2spec/test/eip4844/unittests/test_kzg.py rename to tests/core/pyspec/eth2spec/test/deneb/unittests/test_kzg.py index 7474707b9..71bfae8b8 100644 --- a/tests/core/pyspec/eth2spec/test/eip4844/unittests/test_kzg.py +++ b/tests/core/pyspec/eth2spec/test/deneb/unittests/test_kzg.py @@ -1,6 +1,6 @@ from eth2spec.test.helpers.constants import ( - EIP4844, + DENEB, MINIMAL, ) from eth2spec.test.helpers.sharding import ( @@ -13,7 +13,7 @@ from eth2spec.test.context import ( ) -@with_phases([EIP4844]) +@with_phases([DENEB]) @spec_state_test @with_presets([MINIMAL]) def test_blob_to_kzg_commitment(spec, state): diff --git a/tests/core/pyspec/eth2spec/test/eip4844/unittests/test_offset.py b/tests/core/pyspec/eth2spec/test/deneb/unittests/test_offset.py similarity index 94% rename from tests/core/pyspec/eth2spec/test/eip4844/unittests/test_offset.py rename to tests/core/pyspec/eth2spec/test/deneb/unittests/test_offset.py index 1702ea7e0..13150180b 100644 --- a/tests/core/pyspec/eth2spec/test/eip4844/unittests/test_offset.py +++ b/tests/core/pyspec/eth2spec/test/deneb/unittests/test_offset.py @@ -1,6 +1,6 @@ from eth2spec.test.helpers.constants import ( - EIP4844, + DENEB, MINIMAL, ) from eth2spec.test.helpers.sharding import ( @@ -13,7 +13,7 @@ from eth2spec.test.context import ( ) -@with_phases([EIP4844]) +@with_phases([DENEB]) @spec_state_test @with_presets([MINIMAL]) def test_tx_peek_blob_versioned_hashes(spec, state): diff --git a/tests/core/pyspec/eth2spec/test/eip4844/fork/test_eip4844_fork_random.py b/tests/core/pyspec/eth2spec/test/eip4844/fork/test_eip4844_fork_random.py deleted file mode 100644 index a22de4b59..000000000 --- a/tests/core/pyspec/eth2spec/test/eip4844/fork/test_eip4844_fork_random.py +++ /dev/null @@ -1,84 +0,0 @@ -from random import Random - -from eth2spec.test.context import ( - with_phases, - with_custom_state, - with_presets, - spec_test, with_state, - low_balances, misc_balances, large_validator_set, -) -from eth2spec.test.utils import with_meta_tags -from eth2spec.test.helpers.constants import ( - CAPELLA, EIP4844, - MINIMAL, -) -from eth2spec.test.helpers.eip4844.fork import ( - EIP4844_FORK_TEST_META_TAGS, - run_fork_test, -) -from eth2spec.test.helpers.random import randomize_state - - -@with_phases(phases=[CAPELLA], other_phases=[EIP4844]) -@spec_test -@with_state -@with_meta_tags(EIP4844_FORK_TEST_META_TAGS) -def test_eip4844_fork_random_0(spec, phases, state): - randomize_state(spec, state, rng=Random(1010)) - yield from run_fork_test(phases[EIP4844], state) - - -@with_phases(phases=[CAPELLA], other_phases=[EIP4844]) -@spec_test -@with_state -@with_meta_tags(EIP4844_FORK_TEST_META_TAGS) -def test_eip4844_fork_random_1(spec, phases, state): - randomize_state(spec, state, rng=Random(2020)) - yield from run_fork_test(phases[EIP4844], state) - - -@with_phases(phases=[CAPELLA], other_phases=[EIP4844]) -@spec_test -@with_state -@with_meta_tags(EIP4844_FORK_TEST_META_TAGS) -def test_eip4844_fork_random_2(spec, phases, state): - randomize_state(spec, state, rng=Random(3030)) - yield from run_fork_test(phases[EIP4844], state) - - -@with_phases(phases=[CAPELLA], other_phases=[EIP4844]) -@spec_test -@with_state -@with_meta_tags(EIP4844_FORK_TEST_META_TAGS) -def test_eip4844_fork_random_3(spec, phases, state): - randomize_state(spec, state, rng=Random(4040)) - yield from run_fork_test(phases[EIP4844], state) - - -@with_phases(phases=[CAPELLA], other_phases=[EIP4844]) -@spec_test -@with_custom_state(balances_fn=low_balances, threshold_fn=lambda spec: spec.config.EJECTION_BALANCE) -@with_meta_tags(EIP4844_FORK_TEST_META_TAGS) -def test_eip4844_fork_random_low_balances(spec, phases, state): - randomize_state(spec, state, rng=Random(5050)) - yield from run_fork_test(phases[EIP4844], state) - - -@with_phases(phases=[CAPELLA], other_phases=[EIP4844]) -@spec_test -@with_custom_state(balances_fn=misc_balances, threshold_fn=lambda spec: spec.config.EJECTION_BALANCE) -@with_meta_tags(EIP4844_FORK_TEST_META_TAGS) -def test_eip4844_fork_random_misc_balances(spec, phases, state): - randomize_state(spec, state, rng=Random(6060)) - yield from run_fork_test(phases[EIP4844], state) - - -@with_phases(phases=[CAPELLA], other_phases=[EIP4844]) -@with_presets([MINIMAL], - reason="mainnet config leads to larger validator set than limit of public/private keys pre-generated") -@spec_test -@with_custom_state(balances_fn=large_validator_set, threshold_fn=lambda spec: spec.config.EJECTION_BALANCE) -@with_meta_tags(EIP4844_FORK_TEST_META_TAGS) -def test_eip4844_fork_random_large_validator_set(spec, phases, state): - randomize_state(spec, state, rng=Random(7070)) - yield from run_fork_test(phases[EIP4844], state) diff --git a/tests/core/pyspec/eth2spec/test/helpers/constants.py b/tests/core/pyspec/eth2spec/test/helpers/constants.py index cd103337f..0d31adb43 100644 --- a/tests/core/pyspec/eth2spec/test/helpers/constants.py +++ b/tests/core/pyspec/eth2spec/test/helpers/constants.py @@ -14,25 +14,25 @@ CAPELLA = SpecForkName('capella') SHARDING = SpecForkName('sharding') CUSTODY_GAME = SpecForkName('custody_game') DAS = SpecForkName('das') -EIP4844 = SpecForkName('eip4844') +DENEB = SpecForkName('deneb') # The forks that pytest can run with. ALL_PHASES = ( # Formal forks PHASE0, ALTAIR, BELLATRIX, CAPELLA, # Experimental patches - EIP4844, + DENEB, ) # The forks that output to the test vectors. -TESTGEN_FORKS = (PHASE0, ALTAIR, BELLATRIX, CAPELLA, EIP4844) +TESTGEN_FORKS = (PHASE0, ALTAIR, BELLATRIX, CAPELLA, DENEB) -# TODO: no EIP4844 fork tests now. Should add when we figure out the content of Capella. +# TODO: no DENEB fork tests now. Should add when we figure out the content of Capella. ALL_FORK_UPGRADES = { # pre_fork_name: post_fork_name PHASE0: ALTAIR, ALTAIR: BELLATRIX, BELLATRIX: CAPELLA, - CAPELLA: EIP4844, + CAPELLA: DENEB, } ALL_PRE_POST_FORKS = ALL_FORK_UPGRADES.items() AFTER_BELLATRIX_UPGRADES = {key: value for key, value in ALL_FORK_UPGRADES.items() if key != PHASE0} diff --git a/tests/core/pyspec/eth2spec/test/helpers/eip4844/__init__.py b/tests/core/pyspec/eth2spec/test/helpers/deneb/__init__.py similarity index 100% rename from tests/core/pyspec/eth2spec/test/helpers/eip4844/__init__.py rename to tests/core/pyspec/eth2spec/test/helpers/deneb/__init__.py diff --git a/tests/core/pyspec/eth2spec/test/helpers/eip4844/fork.py b/tests/core/pyspec/eth2spec/test/helpers/deneb/fork.py similarity index 90% rename from tests/core/pyspec/eth2spec/test/helpers/eip4844/fork.py rename to tests/core/pyspec/eth2spec/test/helpers/deneb/fork.py index ed4ae057d..7fe0535c1 100644 --- a/tests/core/pyspec/eth2spec/test/helpers/eip4844/fork.py +++ b/tests/core/pyspec/eth2spec/test/helpers/deneb/fork.py @@ -1,17 +1,17 @@ from eth2spec.test.helpers.constants import ( - EIP4844, + DENEB, ) -EIP4844_FORK_TEST_META_TAGS = { - 'fork': EIP4844, +DENEB_FORK_TEST_META_TAGS = { + 'fork': DENEB, } def run_fork_test(post_spec, pre_state): yield 'pre', pre_state - post_state = post_spec.upgrade_to_eip4844(pre_state) + post_state = post_spec.upgrade_to_deneb(pre_state) # Stable fields stable_fields = [ @@ -57,7 +57,7 @@ def run_fork_test(post_spec, pre_state): assert getattr(pre_validator, field) == getattr(post_validator, field) assert pre_state.fork.current_version == post_state.fork.previous_version - assert post_state.fork.current_version == post_spec.config.EIP4844_FORK_VERSION + assert post_state.fork.current_version == post_spec.config.DENEB_FORK_VERSION assert post_state.fork.epoch == post_spec.get_current_epoch(post_state) yield 'post', post_state diff --git a/tests/core/pyspec/eth2spec/test/helpers/execution_payload.py b/tests/core/pyspec/eth2spec/test/helpers/execution_payload.py index 5e0c160b3..c0a70aca1 100644 --- a/tests/core/pyspec/eth2spec/test/helpers/execution_payload.py +++ b/tests/core/pyspec/eth2spec/test/helpers/execution_payload.py @@ -4,7 +4,7 @@ from rlp import encode from rlp.sedes import big_endian_int, Binary, List from eth2spec.debug.random_value import get_random_bytes_list -from eth2spec.test.helpers.forks import is_post_capella, is_post_eip4844 +from eth2spec.test.helpers.forks import is_post_capella, is_post_deneb def get_execution_payload_header(spec, execution_payload): @@ -26,7 +26,7 @@ def get_execution_payload_header(spec, execution_payload): ) if is_post_capella(spec): payload_header.withdrawals_root = spec.hash_tree_root(execution_payload.withdrawals) - if is_post_eip4844(spec): + if is_post_deneb(spec): payload_header.excess_data_gas = execution_payload.excess_data_gas return payload_header @@ -89,7 +89,7 @@ def compute_el_header_block_hash(spec, if is_post_capella(spec): # withdrawals_root execution_payload_header_rlp.append((Binary(32, 32), withdrawals_trie_root)) - if is_post_eip4844(spec): + if is_post_deneb(spec): # excess_data_gas execution_payload_header_rlp.append((big_endian_int, payload_header.excess_data_gas)) diff --git a/tests/core/pyspec/eth2spec/test/helpers/fork_transition.py b/tests/core/pyspec/eth2spec/test/helpers/fork_transition.py index ca961bde4..96d0d20dc 100644 --- a/tests/core/pyspec/eth2spec/test/helpers/fork_transition.py +++ b/tests/core/pyspec/eth2spec/test/helpers/fork_transition.py @@ -14,7 +14,7 @@ from eth2spec.test.helpers.constants import ( ALTAIR, BELLATRIX, CAPELLA, - EIP4844, + DENEB, ) from eth2spec.test.helpers.deposits import ( prepare_state_and_deposit, @@ -153,8 +153,8 @@ def do_fork(state, spec, post_spec, fork_epoch, with_block=True, operation_dict= state = post_spec.upgrade_to_bellatrix(state) elif post_spec.fork == CAPELLA: state = post_spec.upgrade_to_capella(state) - elif post_spec.fork == EIP4844: - state = post_spec.upgrade_to_eip4844(state) + elif post_spec.fork == DENEB: + state = post_spec.upgrade_to_deneb(state) assert state.fork.epoch == fork_epoch @@ -167,9 +167,9 @@ def do_fork(state, spec, post_spec, fork_epoch, with_block=True, operation_dict= elif post_spec.fork == CAPELLA: assert state.fork.previous_version == post_spec.config.BELLATRIX_FORK_VERSION assert state.fork.current_version == post_spec.config.CAPELLA_FORK_VERSION - elif post_spec.fork == EIP4844: + elif post_spec.fork == DENEB: assert state.fork.previous_version == post_spec.config.CAPELLA_FORK_VERSION - assert state.fork.current_version == post_spec.config.EIP4844_FORK_VERSION + assert state.fork.current_version == post_spec.config.DENEB_FORK_VERSION if with_block: return state, _state_transition_and_sign_block_at_slot(post_spec, state, operation_dict=operation_dict) diff --git a/tests/core/pyspec/eth2spec/test/helpers/forks.py b/tests/core/pyspec/eth2spec/test/helpers/forks.py index 82ff12ff1..be3103e67 100644 --- a/tests/core/pyspec/eth2spec/test/helpers/forks.py +++ b/tests/core/pyspec/eth2spec/test/helpers/forks.py @@ -1,11 +1,11 @@ from .constants import ( - PHASE0, ALTAIR, BELLATRIX, CAPELLA, EIP4844, + PHASE0, ALTAIR, BELLATRIX, CAPELLA, DENEB, ) def is_post_fork(a, b): - if a == EIP4844: - return b in [PHASE0, ALTAIR, BELLATRIX, CAPELLA, EIP4844] + if a == DENEB: + return b in [PHASE0, ALTAIR, BELLATRIX, CAPELLA, DENEB] if a == CAPELLA: return b in [PHASE0, ALTAIR, BELLATRIX, CAPELLA] if a == BELLATRIX: @@ -29,5 +29,5 @@ def is_post_capella(spec): return is_post_fork(spec.fork, CAPELLA) -def is_post_eip4844(spec): - return is_post_fork(spec.fork, EIP4844) +def is_post_deneb(spec): + return is_post_fork(spec.fork, DENEB) diff --git a/tests/core/pyspec/eth2spec/test/helpers/genesis.py b/tests/core/pyspec/eth2spec/test/helpers/genesis.py index de2dd2647..0610f11ad 100644 --- a/tests/core/pyspec/eth2spec/test/helpers/genesis.py +++ b/tests/core/pyspec/eth2spec/test/helpers/genesis.py @@ -1,5 +1,5 @@ from eth2spec.test.helpers.constants import ( - ALTAIR, BELLATRIX, CAPELLA, EIP4844, + ALTAIR, BELLATRIX, CAPELLA, DENEB, ) from eth2spec.test.helpers.execution_payload import ( compute_el_header_block_hash, @@ -77,9 +77,9 @@ def create_genesis_state(spec, validator_balances, activation_threshold): elif spec.fork == CAPELLA: previous_version = spec.config.BELLATRIX_FORK_VERSION current_version = spec.config.CAPELLA_FORK_VERSION - elif spec.fork == EIP4844: + elif spec.fork == DENEB: previous_version = spec.config.CAPELLA_FORK_VERSION - current_version = spec.config.EIP4844_FORK_VERSION + current_version = spec.config.DENEB_FORK_VERSION state = spec.BeaconState( genesis_time=0, diff --git a/tests/core/pyspec/eth2spec/test/utils/randomized_block_tests.py b/tests/core/pyspec/eth2spec/test/utils/randomized_block_tests.py index 4d2ec124d..35ddbc330 100644 --- a/tests/core/pyspec/eth2spec/test/utils/randomized_block_tests.py +++ b/tests/core/pyspec/eth2spec/test/utils/randomized_block_tests.py @@ -88,7 +88,7 @@ def randomize_state_capella(spec, state, stats, exit_fraction=0.1, slash_fractio return scenario_state -def randomize_state_eip4844(spec, state, stats, exit_fraction=0.1, slash_fraction=0.1): +def randomize_state_deneb(spec, state, stats, exit_fraction=0.1, slash_fraction=0.1): scenario_state = randomize_state_capella(spec, state, stats, @@ -232,7 +232,7 @@ def random_block_capella(spec, state, signed_blocks, scenario_state, rng=Random( return block -def random_block_eip4844(spec, state, signed_blocks, scenario_state, rng=Random(3456)): +def random_block_deneb(spec, state, signed_blocks, scenario_state, rng=Random(3456)): block = random_block_capella(spec, state, signed_blocks, scenario_state) # TODO: more commitments. blob_kzg_commitments: List[KZGCommitment, MAX_BLOBS_PER_BLOCK] opaque_tx, _, blob_kzg_commitments = get_sample_opaque_tx(spec, blob_count=1) diff --git a/tests/generators/epoch_processing/main.py b/tests/generators/epoch_processing/main.py index dda4345a8..a485f646a 100644 --- a/tests/generators/epoch_processing/main.py +++ b/tests/generators/epoch_processing/main.py @@ -1,5 +1,5 @@ from eth2spec.gen_helpers.gen_from_tests.gen import run_state_test_generators, combine_mods -from eth2spec.test.helpers.constants import PHASE0, ALTAIR, BELLATRIX, CAPELLA, EIP4844 +from eth2spec.test.helpers.constants import PHASE0, ALTAIR, BELLATRIX, CAPELLA, DENEB if __name__ == "__main__": @@ -32,7 +32,7 @@ if __name__ == "__main__": ]} capella_mods = combine_mods(_new_capella_mods, bellatrix_mods) - eip4844_mods = capella_mods + deneb_mods = capella_mods # TODO Custody Game testgen is disabled for now # custody_game_mods = {**{key: 'eth2spec.test.custody_game.epoch_processing.test_process_' + key for key in [ @@ -46,7 +46,7 @@ if __name__ == "__main__": ALTAIR: altair_mods, BELLATRIX: bellatrix_mods, CAPELLA: capella_mods, - EIP4844: eip4844_mods, + DENEB: deneb_mods, } run_state_test_generators(runner_name="epoch_processing", all_mods=all_mods) diff --git a/tests/generators/finality/main.py b/tests/generators/finality/main.py index de5af9b11..a25f3b8e7 100644 --- a/tests/generators/finality/main.py +++ b/tests/generators/finality/main.py @@ -1,5 +1,5 @@ from eth2spec.gen_helpers.gen_from_tests.gen import run_state_test_generators -from eth2spec.test.helpers.constants import PHASE0, ALTAIR, BELLATRIX, CAPELLA, EIP4844 +from eth2spec.test.helpers.constants import PHASE0, ALTAIR, BELLATRIX, CAPELLA, DENEB if __name__ == "__main__": @@ -7,14 +7,14 @@ if __name__ == "__main__": altair_mods = phase_0_mods # No additional Altair specific finality tests bellatrix_mods = altair_mods # No additional Bellatrix specific finality tests capella_mods = bellatrix_mods # No additional Capella specific finality tests - eip4844_mods = capella_mods # No additional EIP4844 specific finality tests + deneb_mods = capella_mods # No additional Deneb specific finality tests all_mods = { PHASE0: phase_0_mods, ALTAIR: altair_mods, BELLATRIX: bellatrix_mods, CAPELLA: capella_mods, - EIP4844: eip4844_mods, + DENEB: deneb_mods, } run_state_test_generators(runner_name="finality", all_mods=all_mods) diff --git a/tests/generators/fork_choice/main.py b/tests/generators/fork_choice/main.py index 40e19a8ac..c106810f8 100644 --- a/tests/generators/fork_choice/main.py +++ b/tests/generators/fork_choice/main.py @@ -1,5 +1,5 @@ from eth2spec.gen_helpers.gen_from_tests.gen import run_state_test_generators, combine_mods -from eth2spec.test.helpers.constants import PHASE0, ALTAIR, BELLATRIX, CAPELLA, EIP4844 +from eth2spec.test.helpers.constants import PHASE0, ALTAIR, BELLATRIX, CAPELLA, DENEB if __name__ == "__main__": @@ -18,14 +18,14 @@ if __name__ == "__main__": ]} bellatrix_mods = combine_mods(_new_bellatrix_mods, altair_mods) capella_mods = bellatrix_mods # No additional Capella specific fork choice tests - eip4844_mods = capella_mods # No additional Capella specific fork choice tests + deneb_mods = capella_mods # No additional Capella specific fork choice tests all_mods = { PHASE0: phase_0_mods, ALTAIR: altair_mods, BELLATRIX: bellatrix_mods, CAPELLA: capella_mods, - EIP4844: eip4844_mods, + DENEB: deneb_mods, } run_state_test_generators(runner_name="fork_choice", all_mods=all_mods) diff --git a/tests/generators/forks/main.py b/tests/generators/forks/main.py index 42f3f3a1f..7d68a31e7 100644 --- a/tests/generators/forks/main.py +++ b/tests/generators/forks/main.py @@ -1,14 +1,14 @@ from typing import Iterable from eth2spec.test.helpers.constants import ( - PHASE0, ALTAIR, BELLATRIX, CAPELLA, EIP4844, + PHASE0, ALTAIR, BELLATRIX, CAPELLA, DENEB, MINIMAL, MAINNET, ) from eth2spec.test.helpers.typing import SpecForkName, PresetBaseName from eth2spec.test.altair.fork import test_altair_fork_basic, test_altair_fork_random from eth2spec.test.bellatrix.fork import test_bellatrix_fork_basic, test_bellatrix_fork_random from eth2spec.test.capella.fork import test_capella_fork_basic, test_capella_fork_random -from eth2spec.test.eip4844.fork import test_eip4844_fork_basic, test_eip4844_fork_random +from eth2spec.test.deneb.fork import test_deneb_fork_basic, test_deneb_fork_random from eth2spec.gen_helpers.gen_base import gen_runner, gen_typing from eth2spec.gen_helpers.gen_from_tests.gen import generate_from_tests @@ -40,8 +40,8 @@ def _get_fork_tests_providers(): yield create_provider(test_bellatrix_fork_random, preset, ALTAIR, BELLATRIX) yield create_provider(test_capella_fork_basic, preset, BELLATRIX, CAPELLA) yield create_provider(test_capella_fork_random, preset, BELLATRIX, CAPELLA) - yield create_provider(test_eip4844_fork_basic, preset, CAPELLA, EIP4844) - yield create_provider(test_eip4844_fork_random, preset, CAPELLA, EIP4844) + yield create_provider(test_deneb_fork_basic, preset, CAPELLA, DENEB) + yield create_provider(test_deneb_fork_random, preset, CAPELLA, DENEB) if __name__ == "__main__": diff --git a/tests/generators/genesis/main.py b/tests/generators/genesis/main.py index a5c4eba9d..e95afcde1 100644 --- a/tests/generators/genesis/main.py +++ b/tests/generators/genesis/main.py @@ -1,5 +1,5 @@ from eth2spec.gen_helpers.gen_from_tests.gen import run_state_test_generators, combine_mods -from eth2spec.test.helpers.constants import PHASE0, ALTAIR, BELLATRIX, CAPELLA, EIP4844 +from eth2spec.test.helpers.constants import PHASE0, ALTAIR, BELLATRIX, CAPELLA, DENEB if __name__ == "__main__": @@ -16,13 +16,13 @@ if __name__ == "__main__": ]} bellatrix_mods = combine_mods(_new_bellatrix_mods, altair_mods) capella_mods = bellatrix_mods # No additional Capella specific genesis tests - eip4844_mods = capella_mods # No additional EIP4844 specific genesis tests + deneb_mods = capella_mods # No additional Deneb specific genesis tests all_mods = { PHASE0: phase_0_mods, ALTAIR: altair_mods, BELLATRIX: bellatrix_mods, CAPELLA: capella_mods, - EIP4844: eip4844_mods, + DENEB: deneb_mods, } run_state_test_generators(runner_name="genesis", all_mods=all_mods) diff --git a/tests/generators/light_client/main.py b/tests/generators/light_client/main.py index 54c09fae6..cfe34aee4 100644 --- a/tests/generators/light_client/main.py +++ b/tests/generators/light_client/main.py @@ -1,4 +1,4 @@ -from eth2spec.test.helpers.constants import ALTAIR, BELLATRIX, CAPELLA, EIP4844 +from eth2spec.test.helpers.constants import ALTAIR, BELLATRIX, CAPELLA, DENEB from eth2spec.gen_helpers.gen_from_tests.gen import combine_mods, run_state_test_generators @@ -14,13 +14,13 @@ if __name__ == "__main__": 'single_merkle_proof', ]} capella_mods = combine_mods(_new_capella_mods, bellatrix_mods) - eip4844_mods = capella_mods + deneb_mods = capella_mods all_mods = { ALTAIR: altair_mods, BELLATRIX: bellatrix_mods, CAPELLA: capella_mods, - EIP4844: eip4844_mods, + DENEB: deneb_mods, } run_state_test_generators(runner_name="light_client", all_mods=all_mods) diff --git a/tests/generators/operations/main.py b/tests/generators/operations/main.py index d370a1b85..ed4c6c26c 100644 --- a/tests/generators/operations/main.py +++ b/tests/generators/operations/main.py @@ -1,5 +1,5 @@ from eth2spec.gen_helpers.gen_from_tests.gen import run_state_test_generators, combine_mods -from eth2spec.test.helpers.constants import PHASE0, ALTAIR, BELLATRIX, CAPELLA, EIP4844 +from eth2spec.test.helpers.constants import PHASE0, ALTAIR, BELLATRIX, CAPELLA, DENEB if __name__ == "__main__": @@ -36,7 +36,7 @@ if __name__ == "__main__": ]} capella_mods = combine_mods(_new_capella_mods, bellatrix_mods) - eip4844_mods = capella_mods + deneb_mods = capella_mods # TODO Custody Game testgen is disabled for now # _new_custody_game_mods = {key: 'eth2spec.test.custody_game.block_processing.test_process_' + key for key in [ @@ -53,7 +53,7 @@ if __name__ == "__main__": ALTAIR: altair_mods, BELLATRIX: bellatrix_mods, CAPELLA: capella_mods, - EIP4844: eip4844_mods, + DENEB: deneb_mods, } run_state_test_generators(runner_name="operations", all_mods=all_mods) diff --git a/tests/generators/random/Makefile b/tests/generators/random/Makefile index f57221ab4..bb557204a 100644 --- a/tests/generators/random/Makefile +++ b/tests/generators/random/Makefile @@ -6,9 +6,9 @@ all: rm -f ../../core/pyspec/eth2spec/test/altair/random/test_random.py rm -f ../../core/pyspec/eth2spec/test/bellatrix/random/test_random.py rm -f ../../core/pyspec/eth2spec/test/capella/random/test_random.py - rm -f ../../core/pyspec/eth2spec/test/eip4844/random/test_random.py + rm -f ../../core/pyspec/eth2spec/test/deneb/random/test_random.py python3 generate.py phase0 > ../../core/pyspec/eth2spec/test/phase0/random/test_random.py python3 generate.py altair > ../../core/pyspec/eth2spec/test/altair/random/test_random.py python3 generate.py bellatrix > ../../core/pyspec/eth2spec/test/bellatrix/random/test_random.py python3 generate.py capella > ../../core/pyspec/eth2spec/test/capella/random/test_random.py - python3 generate.py eip4844 > ../../core/pyspec/eth2spec/test/eip4844/random/test_random.py + python3 generate.py deneb > ../../core/pyspec/eth2spec/test/deneb/random/test_random.py diff --git a/tests/generators/random/generate.py b/tests/generators/random/generate.py index 129d670fd..3a1eb9c67 100644 --- a/tests/generators/random/generate.py +++ b/tests/generators/random/generate.py @@ -21,12 +21,12 @@ from eth2spec.test.utils.randomized_block_tests import ( randomize_state_altair, randomize_state_bellatrix, randomize_state_capella, - randomize_state_eip4844, + randomize_state_deneb, random_block, random_block_altair_with_cycling_sync_committee_participation, random_block_bellatrix, random_block_capella, - random_block_eip4844, + random_block_deneb, last_slot_in_epoch, random_slot_in_epoch, penultimate_slot_in_epoch, @@ -36,7 +36,7 @@ from eth2spec.test.utils.randomized_block_tests import ( transition_to_leaking, transition_without_leak, ) -from eth2spec.test.helpers.constants import PHASE0, ALTAIR, BELLATRIX, CAPELLA, EIP4844 +from eth2spec.test.helpers.constants import PHASE0, ALTAIR, BELLATRIX, CAPELLA, DENEB # Ensure this many blocks are present in *each* randomized scenario @@ -274,12 +274,12 @@ if __name__ == "__main__": state_randomizer=randomize_state_capella, block_randomizer=random_block_capella, ) - if EIP4844 in sys.argv: + if DENEB in sys.argv: did_generate = True run_generate_tests_to_std_out( - EIP4844, - state_randomizer=randomize_state_eip4844, - block_randomizer=random_block_eip4844, + DENEB, + state_randomizer=randomize_state_deneb, + block_randomizer=random_block_deneb, ) if not did_generate: warnings.warn("no phase given for test generation") diff --git a/tests/generators/random/main.py b/tests/generators/random/main.py index e36678771..c5b991e4a 100644 --- a/tests/generators/random/main.py +++ b/tests/generators/random/main.py @@ -1,4 +1,4 @@ -from eth2spec.test.helpers.constants import PHASE0, ALTAIR, BELLATRIX, CAPELLA, EIP4844 +from eth2spec.test.helpers.constants import PHASE0, ALTAIR, BELLATRIX, CAPELLA, DENEB from eth2spec.gen_helpers.gen_from_tests.gen import run_state_test_generators @@ -15,7 +15,7 @@ if __name__ == "__main__": capella_mods = {key: 'eth2spec.test.capella.random.test_' + key for key in [ 'random', ]} - eip4844_mods = {key: 'eth2spec.test.eip4844.random.test_' + key for key in [ + deneb_mods = {key: 'eth2spec.test.deneb.random.test_' + key for key in [ 'random', ]} @@ -24,7 +24,7 @@ if __name__ == "__main__": ALTAIR: altair_mods, BELLATRIX: bellatrix_mods, CAPELLA: capella_mods, - EIP4844: eip4844_mods, + DENEB: deneb_mods, } run_state_test_generators(runner_name="random", all_mods=all_mods) diff --git a/tests/generators/rewards/main.py b/tests/generators/rewards/main.py index 8958074bc..e6244d172 100644 --- a/tests/generators/rewards/main.py +++ b/tests/generators/rewards/main.py @@ -1,5 +1,5 @@ from eth2spec.gen_helpers.gen_from_tests.gen import run_state_test_generators -from eth2spec.test.helpers.constants import PHASE0, ALTAIR, BELLATRIX, CAPELLA, EIP4844 +from eth2spec.test.helpers.constants import PHASE0, ALTAIR, BELLATRIX, CAPELLA, DENEB if __name__ == "__main__": @@ -16,14 +16,14 @@ if __name__ == "__main__": # Transaction fees are part of the execution-layer. bellatrix_mods = altair_mods capella_mods = bellatrix_mods - eip4844_mods = capella_mods + deneb_mods = capella_mods all_mods = { PHASE0: phase_0_mods, ALTAIR: altair_mods, BELLATRIX: bellatrix_mods, CAPELLA: capella_mods, - EIP4844: eip4844_mods, + DENEB: deneb_mods, } run_state_test_generators(runner_name="rewards", all_mods=all_mods) diff --git a/tests/generators/sanity/main.py b/tests/generators/sanity/main.py index 9dd6d7ac0..8a6c7b39c 100644 --- a/tests/generators/sanity/main.py +++ b/tests/generators/sanity/main.py @@ -1,4 +1,4 @@ -from eth2spec.test.helpers.constants import PHASE0, ALTAIR, BELLATRIX, CAPELLA, EIP4844 +from eth2spec.test.helpers.constants import PHASE0, ALTAIR, BELLATRIX, CAPELLA, DENEB from eth2spec.gen_helpers.gen_from_tests.gen import run_state_test_generators, combine_mods @@ -23,17 +23,17 @@ if __name__ == "__main__": ]} capella_mods = combine_mods(_new_capella_mods, bellatrix_mods) - _new_eip4844_mods = {key: 'eth2spec.test.eip4844.sanity.test_' + key for key in [ + _new_deneb_mods = {key: 'eth2spec.test.deneb.sanity.test_' + key for key in [ 'blocks', ]} - eip4844_mods = combine_mods(_new_eip4844_mods, capella_mods) + deneb_mods = combine_mods(_new_deneb_mods, capella_mods) all_mods = { PHASE0: phase_0_mods, ALTAIR: altair_mods, BELLATRIX: bellatrix_mods, CAPELLA: capella_mods, - EIP4844: eip4844_mods, + DENEB: deneb_mods, } run_state_test_generators(runner_name="sanity", all_mods=all_mods) diff --git a/tests/generators/sync/main.py b/tests/generators/sync/main.py index 8fb395053..11f05a741 100644 --- a/tests/generators/sync/main.py +++ b/tests/generators/sync/main.py @@ -1,5 +1,5 @@ from eth2spec.gen_helpers.gen_from_tests.gen import run_state_test_generators -from eth2spec.test.helpers.constants import BELLATRIX, CAPELLA, EIP4844 +from eth2spec.test.helpers.constants import BELLATRIX, CAPELLA, DENEB if __name__ == "__main__": @@ -7,12 +7,12 @@ if __name__ == "__main__": 'optimistic', ]} capella_mods = bellatrix_mods - eip4844_mods = capella_mods + deneb_mods = capella_mods all_mods = { BELLATRIX: bellatrix_mods, CAPELLA: capella_mods, - EIP4844: eip4844_mods, + DENEB: deneb_mods, } run_state_test_generators(runner_name="sync", all_mods=all_mods) From 470c1b14b35c64151114bca07a9a90154f77fe0e Mon Sep 17 00:00:00 2001 From: Paul Harris Date: Wed, 8 Feb 2023 09:22:28 +1000 Subject: [PATCH 12/29] fix references to eip4844 --- README.md | 2 +- specs/deneb/beacon-chain.md | 22 +++++++++---------- specs/deneb/fork-choice.md | 6 ++--- specs/deneb/fork.md | 10 ++++----- specs/deneb/p2p-interface.md | 10 ++++----- specs/deneb/polynomial-commitments.md | 6 ++--- specs/deneb/validator.md | 6 ++--- .../pyspec/eth2spec/test/helpers/sharding.py | 2 +- tests/generators/transition/main.py | 6 ++--- 9 files changed, 35 insertions(+), 35 deletions(-) diff --git a/README.md b/README.md index 466c15193..da893a53d 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ Features are researched and developed in parallel, and then consolidated into se | Code Name or Topic | Specs | Notes | | - | - | - | | Capella (tentative) |
  • Core
    • [Beacon chain changes](specs/capella/beacon-chain.md)
    • [Capella fork](specs/capella/fork.md)
  • Additions
    • [Light client sync protocol changes](specs/capella/light-client/sync-protocol.md) ([fork](specs/capella/light-client/fork.md), [full node](specs/capella/light-client/full-node.md), [networking](specs/capella/light-client/p2p-interface.md))
    • [Validator additions](specs/capella/validator.md)
    • [P2P networking](specs/capella/p2p-interface.md)
| -| Deneb (tentative) |
  • Core
    • [Beacon Chain changes](specs/deneb/beacon-chain.md)
    • [EIP-4844 fork](specs/deneb/fork.md)
    • [Polynomial commitments](specs/deneb/polynomial-commitments.md)
    • [Fork choice changes](specs/deneb/fork-choice.md)
  • Additions
    • [Light client sync protocol changes](specs/deneb/light-client/sync-protocol.md) ([fork](specs/deneb/light-client/fork.md), [full node](specs/deneb/light-client/full-node.md), [networking](specs/deneb/light-client/p2p-interface.md))
    • [Honest validator guide changes](specs/deneb/validator.md)
    • [P2P networking](specs/deneb/p2p-interface.md)
| +| Deneb (tentative) |
  • Core
    • [Beacon Chain changes](specs/deneb/beacon-chain.md)
    • [Deneb fork](specs/deneb/fork.md)
    • [Polynomial commitments](specs/deneb/polynomial-commitments.md)
    • [Fork choice changes](specs/deneb/fork-choice.md)
  • Additions
    • [Light client sync protocol changes](specs/deneb/light-client/sync-protocol.md) ([fork](specs/deneb/light-client/fork.md), [full node](specs/deneb/light-client/full-node.md), [networking](specs/deneb/light-client/p2p-interface.md))
    • [Honest validator guide changes](specs/deneb/validator.md)
    • [P2P networking](specs/deneb/p2p-interface.md)
| | Sharding (outdated) |
  • Core
    • [Beacon Chain changes](specs/sharding/beacon-chain.md)
  • Additions
    • [P2P networking](specs/sharding/p2p-interface.md)
| | Custody Game (outdated) |
  • Core
    • [Beacon Chain changes](specs/custody_game/beacon-chain.md)
  • Additions
    • [Honest validator guide changes](specs/custody_game/validator.md)
| Dependent on sharding | | Data Availability Sampling (outdated) |
  • Core
    • [Core types and functions](specs/das/das-core.md)
    • [Fork choice changes](specs/das/fork-choice.md)
  • Additions
    • [P2P Networking](specs/das/p2p-interface.md)
    • [Sampling process](specs/das/sampling.md)
|
  • Dependent on sharding
  • [Technical explainer](https://hackmd.io/@HWeNw8hNRimMm2m2GH56Cw/B1YJPGkpD)
| diff --git a/specs/deneb/beacon-chain.md b/specs/deneb/beacon-chain.md index 87ebf7a9e..e82fdfdcb 100644 --- a/specs/deneb/beacon-chain.md +++ b/specs/deneb/beacon-chain.md @@ -1,4 +1,4 @@ -# EIP-4844 -- The Beacon Chain +# Deneb -- The Beacon Chain **Notice**: This document is a work-in-progress for researchers and implementers. @@ -37,7 +37,7 @@ ## Introduction -This upgrade adds blobs to the beacon chain as part of EIP-4844. This is an extension of the Capella upgrade. +This upgrade adds blobs to the beacon chain as part of Deneb. This is an extension of the Capella upgrade. ## Custom types @@ -86,9 +86,9 @@ class BeaconBlockBody(Container): voluntary_exits: List[SignedVoluntaryExit, MAX_VOLUNTARY_EXITS] sync_aggregate: SyncAggregate # Execution - execution_payload: ExecutionPayload # [Modified in EIP-4844] + execution_payload: ExecutionPayload # [Modified in Deneb] bls_to_execution_changes: List[SignedBLSToExecutionChange, MAX_BLS_TO_EXECUTION_CHANGES] - blob_kzg_commitments: List[KZGCommitment, MAX_BLOBS_PER_BLOCK] # [New in EIP-4844] + blob_kzg_commitments: List[KZGCommitment, MAX_BLOBS_PER_BLOCK] # [New in Deneb] ``` #### `ExecutionPayload` @@ -108,7 +108,7 @@ class ExecutionPayload(Container): timestamp: uint64 extra_data: ByteList[MAX_EXTRA_DATA_BYTES] base_fee_per_gas: uint256 - excess_data_gas: uint256 # [New in EIP-4844] + excess_data_gas: uint256 # [New in Deneb] # Extra payload fields block_hash: Hash32 # Hash of execution block transactions: List[Transaction, MAX_TRANSACTIONS_PER_PAYLOAD] @@ -132,7 +132,7 @@ class ExecutionPayloadHeader(Container): timestamp: uint64 extra_data: ByteList[MAX_EXTRA_DATA_BYTES] base_fee_per_gas: uint256 - excess_data_gas: uint256 # [New in EIP-4844] + excess_data_gas: uint256 # [New in Deneb] # Extra payload fields block_hash: Hash32 # Hash of execution block transactions_root: Root @@ -152,7 +152,7 @@ def kzg_commitment_to_versioned_hash(kzg_commitment: KZGCommitment) -> Versioned #### `tx_peek_blob_versioned_hashes` -This function retrieves the hashes from the `SignedBlobTransaction` as defined in EIP-4844, using SSZ offsets. +This function retrieves the hashes from the `SignedBlobTransaction` as defined in Deneb, using SSZ offsets. Offsets are little-endian `uint32` values, as defined in the [SSZ specification](../../ssz/simple-serialize.md). See [the full details of `blob_versioned_hashes` offset calculation](https://gist.github.com/protolambda/23bd106b66f6d4bb854ce46044aa3ca3). @@ -192,12 +192,12 @@ def process_block(state: BeaconState, block: BeaconBlock) -> None: process_block_header(state, block) if is_execution_enabled(state, block.body): process_withdrawals(state, block.body.execution_payload) - process_execution_payload(state, block.body.execution_payload, EXECUTION_ENGINE) # [Modified in EIP-4844] + process_execution_payload(state, block.body.execution_payload, EXECUTION_ENGINE) # [Modified in Deneb] process_randao(state, block.body) process_eth1_data(state, block.body) process_operations(state, block.body) process_sync_aggregate(state, block.body.sync_aggregate) - process_blob_kzg_commitments(state, block.body) # [New in EIP-4844] + process_blob_kzg_commitments(state, block.body) # [New in Deneb] ``` #### Execution payload @@ -230,7 +230,7 @@ def process_execution_payload(state: BeaconState, payload: ExecutionPayload, exe timestamp=payload.timestamp, extra_data=payload.extra_data, base_fee_per_gas=payload.base_fee_per_gas, - excess_data_gas=payload.excess_data_gas, # [New in EIP-4844] + excess_data_gas=payload.excess_data_gas, # [New in Deneb] block_hash=payload.block_hash, transactions_root=hash_tree_root(payload.transactions), withdrawals_root=hash_tree_root(payload.withdrawals), @@ -247,7 +247,7 @@ def process_blob_kzg_commitments(state: BeaconState, body: BeaconBlockBody) -> N ## Testing -*Note*: The function `initialize_beacon_state_from_eth1` is modified for pure EIP-4844 testing only. +*Note*: The function `initialize_beacon_state_from_eth1` is modified for pure Deneb testing only. The `BeaconState` initialization is unchanged, except for the use of the updated `deneb.BeaconBlockBody` type when initializing the first body-root. diff --git a/specs/deneb/fork-choice.md b/specs/deneb/fork-choice.md index 962987907..d245034cf 100644 --- a/specs/deneb/fork-choice.md +++ b/specs/deneb/fork-choice.md @@ -1,4 +1,4 @@ -# EIP-4844 -- Fork Choice +# Deneb -- Fork Choice ## Table of contents @@ -19,7 +19,7 @@ ## Introduction -This is the modification of the fork choice accompanying the EIP-4844 upgrade. +This is the modification of the fork choice accompanying the Deneb upgrade. ## Containers @@ -100,7 +100,7 @@ def on_block(store: Store, signed_block: SignedBeaconBlock) -> None: # Check block is a descendant of the finalized block at the checkpoint finalized slot assert get_ancestor(store, block.parent_root, finalized_slot) == store.finalized_checkpoint.root - # [New in EIP-4844] + # [New in Deneb] # Check if blob data is available # If not, this block MAY be queued and subsequently considered when blob data becomes available assert is_data_available(block.slot, hash_tree_root(block), block.body.blob_kzg_commitments) diff --git a/specs/deneb/fork.md b/specs/deneb/fork.md index 864e28888..1ace26c7f 100644 --- a/specs/deneb/fork.md +++ b/specs/deneb/fork.md @@ -1,4 +1,4 @@ -# EIP-4844 -- Fork Logic +# Deneb -- Fork Logic **Notice**: This document is a work-in-progress for researchers and implementers. @@ -12,7 +12,7 @@ - [Helper functions](#helper-functions) - [Misc](#misc) - [Modified `compute_fork_version`](#modified-compute_fork_version) -- [Fork to EIP-4844](#fork-to-eip-4844) +- [Fork to Deneb](#fork-to-deneb) - [Fork trigger](#fork-trigger) - [Upgrading the state](#upgrading-the-state) @@ -20,7 +20,7 @@ ## Introduction -This document describes the process of EIP-4844 upgrade. +This document describes the process of Deneb upgrade. ## Configuration @@ -53,7 +53,7 @@ def compute_fork_version(epoch: Epoch) -> Version: return GENESIS_FORK_VERSION ``` -## Fork to EIP-4844 +## Fork to Deneb ### Fork trigger @@ -82,7 +82,7 @@ def upgrade_to_deneb(pre: capella.BeaconState) -> BeaconState: timestamp=pre.latest_execution_payload_header.timestamp, extra_data=pre.latest_execution_payload_header.extra_data, base_fee_per_gas=pre.latest_execution_payload_header.base_fee_per_gas, - excess_data_gas=uint256(0), # [New in EIP-4844] + excess_data_gas=uint256(0), # [New in Deneb] block_hash=pre.latest_execution_payload_header.block_hash, transactions_root=pre.latest_execution_payload_header.transactions_root, withdrawals_root=pre.latest_execution_payload_header.withdrawals_root, diff --git a/specs/deneb/p2p-interface.md b/specs/deneb/p2p-interface.md index 852597b09..b1ff8b922 100644 --- a/specs/deneb/p2p-interface.md +++ b/specs/deneb/p2p-interface.md @@ -1,6 +1,6 @@ -# EIP-4844 -- Networking +# Deneb -- Networking -This document contains the consensus-layer networking specification for EIP-4844. +This document contains the consensus-layer networking specification for Deneb. The specification of these changes continues in the same format as the network specifications of previous upgrades, and assumes them as pre-requisite. @@ -50,7 +50,7 @@ class SignedBeaconBlockAndBlobsSidecar(Container): ## The gossip domain: gossipsub -Some gossip meshes are upgraded in the fork of EIP-4844 to support upgraded types. +Some gossip meshes are upgraded in the fork of Deneb to support upgraded types. ### Topics and messages @@ -69,7 +69,7 @@ The new topics along with the type of the `data` field of a gossipsub message ar #### Global topics -EIP-4844 introduces a new global topic for beacon block and blobs-sidecars. +Deneb introduces a new global topic for beacon block and blobs-sidecars. ##### `beacon_block` @@ -107,7 +107,7 @@ details on how to handle transitioning gossip topics for this upgrade. **Protocol ID:** `/eth2/beacon_chain/req/beacon_blocks_by_range/2/` -The EIP-4844 fork-digest is introduced to the `context` enum to specify EIP-4844 beacon block type. +The Deneb fork-digest is introduced to the `context` enum to specify Deneb beacon block type. Per `context = compute_fork_digest(fork_version, genesis_validators_root)`: diff --git a/specs/deneb/polynomial-commitments.md b/specs/deneb/polynomial-commitments.md index ac99313ce..959057558 100644 --- a/specs/deneb/polynomial-commitments.md +++ b/specs/deneb/polynomial-commitments.md @@ -1,4 +1,4 @@ -# EIP-4844 -- Polynomial Commitments +# Deneb -- Polynomial Commitments ## Table of contents @@ -48,7 +48,7 @@ ## Introduction -This document specifies basic polynomial operations and KZG polynomial commitment operations as they are needed for the EIP-4844 specification. The implementations are not optimized for performance, but readability. All practical implementations should optimize the polynomial operations. +This document specifies basic polynomial operations and KZG polynomial commitment operations as they are needed for the Deneb specification. The implementations are not optimized for performance, but readability. All practical implementations should optimize the polynomial operations. Functions flagged as "Public method" MUST be provided by the underlying KZG library as public functions. All other functions are private functions used internally by the KZG library. @@ -337,7 +337,7 @@ def evaluate_polynomial_in_evaluation_form(polynomial: Polynomial, ### KZG -KZG core functions. These are also defined in EIP-4844 execution specs. +KZG core functions. These are also defined in Deneb execution specs. #### `blob_to_kzg_commitment` diff --git a/specs/deneb/validator.md b/specs/deneb/validator.md index 413e315fc..92a5e5333 100644 --- a/specs/deneb/validator.md +++ b/specs/deneb/validator.md @@ -1,4 +1,4 @@ -# EIP-4844 -- Honest Validator +# Deneb -- Honest Validator **Notice**: This document is a work-in-progress for researchers and implementers. @@ -25,14 +25,14 @@ ## Introduction -This document represents the changes to be made in the code of an "honest validator" to implement EIP-4844. +This document represents the changes to be made in the code of an "honest validator" to implement Deneb. ## Prerequisites This document is an extension of the [Capella -- Honest Validator](../capella/validator.md) guide. All behaviors and definitions defined in this document, and documents it extends, carry over unless explicitly noted or overridden. -All terminology, constants, functions, and protocol mechanics defined in the updated [Beacon Chain doc of EIP-4844](./beacon-chain.md) are requisite for this document and used throughout. +All terminology, constants, functions, and protocol mechanics defined in the updated [Beacon Chain doc of Deneb](./beacon-chain.md) are requisite for this document and used throughout. Please see related Beacon Chain doc before continuing and use them as a reference throughout. ## Helpers diff --git a/tests/core/pyspec/eth2spec/test/helpers/sharding.py b/tests/core/pyspec/eth2spec/test/helpers/sharding.py index 2ea8c94bc..fd60d5d3b 100644 --- a/tests/core/pyspec/eth2spec/test/helpers/sharding.py +++ b/tests/core/pyspec/eth2spec/test/helpers/sharding.py @@ -12,7 +12,7 @@ from eth2spec.utils.ssz.ssz_impl import serialize # -# Containers from EIP-4844 +# Containers from Deneb # MAX_CALLDATA_SIZE = 2**24 MAX_VERSIONED_HASHES_LIST_SIZE = 2**24 diff --git a/tests/generators/transition/main.py b/tests/generators/transition/main.py index a4eba90df..303f309c2 100644 --- a/tests/generators/transition/main.py +++ b/tests/generators/transition/main.py @@ -16,8 +16,8 @@ from eth2spec.test.altair.transition import ( test_slashing as test_altair_slashing, test_operations as test_altair_operations, ) -from eth2spec.test.eip4844.transition import ( - test_operations as test_eip4844_operations, +from eth2spec.test.deneb.transition import ( + test_operations as test_deneb_operations, ) @@ -46,7 +46,7 @@ if __name__ == "__main__": test_altair_leaking, test_altair_slashing, test_altair_operations, - test_eip4844_operations, + test_deneb_operations, ) for transition_test_module in all_tests: for pre_fork, post_fork in ALL_PRE_POST_FORKS: From f91b9863cec50895143ec0d60249d0d2cb34eec6 Mon Sep 17 00:00:00 2001 From: Potuz Date: Fri, 10 Feb 2023 11:43:38 -0300 Subject: [PATCH 13/29] Simplify commitee weight computation --- specs/phase0/fork-choice.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/specs/phase0/fork-choice.md b/specs/phase0/fork-choice.md index e535184af..f2ccc24b9 100644 --- a/specs/phase0/fork-choice.md +++ b/specs/phase0/fork-choice.md @@ -194,10 +194,7 @@ def get_latest_attesting_balance(store: Store, root: Root) -> Gwei: proposer_score = Gwei(0) # Boost is applied if ``root`` is an ancestor of ``proposer_boost_root`` if get_ancestor(store, store.proposer_boost_root, store.blocks[root].slot) == root: - num_validators = len(get_active_validator_indices(state, get_current_epoch(state))) - avg_balance = get_total_active_balance(state) // num_validators - committee_size = num_validators // SLOTS_PER_EPOCH - committee_weight = committee_size * avg_balance + committee_weight = get_total_active_balance(state) // SLOTS_PER_EPOCH proposer_score = (committee_weight * PROPOSER_SCORE_BOOST) // 100 return attestation_score + proposer_score From b76ea49feceb4e6c00c068dd769fdc987a0ed1a2 Mon Sep 17 00:00:00 2001 From: Dankrad Feist Date: Fri, 27 Jan 2023 14:23:38 +0000 Subject: [PATCH 14/29] Add KZG multi verify function --- specs/deneb/polynomial-commitments.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/specs/deneb/polynomial-commitments.md b/specs/deneb/polynomial-commitments.md index 959057558..a7df3c84d 100644 --- a/specs/deneb/polynomial-commitments.md +++ b/specs/deneb/polynomial-commitments.md @@ -527,3 +527,28 @@ def verify_blob_kzg_proof_multi(blobs: Sequence[Blob], return verify_kzg_proof_multi(commitments, evaluation_challenges, ys, proofs) ``` + +#### `verify_aggregate_kzg_proof_multi` + +```python +def verify_aggregate_kzg_proof_multi(list_blobs: Sequence[Sequence[Blob]], + list_commitments_bytes: Sequence[Sequence[Bytes48]], + list_aggregated_proof_bytes: Sequence[Bytes48]) -> bool: + """ + Given a list of blobs and an aggregated KZG proof, verify that they correspond to the provided commitments. + + Public method. + """ + + aggregated_poly_commitments, evaluation_challenges, ys = [], [], [] + for blobs, commitments_bytes in zip(list_blobs, list_commitments_bytes): + aggregated_poly_commitment, evaluation_challenge, y = \ + verify_aggregate_kzg_proof_aggregation(blobs, commitments_bytes) + aggregated_poly_commitments.append(aggregated_poly_commitment) + evaluation_challenges.append(evaluation_challenge) + ys.append(y) + + list_aggregated_proof = [bytes_to_kzg_proof(proof) for proof in list_aggregated_proof_bytes] + + return verify_kzg_proof_multi(aggregated_poly_commitments, evaluation_challenges, ys, list_aggregated_proof) +``` From 7f1748b3c876db2ed818a036a16ba117573eafea Mon Sep 17 00:00:00 2001 From: Dankrad Feist Date: Sun, 29 Jan 2023 13:05:02 +0000 Subject: [PATCH 15/29] Change blob verification fiat-shamir to single blob --- specs/deneb/polynomial-commitments.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/specs/deneb/polynomial-commitments.md b/specs/deneb/polynomial-commitments.md index a7df3c84d..40fb83ad4 100644 --- a/specs/deneb/polynomial-commitments.md +++ b/specs/deneb/polynomial-commitments.md @@ -540,15 +540,15 @@ def verify_aggregate_kzg_proof_multi(list_blobs: Sequence[Sequence[Blob]], Public method. """ - aggregated_poly_commitments, evaluation_challenges, ys = [], [], [] - for blobs, commitments_bytes in zip(list_blobs, list_commitments_bytes): - aggregated_poly_commitment, evaluation_challenge, y = \ - verify_aggregate_kzg_proof_aggregation(blobs, commitments_bytes) - aggregated_poly_commitments.append(aggregated_poly_commitment) + commitments, evaluation_challenges, ys, proofs = [], [], [], [] + for blob, commitment_bytes, proof_bytes in zip(blobs, commitments_bytes, proofs_bytes): + commitment = bytes_to_kzg_commitment(commitment_bytes) + commitments.append(commitment) + evaluation_challenge = compute_challenge(blob, commitment) evaluation_challenges.append(evaluation_challenge) - ys.append(y) + polynomial = blob_to_polynomial(blob) + ys.append(evaluate_polynomial_in_evaluation_form(polynomial, evaluation_challenge)) + proofs.append(bytes_to_kzg_proof(proof_bytes)) - list_aggregated_proof = [bytes_to_kzg_proof(proof) for proof in list_aggregated_proof_bytes] - - return verify_kzg_proof_multi(aggregated_poly_commitments, evaluation_challenges, ys, list_aggregated_proof) + return verify_kzg_proof_multi(commitments, evaluation_challenges, ys, proofs) ``` From 86d955ab7f286a2595ec7f3966785de38f717ccf Mon Sep 17 00:00:00 2001 From: Dankrad Feist Date: Mon, 13 Feb 2023 14:32:50 +0000 Subject: [PATCH 16/29] Call compute_challenge with polynomial as argument --- specs/deneb/polynomial-commitments.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/specs/deneb/polynomial-commitments.md b/specs/deneb/polynomial-commitments.md index 40fb83ad4..d4e3b26d6 100644 --- a/specs/deneb/polynomial-commitments.md +++ b/specs/deneb/polynomial-commitments.md @@ -547,6 +547,8 @@ def verify_aggregate_kzg_proof_multi(list_blobs: Sequence[Sequence[Blob]], evaluation_challenge = compute_challenge(blob, commitment) evaluation_challenges.append(evaluation_challenge) polynomial = blob_to_polynomial(blob) + evaluation_challenge = compute_challenge(polynomial, commitment) + evaluation_challenges.append(evaluation_challenge) ys.append(evaluate_polynomial_in_evaluation_form(polynomial, evaluation_challenge)) proofs.append(bytes_to_kzg_proof(proof_bytes)) From fc4e1a9acfc6565d42c6756b54b2ec42ec3171a3 Mon Sep 17 00:00:00 2001 From: George Kadianakis Date: Tue, 14 Feb 2023 14:50:44 +0200 Subject: [PATCH 17/29] EIP4844: compute_kzg_proof() can now create proofs within the domain (#3243) This will be used by optimistic rollups to create proofs about past data --- specs/deneb/polynomial-commitments.md | 47 +++++++++++++++++-- .../test_polynomial_commitments.py | 20 ++++++++ 2 files changed, 63 insertions(+), 4 deletions(-) diff --git a/specs/deneb/polynomial-commitments.md b/specs/deneb/polynomial-commitments.md index facf1dbc2..dde75bdcd 100644 --- a/specs/deneb/polynomial-commitments.md +++ b/specs/deneb/polynomial-commitments.md @@ -38,6 +38,7 @@ - [`verify_kzg_proof`](#verify_kzg_proof) - [`verify_kzg_proof_impl`](#verify_kzg_proof_impl) - [`compute_kzg_proof`](#compute_kzg_proof) + - [`compute_quotient_eval_within_domain`](#compute_quotient_eval_within_domain) - [`compute_kzg_proof_impl`](#compute_kzg_proof_impl) - [`compute_aggregated_poly_and_commitment`](#compute_aggregated_poly_and_commitment) - [`compute_aggregate_kzg_proof`](#compute_aggregate_kzg_proof) @@ -427,6 +428,34 @@ def compute_kzg_proof(blob: Blob, z: Bytes32) -> KZGProof: return compute_kzg_proof_impl(polynomial, bytes_to_bls_field(z)) ``` +#### `compute_quotient_eval_within_domain` + +```python +def compute_quotient_eval_within_domain(z: BLSFieldElement, + polynomial: Polynomial, + y: BLSFieldElement + ) -> BLSFieldElement: + """ + Given `y == p(z)` for a polynomial `p(x)`, compute `q(z)`: the KZG quotient polynomial evaluated at `z` for the + special case where `z` is in `ROOTS_OF_UNITY`. + + For more details, read https://dankradfeist.de/ethereum/2021/06/18/pcs-multiproofs.html section "Dividing + when one of the points is zero". The code below computes q(x_m) for the roots of unity special case. + """ + roots_of_unity_brp = bit_reversal_permutation(ROOTS_OF_UNITY) + result = 0 + for i, omega_i in enumerate(roots_of_unity_brp): + if omega_i == z: # skip the evaluation point in the sum + continue + + f_i = int(BLS_MODULUS) + int(polynomial[i]) - int(y) % BLS_MODULUS + numerator = f_i * int(omega_i) % BLS_MODULUS + denominator = int(z) * (int(BLS_MODULUS) + int(z) - int(omega_i)) % BLS_MODULUS + result += div(BLSFieldElement(numerator), BLSFieldElement(denominator)) + + return BLSFieldElement(result % BLS_MODULUS) +``` + #### `compute_kzg_proof_impl` ```python @@ -434,16 +463,26 @@ def compute_kzg_proof_impl(polynomial: Polynomial, z: BLSFieldElement) -> KZGPro """ Helper function for compute_kzg_proof() and compute_aggregate_kzg_proof(). """ + roots_of_unity_brp = bit_reversal_permutation(ROOTS_OF_UNITY) + + # For all x_i, compute p(x_i) - p(z) y = evaluate_polynomial_in_evaluation_form(polynomial, z) polynomial_shifted = [BLSFieldElement((int(p) - int(y)) % BLS_MODULUS) for p in polynomial] - # Make sure we won't divide by zero during division - assert z not in ROOTS_OF_UNITY + # For all x_i, compute (x_i - z) denominator_poly = [BLSFieldElement((int(x) - int(z)) % BLS_MODULUS) for x in bit_reversal_permutation(ROOTS_OF_UNITY)] - # Calculate quotient polynomial by doing point-by-point division - quotient_polynomial = [div(a, b) for a, b in zip(polynomial_shifted, denominator_poly)] + # Compute the quotient polynomial directly in evaluation form + quotient_polynomial = [BLSFieldElement(0)] * FIELD_ELEMENTS_PER_BLOB + for i, (a, b) in enumerate(zip(polynomial_shifted, denominator_poly)): + if b == 0: + # The denominator is zero hence `z` is a root of unity: we must handle it as a special case + quotient_polynomial[i] = compute_quotient_eval_within_domain(roots_of_unity_brp[i], polynomial, y) + else: + # Compute: q(x_i) = (p(x_i) - p(z)) / (x_i - z). + quotient_polynomial[i] = div(a, b) + return KZGProof(g1_lincomb(bit_reversal_permutation(KZG_SETUP_LAGRANGE), quotient_polynomial)) ``` diff --git a/tests/core/pyspec/eth2spec/test/deneb/unittests/polynomial_commitments/test_polynomial_commitments.py b/tests/core/pyspec/eth2spec/test/deneb/unittests/polynomial_commitments/test_polynomial_commitments.py index 4d881e3e3..67dce5c5b 100644 --- a/tests/core/pyspec/eth2spec/test/deneb/unittests/polynomial_commitments/test_polynomial_commitments.py +++ b/tests/core/pyspec/eth2spec/test/deneb/unittests/polynomial_commitments/test_polynomial_commitments.py @@ -87,3 +87,23 @@ def test_barycentric_within_domain(spec, state): # The two evaluations should be agree and p(z) should also be the i-th "coefficient" of the polynomial in # evaluation form assert p_z_coeff == p_z_eval == poly_eval[i] + + +@with_deneb_and_later +@spec_state_test +def test_compute_kzg_proof_within_domain(spec, state): + """ + Create and verify KZG proof that p(z) == y + where z is in the domain of our KZG scheme (i.e. a relevant root of unity). + """ + blob = get_sample_blob(spec) + commitment = spec.blob_to_kzg_commitment(blob) + polynomial = spec.blob_to_polynomial(blob) + + roots_of_unity_brp = spec.bit_reversal_permutation(spec.ROOTS_OF_UNITY) + + for i, z in enumerate(roots_of_unity_brp): + proof = spec.compute_kzg_proof_impl(polynomial, z) + + y = spec.evaluate_polynomial_in_evaluation_form(polynomial, z) + assert spec.verify_kzg_proof_impl(commitment, z, y, proof) From db5a168f3b073cf525116bca7433fede0172c422 Mon Sep 17 00:00:00 2001 From: Hsiao-Wei Wang Date: Tue, 14 Feb 2023 23:39:43 +0800 Subject: [PATCH 18/29] Move experimental features to `specs/_features` folder --- specs/{ => _features}/custody_game/beacon-chain.md | 0 specs/{ => _features}/custody_game/validator.md | 4 ++-- specs/{ => _features}/das/das-core.md | 0 specs/{ => _features}/das/fork-choice.md | 0 specs/{ => _features}/das/p2p-interface.md | 4 ++-- specs/{ => _features}/das/sampling.md | 0 specs/{ => _features}/sharding/beacon-chain.md | 0 specs/{ => _features}/sharding/p2p-interface.md | 2 +- specs/{ => _features}/sharding/polynomial-commitments.md | 0 specs/{ => _features}/sharding/validator.md | 2 +- 10 files changed, 6 insertions(+), 6 deletions(-) rename specs/{ => _features}/custody_game/beacon-chain.md (100%) rename specs/{ => _features}/custody_game/validator.md (96%) rename specs/{ => _features}/das/das-core.md (100%) rename specs/{ => _features}/das/fork-choice.md (100%) rename specs/{ => _features}/das/p2p-interface.md (98%) rename specs/{ => _features}/das/sampling.md (100%) rename specs/{ => _features}/sharding/beacon-chain.md (100%) rename specs/{ => _features}/sharding/p2p-interface.md (97%) rename specs/{ => _features}/sharding/polynomial-commitments.md (100%) rename specs/{ => _features}/sharding/validator.md (99%) diff --git a/specs/custody_game/beacon-chain.md b/specs/_features/custody_game/beacon-chain.md similarity index 100% rename from specs/custody_game/beacon-chain.md rename to specs/_features/custody_game/beacon-chain.md diff --git a/specs/custody_game/validator.md b/specs/_features/custody_game/validator.md similarity index 96% rename from specs/custody_game/validator.md rename to specs/_features/custody_game/validator.md index 05ceb854d..ed47eb0ac 100644 --- a/specs/custody_game/validator.md +++ b/specs/_features/custody_game/validator.md @@ -36,11 +36,11 @@ docs are requisite for this document and used throughout. Please see the Custody ## Becoming a validator -Becoming a validator in Custody Game is unchanged from Phase 0. See the [Phase 0 validator guide](../phase0/validator.md#becoming-a-validator) for details. +Becoming a validator in Custody Game is unchanged from Phase 0. See the [Phase 0 validator guide](../../phase0/validator.md#becoming-a-validator) for details. ## Beacon chain validator assignments -Beacon chain validator assignments to beacon committees and beacon block proposal are unchanged from Phase 0. See the [Phase 0 validator guide](../phase0/validator.md#validator-assignments) for details. +Beacon chain validator assignments to beacon committees and beacon block proposal are unchanged from Phase 0. See the [Phase 0 validator guide](../../phase0/validator.md#validator-assignments) for details. ##### Custody slashings diff --git a/specs/das/das-core.md b/specs/_features/das/das-core.md similarity index 100% rename from specs/das/das-core.md rename to specs/_features/das/das-core.md diff --git a/specs/das/fork-choice.md b/specs/_features/das/fork-choice.md similarity index 100% rename from specs/das/fork-choice.md rename to specs/_features/das/fork-choice.md diff --git a/specs/das/p2p-interface.md b/specs/_features/das/p2p-interface.md similarity index 98% rename from specs/das/p2p-interface.md rename to specs/_features/das/p2p-interface.md index a60bd9c85..b166c9c3e 100644 --- a/specs/das/p2p-interface.md +++ b/specs/_features/das/p2p-interface.md @@ -143,7 +143,7 @@ If the node does not already have connected peers on the topic it needs to sampl ### Topics and messages -Following the same scheme as the [Phase0 gossip topics](../phase0/p2p-interface.md#topics-and-messages), names and payload types are: +Following the same scheme as the [Phase0 gossip topics](../../phase0/p2p-interface.md#topics-and-messages), names and payload types are: | Name | Message Type | |----------------------------------|---------------------------| | `das_sample_{subnet_index}` | `DASSample` | @@ -192,7 +192,7 @@ This is to serve other peers that may have missed it. To pull samples from nodes, in case of network instability when samples are unavailable, a new query method is added to the Req-Resp domain. -This builds on top of the protocol identification and encoding spec which was introduced in [the Phase0 network spec](../phase0/p2p-interface.md). +This builds on top of the protocol identification and encoding spec which was introduced in [the Phase0 network spec](../../phase0/p2p-interface.md). Note that DAS networking uses a different protocol prefix: `/eth2/das/req` diff --git a/specs/das/sampling.md b/specs/_features/das/sampling.md similarity index 100% rename from specs/das/sampling.md rename to specs/_features/das/sampling.md diff --git a/specs/sharding/beacon-chain.md b/specs/_features/sharding/beacon-chain.md similarity index 100% rename from specs/sharding/beacon-chain.md rename to specs/_features/sharding/beacon-chain.md diff --git a/specs/sharding/p2p-interface.md b/specs/_features/sharding/p2p-interface.md similarity index 97% rename from specs/sharding/p2p-interface.md rename to specs/_features/sharding/p2p-interface.md index 3b627a339..c29146fe9 100644 --- a/specs/sharding/p2p-interface.md +++ b/specs/_features/sharding/p2p-interface.md @@ -39,7 +39,7 @@ The adjustments and additions for Shards are outlined in this document. ### Topics and messages -Following the same scheme as the [Phase0 gossip topics](../phase0/p2p-interface.md#topics-and-messages), names and payload types are: +Following the same scheme as the [Phase0 gossip topics](../../phase0/p2p-interface.md#topics-and-messages), names and payload types are: | Name | Message Type | |---------------------------------|--------------------------| diff --git a/specs/sharding/polynomial-commitments.md b/specs/_features/sharding/polynomial-commitments.md similarity index 100% rename from specs/sharding/polynomial-commitments.md rename to specs/_features/sharding/polynomial-commitments.md diff --git a/specs/sharding/validator.md b/specs/_features/sharding/validator.md similarity index 99% rename from specs/sharding/validator.md rename to specs/_features/sharding/validator.md index 38914095f..466c4df66 100644 --- a/specs/sharding/validator.md +++ b/specs/_features/sharding/validator.md @@ -33,7 +33,7 @@ This document represents the changes to be made in the code of an "honest valida ## Prerequisites -This document is an extension of the [Bellatrix -- Honest Validator](../bellatrix/validator.md) guide. +This document is an extension of the [Bellatrix -- Honest Validator](../../bellatrix/validator.md) guide. All behaviors and definitions defined in this document, and documents it extends, carry over unless explicitly noted or overridden. All terminology, constants, functions, and protocol mechanics defined in the updated Beacon Chain doc of [Sharding](./beacon-chain.md) are requisite for this document and used throughout. From 95720872e6097505be325eb5be2e1e348f5cd390 Mon Sep 17 00:00:00 2001 From: Hsiao-Wei Wang Date: Tue, 14 Feb 2023 23:50:00 +0800 Subject: [PATCH 19/29] Update README.md --- Makefile | 6 +++--- README.md | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 854f42ce3..d4259b2fe 100644 --- a/Makefile +++ b/Makefile @@ -27,10 +27,10 @@ MARKDOWN_FILES = $(wildcard $(SPEC_DIR)/phase0/*.md) \ $(wildcard $(SPEC_DIR)/altair/*.md) $(wildcard $(SPEC_DIR)/altair/**/*.md) \ $(wildcard $(SPEC_DIR)/bellatrix/*.md) \ $(wildcard $(SPEC_DIR)/capella/*.md) $(wildcard $(SPEC_DIR)/capella/**/*.md) \ - $(wildcard $(SPEC_DIR)/custody/*.md) \ - $(wildcard $(SPEC_DIR)/das/*.md) \ - $(wildcard $(SPEC_DIR)/sharding/*.md) \ $(wildcard $(SPEC_DIR)/deneb/*.md) $(wildcard $(SPEC_DIR)/deneb/**/*.md) \ + $(wildcard $(SPEC_DIR)/_features/custody/*.md) \ + $(wildcard $(SPEC_DIR)/_features/das/*.md) \ + $(wildcard $(SPEC_DIR)/_features/sharding/*.md) \ $(wildcard $(SSZ_DIR)/*.md) COV_HTML_OUT=.htmlcov diff --git a/README.md b/README.md index da893a53d..49e1c3a4d 100644 --- a/README.md +++ b/README.md @@ -26,9 +26,9 @@ Features are researched and developed in parallel, and then consolidated into se | - | - | - | | Capella (tentative) |
  • Core
    • [Beacon chain changes](specs/capella/beacon-chain.md)
    • [Capella fork](specs/capella/fork.md)
  • Additions
    • [Light client sync protocol changes](specs/capella/light-client/sync-protocol.md) ([fork](specs/capella/light-client/fork.md), [full node](specs/capella/light-client/full-node.md), [networking](specs/capella/light-client/p2p-interface.md))
    • [Validator additions](specs/capella/validator.md)
    • [P2P networking](specs/capella/p2p-interface.md)
| | Deneb (tentative) |
  • Core
    • [Beacon Chain changes](specs/deneb/beacon-chain.md)
    • [Deneb fork](specs/deneb/fork.md)
    • [Polynomial commitments](specs/deneb/polynomial-commitments.md)
    • [Fork choice changes](specs/deneb/fork-choice.md)
  • Additions
    • [Light client sync protocol changes](specs/deneb/light-client/sync-protocol.md) ([fork](specs/deneb/light-client/fork.md), [full node](specs/deneb/light-client/full-node.md), [networking](specs/deneb/light-client/p2p-interface.md))
    • [Honest validator guide changes](specs/deneb/validator.md)
    • [P2P networking](specs/deneb/p2p-interface.md)
| -| Sharding (outdated) |
  • Core
    • [Beacon Chain changes](specs/sharding/beacon-chain.md)
  • Additions
    • [P2P networking](specs/sharding/p2p-interface.md)
| -| Custody Game (outdated) |
  • Core
    • [Beacon Chain changes](specs/custody_game/beacon-chain.md)
  • Additions
    • [Honest validator guide changes](specs/custody_game/validator.md)
| Dependent on sharding | -| Data Availability Sampling (outdated) |
  • Core
    • [Core types and functions](specs/das/das-core.md)
    • [Fork choice changes](specs/das/fork-choice.md)
  • Additions
    • [P2P Networking](specs/das/p2p-interface.md)
    • [Sampling process](specs/das/sampling.md)
|
  • Dependent on sharding
  • [Technical explainer](https://hackmd.io/@HWeNw8hNRimMm2m2GH56Cw/B1YJPGkpD)
| +| Sharding (outdated) |
  • Core
    • [Beacon Chain changes](specs/_features/sharding/beacon-chain.md)
  • Additions
    • [P2P networking](specs/_features/sharding/p2p-interface.md)
| +| Custody Game (outdated) |
  • Core
    • [Beacon Chain changes](specs/_features/custody_game/beacon-chain.md)
  • Additions
    • [Honest validator guide changes](specs/_features/custody_game/validator.md)
| Dependent on sharding | +| Data Availability Sampling (outdated) |
  • Core
    • [Core types and functions](specs/_features/das/das-core.md)
    • [Fork choice changes](specs/_features/das/fork-choice.md)
  • Additions
    • [P2P Networking](specs/_features/das/p2p-interface.md)
    • [Sampling process](specs/_features/das/sampling.md)
|
  • Dependent on sharding
  • [Technical explainer](https://hackmd.io/@HWeNw8hNRimMm2m2GH56Cw/B1YJPGkpD)
| ### Accompanying documents can be found in [specs](specs) and include: From c49a2c2855cb19bcbf350540e130f9478633bdb7 Mon Sep 17 00:00:00 2001 From: dankrad Date: Tue, 14 Feb 2023 20:00:58 +0000 Subject: [PATCH 20/29] Update specs/deneb/polynomial-commitments.md Co-authored-by: George Kadianakis --- specs/deneb/polynomial-commitments.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specs/deneb/polynomial-commitments.md b/specs/deneb/polynomial-commitments.md index d4e3b26d6..b604e7431 100644 --- a/specs/deneb/polynomial-commitments.md +++ b/specs/deneb/polynomial-commitments.md @@ -406,7 +406,7 @@ def verify_kzg_proof_multi(commitments: Sequence[KZGCommitment], num_commitments = int.to_bytes(len(commitments), 8, ENDIANNESS) data = RANDOM_CHALLENGE_KZG_MULTI_DOMAIN + degree_poly + num_commitments - # Append each polynomial which is composed by field elements + # Append all inputs to the transcript before we hash for commitment, z, y, proof in zip(commitments, zs, ys, proofs): data += commitment \ + int.to_bytes(z, BYTES_PER_FIELD_ELEMENT, ENDIANNESS) \ From 855cf062f01f6b66915e007d2bdba673c31c51c7 Mon Sep 17 00:00:00 2001 From: Dankrad Feist Date: Tue, 14 Feb 2023 20:07:22 +0000 Subject: [PATCH 21/29] Remove additional function --- specs/deneb/polynomial-commitments.md | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/specs/deneb/polynomial-commitments.md b/specs/deneb/polynomial-commitments.md index b604e7431..c9d7496fa 100644 --- a/specs/deneb/polynomial-commitments.md +++ b/specs/deneb/polynomial-commitments.md @@ -527,30 +527,3 @@ def verify_blob_kzg_proof_multi(blobs: Sequence[Blob], return verify_kzg_proof_multi(commitments, evaluation_challenges, ys, proofs) ``` - -#### `verify_aggregate_kzg_proof_multi` - -```python -def verify_aggregate_kzg_proof_multi(list_blobs: Sequence[Sequence[Blob]], - list_commitments_bytes: Sequence[Sequence[Bytes48]], - list_aggregated_proof_bytes: Sequence[Bytes48]) -> bool: - """ - Given a list of blobs and an aggregated KZG proof, verify that they correspond to the provided commitments. - - Public method. - """ - - commitments, evaluation_challenges, ys, proofs = [], [], [], [] - for blob, commitment_bytes, proof_bytes in zip(blobs, commitments_bytes, proofs_bytes): - commitment = bytes_to_kzg_commitment(commitment_bytes) - commitments.append(commitment) - evaluation_challenge = compute_challenge(blob, commitment) - evaluation_challenges.append(evaluation_challenge) - polynomial = blob_to_polynomial(blob) - evaluation_challenge = compute_challenge(polynomial, commitment) - evaluation_challenges.append(evaluation_challenge) - ys.append(evaluate_polynomial_in_evaluation_form(polynomial, evaluation_challenge)) - proofs.append(bytes_to_kzg_proof(proof_bytes)) - - return verify_kzg_proof_multi(commitments, evaluation_challenges, ys, proofs) -``` From 3a6fccd389de63c80b45c08cf62b6d867e36597a Mon Sep 17 00:00:00 2001 From: Dankrad Feist Date: Tue, 14 Feb 2023 20:17:25 +0000 Subject: [PATCH 22/29] Remove double hashing --- specs/deneb/polynomial-commitments.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/specs/deneb/polynomial-commitments.md b/specs/deneb/polynomial-commitments.md index c9d7496fa..e4e899d67 100644 --- a/specs/deneb/polynomial-commitments.md +++ b/specs/deneb/polynomial-commitments.md @@ -248,8 +248,7 @@ def compute_challenge(blob: Blob, data += commitment # Transcript has been prepared: time to create the challenges - hashed_data = hash(data) - return hash_to_bls_field(hashed_data + b'\x00') + return hash_to_bls_field(data) ``` #### `bls_modular_inverse` @@ -413,8 +412,7 @@ def verify_kzg_proof_multi(commitments: Sequence[KZGCommitment], + int.to_bytes(y, BYTES_PER_FIELD_ELEMENT, ENDIANNESS) \ + proof - hashed_data = hash(data) - r = hash_to_bls_field(hashed_data + b'\x00') + r = hash_to_bls_field(data) r_powers = compute_powers(r, len(commitments)) # Verify: e(sum r^i proof_i, [s]) == From aafbd45a19d75dc825d94ec513b920e63dae98c5 Mon Sep 17 00:00:00 2001 From: dankrad Date: Tue, 14 Feb 2023 20:59:24 +0000 Subject: [PATCH 23/29] Update specs/deneb/polynomial-commitments.md Co-authored-by: George Kadianakis --- specs/deneb/polynomial-commitments.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specs/deneb/polynomial-commitments.md b/specs/deneb/polynomial-commitments.md index e4e899d67..04f1b97c6 100644 --- a/specs/deneb/polynomial-commitments.md +++ b/specs/deneb/polynomial-commitments.md @@ -419,9 +419,9 @@ def verify_kzg_proof_multi(commitments: Sequence[KZGCommitment], # e(sum r^i (commitment_i - [y_i]) + sum r^i z_i proof_i, [1]) proof_lincomb = g1_lincomb(proofs, r_powers) proof_z_lincomb = g1_lincomb(proofs, [z * r_power for z, r_power in zip(zs, r_powers)]) - C_minus_ys = [bls.G1_to_bytes48(bls.add(bls.bytes48_to_G1(commitment), bls.multiply(bls.G1, BLS_MODULUS - y))) + C_minus_ys = [bls.add(bls.bytes48_to_G1(commitment), bls.multiply(bls.G1, BLS_MODULUS - y)) for commitment, y in zip(commitments, ys)] - C_minus_y_as_KZGCommitments = [KZGCommitment(x) for x in C_minus_ys] + C_minus_y_as_KZGCommitments = [KZGCommitment(bls.G1_to_bytes48(x)) for x in C_minus_ys] C_minus_y_lincomb = g1_lincomb(C_minus_y_as_KZGCommitments, r_powers) return bls.pairing_check([ From d8509e42c6c02f97ec738843ba617d292b5f8554 Mon Sep 17 00:00:00 2001 From: dankrad Date: Tue, 14 Feb 2023 20:59:41 +0000 Subject: [PATCH 24/29] Update specs/deneb/polynomial-commitments.md Co-authored-by: George Kadianakis --- specs/deneb/polynomial-commitments.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specs/deneb/polynomial-commitments.md b/specs/deneb/polynomial-commitments.md index 04f1b97c6..4d990113d 100644 --- a/specs/deneb/polynomial-commitments.md +++ b/specs/deneb/polynomial-commitments.md @@ -493,7 +493,7 @@ def verify_blob_kzg_proof(blob: Blob, polynomial = blob_to_polynomial(blob) evaluation_challenge = compute_challenge(blob, commitment) - # Evaluate polynomial at `evaluation_challenge` (evaluation function checks for div-by-zero) + # Evaluate polynomial at `evaluation_challenge` y = evaluate_polynomial_in_evaluation_form(polynomial, evaluation_challenge) # Verify proof From c3cb7fa773e10e14695536b6576491636cac58c3 Mon Sep 17 00:00:00 2001 From: Dankrad Feist Date: Tue, 14 Feb 2023 21:10:09 +0000 Subject: [PATCH 25/29] Comment on compute_challenge, assert on verify_blob_kzg_proof_multi --- specs/deneb/polynomial-commitments.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/specs/deneb/polynomial-commitments.md b/specs/deneb/polynomial-commitments.md index 4d990113d..2484e1a2c 100644 --- a/specs/deneb/polynomial-commitments.md +++ b/specs/deneb/polynomial-commitments.md @@ -229,11 +229,8 @@ def blob_to_polynomial(blob: Blob) -> Polynomial: def compute_challenge(blob: Blob, commitment: KZGCommitment) -> BLSFieldElement: """ - Return the Fiat-Shamir challenges required by the rest of the protocol. + Return the Fiat-Shamir challenge required by the rest of the protocol. The Fiat-Shamir logic works as per the following pseudocode: - - hashed_data = hash(DOMAIN_SEPARATOR, polynomial, commitment) - eval_challenge = hash(hashed_data, 0) """ # Append the number of polynomials and the degree of each polynomial as a domain separator @@ -512,6 +509,8 @@ def verify_blob_kzg_proof_multi(blobs: Sequence[Blob], Public method. """ + + assert len(blobs) == len(commitments_bytes) == len(proofs_bytes) commitments, evaluation_challenges, ys, proofs = [], [], [], [] for blob, commitment_bytes, proof_bytes in zip(blobs, commitments_bytes, proofs_bytes): From 4086a09d0fdc8e21bc96b68160051cb53c3c24ea Mon Sep 17 00:00:00 2001 From: Dankrad Feist Date: Tue, 14 Feb 2023 21:21:46 +0000 Subject: [PATCH 26/29] multi -> batch --- specs/deneb/polynomial-commitments.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/specs/deneb/polynomial-commitments.md b/specs/deneb/polynomial-commitments.md index 2484e1a2c..39ae3570c 100644 --- a/specs/deneb/polynomial-commitments.md +++ b/specs/deneb/polynomial-commitments.md @@ -36,12 +36,12 @@ - [`blob_to_kzg_commitment`](#blob_to_kzg_commitment) - [`verify_kzg_proof`](#verify_kzg_proof) - [`verify_kzg_proof_impl`](#verify_kzg_proof_impl) - - [`verify_kzg_proof_multi`](#verify_kzg_proof_multi) + - [`verify_kzg_proof_batch`](#verify_kzg_proof_batch) - [`compute_kzg_proof`](#compute_kzg_proof) - [`compute_kzg_proof_impl`](#compute_kzg_proof_impl) - [`compute_blob_kzg_proof`](#compute_blob_kzg_proof) - [`verify_blob_kzg_proof`](#verify_blob_kzg_proof) - - [`verify_blob_kzg_proof_multi`](#verify_blob_kzg_proof_multi) + - [`verify_blob_kzg_proof_batch`](#verify_blob_kzg_proof_batch) @@ -83,7 +83,7 @@ Public functions MUST accept raw bytes as input and perform the required cryptog | - | - | | `FIELD_ELEMENTS_PER_BLOB` | `uint64(4096)` | | `FIAT_SHAMIR_PROTOCOL_DOMAIN` | `b'FSBLOBVERIFY_V1_'` | -| `RANDOM_CHALLENGE_KZG_MULTI_DOMAIN` | `b'RCKZGMULTI___V1_'` | +| `RANDOM_CHALLENGE_KZG_BATCH_DOMAIN` | `b'RCKZGBATCH___V1_'` | ### Crypto @@ -383,10 +383,10 @@ def verify_kzg_proof_impl(commitment: KZGCommitment, ]) ``` -#### `verify_kzg_proof_multi` +#### `verify_kzg_proof_batch` ```python -def verify_kzg_proof_multi(commitments: Sequence[KZGCommitment], +def verify_kzg_proof_batch(commitments: Sequence[KZGCommitment], zs: Sequence[BLSFieldElement], ys: Sequence[BLSFieldElement], proofs: Sequence[KZGProof]) -> bool: @@ -400,7 +400,7 @@ def verify_kzg_proof_multi(commitments: Sequence[KZGCommitment], # r just has to be random. degree_poly = int.to_bytes(FIELD_ELEMENTS_PER_BLOB, 8, ENDIANNESS) num_commitments = int.to_bytes(len(commitments), 8, ENDIANNESS) - data = RANDOM_CHALLENGE_KZG_MULTI_DOMAIN + degree_poly + num_commitments + data = RANDOM_CHALLENGE_KZG_BATCH_DOMAIN + degree_poly + num_commitments # Append all inputs to the transcript before we hash for commitment, z, y, proof in zip(commitments, zs, ys, proofs): @@ -498,10 +498,10 @@ def verify_blob_kzg_proof(blob: Blob, return verify_kzg_proof_impl(commitment, evaluation_challenge, y, proof) ``` -#### `verify_blob_kzg_proof_multi` +#### `verify_blob_kzg_proof_batch` ```python -def verify_blob_kzg_proof_multi(blobs: Sequence[Blob], +def verify_blob_kzg_proof_batch(blobs: Sequence[Blob], commitments_bytes: Sequence[Bytes48], proofs_bytes: Sequence[Bytes48]) -> bool: """ @@ -522,5 +522,5 @@ def verify_blob_kzg_proof_multi(blobs: Sequence[Blob], ys.append(evaluate_polynomial_in_evaluation_form(polynomial, evaluation_challenge)) proofs.append(bytes_to_kzg_proof(proof_bytes)) - return verify_kzg_proof_multi(commitments, evaluation_challenges, ys, proofs) + return verify_kzg_proof_batch(commitments, evaluation_challenges, ys, proofs) ``` From b26c136b34e7fd4cc35cd6c690bcf3af2389848f Mon Sep 17 00:00:00 2001 From: Stefan Bratanov Date: Wed, 15 Feb 2023 17:25:08 +0000 Subject: [PATCH 27/29] fix Deneb reference in presets --- presets/mainnet/deneb.yaml | 2 +- presets/minimal/deneb.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/presets/mainnet/deneb.yaml b/presets/mainnet/deneb.yaml index 3866e82ff..ebe33f2d1 100644 --- a/presets/mainnet/deneb.yaml +++ b/presets/mainnet/deneb.yaml @@ -1,4 +1,4 @@ -# Mainnet preset - Phase0 +# Mainnet preset - Deneb # Misc # --------------------------------------------------------------- diff --git a/presets/minimal/deneb.yaml b/presets/minimal/deneb.yaml index dacacf5b8..e51b5587d 100644 --- a/presets/minimal/deneb.yaml +++ b/presets/minimal/deneb.yaml @@ -1,4 +1,4 @@ -# Minimal preset - Phase0 +# Minimal preset - Deneb # Misc # --------------------------------------------------------------- From 48e7be7dd0e1ce10ce151f797dbfa58a31c76b2d Mon Sep 17 00:00:00 2001 From: Dankrad Feist Date: Wed, 15 Feb 2023 18:23:04 +0000 Subject: [PATCH 28/29] Fix doctoc --- specs/deneb/polynomial-commitments.md | 1 + 1 file changed, 1 insertion(+) diff --git a/specs/deneb/polynomial-commitments.md b/specs/deneb/polynomial-commitments.md index 460fb8297..6b94e1d9a 100644 --- a/specs/deneb/polynomial-commitments.md +++ b/specs/deneb/polynomial-commitments.md @@ -38,6 +38,7 @@ - [`verify_kzg_proof_impl`](#verify_kzg_proof_impl) - [`verify_kzg_proof_batch`](#verify_kzg_proof_batch) - [`compute_kzg_proof`](#compute_kzg_proof) + - [`compute_quotient_eval_within_domain`](#compute_quotient_eval_within_domain) - [`compute_kzg_proof_impl`](#compute_kzg_proof_impl) - [`compute_blob_kzg_proof`](#compute_blob_kzg_proof) - [`verify_blob_kzg_proof`](#verify_blob_kzg_proof) From 078d62e6ffe1f840e2d2ae9bc43d3b2e48c5926a Mon Sep 17 00:00:00 2001 From: Dankrad Feist Date: Wed, 15 Feb 2023 19:48:58 +0000 Subject: [PATCH 29/29] Simplify compute_challenge --- specs/deneb/polynomial-commitments.md | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/specs/deneb/polynomial-commitments.md b/specs/deneb/polynomial-commitments.md index 6b94e1d9a..afcf934fc 100644 --- a/specs/deneb/polynomial-commitments.md +++ b/specs/deneb/polynomial-commitments.md @@ -231,21 +231,16 @@ def compute_challenge(blob: Blob, commitment: KZGCommitment) -> BLSFieldElement: """ Return the Fiat-Shamir challenge required by the rest of the protocol. - The Fiat-Shamir logic works as per the following pseudocode: """ - # Append the number of polynomials and the degree of each polynomial as a domain separator - num_polynomials = int.to_bytes(1, 8, ENDIANNESS) - degree_poly = int.to_bytes(FIELD_ELEMENTS_PER_BLOB, 8, ENDIANNESS) - data = FIAT_SHAMIR_PROTOCOL_DOMAIN + degree_poly + num_polynomials + # Append the degree of the polynomial as a domain separator + degree_poly = int.to_bytes(FIELD_ELEMENTS_PER_BLOB, 16, ENDIANNESS) + data = FIAT_SHAMIR_PROTOCOL_DOMAIN + degree_poly - # Append each polynomial which is composed by field elements data += blob - - # Append serialized G1 points data += commitment - # Transcript has been prepared: time to create the challenges + # Transcript has been prepared: time to create the challenge return hash_to_bls_field(data) ```