mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-09 15:37:56 -05:00
Add sources for compute_fork_digest to specrefs (#15699)
* Add sources for compute_fork_digest to specrefs * Delete non-existant exception keys * Lint specref files --------- Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com>
This commit is contained in:
3
changelog/jtraglia_specrefs_compute_fork_digest.md
Normal file
3
changelog/jtraglia_specrefs_compute_fork_digest.md
Normal file
@@ -0,0 +1,3 @@
|
||||
### Changed
|
||||
|
||||
- Add sources for compute_fork_digest to specrefs
|
||||
@@ -18,7 +18,6 @@ exceptions:
|
||||
- UPDATE_TIMEOUT#altair
|
||||
|
||||
# Not implemented: gloas (future fork)
|
||||
- KZG_COMMITMENTS_INCLUSION_PROOF_DEPTH_GLOAS#gloas
|
||||
- MAX_PAYLOAD_ATTESTATIONS#gloas
|
||||
- PTC_SIZE#gloas
|
||||
|
||||
@@ -215,7 +214,6 @@ exceptions:
|
||||
|
||||
# Not implemented: altair
|
||||
- compute_sync_committee_period_at_slot#altair
|
||||
- compute_timestamp_at_slot#bellatrix
|
||||
- get_contribution_and_proof#altair
|
||||
- get_contribution_due_ms#altair
|
||||
- get_index_for_new_validator#altair
|
||||
@@ -285,12 +283,10 @@ exceptions:
|
||||
- upgrade_lc_update_to_electra#electra
|
||||
|
||||
# Not implemented: fulu
|
||||
- compute_fork_digest#fulu
|
||||
- compute_matrix#fulu
|
||||
- get_blob_parameters#fulu
|
||||
- get_data_column_sidecars_from_block#fulu
|
||||
- get_data_column_sidecars_from_column_sidecar#fulu
|
||||
- get_extended_sample_count#fulu
|
||||
- recover_matrix#fulu
|
||||
|
||||
# Not implemented: gloas (future fork)
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
- name: AGGREGATE_DUE_BPS
|
||||
sources: []
|
||||
spec: |
|
||||
<spec config_var="AGGREGATE_DUE_BPS" fork="phase0" hash="7eaa811a">
|
||||
AGGREGATE_DUE_BPS: uint64 = 6667
|
||||
</spec>
|
||||
|
||||
- name: ALTAIR_FORK_EPOCH
|
||||
sources:
|
||||
- file: config/params/config.go
|
||||
@@ -18,11 +25,11 @@
|
||||
ALTAIR_FORK_VERSION: Version = '0x01000000'
|
||||
</spec>
|
||||
|
||||
- name: AGGREGATE_DUE_BPS
|
||||
- name: ATTESTATION_DUE_BPS
|
||||
sources: []
|
||||
spec: |
|
||||
<spec config_var="AGGREGATE_DUE_BPS" fork="phase0" hash="7eaa811a">
|
||||
AGGREGATE_DUE_BPS: uint64 = 6667
|
||||
<spec config_var="ATTESTATION_DUE_BPS" fork="phase0" hash="929dd1c9">
|
||||
ATTESTATION_DUE_BPS: uint64 = 3333
|
||||
</spec>
|
||||
|
||||
- name: ATTESTATION_PROPAGATION_SLOT_RANGE
|
||||
@@ -65,13 +72,6 @@
|
||||
ATTESTATION_SUBNET_PREFIX_BITS: int = 6
|
||||
</spec>
|
||||
|
||||
- name: ATTESTATION_DUE_BPS
|
||||
sources: []
|
||||
spec: |
|
||||
<spec config_var="ATTESTATION_DUE_BPS" fork="phase0" hash="929dd1c9">
|
||||
ATTESTATION_DUE_BPS: uint64 = 3333
|
||||
</spec>
|
||||
|
||||
- name: BALANCE_PER_ADDITIONAL_CUSTODY_GROUP
|
||||
sources:
|
||||
- file: config/params/config.go
|
||||
@@ -163,6 +163,13 @@
|
||||
CHURN_LIMIT_QUOTIENT: uint64 = 65536
|
||||
</spec>
|
||||
|
||||
- name: CONTRIBUTION_DUE_BPS
|
||||
sources: []
|
||||
spec: |
|
||||
<spec config_var="CONTRIBUTION_DUE_BPS" fork="altair" hash="a3808203">
|
||||
CONTRIBUTION_DUE_BPS: uint64 = 6667
|
||||
</spec>
|
||||
|
||||
- name: CUSTODY_REQUIREMENT
|
||||
sources:
|
||||
- file: config/params/config.go
|
||||
@@ -533,6 +540,13 @@
|
||||
NUMBER_OF_CUSTODY_GROUPS = 128
|
||||
</spec>
|
||||
|
||||
- name: PROPOSER_REORG_CUTOFF_BPS
|
||||
sources: []
|
||||
spec: |
|
||||
<spec config_var="PROPOSER_REORG_CUTOFF_BPS" fork="phase0" hash="a487cc43">
|
||||
PROPOSER_REORG_CUTOFF_BPS: uint64 = 1667
|
||||
</spec>
|
||||
|
||||
- name: PROPOSER_SCORE_BOOST
|
||||
sources:
|
||||
- file: config/params/config.go
|
||||
@@ -543,13 +557,6 @@
|
||||
PROPOSER_SCORE_BOOST: uint64 = 40
|
||||
</spec>
|
||||
|
||||
- name: PROPOSER_REORG_CUTOFF_BPS
|
||||
sources: []
|
||||
spec: |
|
||||
<spec config_var="PROPOSER_REORG_CUTOFF_BPS" fork="phase0" hash="a487cc43">
|
||||
PROPOSER_REORG_CUTOFF_BPS: uint64 = 1667
|
||||
</spec>
|
||||
|
||||
- name: REORG_HEAD_WEIGHT_THRESHOLD
|
||||
sources:
|
||||
- file: config/params/config.go
|
||||
@@ -610,13 +617,6 @@
|
||||
SECONDS_PER_SLOT: uint64 = 12
|
||||
</spec>
|
||||
|
||||
- name: SLOT_DURATION_MS
|
||||
sources: []
|
||||
spec: |
|
||||
<spec config_var="SLOT_DURATION_MS" fork="phase0" hash="b6d4ba6d">
|
||||
SLOT_DURATION_MS: uint64 = 12000
|
||||
</spec>
|
||||
|
||||
- name: SHARD_COMMITTEE_PERIOD
|
||||
sources:
|
||||
- file: config/params/config.go
|
||||
@@ -627,6 +627,13 @@
|
||||
SHARD_COMMITTEE_PERIOD: uint64 = 256
|
||||
</spec>
|
||||
|
||||
- name: SLOT_DURATION_MS
|
||||
sources: []
|
||||
spec: |
|
||||
<spec config_var="SLOT_DURATION_MS" fork="phase0" hash="b6d4ba6d">
|
||||
SLOT_DURATION_MS: uint64 = 12000
|
||||
</spec>
|
||||
|
||||
- name: SUBNETS_PER_NODE
|
||||
sources:
|
||||
- file: config/params/config.go
|
||||
@@ -637,6 +644,13 @@
|
||||
SUBNETS_PER_NODE = 2
|
||||
</spec>
|
||||
|
||||
- name: SYNC_MESSAGE_DUE_BPS
|
||||
sources: []
|
||||
spec: |
|
||||
<spec config_var="SYNC_MESSAGE_DUE_BPS" fork="altair" hash="791b29d8">
|
||||
SYNC_MESSAGE_DUE_BPS: uint64 = 3333
|
||||
</spec>
|
||||
|
||||
- name: TERMINAL_BLOCK_HASH
|
||||
sources:
|
||||
- file: config/params/config.go
|
||||
@@ -676,18 +690,3 @@
|
||||
<spec config_var="VALIDATOR_CUSTODY_REQUIREMENT" fork="fulu" hash="4dfc4457">
|
||||
VALIDATOR_CUSTODY_REQUIREMENT = 8
|
||||
</spec>
|
||||
|
||||
- name: CONTRIBUTION_DUE_BPS
|
||||
sources: []
|
||||
spec: |
|
||||
<spec config_var="CONTRIBUTION_DUE_BPS" fork="altair" hash="a3808203">
|
||||
CONTRIBUTION_DUE_BPS: uint64 = 6667
|
||||
</spec>
|
||||
|
||||
- name: SYNC_MESSAGE_DUE_BPS
|
||||
sources: []
|
||||
spec: |
|
||||
<spec config_var="SYNC_MESSAGE_DUE_BPS" fork="altair" hash="791b29d8">
|
||||
SYNC_MESSAGE_DUE_BPS: uint64 = 3333
|
||||
</spec>
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
- name: BASE_REWARDS_PER_EPOCH
|
||||
sources:
|
||||
- file: config/params/config.go
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
- name: BlobParameters
|
||||
sources: []
|
||||
spec: |
|
||||
|
||||
@@ -527,7 +527,11 @@
|
||||
</spec>
|
||||
|
||||
- name: compute_fork_digest#fulu
|
||||
sources: []
|
||||
sources:
|
||||
- file: config/params/fork.go
|
||||
search: func ForkDigest(
|
||||
- file: config/params/config.go
|
||||
search: func entryWithForkDigest(
|
||||
spec: |
|
||||
<spec fn="compute_fork_digest" fork="fulu" hash="e916a595">
|
||||
def compute_fork_digest(
|
||||
@@ -3140,6 +3144,17 @@
|
||||
return hash(domain_type + uint_to_bytes(epoch) + mix)
|
||||
</spec>
|
||||
|
||||
- name: get_slot_component_duration_ms
|
||||
sources: []
|
||||
spec: |
|
||||
<spec fn="get_slot_component_duration_ms" fork="phase0" hash="b81504df">
|
||||
def get_slot_component_duration_ms(basis_points: uint64) -> uint64:
|
||||
"""
|
||||
Calculate the duration of a slot component in milliseconds.
|
||||
"""
|
||||
return basis_points * SLOT_DURATION_MS // BASIS_POINTS
|
||||
</spec>
|
||||
|
||||
- name: get_slot_signature
|
||||
sources: []
|
||||
spec: |
|
||||
@@ -3160,17 +3175,6 @@
|
||||
return (store.time - store.genesis_time) // SECONDS_PER_SLOT
|
||||
</spec>
|
||||
|
||||
- name: get_slot_component_duration_ms
|
||||
sources: []
|
||||
spec: |
|
||||
<spec fn="get_slot_component_duration_ms" fork="phase0" hash="b81504df">
|
||||
def get_slot_component_duration_ms(basis_points: uint64) -> uint64:
|
||||
"""
|
||||
Calculate the duration of a slot component in milliseconds.
|
||||
"""
|
||||
return basis_points * SLOT_DURATION_MS // BASIS_POINTS
|
||||
</spec>
|
||||
|
||||
- name: get_source_deltas
|
||||
sources:
|
||||
- file: beacon-chain/core/epoch/precompute/reward_penalty.go
|
||||
@@ -7279,6 +7283,20 @@
|
||||
return a - b if a > b else 0
|
||||
</spec>
|
||||
|
||||
- name: seconds_to_milliseconds
|
||||
sources: []
|
||||
spec: |
|
||||
<spec fn="seconds_to_milliseconds" fork="phase0" hash="b2cc9743">
|
||||
def seconds_to_milliseconds(seconds: uint64) -> uint64:
|
||||
"""
|
||||
Convert seconds to milliseconds with overflow protection.
|
||||
Returns ``UINT64_MAX`` if the result would overflow.
|
||||
"""
|
||||
if seconds > UINT64_MAX // 1000:
|
||||
return UINT64_MAX
|
||||
return seconds * 1000
|
||||
</spec>
|
||||
|
||||
- name: set_or_append_list
|
||||
sources: []
|
||||
spec: |
|
||||
@@ -7516,20 +7534,6 @@
|
||||
assert block.state_root == hash_tree_root(state)
|
||||
</spec>
|
||||
|
||||
- name: seconds_to_milliseconds
|
||||
sources: []
|
||||
spec: |
|
||||
<spec fn="seconds_to_milliseconds" fork="phase0" hash="b2cc9743">
|
||||
def seconds_to_milliseconds(seconds: uint64) -> uint64:
|
||||
"""
|
||||
Convert seconds to milliseconds with overflow protection.
|
||||
Returns ``UINT64_MAX`` if the result would overflow.
|
||||
"""
|
||||
if seconds > UINT64_MAX // 1000:
|
||||
return UINT64_MAX
|
||||
return seconds * 1000
|
||||
</spec>
|
||||
|
||||
- name: store_target_checkpoint_state
|
||||
sources: []
|
||||
spec: |
|
||||
|
||||
Reference in New Issue
Block a user