File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88from pydantic import BaseModel , ConfigDict
99from typing_extensions import Final
1010
11- from lean_spec .types import BasisPoint , uint64
11+ from lean_spec .types import BasisPoint , Uint64
1212
1313# --- Time Parameters ---
1414
@@ -73,15 +73,15 @@ class _ChainConfig(BaseModel):
7373 model_config = ConfigDict (frozen = True , extra = "forbid" )
7474
7575 # Time Parameters
76- slot_duration_ms : uint64
76+ slot_duration_ms : Uint64
7777 proposer_reorg_cutoff_bps : BasisPoint
7878 vote_due_bps : BasisPoint
7979 fast_confirm_due_bps : BasisPoint
8080 view_freeze_cutoff_bps : BasisPoint
8181
8282 # State List Length Presets
83- historical_roots_limit : uint64
84- validator_registry_limit : uint64
83+ historical_roots_limit : Uint64
84+ validator_registry_limit : Uint64
8585
8686
8787# The Devnet Chain Configuration.
Original file line number Diff line number Diff line change 33from pydantic import Field
44from typing_extensions import Annotated
55
6- from lean_spec .types import Bytes32 , StrictBaseModel , uint64
6+ from lean_spec .types import Bytes32 , StrictBaseModel , Uint64
77
88from ..chain import config
99from .vote import Vote
@@ -26,10 +26,10 @@ class BlockBody(StrictBaseModel):
2626class BlockHeader (StrictBaseModel ):
2727 """The header of a block, containing metadata."""
2828
29- slot : uint64
29+ slot : Uint64
3030 """The slot in which the block was proposed."""
3131
32- proposer_index : uint64
32+ proposer_index : Uint64
3333 """The index of the validator that proposed the block."""
3434
3535 parent_root : Bytes32
@@ -45,10 +45,10 @@ class BlockHeader(StrictBaseModel):
4545class Block (StrictBaseModel ):
4646 """Represents a single block in the chain."""
4747
48- slot : uint64
48+ slot : Uint64
4949 """The slot in which the block was proposed."""
5050
51- proposer_index : uint64
51+ proposer_index : Uint64
5252 """The index of the validator that proposed the block."""
5353
5454 parent_root : Bytes32
Original file line number Diff line number Diff line change 11"""Checkpoint Container."""
22
3- from lean_spec .types import Bytes32 , StrictBaseModel , uint64
3+ from lean_spec .types import Bytes32 , StrictBaseModel , Uint64
44
55
66class Checkpoint (StrictBaseModel ):
@@ -9,5 +9,5 @@ class Checkpoint(StrictBaseModel):
99 root : Bytes32
1010 """The root hash of the checkpoint's block."""
1111
12- slot : uint64
12+ slot : Uint64
1313 """The slot number of the checkpoint's block."""
Original file line number Diff line number Diff line change 11"""Consensus Configuration Container."""
22
3- from lean_spec .types import StrictBaseModel , uint64
3+ from lean_spec .types import StrictBaseModel , Uint64
44
55
66class Config (StrictBaseModel ):
@@ -11,8 +11,8 @@ class Config(StrictBaseModel):
1111 in the absence of more complex mechanisms like RANDAO or deposits.
1212 """
1313
14- num_validators : uint64
14+ num_validators : Uint64
1515 """The total number of validators in the network."""
1616
17- genesis_time : uint64
17+ genesis_time : Uint64
1818 """The timestamp of the genesis block."""
Original file line number Diff line number Diff line change 44from typing_extensions import Annotated
55
66from lean_spec .subspecs .chain import DEVNET_CONFIG
7- from lean_spec .types import Bytes32 , StrictBaseModel , uint64
7+ from lean_spec .types import Bytes32 , StrictBaseModel , Uint64
88
99from .block import BlockHeader
1010from .checkpoint import Checkpoint
@@ -19,7 +19,7 @@ class State(StrictBaseModel):
1919 """The chain's configuration parameters."""
2020
2121 # Slot and block tracking
22- slot : uint64
22+ slot : Uint64
2323 """The current slot number."""
2424
2525 latest_block_header : BlockHeader
Original file line number Diff line number Diff line change 11"""Vote Containers."""
22
3- from lean_spec .types import Bytes32 , StrictBaseModel , uint64
3+ from lean_spec .types import Bytes32 , StrictBaseModel , Uint64
44
55from .checkpoint import Checkpoint
66
77
88class Vote (StrictBaseModel ):
99 """Represents a validator's vote for chain head."""
1010
11- validator_id : uint64
11+ validator_id : Uint64
1212 """The index of the voting validator."""
1313
14- slot : uint64
14+ slot : Uint64
1515 """The slot for which this vote is cast."""
1616
1717 head : Checkpoint
Original file line number Diff line number Diff line change 33from .base import StrictBaseModel
44from .basispt import BasisPoint
55from .hash import Bytes32
6- from .uint64 import uint64
6+ from .uint64 import Uint64
77
88__all__ = [
9- "uint64 " ,
9+ "Uint64 " ,
1010 "BasisPoint" ,
1111 "Bytes32" ,
1212 "StrictBaseModel" ,
Original file line number Diff line number Diff line change 33from pydantic import Field
44from typing_extensions import Annotated
55
6- from ..types .uint64 import uint64
6+ from ..types .uint64 import Uint64
77
88BasisPoint = Annotated [
9- uint64 ,
9+ Uint64 ,
1010 Field (le = 10000 , description = "A value in basis points (1/10000)." ),
1111]
1212"""
Original file line number Diff line number Diff line change 66UINT64_MAX = 2 ** 64
77"""The maximum value for an unsigned 64-bit integer (2**64)."""
88
9- uint64 = Annotated [int , Field (ge = 0 , lt = UINT64_MAX )]
9+ Uint64 = Annotated [int , Field (ge = 0 , lt = UINT64_MAX )]
1010"""A type alias to represent a uint64."""
You can’t perform that action at this time.
0 commit comments