Skip to content

Commit ac69ffb

Browse files
djrtwohwwhww
andcommitted
Apply suggestions from code review
Co-Authored-By: hwwhww <[email protected]>
1 parent 1708861 commit ac69ffb

File tree

5 files changed

+5
-10
lines changed

5 files changed

+5
-10
lines changed

eth/beacon/db/chain.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ def _persist_block_chain(
305305
)
306306

307307
# TODO: It's a stub before we implement fork choice rule
308-
score += block.slot
308+
score = block.slot
309309

310310
db.set(
311311
SchemaV1.make_block_hash_to_score_lookup_key(block.hash),
@@ -409,15 +409,15 @@ def _add_block_slot_to_hash_lookup(db: BaseDB, block: BaseBeaconBlock) -> None:
409409
)
410410

411411
#
412-
# Active State API
412+
# Beacon State API
413413
#
414414
def get_state_by_root(self, state_root: Hash32) -> BeaconState:
415415
return self._get_state_by_root(self.db, state_root)
416416

417417
@staticmethod
418418
def _get_state_by_root(db: BaseDB, state_root: Hash32) -> BeaconState:
419419
"""
420-
Return the requested crystallized state as specified by state hash.
420+
Return the requested beacon state as specified by state hash.
421421
422422
Raises StateRootNotFound if it is not present in the db.
423423
"""

eth/beacon/state_machines/configs.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
('MIN_ONLINE_DEPOSIT_SIZE', int), # ETH
1616
('DEPOSIT_CONTRACT_ADDRESS', Address),
1717
('TARGET_COMMITTEE_SIZE', int), # validators
18-
('GENESIS_TIME', int), # seconds
1918
('SLOT_DURATION', int), # seconds
2019
('CYCLE_LENGTH', int), # slots
2120
('MIN_VALIDATOR_SET_CHANGE_INTERVAL', int), # slots

eth/beacon/state_machines/forks/serenity/configs.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
MIN_ONLINE_DEPOSIT_SIZE=2**4, # = 16 ETH
1111
DEPOSIT_CONTRACT_ADDRESS=ZERO_ADDRESS, # TODO: TBD
1212
TARGET_COMMITTEE_SIZE=2**8, # = 256 validators
13-
GENESIS_TIME=0, # TBD seconds
1413
SLOT_DURATION=6, # seconds
1514
CYCLE_LENGTH=2**6, # = 64 slots
1615
MIN_VALIDATOR_SET_CHANGE_INTERVAL=2**8, # = 256 slots

eth/beacon/types/proposal_signed_data.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ class ProposalSignedData(rlp.Serializable):
1515
"""
1616
fields = [
1717
# Fork version
18-
('fork_version', uint64),
1918
# Slot number
2019
('slot', uint64),
2120
# Shard number (or `2**64 - 1` for beacon chain)
@@ -25,12 +24,10 @@ class ProposalSignedData(rlp.Serializable):
2524
]
2625

2726
def __init__(self,
28-
fork_version: int,
2927
slot: int,
3028
shard: int,
3129
block_hash: Hash32) -> None:
3230
super().__init__(
33-
fork_version=fork_version,
3431
slot=slot,
3532
shard=shard,
3633
block_hash=block_hash,

eth/beacon/types/special_records.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
)
55

66
from eth.rlp.sedes import (
7-
uint8,
7+
uint64,
88
)
99

1010

@@ -14,7 +14,7 @@ class SpecialRecord(rlp.Serializable):
1414
"""
1515
fields = [
1616
# Kind
17-
('kind', uint8),
17+
('kind', uint64),
1818
# Data
1919
('data', binary),
2020
]

0 commit comments

Comments
 (0)