Skip to content

Commit

Permalink
chore: check consensus version to enable EIP7549 support
Browse files Browse the repository at this point in the history
  • Loading branch information
madlabman committed Jan 30, 2025
1 parent 850924f commit 586f901
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/modules/csm/checkpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
lock = Lock()


EIP7549_SUPPORT = True


class MinStepIsNotReached(Exception): ...


Expand Down Expand Up @@ -240,6 +243,8 @@ def process_attestations(attestations: Iterable[BlockAttestation], committees: C

def get_committee_indices(attestation: BlockAttestation) -> list[CommitteeIndex]:
if is_eip7549_attestation(attestation):
if not EIP7549_SUPPORT:
raise ValueError("EIP-7549 support is not enabled")
return [CommitteeIndex(i) for i in get_set_indices(hex_bitvector_to_list(attestation.committee_bits))]
return [attestation.data.index]

Expand Down
4 changes: 4 additions & 0 deletions src/modules/csm/csm.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
)
from src.metrics.prometheus.duration_meter import duration_meter
from src.modules.csm.checkpoint import FrameCheckpointProcessor, FrameCheckpointsIterator, MinStepIsNotReached
from src.modules.csm import checkpoint as checkpoint_module
from src.modules.csm.log import FramePerfLog
from src.modules.csm.state import State
from src.modules.csm.tree import Tree
Expand Down Expand Up @@ -168,6 +169,9 @@ def validate_state(self, blockstamp: ReferenceBlockStamp) -> None:
def collect_data(self, blockstamp: BlockStamp) -> bool:
"""Ongoing report data collection for the estimated reference slot"""

consensus_version = self.get_consensus_version(blockstamp)
checkpoint_module.EIP7549_SUPPORT = consensus_version != 1

logger.info({"msg": "Collecting data for the report"})

converter = self.converter(blockstamp)
Expand Down

0 comments on commit 586f901

Please sign in to comment.