2019-10-01 13:52:28 +00:00
|
|
|
# beacon_chain
|
2020-02-21 12:16:58 +00:00
|
|
|
# Copyright (c) 2018-2020 Status Research & Development GmbH
|
2019-10-01 13:52:28 +00:00
|
|
|
# Licensed and distributed under either of
|
2019-11-25 15:30:02 +00:00
|
|
|
# * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT).
|
|
|
|
# * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0).
|
2019-10-01 13:52:28 +00:00
|
|
|
# at your option. This file may not be copied, modified, or distributed except according to those terms.
|
|
|
|
|
2020-02-21 12:16:58 +00:00
|
|
|
import strformat
|
|
|
|
|
2019-10-01 13:52:28 +00:00
|
|
|
const
|
|
|
|
topicBeaconBlocks* = "/eth2/beacon_block/ssz"
|
2020-02-21 12:16:58 +00:00
|
|
|
topicAttestationSuffix* = "_beacon_attestation/ssz"
|
2019-10-01 13:52:28 +00:00
|
|
|
topicVoluntaryExits* = "/eth2/voluntary_exit/ssz"
|
|
|
|
topicProposerSlashings* = "/eth2/proposer_slashing/ssz"
|
|
|
|
topicAttesterSlashings* = "/eth2/attester_slashing/ssz"
|
2020-02-21 12:16:58 +00:00
|
|
|
|
2020-02-21 13:15:13 +00:00
|
|
|
# https://github.com/ethereum/eth2.0-specs/blob/v0.10.1/specs/phase0/p2p-interface.md#configuration
|
2020-02-21 12:16:58 +00:00
|
|
|
ATTESTATION_SUBNET_COUNT* = 64
|
|
|
|
|
|
|
|
func getAttestationTopic*(committeeIndex: uint64): string =
|
|
|
|
doAssert committeeIndex < ATTESTATION_SUBNET_COUNT
|
|
|
|
# https://github.com/ethereum/eth2.0-specs/blob/v0.10.1/specs/phase0/validator.md#broadcast-attestation
|
|
|
|
&"/eth2/index{committeeIndex}{topicAttestationSuffix}"
|