Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
25 changes: 25 additions & 0 deletions specs/fulu/p2p-interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
- [ENR structure](#enr-structure)
- [Custody group count](#custody-group-count)
- [Next fork digest](#next-fork-digest)
- [Peer Scoring](#peer-scoring)
- [DAS providers](#das-providers)

<!-- mdformat-toc end -->

Expand Down Expand Up @@ -545,3 +547,26 @@ disconnect from such peers at the fork boundary, but not sooner.
Nodes unprepared to follow the Fulu fork will be unaware of `nfd` entries.
However, their existing comparison of `eth2` entries (concretely
`next_fork_epoch`) is sufficient to detect upcoming divergence.

## Peer Scoring

Due to the deterministic custody functions, a node knows exactly what a peer
should be able to respond to. In the event that a peer does not respond to
samples of their custodied rows/columns, a node may downscore or disconnect from
a peer.

## DAS providers

A DAS provider is a consistently-available-for-DAS-queries, super-full (or high
capacity) node. To the p2p, these look just like other nodes but with high
advertised capacity, and they should generally be able to be latently found via
normal discovery.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean supernode here right? I'd prefer to avoid having new terms here for the same thing: DAS provider and super-full node.

There have been attempts in the past to change this name, but it seems like supernode is pretty stuck in our conversation now and I'm kind of used to it 😅 (and it's also used in our codebase) Unless we come up with a substantially better name, my weak preference is to keep it as it is.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I agree we should say supernode here. Will follow up in another PR.


DAS providers can also be found out-of-band and configured into a node to
connect to directly and prioritize. Nodes can add some set of these to their
local configuration for persistent connection to bolster their DAS quality of
service.

Such direct peering utilizes a feature supported out of the box today on all
nodes and can complement (and reduce attackability and increase
quality-of-service) alternative peer discovery mechanisms.
173 changes: 0 additions & 173 deletions specs/fulu/peer-sampling.md

This file was deleted.

84 changes: 0 additions & 84 deletions tests/core/pyspec/eth2spec/test/fulu/unittests/das/test_das.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import random

from eth2spec.test.context import (
expect_assertion_error,
single_phase,
spec_test,
with_config_overrides,
with_fulu_and_later,
)
from eth2spec.test.helpers.blob import (
Expand Down Expand Up @@ -67,85 +65,3 @@ def test_recover_matrix(spec):

# Ensure that the recovered matrix matches the original matrix
assert recovered_matrix == matrix


@with_fulu_and_later
@spec_test
@single_phase
def test_get_extended_sample_count__1(spec):
rng = random.Random(1111)
allowed_failures = rng.randint(0, spec.config.NUMBER_OF_COLUMNS // 2)
spec.get_extended_sample_count(allowed_failures)


@with_fulu_and_later
@spec_test
@single_phase
def test_get_extended_sample_count__2(spec):
rng = random.Random(2222)
allowed_failures = rng.randint(0, spec.config.NUMBER_OF_COLUMNS // 2)
spec.get_extended_sample_count(allowed_failures)


@with_fulu_and_later
@spec_test
@single_phase
def test_get_extended_sample_count__3(spec):
rng = random.Random(3333)
allowed_failures = rng.randint(0, spec.config.NUMBER_OF_COLUMNS // 2)
spec.get_extended_sample_count(allowed_failures)


@with_fulu_and_later
@spec_test
@single_phase
def test_get_extended_sample_count__lower_bound(spec):
allowed_failures = 0
spec.get_extended_sample_count(allowed_failures)


@with_fulu_and_later
@spec_test
@single_phase
def test_get_extended_sample_count__upper_bound(spec):
allowed_failures = spec.config.NUMBER_OF_COLUMNS // 2
spec.get_extended_sample_count(allowed_failures)


@with_fulu_and_later
@spec_test
@single_phase
def test_get_extended_sample_count__upper_bound_exceed(spec):
allowed_failures = spec.config.NUMBER_OF_COLUMNS // 2 + 1
expect_assertion_error(lambda: spec.get_extended_sample_count(allowed_failures))


@with_fulu_and_later
@spec_test
@with_config_overrides(
{
"NUMBER_OF_COLUMNS": 128,
"SAMPLES_PER_SLOT": 16,
}
)
@single_phase
def test_get_extended_sample_count__table_in_spec(spec):
table = dict(
# (allowed_failures, expected_extended_sample_count)
{
0: 16,
1: 20,
2: 24,
3: 27,
4: 29,
5: 32,
6: 35,
7: 37,
8: 40,
}
)
for allowed_failures, expected_extended_sample_count in table.items():
assert (
spec.get_extended_sample_count(allowed_failures=allowed_failures)
== expected_extended_sample_count
)