Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
82b59b6
Add executable gossip validation functions for phase0
jtraglia Feb 6, 2026
f15d117
Merge branch 'master' into executable-networking-specs
jtraglia Mar 2, 2026
663726c
Merge branch 'master' into executable-networking-specs
jtraglia Mar 11, 2026
97c001e
Pass state (not store) to compute_time_at_slot_ms()
jtraglia Mar 11, 2026
ae68b76
Rename attestation_time_ms to attestation_slot_time_ms
jtraglia Mar 11, 2026
b593248
Add separate check for invalid proposer index
jtraglia Mar 11, 2026
55c066a
Change reject message for consistency
jtraglia Mar 11, 2026
5249846
Inline get_new_attester_slashing_indices
jtraglia Mar 12, 2026
f720cdc
Remove redundant index check
jtraglia Mar 12, 2026
50bafcc
Clean up attester_slashing fn & separate index checks
jtraglia Mar 12, 2026
e28b1d3
Simplify already seen attestation check
jtraglia Mar 12, 2026
43a4830
Fix inconsistent existance checks
jtraglia Mar 12, 2026
8fe3a5c
Move dataclass above functions
jtraglia Mar 12, 2026
67a589b
Allow attestations within clock disparity on the later side
jtraglia Mar 12, 2026
93a33f8
Remove check for impossible situation
jtraglia Mar 12, 2026
9f31fbb
Add sentences about state being the head state.
jtraglia Mar 12, 2026
df2ae7c
Define generic functions for checking if something is on time
jtraglia Mar 12, 2026
d0182e3
Each GossipIgnore/Reject should be paired with a comment
jtraglia Mar 12, 2026
c8d8848
Improve two comments
jtraglia Mar 12, 2026
4a95cd1
Evaluate test coverage, add missing test, always use real bls
jtraglia Mar 12, 2026
0c2414f
Make comments proper sentences & fix mainnet test
jtraglia Mar 12, 2026
101acfd
Get parent state in check section
jtraglia Mar 12, 2026
6eea5f4
Merge branch 'master' into executable-networking-specs
jihoonsong Mar 22, 2026
4d04ddc
Some nits
Mar 22, 2026
5737f34
Remove unused `Store` parameter in some p2p validation functions
Mar 22, 2026
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
11 changes: 11 additions & 0 deletions pysetup/spec_builders/phase0.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@
class Phase0SpecBuilder(BaseSpecBuilder):
fork: str = PHASE0

@classmethod
def classes(cls) -> str:
return """
class GossipIgnore(Exception):
pass


class GossipReject(Exception):
pass
"""

@classmethod
def imports(cls, preset_name: str) -> str:
return """from lru import LRU
Expand Down
676 changes: 512 additions & 164 deletions specs/phase0/p2p-interface.md

Large diffs are not rendered by default.

37 changes: 37 additions & 0 deletions tests/core/pyspec/eth_consensus_specs/test/helpers/gossip.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
from eth_utils import encode_hex


def get_seen(spec):
"""Create an empty Seen object for gossip validation."""
return spec.Seen(
proposer_slots=set(),
aggregator_epochs=set(),
aggregate_data_roots={},
voluntary_exit_indices=set(),
proposer_slashing_indices=set(),
attester_slashing_indices=set(),
attestation_validator_epochs=set(),
)


def get_filename(obj):
"""Get a filename for an SSZ object based on its type."""
class_name = obj.__class__.__name__

# Map class names to filename prefixes
if "BeaconBlock" in class_name:
prefix = "block"
elif class_name == "Attestation":
prefix = "attestation"
elif "AggregateAndProof" in class_name:
prefix = "aggregate"
elif class_name == "ProposerSlashing":
prefix = "proposer_slashing"
elif class_name == "AttesterSlashing":
prefix = "attester_slashing"
elif "VoluntaryExit" in class_name:
prefix = "voluntary_exit"
else:
raise Exception(f"unsupported type: {class_name}")

return f"{prefix}_{encode_hex(obj.hash_tree_root())}"
Empty file.
Loading