Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release v1.4.0-beta.5 #3554

Merged
merged 37 commits into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
321f47b
Remove `SignedBlobSidecar` refs from p2p spec
etan-status Nov 3, 2023
3ef362c
Remove unused `DOMAIN_BLOB_SIDECAR`
etan-status Nov 3, 2023
9338d37
Update toc
etan-status Nov 3, 2023
088dd19
Merge pull request #3542 from etan-status/df-nodomain
djrtwo Nov 3, 2023
36f0bb0
Merge pull request #3541 from etan-status/df-rmsigned
djrtwo Nov 3, 2023
70ce4f2
Remove extra tick
hwwhww Nov 14, 2023
3d853b0
Add `assert time >= store.time` to `on_tick`
hwwhww Nov 16, 2023
1028093
Merge pull request #3548 from ethereum/fix-fc-script
hwwhww Nov 29, 2023
6fb9b0a
Revert the spec. Only handle it in tests
hwwhww Nov 29, 2023
a8d0268
Merge branch 'dev' into on-tick-precondition
hwwhww Nov 30, 2023
581a64b
cleanup leftover
hwwhww Nov 30, 2023
8fa1f8e
Merge pull request #3550 from ethereum/on-tick-precondition
djrtwo Nov 30, 2023
e664d40
Specify RPC byRoot blocks-sidecars elegibility
tbenr Nov 16, 2023
c46c4ec
fix typo
tbenr Nov 16, 2023
6bbdeb8
Update specs/phase0/p2p-interface.md
tbenr Nov 17, 2023
ccf9e34
Update specs/deneb/p2p-interface.md
tbenr Nov 17, 2023
e2ca4b3
add failed on_block condition
tbenr Nov 22, 2023
d749a49
rephrase
tbenr Nov 22, 2023
4c5e5c8
Update specs/phase0/p2p-interface.md
tbenr Nov 29, 2023
ccca449
apply suggestion
tbenr Nov 29, 2023
88b1818
Update specs/deneb/p2p-interface.md
tbenr Nov 30, 2023
b525e9e
Update specs/deneb/p2p-interface.md
tbenr Nov 30, 2023
662c6eb
remove the last consider
tbenr Nov 30, 2023
bdac932
from on_block to state_transition
tbenr Nov 30, 2023
6a460ae
Add randomized block cases
hwwhww Nov 30, 2023
c661e20
simplify and add a new rule
tbenr Nov 30, 2023
113c58f
Merge pull request #3555 from ethereum/random-blob_kzg_commitment_mer…
djrtwo Nov 30, 2023
dad09f6
Update specs/phase0/p2p-interface.md
tbenr Dec 1, 2023
eed7a66
Update specs/deneb/p2p-interface.md
tbenr Dec 1, 2023
cf39eed
Update specs/deneb/p2p-interface.md
tbenr Dec 1, 2023
ba09761
remove gossip failure rules
tbenr Dec 1, 2023
c43173e
Move `blob_sidecar_{subnet_id}` to `Blob subnets` section
hwwhww Dec 1, 2023
d343b6f
Apply suggestions from code review
djrtwo Dec 4, 2023
06fe616
Merge pull request #3551 from tbenr/specify_rpc_by_root_elegibility
hwwhww Dec 4, 2023
a558f19
bump version to v1.4.0-beta.5
hwwhww Dec 4, 2023
4420c64
Merge pull request #3558 from ethereum/bump-version
djrtwo Dec 4, 2023
b2f2102
Merge pull request #3556 from ethereum/blob-subnets
djrtwo Dec 4, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions specs/deneb/beacon-chain.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
- [Introduction](#introduction)
- [Custom types](#custom-types)
- [Constants](#constants)
- [Domain types](#domain-types)
- [Blob](#blob)
- [Preset](#preset)
- [Execution](#execution)
Expand Down Expand Up @@ -67,12 +66,6 @@ Deneb is a consensus-layer upgrade containing a number of features. Including:

## Constants

### Domain types

| Name | Value |
| - | - |
| `DOMAIN_BLOB_SIDECAR` | `DomainType('0x0B000000')` |

### Blob

| Name | Value |
Expand Down
53 changes: 31 additions & 22 deletions specs/deneb/p2p-interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ The specification of these changes continues in the same format as the network s
- [Topics and messages](#topics-and-messages)
- [Global topics](#global-topics)
- [`beacon_block`](#beacon_block)
- [`blob_sidecar_{subnet_id}`](#blob_sidecar_subnet_id)
- [`beacon_aggregate_and_proof`](#beacon_aggregate_and_proof)
- [Blob subnets](#blob-subnets)
- [`blob_sidecar_{subnet_id}`](#blob_sidecar_subnet_id)
- [Attestation subnets](#attestation-subnets)
- [`beacon_attestation_{subnet_id}`](#beacon_attestation_subnet_id)
- [Transitioning the gossip](#transitioning-the-gossip)
Expand Down Expand Up @@ -133,8 +134,6 @@ The new topics along with the type of the `data` field of a gossipsub message ar

##### Global topics

Deneb introduces new global topics for blob sidecars.

###### `beacon_block`

The *type* of the payload of this topic changes to the (modified) `SignedBeaconBlock` found in Deneb.
Expand All @@ -146,11 +145,30 @@ New validation:
- _[REJECT]_ The length of KZG commitments is less than or equal to the limitation defined in Consensus Layer --
i.e. validate that `len(body.signed_beacon_block.message.blob_kzg_commitments) <= MAX_BLOBS_PER_BLOCK`

###### `beacon_aggregate_and_proof`

*[Modified in Deneb:EIP7045]*

The following validation is removed:
* _[IGNORE]_ `aggregate.data.slot` is within the last `ATTESTATION_PROPAGATION_SLOT_RANGE` slots (with a `MAXIMUM_GOSSIP_CLOCK_DISPARITY` allowance) --
i.e. `aggregate.data.slot + ATTESTATION_PROPAGATION_SLOT_RANGE >= current_slot >= aggregate.data.slot`
(a client MAY queue future aggregates for processing at the appropriate slot).

The following validations are added in its place:
* _[IGNORE]_ `aggregate.data.slot` is equal to or earlier than the `current_slot` (with a `MAXIMUM_GOSSIP_CLOCK_DISPARITY` allowance) --
i.e. `aggregate.data.slot <= current_slot`
(a client MAY queue future aggregates for processing at the appropriate slot).
* _[IGNORE]_ the epoch of `aggregate.data.slot` is either the current or previous epoch
(with a `MAXIMUM_GOSSIP_CLOCK_DISPARITY` allowance) --
i.e. `compute_epoch_at_slot(aggregate.data.slot) in (get_previous_epoch(state), get_current_epoch(state))`

##### Blob subnets

###### `blob_sidecar_{subnet_id}`

*[New in Deneb:EIP4844]*

This topic is used to propagate signed blob sidecars, where each blob index maps to some `subnet_id`.
This topic is used to propagate blob sidecars, where each blob index maps to some `subnet_id`.

The following validations MUST pass before forwarding the `blob_sidecar` on the network, assuming the alias `block_header = blob_sidecar.signed_block_header.message`:

Expand All @@ -169,23 +187,6 @@ The following validations MUST pass before forwarding the `blob_sidecar` on the
- _[REJECT]_ The sidecar is proposed by the expected `proposer_index` for the block's slot in the context of the current shuffling (defined by `block_header.parent_root`/`block_header.slot`).
If the `proposer_index` cannot immediately be verified against the expected shuffling, the sidecar MAY be queued for later processing while proposers for the block's branch are calculated -- in such a case _do not_ `REJECT`, instead `IGNORE` this message.

###### `beacon_aggregate_and_proof`

*[Modified in Deneb:EIP7045]*

The following validation is removed:
* _[IGNORE]_ `aggregate.data.slot` is within the last `ATTESTATION_PROPAGATION_SLOT_RANGE` slots (with a `MAXIMUM_GOSSIP_CLOCK_DISPARITY` allowance) --
i.e. `aggregate.data.slot + ATTESTATION_PROPAGATION_SLOT_RANGE >= current_slot >= aggregate.data.slot`
(a client MAY queue future aggregates for processing at the appropriate slot).

The following validations are added in its place:
* _[IGNORE]_ `aggregate.data.slot` is equal to or earlier than the `current_slot` (with a `MAXIMUM_GOSSIP_CLOCK_DISPARITY` allowance) --
i.e. `aggregate.data.slot <= current_slot`
(a client MAY queue future aggregates for processing at the appropriate slot).
* _[IGNORE]_ the epoch of `aggregate.data.slot` is either the current or previous epoch
(with a `MAXIMUM_GOSSIP_CLOCK_DISPARITY` allowance) --
i.e. `compute_epoch_at_slot(aggregate.data.slot) in (get_previous_epoch(state), get_current_epoch(state))`

##### Attestation subnets

###### `beacon_attestation_{subnet_id}`
Expand Down Expand Up @@ -252,6 +253,10 @@ Per `context = compute_fork_digest(fork_version, genesis_validators_root)`:

No more than `MAX_REQUEST_BLOCKS_DENEB` may be requested at a time.

*[Modified in Deneb:EIP4844]*
Clients SHOULD include a block in the response as soon as it passes the gossip validation rules.
Clients SHOULD NOT respond with blocks that fail the beacon chain state transition.

##### BlobSidecarsByRoot v1

**Protocol ID:** `/eth2/beacon_chain/req/blob_sidecars_by_root/1/`
Expand Down Expand Up @@ -300,6 +305,10 @@ Clients MUST support requesting sidecars since `minimum_request_epoch`, where `m
Clients MUST respond with at least one sidecar, if they have it.
Clients MAY limit the number of blocks and sidecars in the response.

Clients SHOULD include a sidecar in the response as soon as it passes the gossip validation rules.
Clients SHOULD NOT respond with sidecars related to blocks that fail gossip validation rules.
Clients SHOULD NOT respond with sidecars related to blocks that fail the beacon chain state transition

##### BlobSidecarsByRange v1

**Protocol ID:** `/eth2/beacon_chain/req/blob_sidecars_by_range/1/`
Expand Down Expand Up @@ -341,7 +350,7 @@ The response MUST consist of zero or more `response_chunk`.
Each _successful_ `response_chunk` MUST contain a single `BlobSidecar` payload.

Let `blob_serve_range` be `[max(current_epoch - MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS, DENEB_FORK_EPOCH), current_epoch]`.
Clients MUST keep a record of signed blob sidecars seen on the epoch range `blob_serve_range`
Clients MUST keep a record of blob sidecars seen on the epoch range `blob_serve_range`
where `current_epoch` is defined by the current wall-clock time,
and clients MUST support serving requests of blobs on this range.

Expand Down
3 changes: 3 additions & 0 deletions specs/phase0/p2p-interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -856,6 +856,9 @@ Clients MUST support requesting blocks since the latest finalized epoch.
Clients MUST respond with at least one block, if they have it.
Clients MAY limit the number of blocks in the response.

Clients MAY include a block in the response as soon as it passes the gossip validation rules.
Clients SHOULD NOT respond with blocks that fail the beacon chain state transition.

`/eth2/beacon_chain/req/beacon_blocks_by_root/1/` is deprecated. Clients MAY respond with an empty list during the deprecation transition period.

##### Ping
Expand Down
2 changes: 1 addition & 1 deletion tests/core/pyspec/eth2spec/VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.4.0-beta.4
1.4.0-beta.5
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,6 @@ def test_should_override_forkchoice_update__true(spec, state):
# Add attestations to the parent block
temp_state = state.copy()
next_slot(spec, temp_state)
current_time = state.slot * spec.config.SECONDS_PER_SLOT + store.genesis_time + 1
on_tick_and_append_step(spec, store, current_time, test_steps)
attestations = get_valid_attestation_at_slot(
temp_state,
spec,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,39 @@
import random

from eth2spec.test.context import (
spec_state_test,
with_deneb_and_later,
with_test_suite_name,
)
from eth2spec.test.helpers.block import (
build_empty_block_for_next_slot,
sign_block
sign_block,
)
from eth2spec.test.helpers.execution_payload import (
compute_el_block_hash,
)
from eth2spec.test.helpers.sharding import (
get_sample_opaque_tx,
)
from eth2spec.debug.random_value import (
RandomizationMode,
get_random_ssz_object,
)


@with_test_suite_name("BeaconBlockBody")
@with_deneb_and_later
@spec_state_test
def test_blob_kzg_commitment_merkle_proof(spec, state):
def _run_blob_kzg_commitment_merkle_proof_test(spec, state, rng=None):
opaque_tx, blobs, blob_kzg_commitments, proofs = get_sample_opaque_tx(spec, blob_count=1)
block = build_empty_block_for_next_slot(spec, state)
if rng is None:
block = build_empty_block_for_next_slot(spec, state)
else:
block = get_random_ssz_object(
rng,
spec.BeaconBlock,
max_bytes_length=2000,
max_list_length=2000,
mode=RandomizationMode,
chaos=True,
)
block.body.blob_kzg_commitments = blob_kzg_commitments
block.body.execution_payload.transactions = [opaque_tx]
block.body.execution_payload.block_hash = compute_el_block_hash(spec, block.body.execution_payload)
Expand All @@ -44,3 +57,34 @@ def test_blob_kzg_commitment_merkle_proof(spec, state):
index=spec.get_subtree_index(gindex),
root=blob_sidecar.signed_block_header.message.body_root,
)


@with_test_suite_name("BeaconBlockBody")
@with_deneb_and_later
@spec_state_test
def test_blob_kzg_commitment_merkle_proof__basic(spec, state):
yield from _run_blob_kzg_commitment_merkle_proof_test(spec, state)


@with_test_suite_name("BeaconBlockBody")
@with_deneb_and_later
@spec_state_test
def test_blob_kzg_commitment_merkle_proof__random_block_1(spec, state):
rng = random.Random(1111)
yield from _run_blob_kzg_commitment_merkle_proof_test(spec, state, rng=rng)


@with_test_suite_name("BeaconBlockBody")
@with_deneb_and_later
@spec_state_test
def test_blob_kzg_commitment_merkle_proof__random_block_2(spec, state):
rng = random.Random(2222)
yield from _run_blob_kzg_commitment_merkle_proof_test(spec, state, rng=rng)


@with_test_suite_name("BeaconBlockBody")
@with_deneb_and_later
@spec_state_test
def test_blob_kzg_commitment_merkle_proof__random_block_3(spec, state):
rng = random.Random(3333)
yield from _run_blob_kzg_commitment_merkle_proof_test(spec, state, rng=rng)
1 change: 1 addition & 0 deletions tests/core/pyspec/eth2spec/test/helpers/fork_choice.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ def get_blobs_file_name(blobs=None, blobs_root=None):


def on_tick_and_append_step(spec, store, time, test_steps):
assert time >= store.time
spec.on_tick(store, time)
test_steps.append({'tick': int(time)})
output_store_checks(spec, store, test_steps)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,6 @@ def test_basic_is_parent_root(spec, state):
slot = state.slot

# Add attestations to the parent block
current_time = slot * spec.config.SECONDS_PER_SLOT + store.genesis_time
on_tick_and_append_step(spec, store, current_time, test_steps)
attestations = get_valid_attestation_at_slot(
state,
spec,
Expand Down