Skip to content

Commit cc51f3f

Browse files
authored
v1.1.{5 -> 6} phase 0 and altair spec URL updates (#3157)
1 parent 74c63ed commit cc51f3f

35 files changed

+265
-265
lines changed

beacon_chain/beacon_chain_db_immutable.nim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import
1515
./spec/[eth2_ssz_serialization, eth2_merkleization]
1616

1717
type
18-
# https://github.com/ethereum/consensus-specs/blob/v1.1.5/specs/phase0/beacon-chain.md#beaconstate
18+
# https://github.com/ethereum/consensus-specs/blob/v1.1.6/specs/phase0/beacon-chain.md#beaconstate
1919
# Memory-representation-equivalent to a phase0 BeaconState for in-place SSZ reading and writing
2020
Phase0BeaconStateNoImmutableValidators* = object
2121
# Versioning
@@ -69,7 +69,7 @@ type
6969
current_justified_checkpoint*: Checkpoint
7070
finalized_checkpoint*: Checkpoint
7171

72-
# https://github.com/ethereum/consensus-specs/blob/v1.1.5/specs/altair/beacon-chain.md#beaconstate
72+
# https://github.com/ethereum/consensus-specs/blob/v1.1.6/specs/altair/beacon-chain.md#beaconstate
7373
# Memory-representation-equivalent to an Altair BeaconState for in-place SSZ
7474
# reading and writing
7575
AltairBeaconStateNoImmutableValidators* = object

beacon_chain/beacon_clock.nim

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ type
2525
## which blocks are valid - in particular, blocks are not valid if they
2626
## come from the future as seen from the local clock.
2727
##
28-
## https://github.com/ethereum/consensus-specs/blob/v1.1.5/specs/phase0/fork-choice.md#fork-choice
28+
## https://github.com/ethereum/consensus-specs/blob/v1.1.6/specs/phase0/fork-choice.md#fork-choice
2929
##
3030
# TODO consider NTP and network-adjusted timestamps as outlined here:
3131
# https://ethresear.ch/t/network-adjusted-timestamps/4187
@@ -38,13 +38,13 @@ type
3838
const
3939
# Offsets from the start of the slot to when the corresponding message should
4040
# be sent
41-
# https://github.com/ethereum/consensus-specs/blob/v1.1.5/specs/phase0/validator.md#attesting
41+
# https://github.com/ethereum/consensus-specs/blob/v1.1.6/specs/phase0/validator.md#attesting
4242
attestationSlotOffset* = seconds(SECONDS_PER_SLOT.int) div 3
43-
# https://github.com/ethereum/consensus-specs/blob/v1.1.5/specs/phase0/validator.md#broadcast-aggregate
43+
# https://github.com/ethereum/consensus-specs/blob/v1.1.6/specs/phase0/validator.md#broadcast-aggregate
4444
aggregateSlotOffset* = seconds(SECONDS_PER_SLOT.int) * 2 div 3
45-
# https://github.com/ethereum/consensus-specs/blob/v1.1.5/specs/altair/validator.md#prepare-sync-committee-message
45+
# https://github.com/ethereum/consensus-specs/blob/v1.1.6/specs/altair/validator.md#prepare-sync-committee-message
4646
syncCommitteeMessageSlotOffset* = seconds(SECONDS_PER_SLOT.int) div 3
47-
# https://github.com/ethereum/consensus-specs/blob/v1.1.5/specs/altair/validator.md#broadcast-sync-committee-contribution
47+
# https://github.com/ethereum/consensus-specs/blob/v1.1.6/specs/altair/validator.md#broadcast-sync-committee-contribution
4848
syncContributionSlotOffset* = seconds(SECONDS_PER_SLOT.int) * 2 div 3
4949

5050
proc init*(T: type BeaconClock, genesis_time: uint64): T =

beacon_chain/consensus_object_pools/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ This folder holds the various consensus object pools needed for a blockchain cli
44

55
Object in those pools have passed the "gossip validation" filter according
66
to specs:
7-
- blocks: https://github.com/ethereum/consensus-specs/blob/v1.1.5/specs/phase0/p2p-interface.md#beacon_block
8-
- aggregate attestations: https://github.com/ethereum/consensus-specs/blob/v1.1.5/specs/phase0/p2p-interface.md#beacon_aggregate_and_proof
9-
- unaggregated attestation: https://github.com/ethereum/consensus-specs/blob/v1.1.5/specs/phase0/p2p-interface.md#beacon_attestation_subnet_id
10-
- voluntary exits: https://github.com/ethereum/consensus-specs/blob/v1.1.5/specs/phase0/p2p-interface.md#voluntary_exit
11-
- Attester slashings: https://github.com/ethereum/consensus-specs/blob/v1.1.5/specs/phase0/p2p-interface.md#attester_slashing
12-
- Proposer slashings: https://github.com/ethereum/consensus-specs/blob/v1.1.5/specs/phase0/p2p-interface.md#proposer_slashing
7+
- blocks: https://github.com/ethereum/consensus-specs/blob/v1.1.6/specs/phase0/p2p-interface.md#beacon_block
8+
- aggregate attestations: https://github.com/ethereum/consensus-specs/blob/v1.1.6/specs/phase0/p2p-interface.md#beacon_aggregate_and_proof
9+
- unaggregated attestation: https://github.com/ethereum/consensus-specs/blob/v1.1.6/specs/phase0/p2p-interface.md#beacon_attestation_subnet_id
10+
- voluntary exits: https://github.com/ethereum/consensus-specs/blob/v1.1.6/specs/phase0/p2p-interface.md#voluntary_exit
11+
- Attester slashings: https://github.com/ethereum/consensus-specs/blob/v1.1.6/specs/phase0/p2p-interface.md#attester_slashing
12+
- Proposer slashings: https://github.com/ethereum/consensus-specs/blob/v1.1.6/specs/phase0/p2p-interface.md#proposer_slashing
1313

1414
After "gossip validation" the consensus objects can be rebroadcasted as they are optimistically good, however for internal processing further verification is needed.
1515
For blocks, this means verifying state transition and all contained cryptographic signatures (instead of just the proposer signature).

beacon_chain/consensus_object_pools/attestation_pool.nim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,7 @@ proc getAggregatedAttestation*(pool: var AttestationPool,
691691
index: CommitteeIndex): Option[Attestation] =
692692
## Select the attestation that has the most votes going for it in the given
693693
## slot/index
694-
## https://github.com/ethereum/consensus-specs/blob/v1.1.5/specs/phase0/validator.md#construct-aggregate
694+
## https://github.com/ethereum/consensus-specs/blob/v1.1.6/specs/phase0/validator.md#construct-aggregate
695695
let
696696
candidateIdx = pool.candidateIdx(slot)
697697
if candidateIdx.isNone:

beacon_chain/consensus_object_pools/spec_cache.nim

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ export
2222
func count_active_validators*(epochInfo: EpochRef): uint64 =
2323
epochInfo.shuffled_active_validator_indices.lenu64
2424

25-
# https://github.com/ethereum/consensus-specs/blob/v1.1.5/specs/phase0/beacon-chain.md#get_committee_count_per_slot
25+
# https://github.com/ethereum/consensus-specs/blob/v1.1.6/specs/phase0/beacon-chain.md#get_committee_count_per_slot
2626
func get_committee_count_per_slot*(epochInfo: EpochRef): uint64 =
2727
get_committee_count_per_slot(count_active_validators(epochInfo))
2828

2929
iterator get_committee_indices*(epochRef: EpochRef): CommitteeIndex =
3030
for i in 0'u64..<get_committee_count_per_slot(epochRef):
3131
yield CommitteeIndex(i)
3232

33-
# https://github.com/ethereum/consensus-specs/blob/v1.1.5/specs/phase0/beacon-chain.md#get_beacon_committee
33+
# https://github.com/ethereum/consensus-specs/blob/v1.1.6/specs/phase0/beacon-chain.md#get_beacon_committee
3434
iterator get_beacon_committee*(
3535
epochRef: EpochRef, slot: Slot, index: CommitteeIndex): ValidatorIndex =
3636
## Return the beacon committee at ``slot`` for ``index``.
@@ -43,7 +43,7 @@ iterator get_beacon_committee*(
4343
committees_per_slot * SLOTS_PER_EPOCH
4444
): yield idx
4545

46-
# https://github.com/ethereum/consensus-specs/blob/v1.1.5/specs/phase0/beacon-chain.md#get_beacon_committee
46+
# https://github.com/ethereum/consensus-specs/blob/v1.1.6/specs/phase0/beacon-chain.md#get_beacon_committee
4747
func get_beacon_committee*(
4848
epochRef: EpochRef, slot: Slot, index: CommitteeIndex): seq[ValidatorIndex] =
4949
## Return the beacon committee at ``slot`` for ``index``.
@@ -56,7 +56,7 @@ func get_beacon_committee*(
5656
committees_per_slot * SLOTS_PER_EPOCH
5757
)
5858

59-
# https://github.com/ethereum/consensus-specs/blob/v1.1.5/specs/phase0/beacon-chain.md#get_beacon_committee
59+
# https://github.com/ethereum/consensus-specs/blob/v1.1.6/specs/phase0/beacon-chain.md#get_beacon_committee
6060
func get_beacon_committee_len*(
6161
epochRef: EpochRef, slot: Slot, index: CommitteeIndex): uint64 =
6262
## Return the number of members in the beacon committee at ``slot`` for ``index``.
@@ -70,7 +70,7 @@ func get_beacon_committee_len*(
7070
committees_per_slot * SLOTS_PER_EPOCH
7171
)
7272

73-
# https://github.com/ethereum/consensus-specs/blob/v1.1.5/specs/phase0/beacon-chain.md#get_attesting_indices
73+
# https://github.com/ethereum/consensus-specs/blob/v1.1.6/specs/phase0/beacon-chain.md#get_attesting_indices
7474
iterator get_attesting_indices*(epochRef: EpochRef,
7575
data: AttestationData,
7676
bits: CommitteeValidatorsBits):
@@ -105,7 +105,7 @@ func get_attesting_indices_one*(epochRef: EpochRef,
105105
inc i
106106
res
107107

108-
# https://github.com/ethereum/consensus-specs/blob/v1.1.5/specs/phase0/beacon-chain.md#get_attesting_indices
108+
# https://github.com/ethereum/consensus-specs/blob/v1.1.6/specs/phase0/beacon-chain.md#get_attesting_indices
109109
func get_attesting_indices*(epochRef: EpochRef,
110110
data: AttestationData,
111111
bits: CommitteeValidatorsBits):
@@ -114,7 +114,7 @@ func get_attesting_indices*(epochRef: EpochRef,
114114
for idx in get_attesting_indices(epochRef, data, bits):
115115
result.add(idx)
116116

117-
# https://github.com/ethereum/consensus-specs/blob/v1.1.5/specs/phase0/beacon-chain.md#is_valid_indexed_attestation
117+
# https://github.com/ethereum/consensus-specs/blob/v1.1.6/specs/phase0/beacon-chain.md#is_valid_indexed_attestation
118118
proc is_valid_indexed_attestation*(
119119
fork: Fork, genesis_validators_root: Eth2Digest,
120120
epochRef: EpochRef,
@@ -159,7 +159,7 @@ func makeAttestationData*(
159159

160160
doAssert current_epoch == epochRef.epoch
161161

162-
# https://github.com/ethereum/consensus-specs/blob/v1.1.5/specs/phase0/validator.md#attestation-data
162+
# https://github.com/ethereum/consensus-specs/blob/v1.1.6/specs/phase0/validator.md#attestation-data
163163
AttestationData(
164164
slot: slot,
165165
index: committee_index.uint64,
@@ -171,7 +171,7 @@ func makeAttestationData*(
171171
)
172172
)
173173

174-
# https://github.com/ethereum/consensus-specs/blob/v1.1.5/specs/phase0/validator.md#validator-assignments
174+
# https://github.com/ethereum/consensus-specs/blob/v1.1.6/specs/phase0/validator.md#validator-assignments
175175
iterator get_committee_assignments*(
176176
epochRef: EpochRef, validator_indices: HashSet[ValidatorIndex]):
177177
tuple[subcommitteeIdx: CommitteeIndex,

beacon_chain/eth1/eth1_monitor.nim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ template toGaugeValue(x: Quantity): int64 =
293293
# doAssert SECONDS_PER_ETH1_BLOCK * cfg.ETH1_FOLLOW_DISTANCE < GENESIS_DELAY,
294294
# "Invalid configuration: GENESIS_DELAY is set too low"
295295

296-
# https://github.com/ethereum/consensus-specs/blob/v1.1.5/specs/phase0/validator.md#get_eth1_data
296+
# https://github.com/ethereum/consensus-specs/blob/v1.1.6/specs/phase0/validator.md#get_eth1_data
297297
func compute_time_at_slot(genesis_time: uint64, slot: Slot): uint64 =
298298
genesis_time + slot * SECONDS_PER_SLOT
299299

beacon_chain/gossip_processing/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ This folder holds a collection of modules to:
99

1010
Gossip validation is different from consensus verification in particular for blocks.
1111

12-
- Blocks: https://github.com/ethereum/consensus-specs/blob/v1.1.5/specs/phase0/p2p-interface.md#beacon_block
13-
- Attestations (aggregated): https://github.com/ethereum/consensus-specs/blob/v1.1.5/specs/phase0/p2p-interface.md#beacon_aggregate_and_proof
14-
- Attestations (unaggregated): https://github.com/ethereum/consensus-specs/blob/v1.1.5/specs/phase0/p2p-interface.md#attestation-subnets
15-
- Voluntary exits: https://github.com/ethereum/consensus-specs/blob/v1.1.5/specs/phase0/p2p-interface.md#voluntary_exit
16-
- Proposer slashings: https://github.com/ethereum/consensus-specs/blob/v1.1.5/specs/phase0/p2p-interface.md#proposer_slashing
17-
- Attester slashing: https://github.com/ethereum/consensus-specs/blob/v1.1.5/specs/phase0/p2p-interface.md#attester_slashing
12+
- Blocks: https://github.com/ethereum/consensus-specs/blob/v1.1.6/specs/phase0/p2p-interface.md#beacon_block
13+
- Attestations (aggregated): https://github.com/ethereum/consensus-specs/blob/v1.1.6/specs/phase0/p2p-interface.md#beacon_aggregate_and_proof
14+
- Attestations (unaggregated): https://github.com/ethereum/consensus-specs/blob/v1.1.6/specs/phase0/p2p-interface.md#attestation-subnets
15+
- Voluntary exits: https://github.com/ethereum/consensus-specs/blob/v1.1.6/specs/phase0/p2p-interface.md#voluntary_exit
16+
- Proposer slashings: https://github.com/ethereum/consensus-specs/blob/v1.1.6/specs/phase0/p2p-interface.md#proposer_slashing
17+
- Attester slashing: https://github.com/ethereum/consensus-specs/blob/v1.1.6/specs/phase0/p2p-interface.md#attester_slashing
1818

1919
There are multiple consumers of validated consensus objects:
2020
- a `ValidationResult.Accept` output triggers rebroadcasting in libp2p

beacon_chain/networking/eth2_network.nim

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ type
166166
MounterProc* = proc(network: Eth2Node) {.gcsafe, raises: [Defect, CatchableError].}
167167
MessageContentPrinter* = proc(msg: pointer): string {.gcsafe, raises: [Defect].}
168168

169-
# https://github.com/ethereum/consensus-specs/blob/v1.1.5/specs/phase0/p2p-interface.md#goodbye
169+
# https://github.com/ethereum/consensus-specs/blob/v1.1.6/specs/phase0/p2p-interface.md#goodbye
170170
DisconnectionReason* = enum
171171
# might see other values on the wire!
172172
ClientShutDown = 1
@@ -1791,8 +1791,8 @@ proc getPersistentNetKeys*(rng: var BrHmacDrbgContext,
17911791

17921792
func gossipId(
17931793
data: openArray[byte], altairPrefix, topic: string, valid: bool): seq[byte] =
1794-
# https://github.com/ethereum/consensus-specs/blob/v1.1.5/specs/phase0/p2p-interface.md#topics-and-messages
1795-
# https://github.com/ethereum/consensus-specs/blob/v1.1.5/specs/altair/p2p-interface.md#topics-and-messages
1794+
# https://github.com/ethereum/consensus-specs/blob/v1.1.6/specs/phase0/p2p-interface.md#topics-and-messages
1795+
# https://github.com/ethereum/consensus-specs/blob/v1.1.6/specs/altair/p2p-interface.md#topics-and-messages
17961796
const
17971797
MESSAGE_DOMAIN_INVALID_SNAPPY = [0x00'u8, 0x00, 0x00, 0x00]
17981798
MESSAGE_DOMAIN_VALID_SNAPPY = [0x01'u8, 0x00, 0x00, 0x00]
@@ -2066,7 +2066,7 @@ proc subscribeAttestationSubnets*(
20662066

20672067
proc unsubscribeAttestationSubnets*(
20682068
node: Eth2Node, subnets: AttnetBits, forkDigest: ForkDigest) =
2069-
# https://github.com/ethereum/consensus-specs/blob/v1.1.5/specs/phase0/p2p-interface.md#attestations-and-aggregation
2069+
# https://github.com/ethereum/consensus-specs/blob/v1.1.6/specs/phase0/p2p-interface.md#attestations-and-aggregation
20702070
# Nimbus won't score attestation subnets for now; we just rely on block and
20712071
# aggregate which are more stable and reliable
20722072

@@ -2075,15 +2075,15 @@ proc unsubscribeAttestationSubnets*(
20752075
node.unsubscribe(getAttestationTopic(forkDigest, SubnetId(subnet_id)))
20762076

20772077
proc updateStabilitySubnetMetadata*(node: Eth2Node, attnets: AttnetBits) =
2078-
# https://github.com/ethereum/consensus-specs/blob/v1.1.5/specs/phase0/p2p-interface.md#metadata
2078+
# https://github.com/ethereum/consensus-specs/blob/v1.1.6/specs/phase0/p2p-interface.md#metadata
20792079
if node.metadata.attnets == attnets:
20802080
return
20812081

20822082
node.metadata.seq_number += 1
20832083
node.metadata.attnets = attnets
20842084

2085-
# https://github.com/ethereum/consensus-specs/blob/v1.1.5/specs/phase0/validator.md#phase-0-attestation-subnet-stability
2086-
# https://github.com/ethereum/consensus-specs/blob/v1.1.5/specs/phase0/p2p-interface.md#attestation-subnet-bitfield
2085+
# https://github.com/ethereum/consensus-specs/blob/v1.1.6/specs/phase0/validator.md#phase-0-attestation-subnet-stability
2086+
# https://github.com/ethereum/consensus-specs/blob/v1.1.6/specs/phase0/p2p-interface.md#attestation-subnet-bitfield
20872087
let res = node.discovery.updateRecord({
20882088
enrAttestationSubnetsField: SSZ.encode(node.metadata.attnets)
20892089
})
@@ -2095,7 +2095,7 @@ proc updateStabilitySubnetMetadata*(node: Eth2Node, attnets: AttnetBits) =
20952095
debug "Stability subnets changed; updated ENR attnets", attnets
20962096

20972097
proc updateSyncnetsMetadata*(node: Eth2Node, syncnets: SyncnetBits) =
2098-
# https://github.com/ethereum/consensus-specs/blob/v1.1.5/specs/altair/validator.md#sync-committee-subnet-stability
2098+
# https://github.com/ethereum/consensus-specs/blob/v1.1.6/specs/altair/validator.md#sync-committee-subnet-stability
20992099
if node.metadata.syncnets == syncnets:
21002100
return
21012101

@@ -2138,7 +2138,7 @@ proc getWallEpoch(node: Eth2Node): Epoch =
21382138
proc broadcastAttestation*(node: Eth2Node, subnet_id: SubnetId,
21392139
attestation: Attestation) =
21402140
# Regardless of the contents of the attestation,
2141-
# https://github.com/ethereum/consensus-specs/blob/v1.1.5/specs/altair/p2p-interface.md#transitioning-the-gossip
2141+
# https://github.com/ethereum/consensus-specs/blob/v1.1.6/specs/altair/p2p-interface.md#transitioning-the-gossip
21422142
# implies that pre-fork, messages using post-fork digests might be
21432143
# ignored, whilst post-fork, there is effectively a seen_ttl-based
21442144
# timer unsubscription point that means no new pre-fork-forkdigest

beacon_chain/rpc/rest_config_api.nim

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ proc installConfigApiHandlers*(router: var RestRouter, node: BeaconNode) =
162162
DEPOSIT_CONTRACT_ADDRESS:
163163
$node.dag.cfg.DEPOSIT_CONTRACT_ADDRESS,
164164

165-
# https://github.com/ethereum/consensus-specs/blob/v1.1.5/specs/phase0/beacon-chain.md#constants
165+
# https://github.com/ethereum/consensus-specs/blob/v1.1.6/specs/phase0/beacon-chain.md#constants
166166
# GENESIS_SLOT
167167
# GENESIS_EPOCH
168168
# FAR_FUTURE_EPOCH
@@ -196,7 +196,7 @@ proc installConfigApiHandlers*(router: var RestRouter, node: BeaconNode) =
196196
"0x" & ncrutils.toHex(
197197
uint32(DOMAIN_AGGREGATE_AND_PROOF).toBytesLE()),
198198

199-
# https://github.com/ethereum/consensus-specs/blob/v1.1.5/specs/altair/beacon-chain.md#constants
199+
# https://github.com/ethereum/consensus-specs/blob/v1.1.6/specs/altair/beacon-chain.md#constants
200200
TIMELY_SOURCE_FLAG_INDEX:
201201
"0x" & ncrutils.toHex([byte(TIMELY_SOURCE_FLAG_INDEX)]),
202202
TIMELY_TARGET_FLAG_INDEX:
@@ -226,7 +226,7 @@ proc installConfigApiHandlers*(router: var RestRouter, node: BeaconNode) =
226226
uint32(DOMAIN_CONTRIBUTION_AND_PROOF).toBytesLE()),
227227
# PARTICIPATION_FLAG_WEIGHTS
228228

229-
# https://github.com/ethereum/consensus-specs/blob/v1.1.5/specs/phase0/validator.md#constants
229+
# https://github.com/ethereum/consensus-specs/blob/v1.1.6/specs/phase0/validator.md#constants
230230
TARGET_AGGREGATORS_PER_COMMITTEE:
231231
Base10.toString(TARGET_AGGREGATORS_PER_COMMITTEE),
232232
RANDOM_SUBNETS_PER_VALIDATOR:
@@ -236,7 +236,7 @@ proc installConfigApiHandlers*(router: var RestRouter, node: BeaconNode) =
236236
ATTESTATION_SUBNET_COUNT:
237237
Base10.toString(uint64(ATTESTATION_SUBNET_COUNT)),
238238

239-
# https://github.com/ethereum/consensus-specs/blob/v1.1.5/specs/altair/validator.md#constants
239+
# https://github.com/ethereum/consensus-specs/blob/v1.1.6/specs/altair/validator.md#constants
240240
TARGET_AGGREGATORS_PER_SYNC_SUBCOMMITTEE:
241241
Base10.toString(uint64(TARGET_AGGREGATORS_PER_SYNC_SUBCOMMITTEE)),
242242
SYNC_COMMITTEE_SUBNET_COUNT:

0 commit comments

Comments
 (0)