diff --git a/src/lean_spec/forks/lstar/containers/attestation/attestation.py b/src/lean_spec/forks/lstar/containers/attestation/attestation.py index 13ff4c0d..a98f8fb6 100644 --- a/src/lean_spec/forks/lstar/containers/attestation/attestation.py +++ b/src/lean_spec/forks/lstar/containers/attestation/attestation.py @@ -11,8 +11,6 @@ Attestations can be aggregated by common data to save space and bandwidth. """ -from __future__ import annotations - from lean_spec.subspecs.xmss.aggregation import TypeOneMultiSignature from lean_spec.subspecs.xmss.containers import Signature from lean_spec.types import AggregationBits, Checkpoint, Container, Slot, ValidatorIndex diff --git a/src/lean_spec/forks/lstar/containers/block/types.py b/src/lean_spec/forks/lstar/containers/block/types.py index b456681e..07594a75 100644 --- a/src/lean_spec/forks/lstar/containers/block/types.py +++ b/src/lean_spec/forks/lstar/containers/block/types.py @@ -1,7 +1,5 @@ """Block-specific SSZ types for the Lean Ethereum consensus specification.""" -from __future__ import annotations - from lean_spec.subspecs.chain.config import VALIDATOR_REGISTRY_LIMIT from lean_spec.types import SSZList diff --git a/src/lean_spec/forks/lstar/containers/state/state.py b/src/lean_spec/forks/lstar/containers/state/state.py index 4b42023d..38e69149 100644 --- a/src/lean_spec/forks/lstar/containers/state/state.py +++ b/src/lean_spec/forks/lstar/containers/state/state.py @@ -1,7 +1,5 @@ """State Container for the Lean Ethereum consensus specification.""" -from __future__ import annotations - from lean_spec.forks.lstar.containers.block import BlockHeader from lean_spec.forks.lstar.containers.config import Config from lean_spec.forks.lstar.containers.state.types import ( diff --git a/src/lean_spec/forks/lstar/containers/state/types.py b/src/lean_spec/forks/lstar/containers/state/types.py index 02bc6007..8c40aa48 100644 --- a/src/lean_spec/forks/lstar/containers/state/types.py +++ b/src/lean_spec/forks/lstar/containers/state/types.py @@ -1,6 +1,6 @@ """State-specific SSZ types for the Lean Ethereum consensus specification.""" -from __future__ import annotations +from typing import Self from lean_spec.subspecs.chain.config import HISTORICAL_ROOTS_LIMIT, VALIDATOR_REGISTRY_LIMIT from lean_spec.types import Boolean, Bytes32, Slot, SSZList @@ -67,7 +67,7 @@ def with_justified( finalized_slot: Slot, target_slot: Slot, value: Boolean, - ) -> JustifiedSlots: + ) -> Self: """ Return a new bitfield with the justification status updated. @@ -112,7 +112,7 @@ def with_justified( return self.model_copy(update={"data": new_data}) - def extend_to_slot(self, finalized_slot: Slot, target_slot: Slot) -> JustifiedSlots: + def extend_to_slot(self, finalized_slot: Slot, target_slot: Slot) -> Self: """ Extend the tracking capacity to cover a new target slot. @@ -147,7 +147,7 @@ def extend_to_slot(self, finalized_slot: Slot, target_slot: Slot) -> JustifiedSl # We extend the existing data with False values to bridge the gap. return self.model_copy(update={"data": list(self.data) + [Boolean(False)] * gap_size}) - def shift_window(self, delta: int) -> JustifiedSlots: + def shift_window(self, delta: int) -> Self: """ Advance the tracking window by dropping slots that became finalized. diff --git a/src/lean_spec/forks/lstar/containers/validator.py b/src/lean_spec/forks/lstar/containers/validator.py index b4392659..835f5ff6 100644 --- a/src/lean_spec/forks/lstar/containers/validator.py +++ b/src/lean_spec/forks/lstar/containers/validator.py @@ -1,7 +1,5 @@ """Validator container for the Lean Ethereum consensus specification.""" -from __future__ import annotations - from lean_spec.subspecs.chain.config import VALIDATOR_REGISTRY_LIMIT from lean_spec.subspecs.xmss.containers import PublicKey from lean_spec.types import Bytes52, Container, SSZList, ValidatorIndex diff --git a/src/lean_spec/subspecs/xmss/rand.py b/src/lean_spec/subspecs/xmss/rand.py index 040faa07..fa84e80c 100644 --- a/src/lean_spec/subspecs/xmss/rand.py +++ b/src/lean_spec/subspecs/xmss/rand.py @@ -1,7 +1,5 @@ """Random data generator for the XMSS signature scheme.""" -from __future__ import annotations - import secrets from lean_spec.types import StrictBaseModel