├── .bazelversion ├── tools ├── go │ └── BUILD.bazel ├── cross-toolchain │ ├── BUILD.bazel │ ├── configs │ │ └── clang │ │ │ └── bazel_5.0.0 │ │ │ └── prysm_toolchains │ │ │ └── WORKSPACE │ ├── common_osxcross.sh │ └── regenerate.sh ├── analyzers │ ├── gocognit │ │ └── CognitiveComplexity.pdf │ ├── README.md │ ├── nop │ │ └── analyzer_test.go │ ├── ineffassign │ │ ├── testdata │ │ │ └── ctx_assignment.go │ │ └── analyzer_test.go │ ├── comparesame │ │ └── analyzer_test.go │ ├── cryptorand │ │ └── analyzer_test.go │ ├── slicedirect │ │ └── analyzer_test.go │ ├── recursivelock │ │ └── analyzer_test.go │ ├── shadowpredecl │ │ └── analyzer_test.go │ └── properpermissions │ │ └── analyzer_test.go ├── build_settings.bzl ├── target_migration.bzl ├── unencrypted-keys-gen │ └── keygen │ │ └── BUILD.bazel └── specs-checker │ └── data │ └── extra.md ├── .dockerignore ├── crypto ├── bls │ ├── error.go │ ├── constants.go │ ├── blst │ │ ├── doc.go │ │ ├── aliases.go │ │ └── init.go │ ├── interface.go │ ├── common │ │ ├── BUILD.bazel │ │ ├── constants.go │ │ └── error.go │ └── herumi │ │ ├── BUILD.bazel │ │ └── init.go ├── hash │ └── htr │ │ └── BUILD.bazel ├── keystore │ └── keccak256.go └── rand │ └── BUILD.bazel ├── third_party ├── BUILD.bazel ├── com_github_prysmaticlabs_ethereumapis-tags.patch ├── herumi │ ├── BUILD.bazel │ ├── mcl_darwin_arm64_base64.o │ └── bls.BUILD └── usb │ ├── README.md │ └── AUTHORS ├── proto ├── eth │ ├── v1 │ │ ├── node.pb.gw.go │ │ ├── events.pb.gw.go │ │ ├── validator.pb.gw.go │ │ ├── attestation.pb.gw.go │ │ ├── beacon_block.pb.gw.go │ │ ├── beacon_chain.pb.gw.go │ │ ├── beacon_state.pb.gw.go │ │ ├── testdata │ │ │ └── invalid-offset.attestation.ssz │ │ └── README.md │ └── v2 │ │ ├── ssz.pb.gw.go │ │ ├── validator.pb.gw.go │ │ ├── version.pb.gw.go │ │ ├── beacon_block.pb.gw.go │ │ ├── beacon_state.pb.gw.go │ │ └── sync_committee.pb.gw.go ├── prysm │ ├── BUILD.bazel │ └── v1alpha1 │ │ ├── attestation.pb.gw.go │ │ ├── beacon_block.pb.gw.go │ │ ├── beacon_state.pb.gw.go │ │ ├── p2p_messages.pb.gw.go │ │ ├── powchain.pb.gw.go │ │ ├── sync_committee.pb.gw.go │ │ ├── finalized_block_root_container.pb.gw.go │ │ ├── README.md │ │ ├── validator-client │ │ └── interface.go │ │ ├── sync_committee_minimal.go │ │ ├── sync_committee_mainnet.go │ │ └── metadata │ │ └── BUILD.bazel ├── README.md └── testing │ └── gocast.go ├── fuzzbuzz.yaml ├── .github ├── FUNDING.yml └── actions │ ├── gofmt │ ├── Dockerfile │ ├── action.yml │ └── entrypoint.sh │ └── gomodtidy │ ├── Dockerfile │ └── action.yml ├── service-account.json.enc ├── beacon-chain ├── sync │ ├── doc.go │ ├── log.go │ ├── initial-sync │ │ ├── log.go │ │ └── testing │ │ │ └── BUILD.bazel │ └── sync_test.go ├── server │ └── log.go ├── core │ ├── epoch │ │ └── precompute │ │ │ └── precompute_test.go │ ├── blocks │ │ ├── log.go │ │ └── testdata │ │ │ ├── beaconfuzz_78_beacon.ssz │ │ │ ├── beaconfuzz_91_beacon.ssz │ │ │ ├── beaconfuzz_78_attestation.ssz │ │ │ └── beaconfuzz_91_proposer_slashing.ssz │ ├── transition │ │ ├── log.go │ │ └── interop │ │ │ └── log.go │ └── feed │ │ ├── block │ │ ├── notifier.go │ │ └── BUILD.bazel │ │ ├── state │ │ └── notifier.go │ │ ├── operation │ │ ├── notifier.go │ │ └── BUILD.bazel │ │ └── BUILD.bazel ├── package │ ├── postinst.sh │ └── preinst.sh ├── db │ ├── kv │ │ ├── log.go │ │ ├── testdata │ │ │ ├── altona.genesis.ssz │ │ │ └── mainnet.genesis.ssz │ │ ├── init_test.go │ │ ├── encoding_test.go │ │ └── kv_test.go │ ├── log.go │ ├── db_test.go │ ├── slasherkv │ │ ├── log.go │ │ ├── slasherkv_test.go │ │ └── kv_test.go │ └── iface │ │ └── errors.go ├── rpc │ ├── log.go │ ├── eth │ │ ├── beacon │ │ │ ├── log.go │ │ │ ├── server_test.go │ │ │ └── init_test.go │ │ └── node │ │ │ └── server_test.go │ └── prysm │ │ └── v1alpha1 │ │ ├── beacon │ │ ├── log.go │ │ └── init_test.go │ │ ├── validator │ │ └── log.go │ │ └── slasher │ │ └── server.go ├── node │ ├── log.go │ └── registration │ │ └── log.go ├── state │ ├── genesis │ │ └── mainnet.ssz.snappy │ ├── v2 │ │ ├── error.go │ │ ├── testdata │ │ │ └── fuzz │ │ │ │ └── FuzzV2StateHashTreeRoot │ │ │ │ └── 52875ab39ad0eeec927085f3330d00508d015fe3c204b6bc6607296f64ec221c │ │ ├── spec_parameters.go │ │ └── field_roots.go │ ├── v3 │ │ ├── error.go │ │ ├── spec_parameters.go │ │ ├── field_roots.go │ │ └── setters_payload_header.go │ ├── stategen │ │ ├── log.go │ │ ├── errors.go │ │ ├── init_test.go │ │ └── metrics.go │ ├── state-native │ │ ├── error.go │ │ ├── types │ │ │ └── BUILD.bazel │ │ └── ssz.go │ ├── fieldtrie │ │ └── testdata │ │ │ └── fuzz │ │ │ └── FuzzFieldTrie │ │ │ └── c1898b8d556154d8a9d00cf2a64226dd5d76f33e27c373df2c409670db9b4877 │ ├── error.go │ ├── stateutil │ │ └── reference_bench_test.go │ ├── prometheus.go │ └── v1 │ │ ├── spec_parameters.go │ │ └── field_roots.go ├── p2p │ ├── peers │ │ ├── log.go │ │ └── benchmark_test.go │ ├── encoder │ │ └── doc.go │ └── doc.go ├── powchain │ ├── log.go │ ├── powchain_test.go │ └── init_test.go ├── slasher │ ├── log.go │ ├── types │ │ └── BUILD.bazel │ └── mock │ │ └── BUILD.bazel ├── cache │ ├── cache_test.go │ ├── depositcache │ │ └── log.go │ └── doc.go ├── builder │ ├── error.go │ └── testing │ │ └── BUILD.bazel ├── forkchoice │ ├── error.go │ ├── doubly-linked-tree │ │ └── doc.go │ ├── protoarray │ │ └── doc.go │ └── doc.go ├── operations │ ├── slashings │ │ ├── log.go │ │ ├── doc.go │ │ └── mock │ │ │ └── BUILD.bazel │ ├── attestations │ │ ├── log.go │ │ ├── pool_test.go │ │ └── mock │ │ │ └── BUILD.bazel │ ├── synccommittee │ │ └── error.go │ └── voluntaryexits │ │ └── doc.go ├── deterministic-genesis │ └── log.go ├── blockchain │ ├── checktags_test.go │ ├── blockchain_test.go │ ├── init_test.go │ └── error_test.go ├── monitor │ └── doc.go └── BUILD.bazel ├── validator ├── db │ ├── log.go │ ├── kv │ │ └── log.go │ └── alias.go ├── package │ ├── postinst.sh │ └── preinst.sh ├── node │ ├── log.go │ └── testdata │ │ ├── bad-prepare-beacon-proposer-config.json │ │ ├── good-prepare-beacon-proposer-config.yaml │ │ ├── good-prepare-beacon-proposer-config.json │ │ └── good-prepare-beacon-proposer-config-badchecksum.json ├── rpc │ ├── log.go │ └── server_test.go ├── web │ ├── log.go │ └── doc.go ├── accounts │ ├── log.go │ ├── wallet │ │ └── log.go │ ├── testdata │ │ └── fuzz │ │ │ └── FuzzValidateMnemonic │ │ │ └── 0258716f94e00f9df0da869fd97f9e0d0c6ac83eb528677d918f0ac9be5f4b8d │ ├── userprompt │ │ └── log.go │ ├── doc.go │ └── petnames │ │ └── BUILD.bazel ├── graffiti │ └── log.go ├── keymanager │ ├── local │ │ ├── log.go │ │ └── errors.go │ ├── derived │ │ └── log.go │ ├── remote │ │ └── log.go │ ├── constants.go │ ├── remote-web3signer │ │ └── internal │ │ │ └── log.go │ └── remote-utils │ │ └── BUILD.bazel ├── slashing-protection-history │ ├── log.go │ ├── format │ │ └── BUILD.bazel │ └── doc.go ├── testing │ └── constants.go ├── client │ └── iface │ │ └── BUILD.bazel └── BUILD.bazel ├── cmd ├── validator │ ├── log.go │ ├── web │ │ └── log.go │ └── slashing-protection │ │ └── log.go ├── beacon-chain │ ├── log.go │ └── flags │ │ └── log.go ├── client-stats │ ├── log.go │ └── flags │ │ └── BUILD.bazel ├── prysmctl │ ├── checkpoint │ │ └── checkpoint.go │ └── main.go └── mock │ └── BUILD.bazel ├── api ├── gateway │ ├── log.go │ └── apimiddleware │ │ └── log.go ├── client │ └── beacon │ │ └── doc.go └── grpc │ └── parameters.go ├── container ├── trie │ └── testdata │ │ └── fuzz │ │ ├── FuzzSparseMerkleTrie_HashTreeRoot │ │ └── 5838cdfae7b16cde2707c04599b62223e7bade8dafdd8a1c53b8f881e8f79d99 │ │ ├── FuzzSparseMerkleTrie_MerkleProof │ │ └── ec4893c52de558dbac9a850e4266850e109a9e6bc6bab59953b2a30027f66a93 │ │ └── FuzzSparseMerkleTrie_Insert │ │ ├── d863478086b8f8e8c854ec74d4d5360ffbe979064b58f619eb3d5fddfdae64c8 │ │ └── fuzzbuzz-97663548a1e2280a081745e5fa25c289f7121c0b ├── slice │ └── doc.go └── queue │ └── BUILD.bazel ├── time ├── slots │ ├── testing │ │ ├── mock_test.go │ │ └── mock.go │ └── slotutil_test.go ├── BUILD.bazel ├── mclock │ └── BUILD.bazel └── utils.go ├── testing ├── benchmark │ ├── benchmark_files │ │ ├── fullBlock-128Atts-16384Vals.ssz │ │ ├── bState1Epoch-128Atts-16384Vals.ssz │ │ ├── bState2Epochs-128Atts-16384Vals.ssz │ │ └── BUILD.bazel │ └── pregen_test.go ├── endtoend │ ├── lighthouse.BUILD │ ├── web3signer.BUILD │ ├── components │ │ └── log.go │ ├── minimal_e2e_test.go │ ├── static-files │ │ └── eth1 │ │ │ └── BUILD.bazel │ ├── mainnet_e2e_test.go │ ├── policies │ │ └── BUILD.bazel │ └── types │ │ └── BUILD.bazel ├── spectest │ ├── shared │ │ ├── altair │ │ │ └── sanity │ │ │ │ └── block_processing.yaml.go │ │ ├── bellatrix │ │ │ └── sanity │ │ │ │ └── block_processing.yaml.go │ │ └── phase0 │ │ │ ├── sanity │ │ │ └── block_processing.yaml.go │ │ │ └── shuffling │ │ │ └── core │ │ │ └── shuffle │ │ │ └── shuffle_test_format.go │ ├── general │ │ └── phase0 │ │ │ └── bls │ │ │ ├── doc.go │ │ │ ├── aggregate_test.yaml.go │ │ │ ├── sign_test.yaml.go │ │ │ ├── verify_test.yaml.go │ │ │ └── aggregate_verify_test.yaml.go │ ├── mainnet │ │ ├── altair │ │ │ ├── finality │ │ │ │ ├── finality_test.go │ │ │ │ └── BUILD.bazel │ │ │ ├── sanity │ │ │ │ ├── slots_test.go │ │ │ │ ├── blocks_test.go │ │ │ │ └── BUILD.bazel │ │ │ ├── ssz_static │ │ │ │ ├── ssz_static_test.go │ │ │ │ └── BUILD.bazel │ │ │ ├── fork_helper │ │ │ │ ├── upgrade_to_altair_test.go │ │ │ │ └── BUILD.bazel │ │ │ ├── fork_transition │ │ │ │ ├── transition_test.go │ │ │ │ └── BUILD.bazel │ │ │ ├── operations │ │ │ │ ├── deposit_test.go │ │ │ │ ├── attestation_test.go │ │ │ │ ├── block_header_test.go │ │ │ │ ├── sync_committee_test.go │ │ │ │ ├── voluntary_exit_test.go │ │ │ │ ├── attester_slashing_test.go │ │ │ │ └── proposer_slashing_test.go │ │ │ ├── rewards │ │ │ │ ├── rewards_test.go │ │ │ │ └── BUILD.bazel │ │ │ ├── random │ │ │ │ ├── random_test.go │ │ │ │ └── BUILD.bazel │ │ │ └── epoch_processing │ │ │ │ ├── slashings_test.go │ │ │ │ ├── eth1_data_reset_test.go │ │ │ │ ├── slashings_reset_test.go │ │ │ │ ├── inactivity_updates_test.go │ │ │ │ ├── randao_mixes_reset_test.go │ │ │ │ ├── registry_updates_test.go │ │ │ │ ├── rewards_and_penalties_test.go │ │ │ │ ├── historical_roots_update_test.go │ │ │ │ ├── participation_flag_updates_test.go │ │ │ │ ├── effective_balance_updates_test.go │ │ │ │ └── justification_and_finalization_test.go │ │ ├── phase0 │ │ │ ├── finality │ │ │ │ ├── finality_test.go │ │ │ │ └── BUILD.bazel │ │ │ ├── sanity │ │ │ │ ├── slots_test.go │ │ │ │ ├── blocks_test.go │ │ │ │ └── BUILD.bazel │ │ │ ├── ssz_static │ │ │ │ ├── ssz_static_test.go │ │ │ │ └── BUILD.bazel │ │ │ ├── operations │ │ │ │ ├── deposit_test.go │ │ │ │ ├── attestation_test.go │ │ │ │ ├── block_header_test.go │ │ │ │ ├── voluntary_exit_test.go │ │ │ │ ├── attester_slashing_test.go │ │ │ │ └── proposer_slashing_test.go │ │ │ ├── rewards │ │ │ │ ├── rewards_test.go │ │ │ │ └── BUILD.bazel │ │ │ ├── random │ │ │ │ ├── random_test.go │ │ │ │ └── BUILD.bazel │ │ │ ├── shuffling │ │ │ │ └── core │ │ │ │ │ └── shuffle │ │ │ │ │ ├── shuffle_test.go │ │ │ │ │ └── BUILD.bazel │ │ │ └── epoch_processing │ │ │ │ ├── slashings_test.go │ │ │ │ ├── eth1_data_reset_test.go │ │ │ │ ├── slashings_reset_test.go │ │ │ │ ├── randao_mixes_reset_test.go │ │ │ │ ├── registry_updates_test.go │ │ │ │ ├── rewards_and_penalties_test.go │ │ │ │ ├── historical_roots_update_test.go │ │ │ │ ├── effective_balance_updates_test.go │ │ │ │ ├── participation_record_updates_test.go │ │ │ │ ├── justification_and_finalization_test.go │ │ │ │ └── epoch_processing_test.go │ │ └── bellatrix │ │ │ ├── finality │ │ │ ├── finality_test.go │ │ │ └── BUILD.bazel │ │ │ ├── sanity │ │ │ ├── slots_test.go │ │ │ ├── blocks_test.go │ │ │ └── BUILD.bazel │ │ │ ├── ssz_static │ │ │ ├── ssz_static_test.go │ │ │ └── BUILD.bazel │ │ │ ├── fork_transition │ │ │ ├── transition_test.go │ │ │ └── BUILD.bazel │ │ │ ├── operations │ │ │ ├── deposit_test.go │ │ │ ├── attestation_test.go │ │ │ ├── block_header_test.go │ │ │ ├── sync_committee_test.go │ │ │ ├── voluntary_exit_test.go │ │ │ ├── attester_slashing_test.go │ │ │ └── proposer_slashing_test.go │ │ │ ├── rewards │ │ │ ├── rewards_test.go │ │ │ └── BUILD.bazel │ │ │ ├── fork_helper │ │ │ ├── upgrade_to_altair_test.go │ │ │ └── BUILD.bazel │ │ │ └── epoch_processing │ │ │ ├── slashings_test.go │ │ │ ├── eth1_data_reset_test.go │ │ │ ├── slashings_reset_test.go │ │ │ ├── inactivity_updates_test.go │ │ │ ├── randao_mixes_reset_test.go │ │ │ ├── registry_updates_test.go │ │ │ ├── rewards_and_penalties_test.go │ │ │ ├── historical_roots_update_test.go │ │ │ ├── participation_flag_updates_test.go │ │ │ ├── effective_balance_updates_test.go │ │ │ └── justification_and_finalization_test.go │ ├── minimal │ │ ├── altair │ │ │ ├── finality │ │ │ │ ├── finality_test.go │ │ │ │ └── BUILD.bazel │ │ │ ├── fork │ │ │ │ ├── upgrade_to_altair_test.go │ │ │ │ └── BUILD.bazel │ │ │ ├── sanity │ │ │ │ ├── slots_test.go │ │ │ │ └── blocks_test.go │ │ │ ├── ssz_static │ │ │ │ ├── ssz_static_test.go │ │ │ │ └── BUILD.bazel │ │ │ ├── operations │ │ │ │ ├── deposit_test.go │ │ │ │ ├── attestation_test.go │ │ │ │ ├── block_header_test.go │ │ │ │ ├── sync_committee_test.go │ │ │ │ ├── voluntary_exit_test.go │ │ │ │ ├── attester_slashing_test.go │ │ │ │ └── proposer_slashing_test.go │ │ │ ├── rewards │ │ │ │ ├── rewards_test.go │ │ │ │ └── BUILD.bazel │ │ │ ├── random │ │ │ │ ├── random_test.go │ │ │ │ └── BUILD.bazel │ │ │ └── epoch_processing │ │ │ │ ├── slashings_test.go │ │ │ │ ├── eth1_data_reset_test.go │ │ │ │ ├── slashings_reset_test.go │ │ │ │ ├── inactivity_updates_test.go │ │ │ │ ├── randao_mixes_reset_test.go │ │ │ │ ├── registry_updates_test.go │ │ │ │ ├── rewards_and_penalties_test.go │ │ │ │ ├── historical_roots_update_test.go │ │ │ │ ├── participation_flag_updates_test.go │ │ │ │ ├── effective_balance_updates_test.go │ │ │ │ └── justification_and_finalization_test.go │ │ ├── phase0 │ │ │ ├── finality │ │ │ │ ├── finality_test.go │ │ │ │ └── BUILD.bazel │ │ │ ├── sanity │ │ │ │ ├── slots_test.go │ │ │ │ └── blocks_test.go │ │ │ ├── ssz_static │ │ │ │ ├── ssz_static_test.go │ │ │ │ └── BUILD.bazel │ │ │ ├── operations │ │ │ │ ├── deposit_test.go │ │ │ │ ├── attestation_test.go │ │ │ │ ├── block_header_test.go │ │ │ │ ├── voluntary_exit_test.go │ │ │ │ ├── attester_slashing_test.go │ │ │ │ └── proposer_slashing_test.go │ │ │ ├── rewards │ │ │ │ ├── rewards_test.go │ │ │ │ └── BUILD.bazel │ │ │ ├── random │ │ │ │ ├── random_test.go │ │ │ │ └── BUILD.bazel │ │ │ ├── shuffling │ │ │ │ └── core │ │ │ │ │ └── shuffle │ │ │ │ │ ├── shuffle_test.go │ │ │ │ │ └── BUILD.bazel │ │ │ └── epoch_processing │ │ │ │ ├── slashings_test.go │ │ │ │ ├── eth1_data_reset_test.go │ │ │ │ ├── slashings_reset_test.go │ │ │ │ ├── randao_mixes_reset_test.go │ │ │ │ ├── registry_updates_test.go │ │ │ │ ├── rewards_and_penalties_test.go │ │ │ │ ├── historical_roots_update_test.go │ │ │ │ ├── effective_balance_updates_test.go │ │ │ │ ├── participation_record_updates_test.go │ │ │ │ ├── justification_and_finalization_test.go │ │ │ │ └── epoch_processing_test.go │ │ └── bellatrix │ │ │ ├── finality │ │ │ ├── finality_test.go │ │ │ └── BUILD.bazel │ │ │ ├── sanity │ │ │ ├── slots_test.go │ │ │ └── blocks_test.go │ │ │ ├── fork │ │ │ ├── upgrade_to_altair_test.go │ │ │ └── BUILD.bazel │ │ │ ├── ssz_static │ │ │ ├── ssz_static_test.go │ │ │ └── BUILD.bazel │ │ │ ├── operations │ │ │ ├── deposit_test.go │ │ │ ├── attestation_test.go │ │ │ ├── block_header_test.go │ │ │ ├── sync_committee_test.go │ │ │ ├── voluntary_exit_test.go │ │ │ ├── attester_slashing_test.go │ │ │ └── proposer_slashing_test.go │ │ │ ├── rewards │ │ │ ├── rewards_test.go │ │ │ └── BUILD.bazel │ │ │ └── epoch_processing │ │ │ ├── slashings_test.go │ │ │ ├── eth1_data_reset_test.go │ │ │ ├── slashings_reset_test.go │ │ │ ├── inactivity_updates_test.go │ │ │ ├── randao_mixes_reset_test.go │ │ │ ├── registry_updates_test.go │ │ │ ├── rewards_and_penalties_test.go │ │ │ ├── historical_roots_update_test.go │ │ │ ├── participation_flag_updates_test.go │ │ │ ├── effective_balance_updates_test.go │ │ │ └── justification_and_finalization_test.go │ └── README.md ├── bls │ ├── aggregate_test.yaml.go │ ├── deserialization_G1_test.yaml.go │ ├── deserialization_G2_test.yaml.go │ ├── sign_test.yaml.go │ ├── hash_to_G2_test.yaml.go │ ├── verify_test.yaml.go │ ├── batch_verify_test.yaml.go │ ├── aggregate_verify_test.yaml.go │ └── utils │ │ └── BUILD.bazel ├── assert │ └── BUILD.bazel ├── require │ └── BUILD.bazel └── util │ └── wait_timeout.go ├── .gitattributes ├── config ├── params │ ├── checktags_test.go │ ├── values.go │ └── interop.go ├── BUILD.bazel └── validator │ └── service │ └── BUILD.bazel ├── monitoring ├── journald │ ├── journald.go │ └── journald_linux.go ├── backup │ └── BUILD.bazel ├── progress │ └── BUILD.bazel └── prometheus │ └── simple_server.go ├── hack ├── README.md ├── workspace_status_ci.sh └── workspace_status.sh ├── network ├── authorization │ ├── BUILD.bazel │ └── authorization_method.go └── forks │ └── errors.go ├── runtime ├── debug │ ├── cgo_symbolizer.go │ └── maxprocs_metric.go ├── version │ ├── fork.go │ └── metrics.go └── maxprocs │ ├── BUILD.bazel │ └── maxprocs.go ├── async └── abool │ └── BUILD.bazel ├── bazel.sh ├── consensus-types └── primitives │ └── sszbytes.go ├── .golangci.yml ├── .deepsource.toml └── io └── logs └── stream_test.go /.bazelversion: -------------------------------------------------------------------------------- 1 | 5.0.0 2 | -------------------------------------------------------------------------------- /tools/go/BUILD.bazel: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tools/cross-toolchain/BUILD.bazel: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | bazel-* 2 | .git 3 | -------------------------------------------------------------------------------- /crypto/bls/error.go: -------------------------------------------------------------------------------- 1 | package bls 2 | -------------------------------------------------------------------------------- /third_party/BUILD.bazel: -------------------------------------------------------------------------------- 1 | exports_files(glob(["*.patch"])) 2 | -------------------------------------------------------------------------------- /third_party/com_github_prysmaticlabs_ethereumapis-tags.patch: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /proto/eth/v1/node.pb.gw.go: -------------------------------------------------------------------------------- 1 | //go:build ignore 2 | 3 | package ignore 4 | -------------------------------------------------------------------------------- /proto/eth/v2/ssz.pb.gw.go: -------------------------------------------------------------------------------- 1 | //go:build ignore 2 | 3 | package ignore 4 | -------------------------------------------------------------------------------- /fuzzbuzz.yaml: -------------------------------------------------------------------------------- 1 | base: 2 | language: go 3 | build_tags: 4 | - fuzz 5 | -------------------------------------------------------------------------------- /proto/eth/v1/events.pb.gw.go: -------------------------------------------------------------------------------- 1 | //go:build ignore 2 | 3 | package ignore 4 | -------------------------------------------------------------------------------- /proto/eth/v1/validator.pb.gw.go: -------------------------------------------------------------------------------- 1 | //go:build ignore 2 | 3 | package ignore 4 | -------------------------------------------------------------------------------- /proto/eth/v2/validator.pb.gw.go: -------------------------------------------------------------------------------- 1 | //go:build ignore 2 | 3 | package ignore 4 | -------------------------------------------------------------------------------- /proto/eth/v2/version.pb.gw.go: -------------------------------------------------------------------------------- 1 | //go:build ignore 2 | 3 | package ignore 4 | -------------------------------------------------------------------------------- /proto/prysm/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("@prysm//tools/go:def.bzl", "go_library") 2 | -------------------------------------------------------------------------------- /proto/eth/v1/attestation.pb.gw.go: -------------------------------------------------------------------------------- 1 | //go:build ignore 2 | 3 | package ignore 4 | -------------------------------------------------------------------------------- /proto/eth/v1/beacon_block.pb.gw.go: -------------------------------------------------------------------------------- 1 | //go:build ignore 2 | 3 | package ignore 4 | -------------------------------------------------------------------------------- /proto/eth/v1/beacon_chain.pb.gw.go: -------------------------------------------------------------------------------- 1 | //go:build ignore 2 | 3 | package ignore 4 | -------------------------------------------------------------------------------- /proto/eth/v1/beacon_state.pb.gw.go: -------------------------------------------------------------------------------- 1 | //go:build ignore 2 | 3 | package ignore 4 | -------------------------------------------------------------------------------- /proto/eth/v2/beacon_block.pb.gw.go: -------------------------------------------------------------------------------- 1 | //go:build ignore 2 | 3 | package ignore 4 | -------------------------------------------------------------------------------- /proto/eth/v2/beacon_state.pb.gw.go: -------------------------------------------------------------------------------- 1 | //go:build ignore 2 | 3 | package ignore 4 | -------------------------------------------------------------------------------- /proto/eth/v2/sync_committee.pb.gw.go: -------------------------------------------------------------------------------- 1 | //go:build ignore 2 | 3 | package ignore 4 | -------------------------------------------------------------------------------- /third_party/herumi/BUILD.bazel: -------------------------------------------------------------------------------- 1 | exports_files(["mcl_darwin_arm64_base64.o"]) 2 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | custom: https://gitcoin.co/grants/24/prysm-by-prysmatic-labs 2 | -------------------------------------------------------------------------------- /proto/prysm/v1alpha1/attestation.pb.gw.go: -------------------------------------------------------------------------------- 1 | //go:build ignore 2 | 3 | package ignore 4 | -------------------------------------------------------------------------------- /proto/prysm/v1alpha1/beacon_block.pb.gw.go: -------------------------------------------------------------------------------- 1 | //go:build ignore 2 | 3 | package ignore 4 | -------------------------------------------------------------------------------- /proto/prysm/v1alpha1/beacon_state.pb.gw.go: -------------------------------------------------------------------------------- 1 | //go:build ignore 2 | 3 | package ignore 4 | -------------------------------------------------------------------------------- /proto/prysm/v1alpha1/p2p_messages.pb.gw.go: -------------------------------------------------------------------------------- 1 | //go:build ignore 2 | 3 | package ignore 4 | -------------------------------------------------------------------------------- /proto/prysm/v1alpha1/powchain.pb.gw.go: -------------------------------------------------------------------------------- 1 | //go:build ignore 2 | 3 | package ignore 4 | -------------------------------------------------------------------------------- /proto/prysm/v1alpha1/sync_committee.pb.gw.go: -------------------------------------------------------------------------------- 1 | //go:build ignore 2 | 3 | package ignore 4 | -------------------------------------------------------------------------------- /service-account.json.enc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/patterns/prysm/develop/service-account.json.enc -------------------------------------------------------------------------------- /proto/prysm/v1alpha1/finalized_block_root_container.pb.gw.go: -------------------------------------------------------------------------------- 1 | //go:build ignore 2 | 3 | package ignore 4 | -------------------------------------------------------------------------------- /beacon-chain/sync/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package sync TODO(3147): Add details on how sync works. 3 | */ 4 | package sync 5 | -------------------------------------------------------------------------------- /beacon-chain/server/log.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "github.com/sirupsen/logrus" 4 | 5 | var log = logrus.New() 6 | -------------------------------------------------------------------------------- /beacon-chain/core/epoch/precompute/precompute_test.go: -------------------------------------------------------------------------------- 1 | package precompute 2 | 3 | var ComputeCheckpoints = computeCheckpoints 4 | -------------------------------------------------------------------------------- /beacon-chain/package/postinst.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | chown prysm-beacon:prysm-beacon /etc/prysm/beacon-chain.yaml -------------------------------------------------------------------------------- /validator/db/log.go: -------------------------------------------------------------------------------- 1 | package db 2 | 3 | import "github.com/sirupsen/logrus" 4 | 5 | var log = logrus.WithField("prefix", "db") 6 | -------------------------------------------------------------------------------- /validator/package/postinst.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | chown prysm-validator:prysm-validator /etc/prysm/validator.yaml -------------------------------------------------------------------------------- /.github/actions/gofmt/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM cytopia/gofmt 2 | 3 | COPY entrypoint.sh /entrypoint.sh 4 | 5 | ENTRYPOINT ["/entrypoint.sh"] 6 | -------------------------------------------------------------------------------- /beacon-chain/db/kv/log.go: -------------------------------------------------------------------------------- 1 | package kv 2 | 3 | import "github.com/sirupsen/logrus" 4 | 5 | var log = logrus.WithField("prefix", "db") 6 | -------------------------------------------------------------------------------- /beacon-chain/db/log.go: -------------------------------------------------------------------------------- 1 | package db 2 | 3 | import "github.com/sirupsen/logrus" 4 | 5 | var log = logrus.WithField("prefix", "db") 6 | -------------------------------------------------------------------------------- /beacon-chain/rpc/log.go: -------------------------------------------------------------------------------- 1 | package rpc 2 | 3 | import "github.com/sirupsen/logrus" 4 | 5 | var log = logrus.WithField("prefix", "rpc") 6 | -------------------------------------------------------------------------------- /cmd/validator/log.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "github.com/sirupsen/logrus" 4 | 5 | var log = logrus.WithField("prefix", "main") 6 | -------------------------------------------------------------------------------- /cmd/validator/web/log.go: -------------------------------------------------------------------------------- 1 | package web 2 | 3 | import "github.com/sirupsen/logrus" 4 | 5 | var log = logrus.WithField("prefix", "web") 6 | -------------------------------------------------------------------------------- /validator/db/kv/log.go: -------------------------------------------------------------------------------- 1 | package kv 2 | 3 | import "github.com/sirupsen/logrus" 4 | 5 | var log = logrus.WithField("prefix", "db") 6 | -------------------------------------------------------------------------------- /validator/node/log.go: -------------------------------------------------------------------------------- 1 | package node 2 | 3 | import "github.com/sirupsen/logrus" 4 | 5 | var log = logrus.WithField("prefix", "node") 6 | -------------------------------------------------------------------------------- /validator/rpc/log.go: -------------------------------------------------------------------------------- 1 | package rpc 2 | 3 | import "github.com/sirupsen/logrus" 4 | 5 | var log = logrus.WithField("prefix", "rpc") 6 | -------------------------------------------------------------------------------- /.github/actions/gomodtidy/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM golang:alpine 2 | 3 | COPY entrypoint.sh /entrypoint.sh 4 | 5 | ENTRYPOINT ["/entrypoint.sh"] 6 | -------------------------------------------------------------------------------- /api/gateway/log.go: -------------------------------------------------------------------------------- 1 | package gateway 2 | 3 | import "github.com/sirupsen/logrus" 4 | 5 | var log = logrus.WithField("prefix", "gateway") 6 | -------------------------------------------------------------------------------- /beacon-chain/node/log.go: -------------------------------------------------------------------------------- 1 | package node 2 | 3 | import "github.com/sirupsen/logrus" 4 | 5 | var log = logrus.WithField("prefix", "node") 6 | -------------------------------------------------------------------------------- /beacon-chain/state/genesis/mainnet.ssz.snappy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/patterns/prysm/develop/beacon-chain/state/genesis/mainnet.ssz.snappy -------------------------------------------------------------------------------- /beacon-chain/sync/log.go: -------------------------------------------------------------------------------- 1 | package sync 2 | 3 | import "github.com/sirupsen/logrus" 4 | 5 | var log = logrus.WithField("prefix", "sync") 6 | -------------------------------------------------------------------------------- /cmd/beacon-chain/log.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "github.com/sirupsen/logrus" 4 | 5 | var log = logrus.WithField("prefix", "main") 6 | -------------------------------------------------------------------------------- /cmd/client-stats/log.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "github.com/sirupsen/logrus" 4 | 5 | var log = logrus.WithField("prefix", "main") 6 | -------------------------------------------------------------------------------- /third_party/herumi/mcl_darwin_arm64_base64.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/patterns/prysm/develop/third_party/herumi/mcl_darwin_arm64_base64.o -------------------------------------------------------------------------------- /validator/web/log.go: -------------------------------------------------------------------------------- 1 | package web 2 | 3 | import "github.com/sirupsen/logrus" 4 | 5 | var log = logrus.WithField("prefix", "prysm-web") 6 | -------------------------------------------------------------------------------- /beacon-chain/db/kv/testdata/altona.genesis.ssz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/patterns/prysm/develop/beacon-chain/db/kv/testdata/altona.genesis.ssz -------------------------------------------------------------------------------- /beacon-chain/db/kv/testdata/mainnet.genesis.ssz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/patterns/prysm/develop/beacon-chain/db/kv/testdata/mainnet.genesis.ssz -------------------------------------------------------------------------------- /beacon-chain/p2p/peers/log.go: -------------------------------------------------------------------------------- 1 | package peers 2 | 3 | import "github.com/sirupsen/logrus" 4 | 5 | var log = logrus.WithField("prefix", "peers") 6 | -------------------------------------------------------------------------------- /cmd/beacon-chain/flags/log.go: -------------------------------------------------------------------------------- 1 | package flags 2 | 3 | import "github.com/sirupsen/logrus" 4 | 5 | var log = logrus.WithField("prefix", "flags") 6 | -------------------------------------------------------------------------------- /validator/web/doc.go: -------------------------------------------------------------------------------- 1 | // Package web is the service to serve the Prysm web UI. See https://github.com/prysmaticlabs/prysm-web-ui 2 | package web 3 | -------------------------------------------------------------------------------- /beacon-chain/core/blocks/log.go: -------------------------------------------------------------------------------- 1 | package blocks 2 | 3 | import "github.com/sirupsen/logrus" 4 | 5 | var log = logrus.WithField("prefix", "blocks") 6 | -------------------------------------------------------------------------------- /beacon-chain/db/db_test.go: -------------------------------------------------------------------------------- 1 | package db 2 | 3 | import "github.com/prysmaticlabs/prysm/beacon-chain/db/kv" 4 | 5 | var _ Database = (*kv.Store)(nil) 6 | -------------------------------------------------------------------------------- /beacon-chain/powchain/log.go: -------------------------------------------------------------------------------- 1 | package powchain 2 | 3 | import "github.com/sirupsen/logrus" 4 | 5 | var log = logrus.WithField("prefix", "powchain") 6 | -------------------------------------------------------------------------------- /beacon-chain/slasher/log.go: -------------------------------------------------------------------------------- 1 | package slasher 2 | 3 | import "github.com/sirupsen/logrus" 4 | 5 | var log = logrus.WithField("prefix", "slasher") 6 | -------------------------------------------------------------------------------- /beacon-chain/state/v2/error.go: -------------------------------------------------------------------------------- 1 | package v2 2 | 3 | import "errors" 4 | 5 | var ErrNilParticipation = errors.New("nil epoch participation in state") 6 | -------------------------------------------------------------------------------- /beacon-chain/state/v3/error.go: -------------------------------------------------------------------------------- 1 | package v3 2 | 3 | import "errors" 4 | 5 | var ErrNilParticipation = errors.New("nil epoch participation in state") 6 | -------------------------------------------------------------------------------- /tools/analyzers/gocognit/CognitiveComplexity.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/patterns/prysm/develop/tools/analyzers/gocognit/CognitiveComplexity.pdf -------------------------------------------------------------------------------- /validator/accounts/log.go: -------------------------------------------------------------------------------- 1 | package accounts 2 | 3 | import "github.com/sirupsen/logrus" 4 | 5 | var log = logrus.WithField("prefix", "accounts") 6 | -------------------------------------------------------------------------------- /validator/accounts/wallet/log.go: -------------------------------------------------------------------------------- 1 | package wallet 2 | 3 | import "github.com/sirupsen/logrus" 4 | 5 | var log = logrus.WithField("prefix", "wallet") 6 | -------------------------------------------------------------------------------- /validator/graffiti/log.go: -------------------------------------------------------------------------------- 1 | package graffiti 2 | 3 | import "github.com/sirupsen/logrus" 4 | 5 | var log = logrus.WithField("prefix", "graffiti") 6 | -------------------------------------------------------------------------------- /beacon-chain/cache/cache_test.go: -------------------------------------------------------------------------------- 1 | package cache 2 | 3 | import ( 4 | "testing" 5 | ) 6 | 7 | func TestMain(m *testing.M) { 8 | m.Run() 9 | } 10 | -------------------------------------------------------------------------------- /beacon-chain/core/transition/log.go: -------------------------------------------------------------------------------- 1 | package transition 2 | 3 | import "github.com/sirupsen/logrus" 4 | 5 | var log = logrus.WithField("prefix", "state") 6 | -------------------------------------------------------------------------------- /beacon-chain/db/slasherkv/log.go: -------------------------------------------------------------------------------- 1 | package slasherkv 2 | 3 | import "github.com/sirupsen/logrus" 4 | 5 | var log = logrus.WithField("prefix", "slasherdb") 6 | -------------------------------------------------------------------------------- /proto/eth/v1/testdata/invalid-offset.attestation.ssz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/patterns/prysm/develop/proto/eth/v1/testdata/invalid-offset.attestation.ssz -------------------------------------------------------------------------------- /third_party/herumi/bls.BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | exports_files(["src/bls_c384_256.cpp", "src/bls_c_impl.hpp"]) 4 | -------------------------------------------------------------------------------- /validator/accounts/testdata/fuzz/FuzzValidateMnemonic/0258716f94e00f9df0da869fd97f9e0d0c6ac83eb528677d918f0ac9be5f4b8d: -------------------------------------------------------------------------------- 1 | go test fuzz v1 2 | string("0 ") 3 | -------------------------------------------------------------------------------- /beacon-chain/rpc/eth/beacon/log.go: -------------------------------------------------------------------------------- 1 | package beacon 2 | 3 | import "github.com/sirupsen/logrus" 4 | 5 | var log = logrus.WithField("prefix", "rpc/beaconv1") 6 | -------------------------------------------------------------------------------- /beacon-chain/rpc/prysm/v1alpha1/beacon/log.go: -------------------------------------------------------------------------------- 1 | package beacon 2 | 3 | import "github.com/sirupsen/logrus" 4 | 5 | var log = logrus.WithField("prefix", "rpc") 6 | -------------------------------------------------------------------------------- /beacon-chain/state/stategen/log.go: -------------------------------------------------------------------------------- 1 | package stategen 2 | 3 | import "github.com/sirupsen/logrus" 4 | 5 | var log = logrus.WithField("prefix", "state-gen") 6 | -------------------------------------------------------------------------------- /container/trie/testdata/fuzz/FuzzSparseMerkleTrie_HashTreeRoot/5838cdfae7b16cde2707c04599b62223e7bade8dafdd8a1c53b8f881e8f79d99: -------------------------------------------------------------------------------- 1 | go test fuzz v1 2 | []byte("") 3 | -------------------------------------------------------------------------------- /validator/keymanager/local/log.go: -------------------------------------------------------------------------------- 1 | package local 2 | 3 | import "github.com/sirupsen/logrus" 4 | 5 | var log = logrus.WithField("prefix", "local-keymanager") 6 | -------------------------------------------------------------------------------- /api/gateway/apimiddleware/log.go: -------------------------------------------------------------------------------- 1 | package apimiddleware 2 | 3 | import "github.com/sirupsen/logrus" 4 | 5 | var log = logrus.WithField("prefix", "apimiddleware") 6 | -------------------------------------------------------------------------------- /beacon-chain/builder/error.go: -------------------------------------------------------------------------------- 1 | package builder 2 | 3 | import "github.com/pkg/errors" 4 | 5 | var ( 6 | ErrNotRunning = errors.New("builder is not running") 7 | ) 8 | -------------------------------------------------------------------------------- /cmd/validator/slashing-protection/log.go: -------------------------------------------------------------------------------- 1 | package historycmd 2 | 3 | import "github.com/sirupsen/logrus" 4 | 5 | var log = logrus.WithField("prefix", "historycmd") 6 | -------------------------------------------------------------------------------- /validator/accounts/userprompt/log.go: -------------------------------------------------------------------------------- 1 | package userprompt 2 | 3 | import "github.com/sirupsen/logrus" 4 | 5 | var log = logrus.WithField("prefix", "userprompt") 6 | -------------------------------------------------------------------------------- /validator/keymanager/derived/log.go: -------------------------------------------------------------------------------- 1 | package derived 2 | 3 | import "github.com/sirupsen/logrus" 4 | 5 | var log = logrus.WithField("prefix", "derived-keymanager") 6 | -------------------------------------------------------------------------------- /validator/keymanager/remote/log.go: -------------------------------------------------------------------------------- 1 | package remote 2 | 3 | import "github.com/sirupsen/logrus" 4 | 5 | var log = logrus.WithField("prefix", "remote-keymanager") 6 | -------------------------------------------------------------------------------- /beacon-chain/cache/depositcache/log.go: -------------------------------------------------------------------------------- 1 | package depositcache 2 | 3 | import "github.com/sirupsen/logrus" 4 | 5 | var log = logrus.WithField("prefix", "depositcache") 6 | -------------------------------------------------------------------------------- /beacon-chain/core/blocks/testdata/beaconfuzz_78_beacon.ssz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/patterns/prysm/develop/beacon-chain/core/blocks/testdata/beaconfuzz_78_beacon.ssz -------------------------------------------------------------------------------- /beacon-chain/core/blocks/testdata/beaconfuzz_91_beacon.ssz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/patterns/prysm/develop/beacon-chain/core/blocks/testdata/beaconfuzz_91_beacon.ssz -------------------------------------------------------------------------------- /beacon-chain/forkchoice/error.go: -------------------------------------------------------------------------------- 1 | package forkchoice 2 | 3 | import "github.com/pkg/errors" 4 | 5 | var ErrUnknownCommonAncestor = errors.New("unknown common ancestor") 6 | -------------------------------------------------------------------------------- /beacon-chain/node/registration/log.go: -------------------------------------------------------------------------------- 1 | package registration 2 | 3 | import "github.com/sirupsen/logrus" 4 | 5 | var log = logrus.WithField("prefix", "registration") 6 | -------------------------------------------------------------------------------- /beacon-chain/state/state-native/error.go: -------------------------------------------------------------------------------- 1 | package state_native 2 | 3 | import "errors" 4 | 5 | var ErrNilParticipation = errors.New("nil epoch participation in state") 6 | -------------------------------------------------------------------------------- /container/trie/testdata/fuzz/FuzzSparseMerkleTrie_MerkleProof/ec4893c52de558dbac9a850e4266850e109a9e6bc6bab59953b2a30027f66a93: -------------------------------------------------------------------------------- 1 | go test fuzz v1 2 | []byte("") 3 | int(63) 4 | -------------------------------------------------------------------------------- /time/slots/testing/mock_test.go: -------------------------------------------------------------------------------- 1 | package testing 2 | 3 | import ( 4 | "github.com/prysmaticlabs/prysm/time/slots" 5 | ) 6 | 7 | var _ slots.Ticker = (*MockTicker)(nil) 8 | -------------------------------------------------------------------------------- /beacon-chain/rpc/prysm/v1alpha1/validator/log.go: -------------------------------------------------------------------------------- 1 | package validator 2 | 3 | import "github.com/sirupsen/logrus" 4 | 5 | var log = logrus.WithField("prefix", "rpc/validator") 6 | -------------------------------------------------------------------------------- /beacon-chain/state/v2/testdata/fuzz/FuzzV2StateHashTreeRoot/52875ab39ad0eeec927085f3330d00508d015fe3c204b6bc6607296f64ec221c: -------------------------------------------------------------------------------- 1 | go test fuzz v1 2 | []byte("") 3 | uint64(117) 4 | -------------------------------------------------------------------------------- /validator/keymanager/constants.go: -------------------------------------------------------------------------------- 1 | package keymanager 2 | 3 | // KeysReloaded is a "key reloaded" message. 4 | const KeysReloaded = "Reloaded validator keys into keymanager" 5 | -------------------------------------------------------------------------------- /beacon-chain/core/blocks/testdata/beaconfuzz_78_attestation.ssz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/patterns/prysm/develop/beacon-chain/core/blocks/testdata/beaconfuzz_78_attestation.ssz -------------------------------------------------------------------------------- /beacon-chain/sync/initial-sync/log.go: -------------------------------------------------------------------------------- 1 | package initialsync 2 | 3 | import ( 4 | "github.com/sirupsen/logrus" 5 | ) 6 | 7 | var log = logrus.WithField("prefix", "initial-sync") 8 | -------------------------------------------------------------------------------- /testing/benchmark/benchmark_files/fullBlock-128Atts-16384Vals.ssz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/patterns/prysm/develop/testing/benchmark/benchmark_files/fullBlock-128Atts-16384Vals.ssz -------------------------------------------------------------------------------- /testing/endtoend/lighthouse.BUILD: -------------------------------------------------------------------------------- 1 | sh_binary( 2 | name = "lighthouse_bin", 3 | srcs = [ 4 | "lighthouse", 5 | ], 6 | visibility = ["//visibility:public"], 7 | ) -------------------------------------------------------------------------------- /beacon-chain/operations/slashings/log.go: -------------------------------------------------------------------------------- 1 | package slashings 2 | 3 | import ( 4 | "github.com/sirupsen/logrus" 5 | ) 6 | 7 | var log = logrus.WithField("prefix", "pool/slashings") 8 | -------------------------------------------------------------------------------- /container/trie/testdata/fuzz/FuzzSparseMerkleTrie_Insert/d863478086b8f8e8c854ec74d4d5360ffbe979064b58f619eb3d5fddfdae64c8: -------------------------------------------------------------------------------- 1 | go test fuzz v1 2 | []byte("") 3 | []byte("0") 4 | int(41) 5 | -------------------------------------------------------------------------------- /testing/endtoend/web3signer.BUILD: -------------------------------------------------------------------------------- 1 | sh_binary( 2 | name = "web3signer", 3 | srcs = [ 4 | "bin/web3signer", 5 | ], 6 | visibility = ["//visibility:public"], 7 | ) 8 | -------------------------------------------------------------------------------- /validator/slashing-protection-history/log.go: -------------------------------------------------------------------------------- 1 | package history 2 | 3 | import "github.com/sirupsen/logrus" 4 | 5 | var log = logrus.WithField("prefix", "slashing-protection-history") 6 | -------------------------------------------------------------------------------- /.github/actions/gomodtidy/action.yml: -------------------------------------------------------------------------------- 1 | name: 'Go mod tidy checker' 2 | description: 'Checks that `go mod tidy` has been applied.' 3 | runs: 4 | using: 'docker' 5 | image: 'Dockerfile' 6 | -------------------------------------------------------------------------------- /beacon-chain/core/blocks/testdata/beaconfuzz_91_proposer_slashing.ssz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/patterns/prysm/develop/beacon-chain/core/blocks/testdata/beaconfuzz_91_proposer_slashing.ssz -------------------------------------------------------------------------------- /beacon-chain/operations/attestations/log.go: -------------------------------------------------------------------------------- 1 | package attestations 2 | 3 | import ( 4 | "github.com/sirupsen/logrus" 5 | ) 6 | 7 | var log = logrus.WithField("prefix", "pool/attestations") 8 | -------------------------------------------------------------------------------- /testing/benchmark/benchmark_files/bState1Epoch-128Atts-16384Vals.ssz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/patterns/prysm/develop/testing/benchmark/benchmark_files/bState1Epoch-128Atts-16384Vals.ssz -------------------------------------------------------------------------------- /testing/benchmark/benchmark_files/bState2Epochs-128Atts-16384Vals.ssz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/patterns/prysm/develop/testing/benchmark/benchmark_files/bState2Epochs-128Atts-16384Vals.ssz -------------------------------------------------------------------------------- /testing/spectest/shared/altair/sanity/block_processing.yaml.go: -------------------------------------------------------------------------------- 1 | package sanity 2 | 3 | // SanityConfig -- 4 | type SanityConfig struct { 5 | BlocksCount int `json:"blocks_count"` 6 | } 7 | -------------------------------------------------------------------------------- /testing/spectest/shared/bellatrix/sanity/block_processing.yaml.go: -------------------------------------------------------------------------------- 1 | package sanity 2 | 3 | // SanityConfig -- 4 | type SanityConfig struct { 5 | BlocksCount int `json:"blocks_count"` 6 | } 7 | -------------------------------------------------------------------------------- /testing/spectest/shared/phase0/sanity/block_processing.yaml.go: -------------------------------------------------------------------------------- 1 | package sanity 2 | 3 | // SanityConfig -- 4 | type SanityConfig struct { 5 | BlocksCount int `json:"blocks_count"` 6 | } 7 | -------------------------------------------------------------------------------- /validator/rpc/server_test.go: -------------------------------------------------------------------------------- 1 | package rpc 2 | 3 | import ( 4 | pb "github.com/prysmaticlabs/prysm/proto/prysm/v1alpha1/validator-client" 5 | ) 6 | 7 | var _ pb.AuthServer = (*Server)(nil) 8 | -------------------------------------------------------------------------------- /beacon-chain/state/fieldtrie/testdata/fuzz/FuzzFieldTrie/c1898b8d556154d8a9d00cf2a64226dd5d76f33e27c373df2c409670db9b4877: -------------------------------------------------------------------------------- 1 | go test fuzz v1 2 | int(5) 3 | int(0) 4 | []byte("") 5 | uint64(8234) 6 | -------------------------------------------------------------------------------- /beacon-chain/deterministic-genesis/log.go: -------------------------------------------------------------------------------- 1 | package interopcoldstart 2 | 3 | import ( 4 | "github.com/sirupsen/logrus" 5 | ) 6 | 7 | var log = logrus.WithField("prefix", "deterministic-genesis") 8 | -------------------------------------------------------------------------------- /tools/cross-toolchain/configs/clang/bazel_5.0.0/prysm_toolchains/WORKSPACE: -------------------------------------------------------------------------------- 1 | # DO NOT EDIT: automatically generated WORKSPACE file for prysm_toolchains rule 2 | workspace(name = "prysm_toolchains") 3 | -------------------------------------------------------------------------------- /beacon-chain/rpc/eth/beacon/server_test.go: -------------------------------------------------------------------------------- 1 | package beacon 2 | 3 | import ethpbservice "github.com/prysmaticlabs/prysm/proto/eth/service" 4 | 5 | var _ ethpbservice.BeaconChainServer = (*Server)(nil) 6 | -------------------------------------------------------------------------------- /proto/eth/v1/README.md: -------------------------------------------------------------------------------- 1 | # gRPC Gateway 2 | 3 | This package is contains generated files for applications that wish to use eth/v1alpha as a 4 | [gRPC gateway](https://github.com/grpc-ecosystem/grpc-gateway). -------------------------------------------------------------------------------- /beacon-chain/forkchoice/doubly-linked-tree/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package doublylinkedtree implements eth2 LMD GHOST fork choice using the doubly linked proto array node structure. 3 | */ 4 | package doublylinkedtree 5 | -------------------------------------------------------------------------------- /beacon-chain/rpc/eth/node/server_test.go: -------------------------------------------------------------------------------- 1 | package node 2 | 3 | import ( 4 | ethpbservice "github.com/prysmaticlabs/prysm/proto/eth/service" 5 | ) 6 | 7 | var _ ethpbservice.BeaconNodeServer = (*Server)(nil) 8 | -------------------------------------------------------------------------------- /proto/prysm/v1alpha1/README.md: -------------------------------------------------------------------------------- 1 | # gRPC Gateway 2 | 3 | This package is contains generated files for applications that wish to use eth/v1alpha as a 4 | [gRPC gateway](https://github.com/grpc-ecosystem/grpc-gateway). -------------------------------------------------------------------------------- /validator/keymanager/remote-web3signer/internal/log.go: -------------------------------------------------------------------------------- 1 | package internal 2 | 3 | import ( 4 | "github.com/sirupsen/logrus" 5 | ) 6 | 7 | var log = logrus.WithField("prefix", "remote_web3signer_internal") 8 | -------------------------------------------------------------------------------- /validator/node/testdata/bad-prepare-beacon-proposer-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "proposer_config": { 3 | "0xa057816155ad77931185101128655c0191bd0214c201ca48ed887f6c4c6adf334070efcd75140eada5ac83a92506dd7a": { 4 | 5 | -------------------------------------------------------------------------------- /beacon-chain/blockchain/checktags_test.go: -------------------------------------------------------------------------------- 1 | //go:build !develop 2 | 3 | package blockchain 4 | 5 | func init() { 6 | log.Fatal("Tests in this package require extra build tag: re-run with `-tags develop`") 7 | } 8 | -------------------------------------------------------------------------------- /proto/README.md: -------------------------------------------------------------------------------- 1 | # Prysm Protocol Buffers 2 | 3 | This package defines common protobuf messages and services used by Prysm. For now, we are checking in all generated code to support native go dependency management. 4 | -------------------------------------------------------------------------------- /beacon-chain/operations/attestations/pool_test.go: -------------------------------------------------------------------------------- 1 | package attestations 2 | 3 | import ( 4 | "github.com/prysmaticlabs/prysm/beacon-chain/operations/attestations/kv" 5 | ) 6 | 7 | var _ Pool = (*kv.AttCaches)(nil) 8 | -------------------------------------------------------------------------------- /proto/prysm/v1alpha1/validator-client/interface.go: -------------------------------------------------------------------------------- 1 | package validatorpb 2 | 3 | // SignRequestObject exports the private isSignRequest_Object interface. 4 | type SignRequestObject interface { 5 | isSignRequest_Object 6 | } 7 | -------------------------------------------------------------------------------- /proto/testing/gocast.go: -------------------------------------------------------------------------------- 1 | //go:build tools 2 | 3 | package testing 4 | 5 | // Trick go mod into requiring protoc-gen-go-cast and therefore Gazelle won't prune it. 6 | import ( 7 | _ "github.com/prysmaticlabs/protoc-gen-go-cast" 8 | ) 9 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | *.sol linguist-language=Solidity 4 | 5 | # Ignore diff on generated code 6 | *.pb.go linguist-generated=true 7 | *_mock.go linguist-generated=true 8 | -------------------------------------------------------------------------------- /testing/endtoend/components/log.go: -------------------------------------------------------------------------------- 1 | package components 2 | 3 | import ( 4 | "github.com/sirupsen/logrus" 5 | ) 6 | 7 | var log = logrus.WithField("prefix", "components") 8 | 9 | func init() { 10 | logrus.SetReportCaller(true) 11 | } 12 | -------------------------------------------------------------------------------- /api/client/beacon/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package beacon provides a client for interacting with the standard Eth Beacon Node API. 3 | Interactive swagger documentation for the API is available here: https://ethereum.github.io/beacon-APIs/ 4 | 5 | */ 6 | package beacon 7 | -------------------------------------------------------------------------------- /container/trie/testdata/fuzz/FuzzSparseMerkleTrie_Insert/fuzzbuzz-97663548a1e2280a081745e5fa25c289f7121c0b: -------------------------------------------------------------------------------- 1 | go test fuzz v1 2 | []byte("\b\x03\x12\"2 00000000000000000000000000000000\x12\"2 00000000000000000000000000000000\x12\x00") 3 | []byte("") 4 | int(0) 5 | -------------------------------------------------------------------------------- /validator/testing/constants.go: -------------------------------------------------------------------------------- 1 | package testing 2 | 3 | // TestMnemonic -- 4 | const TestMnemonic = "tumble turn jewel sudden social great water general cabin jacket bounce dry flip monster advance problem social half flee inform century chicken hard reason" 5 | -------------------------------------------------------------------------------- /beacon-chain/state/stategen/errors.go: -------------------------------------------------------------------------------- 1 | package stategen 2 | 3 | import "errors" 4 | 5 | var errUnknownBoundaryState = errors.New("unknown boundary state") 6 | var errUnknownState = errors.New("unknown state") 7 | var errUnknownBlock = errors.New("unknown block") 8 | -------------------------------------------------------------------------------- /time/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("@prysm//tools/go:def.bzl", "go_library") 2 | 3 | go_library( 4 | name = "go_default_library", 5 | srcs = ["utils.go"], 6 | importpath = "github.com/prysmaticlabs/prysm/time", 7 | visibility = ["//visibility:public"], 8 | ) 9 | -------------------------------------------------------------------------------- /testing/spectest/general/phase0/bls/doc.go: -------------------------------------------------------------------------------- 1 | // Package bls includes tests to ensure conformity with the Ethereum BLS cryptography specification. 2 | // See https://github.com/ethereum/consensus-spec-tests/tree/master/tests/general/phase0/bls for details. 3 | package bls 4 | -------------------------------------------------------------------------------- /beacon-chain/operations/synccommittee/error.go: -------------------------------------------------------------------------------- 1 | package synccommittee 2 | 3 | import "github.com/pkg/errors" 4 | 5 | var ( 6 | errNilMessage = errors.New("sync committee message is nil") 7 | errNilContribution = errors.New("sync committee contribution is nil") 8 | ) 9 | -------------------------------------------------------------------------------- /testing/bls/aggregate_test.yaml.go: -------------------------------------------------------------------------------- 1 | // Code generated by yaml_to_go. DO NOT EDIT. 2 | // source: aggregate.yaml 3 | 4 | package bls 5 | 6 | type AggregateTest struct { 7 | Input []string `json:"input"` 8 | Output string `json:"output" ssz:"size=96"` 9 | } 10 | -------------------------------------------------------------------------------- /tools/cross-toolchain/common_osxcross.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -eu 3 | 4 | OSXCROSS_REPO=tpoechtrager/osxcross 5 | OSXCROSS_SHA1=2733413b6847c1489d6230f062d3293e6f42a021 6 | OSX_SDK=MacOSX10.15.sdk 7 | OSX_SDK_SUM=f1703b980d479b367d5bddd299fcad7e0ade2fe5019e571359f52ef2c58872a9 -------------------------------------------------------------------------------- /config/params/checktags_test.go: -------------------------------------------------------------------------------- 1 | //go:build !develop 2 | 3 | package params_test 4 | 5 | import ( 6 | log "github.com/sirupsen/logrus" 7 | ) 8 | 9 | func init() { 10 | log.Fatal("Tests in this package require extra build tag: re-run with `-tags develop`") 11 | } 12 | -------------------------------------------------------------------------------- /crypto/bls/constants.go: -------------------------------------------------------------------------------- 1 | package bls 2 | 3 | // DomainByteLength length of domain byte array. 4 | const DomainByteLength = 4 5 | 6 | // CurveOrder for the BLS12-381 curve. 7 | const CurveOrder = "52435875175126190479447740508185965837690552500527637822603658699938581184513" 8 | -------------------------------------------------------------------------------- /third_party/usb/README.md: -------------------------------------------------------------------------------- 1 | # usb 2 | 3 | This is a copy of github.com/karalabe/usb, except that it is fully disabled. 4 | 5 | The current karalabe/usb library requires a bit of handwritten cc_library targets. 6 | This library isn't used in Prysm anyway, so it is disabled for now. -------------------------------------------------------------------------------- /monitoring/journald/journald.go: -------------------------------------------------------------------------------- 1 | //go:build !linux 2 | 3 | package journald 4 | 5 | import ( 6 | "fmt" 7 | ) 8 | 9 | // Enable returns an error on non-Linux systems 10 | func Enable() error { 11 | return fmt.Errorf("journald is not supported in this platform") 12 | } 13 | -------------------------------------------------------------------------------- /monitoring/journald/journald_linux.go: -------------------------------------------------------------------------------- 1 | //go:build linux 2 | 3 | package journald 4 | 5 | import ( 6 | "github.com/wercker/journalhook" 7 | ) 8 | 9 | //Enable enables the journald logrus hook 10 | func Enable() error { 11 | journalhook.Enable() 12 | return nil 13 | } 14 | -------------------------------------------------------------------------------- /time/slots/slotutil_test.go: -------------------------------------------------------------------------------- 1 | package slots 2 | 3 | import ( 4 | "io" 5 | "testing" 6 | 7 | "github.com/sirupsen/logrus" 8 | ) 9 | 10 | func TestMain(m *testing.M) { 11 | logrus.SetLevel(logrus.DebugLevel) 12 | logrus.SetOutput(io.Discard) 13 | 14 | m.Run() 15 | } 16 | -------------------------------------------------------------------------------- /validator/keymanager/local/errors.go: -------------------------------------------------------------------------------- 1 | package local 2 | 3 | import "errors" 4 | 5 | var ( 6 | ErrNoPasswords = errors.New("no passwords provided for keystores") 7 | ErrMismatchedNumPasswords = errors.New("number of passwords does not match number of keystores") 8 | ) 9 | -------------------------------------------------------------------------------- /beacon-chain/core/feed/block/notifier.go: -------------------------------------------------------------------------------- 1 | package block 2 | 3 | import "github.com/prysmaticlabs/prysm/async/event" 4 | 5 | // Notifier interface defines the methods of the service that provides block updates to consumers. 6 | type Notifier interface { 7 | BlockFeed() *event.Feed 8 | } 9 | -------------------------------------------------------------------------------- /beacon-chain/core/feed/state/notifier.go: -------------------------------------------------------------------------------- 1 | package state 2 | 3 | import "github.com/prysmaticlabs/prysm/async/event" 4 | 5 | // Notifier interface defines the methods of the service that provides state updates to consumers. 6 | type Notifier interface { 7 | StateFeed() *event.Feed 8 | } 9 | -------------------------------------------------------------------------------- /testing/endtoend/minimal_e2e_test.go: -------------------------------------------------------------------------------- 1 | package endtoend 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/endtoend/types" 7 | ) 8 | 9 | func TestEndToEnd_MinimalConfig(t *testing.T) { 10 | e2eMinimal(t, types.WithCheckpointSync()).run() 11 | } 12 | -------------------------------------------------------------------------------- /config/BUILD.bazel: -------------------------------------------------------------------------------- 1 | config_setting( 2 | name = "mainnet", 3 | flag_values = { 4 | "//proto:network": "mainnet", 5 | }, 6 | ) 7 | 8 | config_setting( 9 | name = "minimal", 10 | flag_values = { 11 | "//proto:network": "minimal", 12 | }, 13 | ) 14 | -------------------------------------------------------------------------------- /tools/build_settings.bzl: -------------------------------------------------------------------------------- 1 | BaseImageProvider = provider(fields = ["type"]) 2 | 3 | def _impl(ctx): 4 | return BaseImageProvider(type = ctx.build_setting_value) 5 | 6 | base_image = rule( 7 | implementation = _impl, 8 | build_setting = config.string(flag = True), 9 | ) 10 | -------------------------------------------------------------------------------- /beacon-chain/db/slasherkv/slasherkv_test.go: -------------------------------------------------------------------------------- 1 | package slasherkv 2 | 3 | import ( 4 | "io" 5 | "testing" 6 | 7 | "github.com/sirupsen/logrus" 8 | ) 9 | 10 | func TestMain(m *testing.M) { 11 | logrus.SetLevel(logrus.DebugLevel) 12 | logrus.SetOutput(io.Discard) 13 | m.Run() 14 | } 15 | -------------------------------------------------------------------------------- /beacon-chain/powchain/powchain_test.go: -------------------------------------------------------------------------------- 1 | package powchain 2 | 3 | import ( 4 | "io" 5 | "testing" 6 | 7 | "github.com/sirupsen/logrus" 8 | ) 9 | 10 | func TestMain(m *testing.M) { 11 | logrus.SetLevel(logrus.DebugLevel) 12 | logrus.SetOutput(io.Discard) 13 | 14 | m.Run() 15 | } 16 | -------------------------------------------------------------------------------- /hack/README.md: -------------------------------------------------------------------------------- 1 | # Bash Scripts 2 | 3 | This subproject contains useful bash scripts for working with our repository. We have a simple tool that outputs coverage, a simple tool to check for gazelle requirements, update Go protobuf generated files, visibility rules tools for Bazel packages, and more. 4 | -------------------------------------------------------------------------------- /testing/spectest/general/phase0/bls/aggregate_test.yaml.go: -------------------------------------------------------------------------------- 1 | // Code generated by yaml_to_go. DO NOT EDIT. 2 | // source: aggregate.yaml 3 | 4 | package bls 5 | 6 | type AggregateTest struct { 7 | Input []string `json:"input"` 8 | Output string `json:"output" ssz:"size=96"` 9 | } 10 | -------------------------------------------------------------------------------- /tools/target_migration.bzl: -------------------------------------------------------------------------------- 1 | def moved_targets(targets, new_package): 2 | for target in targets: 3 | native.alias( 4 | name=target[1:], 5 | actual=new_package+target, 6 | deprecation="This target has moved to %s%s"%(new_package,target), 7 | tags = ["manual"], 8 | ) 9 | -------------------------------------------------------------------------------- /beacon-chain/blockchain/blockchain_test.go: -------------------------------------------------------------------------------- 1 | package blockchain 2 | 3 | import ( 4 | "io" 5 | "testing" 6 | 7 | "github.com/sirupsen/logrus" 8 | ) 9 | 10 | func TestMain(m *testing.M) { 11 | logrus.SetLevel(logrus.DebugLevel) 12 | logrus.SetOutput(io.Discard) 13 | 14 | m.Run() 15 | } 16 | -------------------------------------------------------------------------------- /beacon-chain/cache/doc.go: -------------------------------------------------------------------------------- 1 | // Package cache includes all important caches for the runtime 2 | // of an Ethereum Beacon Node, ensuring the node does not spend 3 | // resources computing duplicate operations such as committee 4 | // calculations for validators during the same epoch, etc. 5 | package cache 6 | -------------------------------------------------------------------------------- /beacon-chain/monitor/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package monitor defines a runtime service which receives 3 | notifications triggered by events related to performance of tracked 4 | validating keys. It then logs and emits metrics for a user to keep finely 5 | detailed performance measures. 6 | */ 7 | package monitor 8 | -------------------------------------------------------------------------------- /beacon-chain/operations/slashings/doc.go: -------------------------------------------------------------------------------- 1 | // Package slashings defines an in-memory pool of received 2 | // slashing events by the beacon node, handling their lifecycle 3 | // and performing integrity checks before serving them as objects 4 | // for validators to include in blocks. 5 | package slashings 6 | -------------------------------------------------------------------------------- /testing/benchmark/benchmark_files/BUILD.bazel: -------------------------------------------------------------------------------- 1 | filegroup( 2 | name = "benchmark_data", 3 | srcs = glob([ 4 | "*.ssz", 5 | ]), 6 | visibility = [ 7 | "//beacon-chain/core/transition:__pkg__", 8 | "//testing/benchmark:__subpackages__", 9 | ], 10 | ) 11 | -------------------------------------------------------------------------------- /testing/endtoend/static-files/eth1/BUILD.bazel: -------------------------------------------------------------------------------- 1 | filegroup( 2 | name = "eth1data", 3 | srcs = [ 4 | "UTC--2021-12-22T19-14-08.590377700Z--878705ba3f8bc32fcf7f4caa1a35e72af65cf766", 5 | "genesis.json", 6 | ], 7 | visibility = ["//testing/endtoend:__subpackages__"], 8 | ) 9 | -------------------------------------------------------------------------------- /third_party/usb/AUTHORS: -------------------------------------------------------------------------------- 1 | Felix Lange 2 | Guillaume Ballet 3 | Jakob Weisblat 4 | Martin Holst Swende 5 | Mateusz Mikołajczyk 6 | Péter Szilágyi 7 | Rosen Penev 8 | -------------------------------------------------------------------------------- /network/authorization/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("@prysm//tools/go:def.bzl", "go_library") 2 | 3 | go_library( 4 | name = "go_default_library", 5 | srcs = ["authorization_method.go"], 6 | importpath = "github.com/prysmaticlabs/prysm/network/authorization", 7 | visibility = ["//visibility:public"], 8 | ) 9 | -------------------------------------------------------------------------------- /beacon-chain/core/feed/operation/notifier.go: -------------------------------------------------------------------------------- 1 | package operation 2 | 3 | import "github.com/prysmaticlabs/prysm/async/event" 4 | 5 | // Notifier interface defines the methods of the service that provides beacon block operation updates to consumers. 6 | type Notifier interface { 7 | OperationFeed() *event.Feed 8 | } 9 | -------------------------------------------------------------------------------- /beacon-chain/state/error.go: -------------------------------------------------------------------------------- 1 | package state 2 | 3 | import "errors" 4 | 5 | var ( 6 | // ErrNilValidatorsInState returns when accessing validators in the state while the state has a 7 | // nil slice for the validators field. 8 | ErrNilValidatorsInState = errors.New("state has nil validator slice") 9 | ) 10 | -------------------------------------------------------------------------------- /testing/bls/deserialization_G1_test.yaml.go: -------------------------------------------------------------------------------- 1 | // Code generated by yaml_to_go. DO NOT EDIT. 2 | // source: hash_to_G2.yaml 3 | 4 | package bls 5 | 6 | type DeserializationG1Test struct { 7 | Input struct { 8 | Pubkey string `json:"pubkey"` 9 | } `json:"input"` 10 | Output bool `json:"output"` 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/altair/finality/finality_test.go: -------------------------------------------------------------------------------- 1 | package finality 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/altair/finality" 7 | ) 8 | 9 | func TestMainnet_Altair_Finality(t *testing.T) { 10 | finality.RunFinalityTest(t, "mainnet") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/altair/sanity/slots_test.go: -------------------------------------------------------------------------------- 1 | package sanity 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/altair/sanity" 7 | ) 8 | 9 | func TestMainnet_Altair_Sanity_Slots(t *testing.T) { 10 | sanity.RunSlotProcessingTests(t, "mainnet") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/phase0/finality/finality_test.go: -------------------------------------------------------------------------------- 1 | package finality 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/phase0/finality" 7 | ) 8 | 9 | func TestMainnet_Phase0_Finality(t *testing.T) { 10 | finality.RunFinalityTest(t, "mainnet") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/phase0/sanity/slots_test.go: -------------------------------------------------------------------------------- 1 | package sanity 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/phase0/sanity" 7 | ) 8 | 9 | func TestMainnet_Phase0_Sanity_Slots(t *testing.T) { 10 | sanity.RunSlotProcessingTests(t, "mainnet") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/minimal/altair/finality/finality_test.go: -------------------------------------------------------------------------------- 1 | package finality 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/altair/finality" 7 | ) 8 | 9 | func TestMinimal_Altair_Finality(t *testing.T) { 10 | finality.RunFinalityTest(t, "minimal") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/minimal/altair/fork/upgrade_to_altair_test.go: -------------------------------------------------------------------------------- 1 | package fork 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/altair/fork" 7 | ) 8 | 9 | func TestMinimal_Altair_UpgradeToAltair(t *testing.T) { 10 | fork.RunUpgradeToAltair(t, "minimal") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/minimal/altair/sanity/slots_test.go: -------------------------------------------------------------------------------- 1 | package sanity 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/altair/sanity" 7 | ) 8 | 9 | func TestMinimal_Altair_Sanity_Slots(t *testing.T) { 10 | sanity.RunSlotProcessingTests(t, "minimal") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/minimal/phase0/finality/finality_test.go: -------------------------------------------------------------------------------- 1 | package finality 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/phase0/finality" 7 | ) 8 | 9 | func TestMinimal_Phase0_Finality(t *testing.T) { 10 | finality.RunFinalityTest(t, "minimal") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/minimal/phase0/sanity/slots_test.go: -------------------------------------------------------------------------------- 1 | package sanity 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/phase0/sanity" 7 | ) 8 | 9 | func TestMinimal_Phase0_Sanity_Slots(t *testing.T) { 10 | sanity.RunSlotProcessingTests(t, "minimal") 11 | } 12 | -------------------------------------------------------------------------------- /beacon-chain/operations/voluntaryexits/doc.go: -------------------------------------------------------------------------------- 1 | // Package voluntaryexits defines an in-memory pool of received 2 | // voluntary exit events by the beacon node, handling their lifecycle 3 | // and performing integrity checks before serving them as objects 4 | // for validators to include in blocks. 5 | package voluntaryexits 6 | -------------------------------------------------------------------------------- /beacon-chain/state/stateutil/reference_bench_test.go: -------------------------------------------------------------------------------- 1 | package stateutil 2 | 3 | import ( 4 | "math" 5 | "testing" 6 | ) 7 | 8 | func BenchmarkReference_MinusRef(b *testing.B) { 9 | ref := &Reference{ 10 | refs: math.MaxUint64, 11 | } 12 | for i := 0; i < b.N; i++ { 13 | ref.MinusRef() 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /testing/bls/deserialization_G2_test.yaml.go: -------------------------------------------------------------------------------- 1 | // Code generated by yaml_to_go. DO NOT EDIT. 2 | // source: hash_to_G2.yaml 3 | 4 | package bls 5 | 6 | type DeserializationG2Test struct { 7 | Input struct { 8 | Signature string `json:"signature"` 9 | } `json:"input"` 10 | Output bool `json:"output"` 11 | } 12 | -------------------------------------------------------------------------------- /testing/endtoend/mainnet_e2e_test.go: -------------------------------------------------------------------------------- 1 | package endtoend 2 | 3 | import ( 4 | "testing" 5 | ) 6 | 7 | // Run mainnet e2e config with the current release validator against latest beacon node. 8 | func TestEndToEnd_MainnetConfig_ValidatorAtCurrentRelease(t *testing.T) { 9 | e2eMainnet(t, true, false).run() 10 | } 11 | -------------------------------------------------------------------------------- /hack/workspace_status_ci.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Note: The STABLE_ prefix will force a relink when the value changes when using rules_go x_defs. 4 | 5 | echo STABLE_GIT_COMMIT "continuous-integration" 6 | echo DATE "now" 7 | echo DATE_UNIX "0" 8 | echo DOCKER_TAG "ci-foo" 9 | echo STABLE_GIT_TAG "c1000deadbeef" 10 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/altair/ssz_static/ssz_static_test.go: -------------------------------------------------------------------------------- 1 | package ssz_static 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/altair/ssz_static" 7 | ) 8 | 9 | func TestMainnet_Altair_SSZStatic(t *testing.T) { 10 | ssz_static.RunSSZStaticTests(t, "mainnet") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/bellatrix/finality/finality_test.go: -------------------------------------------------------------------------------- 1 | package finality 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/bellatrix/finality" 7 | ) 8 | 9 | func TestMainnet_Bellatrix_Finality(t *testing.T) { 10 | finality.RunFinalityTest(t, "mainnet") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/bellatrix/sanity/slots_test.go: -------------------------------------------------------------------------------- 1 | package sanity 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/bellatrix/sanity" 7 | ) 8 | 9 | func TestMainnet_Bellatrix_Sanity_Slots(t *testing.T) { 10 | sanity.RunSlotProcessingTests(t, "mainnet") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/phase0/ssz_static/ssz_static_test.go: -------------------------------------------------------------------------------- 1 | package ssz_static 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/phase0/ssz_static" 7 | ) 8 | 9 | func TestMainnet_Phase0_SSZStatic(t *testing.T) { 10 | ssz_static.RunSSZStaticTests(t, "mainnet") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/minimal/altair/ssz_static/ssz_static_test.go: -------------------------------------------------------------------------------- 1 | package ssz_static 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/altair/ssz_static" 7 | ) 8 | 9 | func TestMinimal_Altair_SSZStatic(t *testing.T) { 10 | ssz_static.RunSSZStaticTests(t, "minimal") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/minimal/bellatrix/finality/finality_test.go: -------------------------------------------------------------------------------- 1 | package finality 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/bellatrix/finality" 7 | ) 8 | 9 | func TestMinimal_Bellatrix_Finality(t *testing.T) { 10 | finality.RunFinalityTest(t, "minimal") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/minimal/bellatrix/sanity/slots_test.go: -------------------------------------------------------------------------------- 1 | package sanity 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/bellatrix/sanity" 7 | ) 8 | 9 | func TestMinimal_Bellatrix_Sanity_Slots(t *testing.T) { 10 | sanity.RunSlotProcessingTests(t, "minimal") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/minimal/phase0/ssz_static/ssz_static_test.go: -------------------------------------------------------------------------------- 1 | package ssz_static 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/phase0/ssz_static" 7 | ) 8 | 9 | func TestMinimal_Phase0_SSZStatic(t *testing.T) { 10 | ssz_static.RunSSZStaticTests(t, "minimal") 11 | } 12 | -------------------------------------------------------------------------------- /testing/bls/sign_test.yaml.go: -------------------------------------------------------------------------------- 1 | // Code generated by yaml_to_go. DO NOT EDIT. 2 | // source: sign_msg.yaml 3 | 4 | package bls 5 | 6 | type SignMsgTest struct { 7 | Input struct { 8 | Privkey string `json:"privkey"` 9 | Message string `json:"message"` 10 | } `json:"input"` 11 | Output string `json:"output"` 12 | } 13 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/altair/fork_helper/upgrade_to_altair_test.go: -------------------------------------------------------------------------------- 1 | package fork_helper 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/altair/fork" 7 | ) 8 | 9 | func TestMainnet_Altair_UpgradeToAltair(t *testing.T) { 10 | fork.RunUpgradeToAltair(t, "mainnet") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/altair/fork_transition/transition_test.go: -------------------------------------------------------------------------------- 1 | package fork_transition 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/altair/fork" 7 | ) 8 | 9 | func TestMainnet_Altair_Transition(t *testing.T) { 10 | fork.RunForkTransitionTest(t, "mainnet") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/altair/operations/deposit_test.go: -------------------------------------------------------------------------------- 1 | package operations 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/altair/operations" 7 | ) 8 | 9 | func TestMainnet_Altair_Operations_Deposit(t *testing.T) { 10 | operations.RunDepositTest(t, "mainnet") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/altair/rewards/rewards_test.go: -------------------------------------------------------------------------------- 1 | package rewards 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/altair/rewards" 7 | ) 8 | 9 | func TestMainnet_Altair_Rewards(t *testing.T) { 10 | rewards.RunPrecomputeRewardsAndPenaltiesTests(t, "mainnet") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/phase0/operations/deposit_test.go: -------------------------------------------------------------------------------- 1 | package operations 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/phase0/operations" 7 | ) 8 | 9 | func TestMainnet_Phase0_Operations_Deposit(t *testing.T) { 10 | operations.RunDepositTest(t, "mainnet") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/phase0/rewards/rewards_test.go: -------------------------------------------------------------------------------- 1 | package rewards 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/phase0/rewards" 7 | ) 8 | 9 | func TestMainnet_Phase0_Rewards(t *testing.T) { 10 | rewards.RunPrecomputeRewardsAndPenaltiesTests(t, "mainnet") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/minimal/altair/operations/deposit_test.go: -------------------------------------------------------------------------------- 1 | package operations 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/altair/operations" 7 | ) 8 | 9 | func TestMinimal_Altair_Operations_Deposit(t *testing.T) { 10 | operations.RunDepositTest(t, "minimal") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/minimal/altair/rewards/rewards_test.go: -------------------------------------------------------------------------------- 1 | package rewards 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/altair/rewards" 7 | ) 8 | 9 | func TestMinimal_Altair_Rewards(t *testing.T) { 10 | rewards.RunPrecomputeRewardsAndPenaltiesTests(t, "minimal") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/minimal/bellatrix/fork/upgrade_to_altair_test.go: -------------------------------------------------------------------------------- 1 | package fork 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/bellatrix/fork" 7 | ) 8 | 9 | func TestMinimal_Bellatrix_UpgradeToBellatrix(t *testing.T) { 10 | fork.RunUpgradeToBellatrix(t, "minimal") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/minimal/phase0/operations/deposit_test.go: -------------------------------------------------------------------------------- 1 | package operations 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/phase0/operations" 7 | ) 8 | 9 | func TestMinimal_Phase0_Operations_Deposit(t *testing.T) { 10 | operations.RunDepositTest(t, "minimal") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/minimal/phase0/rewards/rewards_test.go: -------------------------------------------------------------------------------- 1 | package rewards 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/phase0/rewards" 7 | ) 8 | 9 | func TestMinimal_Phase0_Rewards(t *testing.T) { 10 | rewards.RunPrecomputeRewardsAndPenaltiesTests(t, "minimal") 11 | } 12 | -------------------------------------------------------------------------------- /beacon-chain/db/kv/init_test.go: -------------------------------------------------------------------------------- 1 | package kv 2 | 3 | import ( 4 | "github.com/prysmaticlabs/prysm/config/params" 5 | ) 6 | 7 | func init() { 8 | // Override network name so that hardcoded genesis files are not loaded. 9 | if err := params.SetActive(params.MainnetTestConfig()); err != nil { 10 | panic(err) 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/bellatrix/ssz_static/ssz_static_test.go: -------------------------------------------------------------------------------- 1 | package ssz_static 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/bellatrix/ssz_static" 7 | ) 8 | 9 | func TestMainnet_Bellatrix_SSZStatic(t *testing.T) { 10 | ssz_static.RunSSZStaticTests(t, "mainnet") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/minimal/bellatrix/ssz_static/ssz_static_test.go: -------------------------------------------------------------------------------- 1 | package ssz_static 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/bellatrix/ssz_static" 7 | ) 8 | 9 | func TestMinimal_Bellatrix_SSZStatic(t *testing.T) { 10 | ssz_static.RunSSZStaticTests(t, "minimal") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/altair/operations/attestation_test.go: -------------------------------------------------------------------------------- 1 | package operations 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/altair/operations" 7 | ) 8 | 9 | func TestMainnet_Altair_Operations_Attestation(t *testing.T) { 10 | operations.RunAttestationTest(t, "mainnet") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/altair/random/random_test.go: -------------------------------------------------------------------------------- 1 | package random 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/altair/sanity" 7 | ) 8 | 9 | func TestMainnet_Altair_Random(t *testing.T) { 10 | sanity.RunBlockProcessingTest(t, "mainnet", "random/random/pyspec_tests") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/bellatrix/fork_transition/transition_test.go: -------------------------------------------------------------------------------- 1 | package fork_transition 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/bellatrix/fork" 7 | ) 8 | 9 | func TestMainnet_Bellatrix_Transition(t *testing.T) { 10 | fork.RunForkTransitionTest(t, "mainnet") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/bellatrix/operations/deposit_test.go: -------------------------------------------------------------------------------- 1 | package operations 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/bellatrix/operations" 7 | ) 8 | 9 | func TestMainnet_Bellatrix_Operations_Deposit(t *testing.T) { 10 | operations.RunDepositTest(t, "mainnet") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/bellatrix/rewards/rewards_test.go: -------------------------------------------------------------------------------- 1 | package rewards 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/bellatrix/rewards" 7 | ) 8 | 9 | func TestMainnet_Bellatrix_Rewards(t *testing.T) { 10 | rewards.RunPrecomputeRewardsAndPenaltiesTests(t, "mainnet") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/phase0/operations/attestation_test.go: -------------------------------------------------------------------------------- 1 | package operations 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/phase0/operations" 7 | ) 8 | 9 | func TestMainnet_Phase0_Operations_Attestation(t *testing.T) { 10 | operations.RunAttestationTest(t, "mainnet") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/phase0/random/random_test.go: -------------------------------------------------------------------------------- 1 | package random 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/phase0/sanity" 7 | ) 8 | 9 | func TestMainnet_Phase0_Random(t *testing.T) { 10 | sanity.RunBlockProcessingTest(t, "mainnet", "random/random/pyspec_tests") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/minimal/altair/operations/attestation_test.go: -------------------------------------------------------------------------------- 1 | package operations 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/altair/operations" 7 | ) 8 | 9 | func TestMinimal_Altair_Operations_Attestation(t *testing.T) { 10 | operations.RunAttestationTest(t, "minimal") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/minimal/altair/random/random_test.go: -------------------------------------------------------------------------------- 1 | package random 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/altair/sanity" 7 | ) 8 | 9 | func TestMinimal_Altair_Random(t *testing.T) { 10 | sanity.RunBlockProcessingTest(t, "minimal", "random/random/pyspec_tests") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/minimal/bellatrix/operations/deposit_test.go: -------------------------------------------------------------------------------- 1 | package operations 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/bellatrix/operations" 7 | ) 8 | 9 | func TestMinimal_Bellatrix_Operations_Deposit(t *testing.T) { 10 | operations.RunDepositTest(t, "minimal") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/minimal/bellatrix/rewards/rewards_test.go: -------------------------------------------------------------------------------- 1 | package rewards 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/bellatrix/rewards" 7 | ) 8 | 9 | func TestMinimal_Bellatrix_Rewards(t *testing.T) { 10 | rewards.RunPrecomputeRewardsAndPenaltiesTests(t, "minimal") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/minimal/phase0/operations/attestation_test.go: -------------------------------------------------------------------------------- 1 | package operations 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/phase0/operations" 7 | ) 8 | 9 | func TestMinimal_Phase0_Operations_Attestation(t *testing.T) { 10 | operations.RunAttestationTest(t, "minimal") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/minimal/phase0/random/random_test.go: -------------------------------------------------------------------------------- 1 | package random 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/phase0/sanity" 7 | ) 8 | 9 | func TestMinimal_Phase0_Random(t *testing.T) { 10 | sanity.RunBlockProcessingTest(t, "minimal", "random/random/pyspec_tests") 11 | } 12 | -------------------------------------------------------------------------------- /validator/slashing-protection-history/format/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("@prysm//tools/go:def.bzl", "go_library") 2 | 3 | go_library( 4 | name = "go_default_library", 5 | srcs = ["format.go"], 6 | importpath = "github.com/prysmaticlabs/prysm/validator/slashing-protection-history/format", 7 | visibility = ["//visibility:public"], 8 | ) 9 | -------------------------------------------------------------------------------- /.github/actions/gofmt/action.yml: -------------------------------------------------------------------------------- 1 | name: 'Gofmt checker' 2 | description: 'Checks that all project files have been properly formatted.' 3 | inputs: 4 | path: 5 | description: 'Path to check' 6 | required: true 7 | default: './' 8 | runs: 9 | using: 'docker' 10 | image: 'Dockerfile' 11 | args: 12 | - ${{ inputs.path }} -------------------------------------------------------------------------------- /beacon-chain/blockchain/init_test.go: -------------------------------------------------------------------------------- 1 | package blockchain 2 | 3 | import ( 4 | "github.com/prysmaticlabs/prysm/config/params" 5 | ) 6 | 7 | func init() { 8 | // Override network name so that hardcoded genesis files are not loaded. 9 | if err := params.SetActive(params.MainnetTestConfig()); err != nil { 10 | panic(err) 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /beacon-chain/db/iface/errors.go: -------------------------------------------------------------------------------- 1 | package iface 2 | 3 | import ( 4 | "errors" 5 | ) 6 | 7 | var ( 8 | // ErrExistingGenesisState is an error when the user attempts to save a different genesis state 9 | // when one already exists in a database. 10 | ErrExistingGenesisState = errors.New("genesis state exists already in the DB") 11 | ) 12 | -------------------------------------------------------------------------------- /beacon-chain/powchain/init_test.go: -------------------------------------------------------------------------------- 1 | package powchain 2 | 3 | import ( 4 | "github.com/prysmaticlabs/prysm/config/params" 5 | ) 6 | 7 | func init() { 8 | // Override network name so that hardcoded genesis files are not loaded. 9 | if err := params.SetActive(params.MainnetTestConfig()); err != nil { 10 | panic(err) 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /beacon-chain/rpc/eth/beacon/init_test.go: -------------------------------------------------------------------------------- 1 | package beacon 2 | 3 | import ( 4 | "github.com/prysmaticlabs/prysm/config/params" 5 | ) 6 | 7 | func init() { 8 | // Override network name so that hardcoded genesis files are not loaded. 9 | if err := params.SetActive(params.MainnetTestConfig()); err != nil { 10 | panic(err) 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/altair/operations/block_header_test.go: -------------------------------------------------------------------------------- 1 | package operations 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/altair/operations" 7 | ) 8 | 9 | func TestMainnet_Altair_Operations_BlockHeader(t *testing.T) { 10 | operations.RunBlockHeaderTest(t, "mainnet") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/altair/sanity/blocks_test.go: -------------------------------------------------------------------------------- 1 | package sanity 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/altair/sanity" 7 | ) 8 | 9 | func TestMainnet_Altair_Sanity_Blocks(t *testing.T) { 10 | sanity.RunBlockProcessingTest(t, "mainnet", "sanity/blocks/pyspec_tests") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/bellatrix/fork_helper/upgrade_to_altair_test.go: -------------------------------------------------------------------------------- 1 | package fork_helper 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/bellatrix/fork" 7 | ) 8 | 9 | func TestMainnet_Bellatrix_UpgradeToBellatrix(t *testing.T) { 10 | fork.RunUpgradeToBellatrix(t, "mainnet") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/phase0/operations/block_header_test.go: -------------------------------------------------------------------------------- 1 | package operations 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/phase0/operations" 7 | ) 8 | 9 | func TestMainnet_Phase0_Operations_BlockHeader(t *testing.T) { 10 | operations.RunBlockHeaderTest(t, "mainnet") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/phase0/sanity/blocks_test.go: -------------------------------------------------------------------------------- 1 | package sanity 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/phase0/sanity" 7 | ) 8 | 9 | func TestMainnet_Phase0_Sanity_Blocks(t *testing.T) { 10 | sanity.RunBlockProcessingTest(t, "mainnet", "sanity/blocks/pyspec_tests") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/minimal/altair/operations/block_header_test.go: -------------------------------------------------------------------------------- 1 | package operations 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/altair/operations" 7 | ) 8 | 9 | func TestMinimal_Altair_Operations_BlockHeader(t *testing.T) { 10 | operations.RunBlockHeaderTest(t, "minimal") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/minimal/altair/sanity/blocks_test.go: -------------------------------------------------------------------------------- 1 | package sanity 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/altair/sanity" 7 | ) 8 | 9 | func TestMinimal_Altair_Sanity_Blocks(t *testing.T) { 10 | sanity.RunBlockProcessingTest(t, "minimal", "sanity/blocks/pyspec_tests") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/minimal/phase0/operations/block_header_test.go: -------------------------------------------------------------------------------- 1 | package operations 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/phase0/operations" 7 | ) 8 | 9 | func TestMinimal_Phase0_Operations_BlockHeader(t *testing.T) { 10 | operations.RunBlockHeaderTest(t, "minimal") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/minimal/phase0/sanity/blocks_test.go: -------------------------------------------------------------------------------- 1 | package sanity 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/phase0/sanity" 7 | ) 8 | 9 | func TestMinimal_Phase0_Sanity_Blocks(t *testing.T) { 10 | sanity.RunBlockProcessingTest(t, "minimal", "sanity/blocks/pyspec_tests") 11 | } 12 | -------------------------------------------------------------------------------- /validator/slashing-protection-history/doc.go: -------------------------------------------------------------------------------- 1 | // Package history defines methods to parse, import, and export slashing protection data 2 | // from a standard JSON file according to EIP-3076 https://eips.ethereum.org/EIPS/eip-3076. This format 3 | // is critical to allow safe interoperability between Ethereum consensus clients. 4 | package history 5 | -------------------------------------------------------------------------------- /beacon-chain/forkchoice/protoarray/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package protoarray implements proto array fork choice as outlined: 3 | https://github.com/protolambda/lmd-ghost#array-based-stateful-dag-proto_array 4 | This was motivated by the original implementation by Sigma Prime here: 5 | https://github.com/sigp/lighthouse/pull/804 6 | */ 7 | package protoarray 8 | -------------------------------------------------------------------------------- /beacon-chain/state/stategen/init_test.go: -------------------------------------------------------------------------------- 1 | package stategen 2 | 3 | import ( 4 | "github.com/prysmaticlabs/prysm/config/params" 5 | ) 6 | 7 | func init() { 8 | // Override network name so that hardcoded genesis files are not loaded. 9 | if err := params.SetActive(params.MainnetTestConfig()); err != nil { 10 | panic(err) 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/altair/operations/sync_committee_test.go: -------------------------------------------------------------------------------- 1 | package operations 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/altair/operations" 7 | ) 8 | 9 | func TestMainnet_Altair_Operations_SyncCommittee(t *testing.T) { 10 | operations.RunSyncCommitteeTest(t, "mainnet") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/altair/operations/voluntary_exit_test.go: -------------------------------------------------------------------------------- 1 | package operations 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/altair/operations" 7 | ) 8 | 9 | func TestMainnet_Altair_Operations_VoluntaryExit(t *testing.T) { 10 | operations.RunVoluntaryExitTest(t, "mainnet") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/bellatrix/operations/attestation_test.go: -------------------------------------------------------------------------------- 1 | package operations 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/bellatrix/operations" 7 | ) 8 | 9 | func TestMainnet_Bellatrix_Operations_Attestation(t *testing.T) { 10 | operations.RunAttestationTest(t, "mainnet") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/bellatrix/operations/block_header_test.go: -------------------------------------------------------------------------------- 1 | package operations 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/bellatrix/operations" 7 | ) 8 | 9 | func TestMainnet_Bellatrix_Operations_BlockHeader(t *testing.T) { 10 | operations.RunBlockHeaderTest(t, "mainnet") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/phase0/operations/voluntary_exit_test.go: -------------------------------------------------------------------------------- 1 | package operations 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/phase0/operations" 7 | ) 8 | 9 | func TestMainnet_Phase0_Operations_VoluntaryExit(t *testing.T) { 10 | operations.RunVoluntaryExitTest(t, "mainnet") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/minimal/altair/operations/sync_committee_test.go: -------------------------------------------------------------------------------- 1 | package operations 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/altair/operations" 7 | ) 8 | 9 | func TestMinimal_Altair_Operations_SyncCommittee(t *testing.T) { 10 | operations.RunProposerSlashingTest(t, "minimal") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/minimal/altair/operations/voluntary_exit_test.go: -------------------------------------------------------------------------------- 1 | package operations 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/altair/operations" 7 | ) 8 | 9 | func TestMinimal_Altair_Operations_VoluntaryExit(t *testing.T) { 10 | operations.RunVoluntaryExitTest(t, "minimal") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/minimal/bellatrix/operations/attestation_test.go: -------------------------------------------------------------------------------- 1 | package operations 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/bellatrix/operations" 7 | ) 8 | 9 | func TestMinimal_Bellatrix_Operations_Attestation(t *testing.T) { 10 | operations.RunAttestationTest(t, "minimal") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/minimal/bellatrix/operations/block_header_test.go: -------------------------------------------------------------------------------- 1 | package operations 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/bellatrix/operations" 7 | ) 8 | 9 | func TestMinimal_Bellatrix_Operations_BlockHeader(t *testing.T) { 10 | operations.RunBlockHeaderTest(t, "minimal") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/minimal/phase0/operations/voluntary_exit_test.go: -------------------------------------------------------------------------------- 1 | package operations 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/phase0/operations" 7 | ) 8 | 9 | func TestMinimal_Phase0_Operations_VoluntaryExit(t *testing.T) { 10 | operations.RunVoluntaryExitTest(t, "minimal") 11 | } 12 | -------------------------------------------------------------------------------- /beacon-chain/core/transition/interop/log.go: -------------------------------------------------------------------------------- 1 | // Package interop contains useful utilities for persisting 2 | // ssz-encoded states and blocks to disk during each state 3 | // transition for development purposes. 4 | package interop 5 | 6 | import ( 7 | "github.com/sirupsen/logrus" 8 | ) 9 | 10 | var log = logrus.WithField("prefix", "interop") 11 | -------------------------------------------------------------------------------- /crypto/bls/blst/doc.go: -------------------------------------------------------------------------------- 1 | // Package blst implements a go-wrapper around a library implementing the 2 | // the BLS12-381 curve and signature scheme. This package exposes a public API for 3 | // verifying and aggregating BLS signatures used by Ethereum. 4 | // 5 | // This implementation uses the library written by Supranational, blst. 6 | // 7 | package blst 8 | -------------------------------------------------------------------------------- /runtime/debug/cgo_symbolizer.go: -------------------------------------------------------------------------------- 1 | //go:build cgosymbolizer_enabled 2 | 3 | package debug 4 | 5 | import ( 6 | // Using this file with this imported library configures the process to 7 | // expose cgo symbols when possible. Use --config=cgo_symbolizer to make use of 8 | // this feature. 9 | _ "github.com/ianlancetaylor/cgosymbolizer" 10 | ) 11 | -------------------------------------------------------------------------------- /testing/spectest/general/phase0/bls/sign_test.yaml.go: -------------------------------------------------------------------------------- 1 | // Code generated by yaml_to_go. DO NOT EDIT. 2 | // source: sign_msg.yaml 3 | 4 | package bls 5 | 6 | type SignMsgTest struct { 7 | Input struct { 8 | Privkey string `json:"privkey"` 9 | Message string `json:"message"` 10 | } `json:"input"` 11 | Output string `json:"output"` 12 | } 13 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/bellatrix/sanity/blocks_test.go: -------------------------------------------------------------------------------- 1 | package sanity 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/bellatrix/sanity" 7 | ) 8 | 9 | func TestMainnet_Bellatrix_Sanity_Blocks(t *testing.T) { 10 | sanity.RunBlockProcessingTest(t, "mainnet", "sanity/blocks/pyspec_tests") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/phase0/shuffling/core/shuffle/shuffle_test.go: -------------------------------------------------------------------------------- 1 | package shuffle 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/phase0/shuffling/core/shuffle" 7 | ) 8 | 9 | func TestMainnet_Phase0_Shuffling_Core_Shuffle(t *testing.T) { 10 | shuffle.RunShuffleTests(t, "mainnet") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/minimal/bellatrix/sanity/blocks_test.go: -------------------------------------------------------------------------------- 1 | package sanity 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/bellatrix/sanity" 7 | ) 8 | 9 | func TestMinimal_Bellatrix_Sanity_Blocks(t *testing.T) { 10 | sanity.RunBlockProcessingTest(t, "minimal", "sanity/blocks/pyspec_tests") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/minimal/phase0/shuffling/core/shuffle/shuffle_test.go: -------------------------------------------------------------------------------- 1 | package shuffle 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/phase0/shuffling/core/shuffle" 7 | ) 8 | 9 | func TestMinimal_Phase0_Shuffling_Core_Shuffle(t *testing.T) { 10 | shuffle.RunShuffleTests(t, "minimal") 11 | } 12 | -------------------------------------------------------------------------------- /beacon-chain/rpc/prysm/v1alpha1/beacon/init_test.go: -------------------------------------------------------------------------------- 1 | package beacon 2 | 3 | import ( 4 | "github.com/prysmaticlabs/prysm/config/params" 5 | ) 6 | 7 | func init() { 8 | // Override network name so that hardcoded genesis files are not loaded. 9 | if err := params.SetActive(params.MainnetTestConfig()); err != nil { 10 | panic(err) 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /testing/bls/hash_to_G2_test.yaml.go: -------------------------------------------------------------------------------- 1 | // Code generated by yaml_to_go. DO NOT EDIT. 2 | // source: hash_to_G2.yaml 3 | 4 | package bls 5 | 6 | type HashToG2Test struct { 7 | Input struct { 8 | Message string `json:"msg"` 9 | } `json:"input"` 10 | Output struct { 11 | X string `json:"x"` 12 | Y string `json:"y"` 13 | } `json:"output"` 14 | } 15 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/altair/operations/attester_slashing_test.go: -------------------------------------------------------------------------------- 1 | package operations 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/altair/operations" 7 | ) 8 | 9 | func TestMainnet_Altair_Operations_AttesterSlashing(t *testing.T) { 10 | operations.RunAttesterSlashingTest(t, "mainnet") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/altair/operations/proposer_slashing_test.go: -------------------------------------------------------------------------------- 1 | package operations 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/altair/operations" 7 | ) 8 | 9 | func TestMainnet_Altair_Operations_ProposerSlashing(t *testing.T) { 10 | operations.RunProposerSlashingTest(t, "mainnet") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/bellatrix/operations/sync_committee_test.go: -------------------------------------------------------------------------------- 1 | package operations 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/bellatrix/operations" 7 | ) 8 | 9 | func TestMainnet_Bellatrix_Operations_SyncCommittee(t *testing.T) { 10 | operations.RunSyncCommitteeTest(t, "mainnet") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/bellatrix/operations/voluntary_exit_test.go: -------------------------------------------------------------------------------- 1 | package operations 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/bellatrix/operations" 7 | ) 8 | 9 | func TestMainnet_Bellatrix_Operations_VoluntaryExit(t *testing.T) { 10 | operations.RunVoluntaryExitTest(t, "mainnet") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/phase0/operations/attester_slashing_test.go: -------------------------------------------------------------------------------- 1 | package operations 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/phase0/operations" 7 | ) 8 | 9 | func TestMainnet_Phase0_Operations_AttesterSlashing(t *testing.T) { 10 | operations.RunAttesterSlashingTest(t, "mainnet") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/phase0/operations/proposer_slashing_test.go: -------------------------------------------------------------------------------- 1 | package operations 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/phase0/operations" 7 | ) 8 | 9 | func TestMainnet_Phase0_Operations_ProposerSlashing(t *testing.T) { 10 | operations.RunProposerSlashingTest(t, "mainnet") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/minimal/altair/operations/attester_slashing_test.go: -------------------------------------------------------------------------------- 1 | package operations 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/altair/operations" 7 | ) 8 | 9 | func TestMinimal_Altair_Operations_AttesterSlashing(t *testing.T) { 10 | operations.RunAttesterSlashingTest(t, "minimal") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/minimal/altair/operations/proposer_slashing_test.go: -------------------------------------------------------------------------------- 1 | package operations 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/altair/operations" 7 | ) 8 | 9 | func TestMinimal_Altair_Operations_ProposerSlashing(t *testing.T) { 10 | operations.RunProposerSlashingTest(t, "minimal") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/minimal/bellatrix/operations/sync_committee_test.go: -------------------------------------------------------------------------------- 1 | package operations 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/bellatrix/operations" 7 | ) 8 | 9 | func TestMinimal_Bellatrix_Operations_SyncCommittee(t *testing.T) { 10 | operations.RunProposerSlashingTest(t, "minimal") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/minimal/bellatrix/operations/voluntary_exit_test.go: -------------------------------------------------------------------------------- 1 | package operations 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/bellatrix/operations" 7 | ) 8 | 9 | func TestMinimal_Bellatrix_Operations_VoluntaryExit(t *testing.T) { 10 | operations.RunVoluntaryExitTest(t, "minimal") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/minimal/phase0/operations/attester_slashing_test.go: -------------------------------------------------------------------------------- 1 | package operations 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/phase0/operations" 7 | ) 8 | 9 | func TestMinimal_Phase0_Operations_AttesterSlashing(t *testing.T) { 10 | operations.RunAttesterSlashingTest(t, "minimal") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/minimal/phase0/operations/proposer_slashing_test.go: -------------------------------------------------------------------------------- 1 | package operations 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/phase0/operations" 7 | ) 8 | 9 | func TestMinimal_Phase0_Operations_ProposerSlashing(t *testing.T) { 10 | operations.RunProposerSlashingTest(t, "minimal") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/altair/epoch_processing/slashings_test.go: -------------------------------------------------------------------------------- 1 | package epoch_processing 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/altair/epoch_processing" 7 | ) 8 | 9 | func TestMainnet_Altair_EpochProcessing_Slashings(t *testing.T) { 10 | epoch_processing.RunSlashingsTests(t, "mainnet") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/bellatrix/operations/attester_slashing_test.go: -------------------------------------------------------------------------------- 1 | package operations 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/bellatrix/operations" 7 | ) 8 | 9 | func TestMainnet_Bellatrix_Operations_AttesterSlashing(t *testing.T) { 10 | operations.RunAttesterSlashingTest(t, "mainnet") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/bellatrix/operations/proposer_slashing_test.go: -------------------------------------------------------------------------------- 1 | package operations 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/bellatrix/operations" 7 | ) 8 | 9 | func TestMainnet_Bellatrix_Operations_ProposerSlashing(t *testing.T) { 10 | operations.RunProposerSlashingTest(t, "mainnet") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/phase0/epoch_processing/slashings_test.go: -------------------------------------------------------------------------------- 1 | package epoch_processing 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/phase0/epoch_processing" 7 | ) 8 | 9 | func TestMainnet_Phase0_EpochProcessing_Slashings(t *testing.T) { 10 | epoch_processing.RunSlashingsTests(t, "mainnet") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/minimal/altair/epoch_processing/slashings_test.go: -------------------------------------------------------------------------------- 1 | package epoch_processing 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/altair/epoch_processing" 7 | ) 8 | 9 | func TestMinimal_Altair_EpochProcessing_Slashings(t *testing.T) { 10 | epoch_processing.RunSlashingsTests(t, "minimal") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/minimal/bellatrix/operations/attester_slashing_test.go: -------------------------------------------------------------------------------- 1 | package operations 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/bellatrix/operations" 7 | ) 8 | 9 | func TestMinimal_Bellatrix_Operations_AttesterSlashing(t *testing.T) { 10 | operations.RunAttesterSlashingTest(t, "minimal") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/minimal/bellatrix/operations/proposer_slashing_test.go: -------------------------------------------------------------------------------- 1 | package operations 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/bellatrix/operations" 7 | ) 8 | 9 | func TestMinimal_Bellatrix_Operations_ProposerSlashing(t *testing.T) { 10 | operations.RunProposerSlashingTest(t, "minimal") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/minimal/phase0/epoch_processing/slashings_test.go: -------------------------------------------------------------------------------- 1 | package epoch_processing 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/phase0/epoch_processing" 7 | ) 8 | 9 | func TestMinimal_Phase0_EpochProcessing_Slashings(t *testing.T) { 10 | epoch_processing.RunSlashingsTests(t, "minimal") 11 | } 12 | -------------------------------------------------------------------------------- /cmd/prysmctl/checkpoint/checkpoint.go: -------------------------------------------------------------------------------- 1 | package checkpoint 2 | 3 | import "github.com/urfave/cli/v2" 4 | 5 | var Commands = []*cli.Command{ 6 | { 7 | Name: "checkpoint", 8 | Aliases: []string{"cpt"}, 9 | Usage: "commands for managing checkpoint syncing", 10 | Subcommands: []*cli.Command{ 11 | latestCmd, 12 | saveCmd, 13 | }, 14 | }, 15 | } 16 | -------------------------------------------------------------------------------- /time/mclock/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("@prysm//tools/go:def.bzl", "go_library") 2 | 3 | go_library( 4 | name = "go_default_library", 5 | srcs = ["mclock.go"], 6 | importpath = "github.com/prysmaticlabs/prysm/time/mclock", 7 | visibility = ["//visibility:public"], 8 | deps = ["@com_github_aristanetworks_goarista//monotime:go_default_library"], 9 | ) 10 | -------------------------------------------------------------------------------- /cmd/client-stats/flags/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("@prysm//tools/go:def.bzl", "go_library") 2 | 3 | go_library( 4 | name = "go_default_library", 5 | srcs = ["flags.go"], 6 | importpath = "github.com/prysmaticlabs/prysm/cmd/client-stats/flags", 7 | visibility = ["//visibility:public"], 8 | deps = ["@com_github_urfave_cli_v2//:go_default_library"], 9 | ) 10 | -------------------------------------------------------------------------------- /crypto/hash/htr/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("@prysm//tools/go:def.bzl", "go_library") 2 | 3 | go_library( 4 | name = "go_default_library", 5 | srcs = ["hashtree.go"], 6 | importpath = "github.com/prysmaticlabs/prysm/crypto/hash/htr", 7 | visibility = ["//visibility:public"], 8 | deps = ["@com_github_prysmaticlabs_gohashtree//:go_default_library"], 9 | ) 10 | -------------------------------------------------------------------------------- /testing/bls/verify_test.yaml.go: -------------------------------------------------------------------------------- 1 | // Code generated by yaml_to_go. DO NOT EDIT. 2 | // source: verify.yaml 3 | 4 | package bls 5 | 6 | type VerifyMsgTest struct { 7 | Input struct { 8 | Pubkey string `json:"pubkey"` 9 | Message string `json:"message"` 10 | Signature string `json:"signature"` 11 | } `json:"input"` 12 | Output bool `json:"output"` 13 | } 14 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/bellatrix/epoch_processing/slashings_test.go: -------------------------------------------------------------------------------- 1 | package epoch_processing 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/bellatrix/epoch_processing" 7 | ) 8 | 9 | func TestMainnet_Bellatrix_EpochProcessing_Slashings(t *testing.T) { 10 | epoch_processing.RunSlashingsTests(t, "mainnet") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/minimal/bellatrix/epoch_processing/slashings_test.go: -------------------------------------------------------------------------------- 1 | package epoch_processing 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/bellatrix/epoch_processing" 7 | ) 8 | 9 | func TestMinimal_Bellatrix_EpochProcessing_Slashings(t *testing.T) { 10 | epoch_processing.RunSlashingsTests(t, "minimal") 11 | } 12 | -------------------------------------------------------------------------------- /crypto/keystore/keccak256.go: -------------------------------------------------------------------------------- 1 | package keystore 2 | 3 | import ( 4 | "golang.org/x/crypto/sha3" 5 | ) 6 | 7 | // Keccak256 calculates and returns the Keccak256 hash of the input data. 8 | func Keccak256(data ...[]byte) []byte { 9 | d := sha3.NewLegacyKeccak256() 10 | for _, b := range data { 11 | // #nosec G104 12 | d.Write(b) 13 | } 14 | return d.Sum(nil) 15 | } 16 | -------------------------------------------------------------------------------- /monitoring/backup/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("@prysm//tools/go:def.bzl", "go_library") 2 | 3 | go_library( 4 | name = "go_default_library", 5 | srcs = ["http_backup_handler.go"], 6 | importpath = "github.com/prysmaticlabs/prysm/monitoring/backup", 7 | visibility = ["//visibility:public"], 8 | deps = ["@com_github_sirupsen_logrus//:go_default_library"], 9 | ) 10 | -------------------------------------------------------------------------------- /proto/prysm/v1alpha1/sync_committee_minimal.go: -------------------------------------------------------------------------------- 1 | //go:build minimal 2 | 3 | package eth 4 | 5 | import ( 6 | "github.com/prysmaticlabs/go-bitfield" 7 | ) 8 | 9 | func NewSyncCommitteeAggregationBits() bitfield.Bitvector8 { 10 | return bitfield.NewBitvector8() 11 | } 12 | 13 | func ConvertToSyncContributionBitVector(b []byte) bitfield.Bitvector8 { 14 | return b 15 | } 16 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/altair/epoch_processing/eth1_data_reset_test.go: -------------------------------------------------------------------------------- 1 | package epoch_processing 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/altair/epoch_processing" 7 | ) 8 | 9 | func TestMainnet_Altair_EpochProcessing_Eth1DataReset(t *testing.T) { 10 | epoch_processing.RunEth1DataResetTests(t, "mainnet") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/altair/epoch_processing/slashings_reset_test.go: -------------------------------------------------------------------------------- 1 | package epoch_processing 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/altair/epoch_processing" 7 | ) 8 | 9 | func TestMainnet_Altair_EpochProcessing_SlashingsReset(t *testing.T) { 10 | epoch_processing.RunSlashingsResetTests(t, "mainnet") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/phase0/epoch_processing/eth1_data_reset_test.go: -------------------------------------------------------------------------------- 1 | package epoch_processing 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/phase0/epoch_processing" 7 | ) 8 | 9 | func TestMainnet_Phase0_EpochProcessing_Eth1DataReset(t *testing.T) { 10 | epoch_processing.RunEth1DataResetTests(t, "mainnet") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/phase0/epoch_processing/slashings_reset_test.go: -------------------------------------------------------------------------------- 1 | package epoch_processing 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/phase0/epoch_processing" 7 | ) 8 | 9 | func TestMainnet_Phase0_EpochProcessing_SlashingsReset(t *testing.T) { 10 | epoch_processing.RunSlashingsResetTests(t, "mainnet") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/minimal/altair/epoch_processing/eth1_data_reset_test.go: -------------------------------------------------------------------------------- 1 | package epoch_processing 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/altair/epoch_processing" 7 | ) 8 | 9 | func TestMinimal_Altair_EpochProcessing_Eth1DataReset(t *testing.T) { 10 | epoch_processing.RunEth1DataResetTests(t, "minimal") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/minimal/altair/epoch_processing/slashings_reset_test.go: -------------------------------------------------------------------------------- 1 | package epoch_processing 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/altair/epoch_processing" 7 | ) 8 | 9 | func TestMinimal_Altair_EpochProcessing_SlashingsReset(t *testing.T) { 10 | epoch_processing.RunSlashingsResetTests(t, "minimal") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/minimal/phase0/epoch_processing/eth1_data_reset_test.go: -------------------------------------------------------------------------------- 1 | package epoch_processing 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/phase0/epoch_processing" 7 | ) 8 | 9 | func TestMinimal_Phase0_EpochProcessing_Eth1DataReset(t *testing.T) { 10 | epoch_processing.RunEth1DataResetTests(t, "minimal") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/minimal/phase0/epoch_processing/slashings_reset_test.go: -------------------------------------------------------------------------------- 1 | package epoch_processing 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/phase0/epoch_processing" 7 | ) 8 | 9 | func TestMinimal_Phase0_EpochProcessing_SlashingsReset(t *testing.T) { 10 | epoch_processing.RunSlashingsResetTests(t, "minimal") 11 | } 12 | -------------------------------------------------------------------------------- /beacon-chain/state/prometheus.go: -------------------------------------------------------------------------------- 1 | package state 2 | 3 | import ( 4 | "github.com/prometheus/client_golang/prometheus" 5 | "github.com/prometheus/client_golang/prometheus/promauto" 6 | ) 7 | 8 | var ( 9 | StateCount = promauto.NewGauge(prometheus.GaugeOpts{ 10 | Name: "beacon_state_count", 11 | Help: "Count the number of active beacon state objects.", 12 | }) 13 | ) 14 | -------------------------------------------------------------------------------- /testing/endtoend/policies/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("@prysm//tools/go:def.bzl", "go_library") 2 | 3 | go_library( 4 | name = "go_default_library", 5 | srcs = ["policies.go"], 6 | importpath = "github.com/prysmaticlabs/prysm/testing/endtoend/policies", 7 | visibility = ["//visibility:public"], 8 | deps = ["//consensus-types/primitives:go_default_library"], 9 | ) 10 | -------------------------------------------------------------------------------- /cmd/mock/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("@prysm//tools/go:def.bzl", "go_library") 2 | 3 | go_library( 4 | name = "go_default_library", 5 | testonly = True, 6 | srcs = ["password_reader_mock.go"], 7 | importpath = "github.com/prysmaticlabs/prysm/cmd/mock", 8 | visibility = ["//visibility:public"], 9 | deps = ["@com_github_golang_mock//gomock:go_default_library"], 10 | ) 11 | -------------------------------------------------------------------------------- /proto/prysm/v1alpha1/sync_committee_mainnet.go: -------------------------------------------------------------------------------- 1 | //go:build !minimal 2 | 3 | package eth 4 | 5 | import ( 6 | "github.com/prysmaticlabs/go-bitfield" 7 | ) 8 | 9 | func NewSyncCommitteeAggregationBits() bitfield.Bitvector128 { 10 | return bitfield.NewBitvector128() 11 | } 12 | 13 | func ConvertToSyncContributionBitVector(b []byte) bitfield.Bitvector128 { 14 | return b 15 | } 16 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/altair/epoch_processing/inactivity_updates_test.go: -------------------------------------------------------------------------------- 1 | package epoch_processing 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/altair/epoch_processing" 7 | ) 8 | 9 | func TestMainnet_Altair_EpochProcessing_InactivityUpdates(t *testing.T) { 10 | epoch_processing.RunInactivityUpdatesTest(t, "mainnet") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/altair/epoch_processing/randao_mixes_reset_test.go: -------------------------------------------------------------------------------- 1 | package epoch_processing 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/altair/epoch_processing" 7 | ) 8 | 9 | func TestMainnet_Altair_EpochProcessing_RandaoMixesReset(t *testing.T) { 10 | epoch_processing.RunRandaoMixesResetTests(t, "mainnet") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/altair/epoch_processing/registry_updates_test.go: -------------------------------------------------------------------------------- 1 | package epoch_processing 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/altair/epoch_processing" 7 | ) 8 | 9 | func TestMainnet_Altair_EpochProcessing_ResetRegistryUpdates(t *testing.T) { 10 | epoch_processing.RunRegistryUpdatesTests(t, "mainnet") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/bellatrix/epoch_processing/eth1_data_reset_test.go: -------------------------------------------------------------------------------- 1 | package epoch_processing 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/bellatrix/epoch_processing" 7 | ) 8 | 9 | func TestMainnet_Bellatrix_EpochProcessing_Eth1DataReset(t *testing.T) { 10 | epoch_processing.RunEth1DataResetTests(t, "mainnet") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/bellatrix/epoch_processing/slashings_reset_test.go: -------------------------------------------------------------------------------- 1 | package epoch_processing 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/bellatrix/epoch_processing" 7 | ) 8 | 9 | func TestMainnet_Bellatrix_EpochProcessing_SlashingsReset(t *testing.T) { 10 | epoch_processing.RunSlashingsResetTests(t, "mainnet") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/phase0/epoch_processing/randao_mixes_reset_test.go: -------------------------------------------------------------------------------- 1 | package epoch_processing 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/phase0/epoch_processing" 7 | ) 8 | 9 | func TestMainnet_Phase0_EpochProcessing_RandaoMixesReset(t *testing.T) { 10 | epoch_processing.RunRandaoMixesResetTests(t, "mainnet") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/phase0/epoch_processing/registry_updates_test.go: -------------------------------------------------------------------------------- 1 | package epoch_processing 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/phase0/epoch_processing" 7 | ) 8 | 9 | func TestMainnet_Phase0_EpochProcessing_ResetRegistryUpdates(t *testing.T) { 10 | epoch_processing.RunRegistryUpdatesTests(t, "mainnet") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/minimal/altair/epoch_processing/inactivity_updates_test.go: -------------------------------------------------------------------------------- 1 | package epoch_processing 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/altair/epoch_processing" 7 | ) 8 | 9 | func TestMinimal_Altair_EpochProcessing_InactivityUpdates(t *testing.T) { 10 | epoch_processing.RunInactivityUpdatesTest(t, "minimal") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/minimal/altair/epoch_processing/randao_mixes_reset_test.go: -------------------------------------------------------------------------------- 1 | package epoch_processing 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/altair/epoch_processing" 7 | ) 8 | 9 | func TestMinimal_Altair_EpochProcessing_RandaoMixesReset(t *testing.T) { 10 | epoch_processing.RunRandaoMixesResetTests(t, "minimal") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/minimal/altair/epoch_processing/registry_updates_test.go: -------------------------------------------------------------------------------- 1 | package epoch_processing 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/altair/epoch_processing" 7 | ) 8 | 9 | func TestMinimal_Altair_EpochProcessing_ResetRegistryUpdates(t *testing.T) { 10 | epoch_processing.RunRegistryUpdatesTests(t, "minimal") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/minimal/bellatrix/epoch_processing/eth1_data_reset_test.go: -------------------------------------------------------------------------------- 1 | package epoch_processing 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/bellatrix/epoch_processing" 7 | ) 8 | 9 | func TestMinimal_Bellatrix_EpochProcessing_Eth1DataReset(t *testing.T) { 10 | epoch_processing.RunEth1DataResetTests(t, "minimal") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/minimal/bellatrix/epoch_processing/slashings_reset_test.go: -------------------------------------------------------------------------------- 1 | package epoch_processing 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/bellatrix/epoch_processing" 7 | ) 8 | 9 | func TestMinimal_Bellatrix_EpochProcessing_SlashingsReset(t *testing.T) { 10 | epoch_processing.RunSlashingsResetTests(t, "minimal") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/minimal/phase0/epoch_processing/randao_mixes_reset_test.go: -------------------------------------------------------------------------------- 1 | package epoch_processing 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/phase0/epoch_processing" 7 | ) 8 | 9 | func TestMinimal_Phase0_EpochProcessing_RandaoMixesReset(t *testing.T) { 10 | epoch_processing.RunRandaoMixesResetTests(t, "minimal") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/minimal/phase0/epoch_processing/registry_updates_test.go: -------------------------------------------------------------------------------- 1 | package epoch_processing 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/phase0/epoch_processing" 7 | ) 8 | 9 | func TestMinimal_Phase0_EpochProcessing_ResetRegistryUpdates(t *testing.T) { 10 | epoch_processing.RunRegistryUpdatesTests(t, "minimal") 11 | } 12 | -------------------------------------------------------------------------------- /container/slice/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package slice implements set operations for specified data type 3 | 4 | Currently types which are tested and supported are: 5 | 6 | []uint32 7 | []int32 8 | []string 9 | []float32 10 | []uint64 11 | []int64 12 | []string 13 | []float64 14 | 15 | Intersection, Union, Not , IsIn are the operations which are supported on slices 16 | */ 17 | package slice 18 | -------------------------------------------------------------------------------- /beacon-chain/core/feed/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("@prysm//tools/go:def.bzl", "go_library") 2 | 3 | go_library( 4 | name = "go_default_library", 5 | srcs = ["event.go"], 6 | importpath = "github.com/prysmaticlabs/prysm/beacon-chain/core/feed", 7 | visibility = [ 8 | "//beacon-chain:__subpackages__", 9 | "//testing/slasher/simulator:__subpackages__", 10 | ], 11 | ) 12 | -------------------------------------------------------------------------------- /beacon-chain/state/state-native/types/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("@prysm//tools/go:def.bzl", "go_library") 2 | 3 | go_library( 4 | name = "go_default_library", 5 | srcs = ["types.go"], 6 | importpath = "github.com/prysmaticlabs/prysm/beacon-chain/state/state-native/types", 7 | visibility = ["//visibility:public"], 8 | deps = ["@com_github_pkg_errors//:go_default_library"], 9 | ) 10 | -------------------------------------------------------------------------------- /beacon-chain/sync/initial-sync/testing/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("@prysm//tools/go:def.bzl", "go_library") 2 | 3 | go_library( 4 | name = "go_default_library", 5 | testonly = True, 6 | srcs = ["mock.go"], 7 | importpath = "github.com/prysmaticlabs/prysm/beacon-chain/sync/initial-sync/testing", 8 | visibility = [ 9 | "//beacon-chain:__subpackages__", 10 | ], 11 | ) 12 | -------------------------------------------------------------------------------- /testing/bls/batch_verify_test.yaml.go: -------------------------------------------------------------------------------- 1 | // Code generated by yaml_to_go. DO NOT EDIT. 2 | // source: batch_verify.yaml 3 | 4 | package bls 5 | 6 | type BatchVerifyTest struct { 7 | Input struct { 8 | Pubkeys []string `json:"pubkeys"` 9 | Messages []string `json:"messages"` 10 | Signatures []string `json:"signatures"` 11 | } `json:"input"` 12 | Output bool `json:"output"` 13 | } 14 | -------------------------------------------------------------------------------- /testing/spectest/general/phase0/bls/verify_test.yaml.go: -------------------------------------------------------------------------------- 1 | // Code generated by yaml_to_go. DO NOT EDIT. 2 | // source: verify.yaml 3 | 4 | package bls 5 | 6 | type VerifyMsgTest struct { 7 | Input struct { 8 | Pubkey string `json:"pubkey"` 9 | Message string `json:"message"` 10 | Signature string `json:"signature"` 11 | } `json:"input"` 12 | Output bool `json:"output"` 13 | } 14 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/altair/epoch_processing/rewards_and_penalties_test.go: -------------------------------------------------------------------------------- 1 | package epoch_processing 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/altair/epoch_processing" 7 | ) 8 | 9 | func TestMainnet_Altair_EpochProcessing_RewardsAndPenalties(t *testing.T) { 10 | epoch_processing.RunRewardsAndPenaltiesTests(t, "mainnet") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/bellatrix/epoch_processing/inactivity_updates_test.go: -------------------------------------------------------------------------------- 1 | package epoch_processing 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/bellatrix/epoch_processing" 7 | ) 8 | 9 | func TestMainnet_Bellatrix_EpochProcessing_InactivityUpdates(t *testing.T) { 10 | epoch_processing.RunInactivityUpdatesTest(t, "mainnet") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/bellatrix/epoch_processing/randao_mixes_reset_test.go: -------------------------------------------------------------------------------- 1 | package epoch_processing 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/bellatrix/epoch_processing" 7 | ) 8 | 9 | func TestMainnet_Bellatrix_EpochProcessing_RandaoMixesReset(t *testing.T) { 10 | epoch_processing.RunRandaoMixesResetTests(t, "mainnet") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/bellatrix/epoch_processing/registry_updates_test.go: -------------------------------------------------------------------------------- 1 | package epoch_processing 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/bellatrix/epoch_processing" 7 | ) 8 | 9 | func TestMainnet_Bellatrix_EpochProcessing_ResetRegistryUpdates(t *testing.T) { 10 | epoch_processing.RunRegistryUpdatesTests(t, "mainnet") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/phase0/epoch_processing/rewards_and_penalties_test.go: -------------------------------------------------------------------------------- 1 | package epoch_processing 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/phase0/epoch_processing" 7 | ) 8 | 9 | func TestMainnet_Phase0_EpochProcessing_RewardsAndPenalties(t *testing.T) { 10 | epoch_processing.RunRewardsAndPenaltiesTests(t, "mainnet") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/minimal/altair/epoch_processing/rewards_and_penalties_test.go: -------------------------------------------------------------------------------- 1 | package epoch_processing 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/altair/epoch_processing" 7 | ) 8 | 9 | func TestMinimal_Altair_EpochProcessing_RewardsAndPenalties(t *testing.T) { 10 | epoch_processing.RunRewardsAndPenaltiesTests(t, "minimal") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/minimal/bellatrix/epoch_processing/inactivity_updates_test.go: -------------------------------------------------------------------------------- 1 | package epoch_processing 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/bellatrix/epoch_processing" 7 | ) 8 | 9 | func TestMinimal_Bellatrix_EpochProcessing_InactivityUpdates(t *testing.T) { 10 | epoch_processing.RunInactivityUpdatesTest(t, "minimal") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/minimal/bellatrix/epoch_processing/randao_mixes_reset_test.go: -------------------------------------------------------------------------------- 1 | package epoch_processing 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/bellatrix/epoch_processing" 7 | ) 8 | 9 | func TestMinimal_Bellatrix_EpochProcessing_RandaoMixesReset(t *testing.T) { 10 | epoch_processing.RunRandaoMixesResetTests(t, "minimal") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/minimal/bellatrix/epoch_processing/registry_updates_test.go: -------------------------------------------------------------------------------- 1 | package epoch_processing 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/bellatrix/epoch_processing" 7 | ) 8 | 9 | func TestMinimal_Bellatrix_EpochProcessing_ResetRegistryUpdates(t *testing.T) { 10 | epoch_processing.RunRegistryUpdatesTests(t, "minimal") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/minimal/phase0/epoch_processing/rewards_and_penalties_test.go: -------------------------------------------------------------------------------- 1 | package epoch_processing 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/phase0/epoch_processing" 7 | ) 8 | 9 | func TestMinimal_Phase0_EpochProcessing_RewardsAndPenalties(t *testing.T) { 10 | epoch_processing.RunRewardsAndPenaltiesTests(t, "minimal") 11 | } 12 | -------------------------------------------------------------------------------- /tools/unencrypted-keys-gen/keygen/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("@prysm//tools/go:def.bzl", "go_library") 2 | 3 | go_library( 4 | name = "go_default_library", 5 | srcs = ["keygen.go"], 6 | importpath = "github.com/prysmaticlabs/prysm/tools/unencrypted-keys-gen/keygen", 7 | visibility = ["//visibility:public"], 8 | deps = ["@com_github_sirupsen_logrus//:go_default_library"], 9 | ) 10 | -------------------------------------------------------------------------------- /validator/node/testdata/good-prepare-beacon-proposer-config.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | proposer_config: 3 | '0xa057816155ad77931185101128655c0191bd0214c201ca48ed887f6c4c6adf334070efcd75140eada5ac83a92506dd7a': 4 | fee_recipient: '0x50155530FCE8a85ec7055A5F8b2bE214B3DaeFd3' 5 | gas_limit: 40000000 6 | default_config: 7 | fee_recipient: '0x6e35733c5af9B61374A128e6F85f553aF09ff89A' 8 | gas_limit: 45000000 -------------------------------------------------------------------------------- /.github/actions/gofmt/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -l 2 | set -e 3 | 4 | cd $GITHUB_WORKSPACE 5 | 6 | # Check if any files are not formatted. 7 | nonformatted="$(gofmt -l $1 2>&1)" 8 | 9 | # Return if `go fmt` passes. 10 | [ -z "$nonformatted" ] && exit 0 11 | 12 | # Notify of issues with formatting. 13 | echo "Following files need to be properly formatted:" 14 | echo "$nonformatted" 15 | exit 1 16 | -------------------------------------------------------------------------------- /crypto/bls/interface.go: -------------------------------------------------------------------------------- 1 | package bls 2 | 3 | import ( 4 | "github.com/prysmaticlabs/prysm/crypto/bls/common" 5 | ) 6 | 7 | // PublicKey represents a BLS public key. 8 | type PublicKey = common.PublicKey 9 | 10 | // SecretKey represents a BLS secret or private key. 11 | type SecretKey = common.SecretKey 12 | 13 | // Signature represents a BLS signature. 14 | type Signature = common.Signature 15 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/altair/epoch_processing/historical_roots_update_test.go: -------------------------------------------------------------------------------- 1 | package epoch_processing 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/altair/epoch_processing" 7 | ) 8 | 9 | func TestMainnet_Altair_EpochProcessing_HistoricalRootsUpdate(t *testing.T) { 10 | epoch_processing.RunHistoricalRootsUpdateTests(t, "mainnet") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/altair/epoch_processing/participation_flag_updates_test.go: -------------------------------------------------------------------------------- 1 | package epoch_processing 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/altair/epoch_processing" 7 | ) 8 | 9 | func TestMainnet_Altair_EpochProcessing_ParticipationFlag(t *testing.T) { 10 | epoch_processing.RunParticipationFlagUpdatesTests(t, "mainnet") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/bellatrix/epoch_processing/rewards_and_penalties_test.go: -------------------------------------------------------------------------------- 1 | package epoch_processing 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/bellatrix/epoch_processing" 7 | ) 8 | 9 | func TestMainnet_Bellatrix_EpochProcessing_RewardsAndPenalties(t *testing.T) { 10 | epoch_processing.RunRewardsAndPenaltiesTests(t, "mainnet") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/phase0/epoch_processing/historical_roots_update_test.go: -------------------------------------------------------------------------------- 1 | package epoch_processing 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/phase0/epoch_processing" 7 | ) 8 | 9 | func TestMainnet_Phase0_EpochProcessing_HistoricalRootsUpdate(t *testing.T) { 10 | epoch_processing.RunHistoricalRootsUpdateTests(t, "mainnet") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/minimal/altair/epoch_processing/historical_roots_update_test.go: -------------------------------------------------------------------------------- 1 | package epoch_processing 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/altair/epoch_processing" 7 | ) 8 | 9 | func TestMinimal_Altair_EpochProcessing_HistoricalRootsUpdate(t *testing.T) { 10 | epoch_processing.RunHistoricalRootsUpdateTests(t, "minimal") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/minimal/altair/epoch_processing/participation_flag_updates_test.go: -------------------------------------------------------------------------------- 1 | package epoch_processing 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/altair/epoch_processing" 7 | ) 8 | 9 | func TestMinimal_Altair_EpochProcessing_ParticipationFlag(t *testing.T) { 10 | epoch_processing.RunParticipationFlagUpdatesTests(t, "minimal") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/minimal/bellatrix/epoch_processing/rewards_and_penalties_test.go: -------------------------------------------------------------------------------- 1 | package epoch_processing 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/bellatrix/epoch_processing" 7 | ) 8 | 9 | func TestMinimal_Bellatrix_EpochProcessing_RewardsAndPenalties(t *testing.T) { 10 | epoch_processing.RunRewardsAndPenaltiesTests(t, "minimal") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/minimal/phase0/epoch_processing/historical_roots_update_test.go: -------------------------------------------------------------------------------- 1 | package epoch_processing 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/phase0/epoch_processing" 7 | ) 8 | 9 | func TestMinimal_Phase0_EpochProcessing_HistoricalRootsUpdate(t *testing.T) { 10 | epoch_processing.RunHistoricalRootsUpdateTests(t, "minimal") 11 | } 12 | -------------------------------------------------------------------------------- /api/grpc/parameters.go: -------------------------------------------------------------------------------- 1 | package grpc 2 | 3 | // CustomErrorMetadataKey is the name of the metadata key storing additional error information. 4 | // Metadata value is expected to be a byte-encoded JSON object. 5 | const CustomErrorMetadataKey = "Custom-Error" 6 | 7 | // HttpCodeMetadataKey is the key to use when setting custom HTTP status codes in gRPC metadata. 8 | const HttpCodeMetadataKey = "X-Http-Code" 9 | -------------------------------------------------------------------------------- /beacon-chain/p2p/encoder/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package encoder allows for registering custom data encoders for information 3 | sent as raw bytes over the wire via p2p to other nodes. Examples of encoders 4 | are SSZ (SimpleSerialize), SSZ with Snappy compression, among others. Providing 5 | an abstract interface for these encoders allows for future flexibility of 6 | Ethereum beacon node p2p. 7 | */ 8 | package encoder 9 | -------------------------------------------------------------------------------- /testing/bls/aggregate_verify_test.yaml.go: -------------------------------------------------------------------------------- 1 | // Code generated by yaml_to_go. DO NOT EDIT. 2 | // source: aggregate_verify.yaml 3 | 4 | package bls 5 | 6 | type AggregateVerifyTest struct { 7 | Input struct { 8 | Pubkeys []string `json:"pubkeys"` 9 | Messages []string `json:"messages"` 10 | Signature string `json:"signature"` 11 | } `json:"input"` 12 | Output bool `json:"output"` 13 | } 14 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/altair/epoch_processing/effective_balance_updates_test.go: -------------------------------------------------------------------------------- 1 | package epoch_processing 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/altair/epoch_processing" 7 | ) 8 | 9 | func TestMainnet_Altair_EpochProcessing_EffectiveBalanceUpdates(t *testing.T) { 10 | epoch_processing.RunEffectiveBalanceUpdatesTests(t, "mainnet") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/phase0/epoch_processing/effective_balance_updates_test.go: -------------------------------------------------------------------------------- 1 | package epoch_processing 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/phase0/epoch_processing" 7 | ) 8 | 9 | func TestMainnet_Phase0_EpochProcessing_EffectiveBalanceUpdates(t *testing.T) { 10 | epoch_processing.RunEffectiveBalanceUpdatesTests(t, "mainnet") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/minimal/altair/epoch_processing/effective_balance_updates_test.go: -------------------------------------------------------------------------------- 1 | package epoch_processing 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/altair/epoch_processing" 7 | ) 8 | 9 | func TestMinimal_Altair_EpochProcessing_EffectiveBalanceUpdates(t *testing.T) { 10 | epoch_processing.RunEffectiveBalanceUpdatesTests(t, "minimal") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/minimal/phase0/epoch_processing/effective_balance_updates_test.go: -------------------------------------------------------------------------------- 1 | package epoch_processing 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/phase0/epoch_processing" 7 | ) 8 | 9 | func TestMinimal_Phase0_EpochProcessing_EffectiveBalanceUpdates(t *testing.T) { 10 | epoch_processing.RunEffectiveBalanceUpdatesTests(t, "minimal") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/shared/phase0/shuffling/core/shuffle/shuffle_test_format.go: -------------------------------------------------------------------------------- 1 | package shuffle 2 | 3 | import types "github.com/prysmaticlabs/prysm/consensus-types/primitives" 4 | 5 | // ShuffleTestCase -- 6 | type ShuffleTestCase struct { 7 | Seed string `yaml:"seed"` 8 | Count uint64 `yaml:"count"` 9 | Mapping []types.ValidatorIndex `yaml:"mapping"` 10 | } 11 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/bellatrix/epoch_processing/historical_roots_update_test.go: -------------------------------------------------------------------------------- 1 | package epoch_processing 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/bellatrix/epoch_processing" 7 | ) 8 | 9 | func TestMainnet_Bellatrix_EpochProcessing_HistoricalRootsUpdate(t *testing.T) { 10 | epoch_processing.RunHistoricalRootsUpdateTests(t, "mainnet") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/bellatrix/epoch_processing/participation_flag_updates_test.go: -------------------------------------------------------------------------------- 1 | package epoch_processing 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/bellatrix/epoch_processing" 7 | ) 8 | 9 | func TestMainnet_Bellatrix_EpochProcessing_ParticipationFlag(t *testing.T) { 10 | epoch_processing.RunParticipationFlagUpdatesTests(t, "mainnet") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/minimal/bellatrix/epoch_processing/historical_roots_update_test.go: -------------------------------------------------------------------------------- 1 | package epoch_processing 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/bellatrix/epoch_processing" 7 | ) 8 | 9 | func TestMinimal_Bellatrix_EpochProcessing_HistoricalRootsUpdate(t *testing.T) { 10 | epoch_processing.RunHistoricalRootsUpdateTests(t, "minimal") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/minimal/bellatrix/epoch_processing/participation_flag_updates_test.go: -------------------------------------------------------------------------------- 1 | package epoch_processing 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/bellatrix/epoch_processing" 7 | ) 8 | 9 | func TestMinimal_Bellatrix_EpochProcessing_ParticipationFlag(t *testing.T) { 10 | epoch_processing.RunParticipationFlagUpdatesTests(t, "minimal") 11 | } 12 | -------------------------------------------------------------------------------- /validator/node/testdata/good-prepare-beacon-proposer-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "proposer_config": { 3 | "0xa057816155ad77931185101128655c0191bd0214c201ca48ed887f6c4c6adf334070efcd75140eada5ac83a92506dd7a": { 4 | "fee_recipient": "0x50155530FCE8a85ec7055A5F8b2bE214B3DaeFd3" 5 | } 6 | }, 7 | "default_config": { 8 | "fee_recipient": "0x6e35733c5af9B61374A128e6F85f553aF09ff89A" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/bellatrix/epoch_processing/effective_balance_updates_test.go: -------------------------------------------------------------------------------- 1 | package epoch_processing 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/bellatrix/epoch_processing" 7 | ) 8 | 9 | func TestMainnet_Bellatrix_EpochProcessing_EffectiveBalanceUpdates(t *testing.T) { 10 | epoch_processing.RunEffectiveBalanceUpdatesTests(t, "mainnet") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/phase0/epoch_processing/participation_record_updates_test.go: -------------------------------------------------------------------------------- 1 | package epoch_processing 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/phase0/epoch_processing" 7 | ) 8 | 9 | func TestMainnet_Phase0_EpochProcessing_ParticipationRecordUpdates(t *testing.T) { 10 | epoch_processing.RunParticipationRecordUpdatesTests(t, "mainnet") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/minimal/bellatrix/epoch_processing/effective_balance_updates_test.go: -------------------------------------------------------------------------------- 1 | package epoch_processing 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/bellatrix/epoch_processing" 7 | ) 8 | 9 | func TestMinimal_Bellatrix_EpochProcessing_EffectiveBalanceUpdates(t *testing.T) { 10 | epoch_processing.RunEffectiveBalanceUpdatesTests(t, "minimal") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/minimal/phase0/epoch_processing/participation_record_updates_test.go: -------------------------------------------------------------------------------- 1 | package epoch_processing 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/phase0/epoch_processing" 7 | ) 8 | 9 | func TestMinimal_Phase0_EpochProcessing_ParticipationRecordUpdates(t *testing.T) { 10 | epoch_processing.RunParticipationRecordUpdatesTests(t, "minimal") 11 | } 12 | -------------------------------------------------------------------------------- /beacon-chain/forkchoice/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package forkchoice implements the service to support fork choice for the Ethereum beacon chain. This contains the 3 | necessary components to track latest validators votes, and balances. Then a store object to be used 4 | to calculate head. High level fork choice summary: 5 | https://notes.ethereum.org/@vbuterin/rkhCgQteN?type=view#LMD-GHOST-fork-choice-rule 6 | */ 7 | package forkchoice 8 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/altair/epoch_processing/justification_and_finalization_test.go: -------------------------------------------------------------------------------- 1 | package epoch_processing 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/altair/epoch_processing" 7 | ) 8 | 9 | func TestMainnet_Altair_EpochProcessing_JustificationAndFinalization(t *testing.T) { 10 | epoch_processing.RunJustificationAndFinalizationTests(t, "mainnet") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/phase0/epoch_processing/justification_and_finalization_test.go: -------------------------------------------------------------------------------- 1 | package epoch_processing 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/phase0/epoch_processing" 7 | ) 8 | 9 | func TestMainnet_Phase0_EpochProcessing_JustificationAndFinalization(t *testing.T) { 10 | epoch_processing.RunJustificationAndFinalizationTests(t, "mainnet") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/minimal/altair/epoch_processing/justification_and_finalization_test.go: -------------------------------------------------------------------------------- 1 | package epoch_processing 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/altair/epoch_processing" 7 | ) 8 | 9 | func TestMinimal_Altair_EpochProcessing_JustificationAndFinalization(t *testing.T) { 10 | epoch_processing.RunJustificationAndFinalizationTests(t, "minimal") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/minimal/phase0/epoch_processing/justification_and_finalization_test.go: -------------------------------------------------------------------------------- 1 | package epoch_processing 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/phase0/epoch_processing" 7 | ) 8 | 9 | func TestMinimal_Phase0_EpochProcessing_JustificationAndFinalization(t *testing.T) { 10 | epoch_processing.RunJustificationAndFinalizationTests(t, "minimal") 11 | } 12 | -------------------------------------------------------------------------------- /validator/node/testdata/good-prepare-beacon-proposer-config-badchecksum.json: -------------------------------------------------------------------------------- 1 | { 2 | "proposer_config": { 3 | "0xa057816155ad77931185101128655c0191bd0214c201ca48ed887f6c4c6adf334070efcd75140eada5ac83a92506dd7a": { 4 | "fee_recipient": "0xae967917c465db8578ca9024c205720b1a3651A9" 5 | } 6 | }, 7 | "default_config": { 8 | "fee_recipient": "0xae967917c465db8578ca9024c205720b1a3651A9" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /beacon-chain/state/v1/spec_parameters.go: -------------------------------------------------------------------------------- 1 | package v1 2 | 3 | import "github.com/prysmaticlabs/prysm/config/params" 4 | 5 | func (b *BeaconState) ProportionalSlashingMultiplier() (uint64, error) { 6 | return params.BeaconConfig().ProportionalSlashingMultiplier, nil 7 | } 8 | 9 | func (b *BeaconState) InactivityPenaltyQuotient() (uint64, error) { 10 | return params.BeaconConfig().InactivityPenaltyQuotient, nil 11 | } 12 | -------------------------------------------------------------------------------- /crypto/rand/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("@prysm//tools/go:def.bzl", "go_library", "go_test") 2 | 3 | go_library( 4 | name = "go_default_library", 5 | srcs = ["rand.go"], 6 | importpath = "github.com/prysmaticlabs/prysm/crypto/rand", 7 | visibility = ["//visibility:public"], 8 | ) 9 | 10 | go_test( 11 | name = "go_default_test", 12 | srcs = ["rand_test.go"], 13 | embed = [":go_default_library"], 14 | ) 15 | -------------------------------------------------------------------------------- /validator/accounts/doc.go: -------------------------------------------------------------------------------- 1 | // Package accounts defines a new model for accounts management in Prysm, using best 2 | // practices for user security, UX, and extensibility via different wallet types 3 | // including HD wallets, imported (non-HD) wallets, and remote-signing capable configurations. This model 4 | // is compliant with the EIP-2333, EIP-2334, and EIP-2335 standards for key management in Ethereum. 5 | package accounts 6 | -------------------------------------------------------------------------------- /async/abool/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("@prysm//tools/go:def.bzl", "go_library", "go_test") 2 | 3 | go_library( 4 | name = "go_default_library", 5 | srcs = ["abool.go"], 6 | importpath = "github.com/prysmaticlabs/prysm/async/abool", 7 | visibility = ["//visibility:public"], 8 | ) 9 | 10 | go_test( 11 | name = "go_default_test", 12 | srcs = ["abool_test.go"], 13 | embed = [":go_default_library"], 14 | ) 15 | -------------------------------------------------------------------------------- /bazel.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This script serves as a wrapper around bazel to limit the scope of environment variables that 4 | # may change the action output. Using this script should result in a higher cache hit ratio for 5 | # cached actions with a more heremtic build. 6 | 7 | env -i \ 8 | PATH=/usr/bin:/bin \ 9 | HOME="$HOME" \ 10 | GOOGLE_APPLICATION_CREDENTIALS="$GOOGLE_APPLICATION_CREDENTIALS" \ 11 | bazel "$@" 12 | -------------------------------------------------------------------------------- /testing/spectest/general/phase0/bls/aggregate_verify_test.yaml.go: -------------------------------------------------------------------------------- 1 | // Code generated by yaml_to_go. DO NOT EDIT. 2 | // source: aggregate_verify.yaml 3 | 4 | package bls 5 | 6 | type AggregateVerifyTest struct { 7 | Input struct { 8 | Pubkeys []string `json:"pubkeys"` 9 | Messages []string `json:"messages"` 10 | Signature string `json:"signature"` 11 | } `json:"input"` 12 | Output bool `json:"output"` 13 | } 14 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/altair/rewards/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("@prysm//tools/go:def.bzl", "go_test") 2 | 3 | go_test( 4 | name = "go_default_test", 5 | size = "small", 6 | srcs = ["rewards_test.go"], 7 | data = glob(["*.yaml"]) + [ 8 | "@consensus_spec_tests_mainnet//:test_data", 9 | ], 10 | tags = ["spectest"], 11 | deps = ["//testing/spectest/shared/altair/rewards:go_default_library"], 12 | ) 13 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/bellatrix/epoch_processing/justification_and_finalization_test.go: -------------------------------------------------------------------------------- 1 | package epoch_processing 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/bellatrix/epoch_processing" 7 | ) 8 | 9 | func TestMainnet_Bellatrix_EpochProcessing_JustificationAndFinalization(t *testing.T) { 10 | epoch_processing.RunJustificationAndFinalizationTests(t, "mainnet") 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/phase0/rewards/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("@prysm//tools/go:def.bzl", "go_test") 2 | 3 | go_test( 4 | name = "go_default_test", 5 | size = "small", 6 | srcs = ["rewards_test.go"], 7 | data = glob(["*.yaml"]) + [ 8 | "@consensus_spec_tests_mainnet//:test_data", 9 | ], 10 | tags = ["spectest"], 11 | deps = ["//testing/spectest/shared/phase0/rewards:go_default_library"], 12 | ) 13 | -------------------------------------------------------------------------------- /testing/spectest/minimal/bellatrix/epoch_processing/justification_and_finalization_test.go: -------------------------------------------------------------------------------- 1 | package epoch_processing 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/spectest/shared/bellatrix/epoch_processing" 7 | ) 8 | 9 | func TestMinimal_Bellatrix_EpochProcessing_JustificationAndFinalization(t *testing.T) { 10 | epoch_processing.RunJustificationAndFinalizationTests(t, "minimal") 11 | } 12 | -------------------------------------------------------------------------------- /validator/db/alias.go: -------------------------------------------------------------------------------- 1 | package db 2 | 3 | import "github.com/prysmaticlabs/prysm/validator/db/iface" 4 | 5 | // Database defines the necessary methods for Prysm's validator client backend which may be implemented by any 6 | // key-value or relational database in practice. This is the full database interface which should 7 | // not be used often. Prefer a more restrictive interface in this package. 8 | type Database = iface.ValidatorDB 9 | -------------------------------------------------------------------------------- /validator/package/preinst.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | SERVICE_USER=prysm-validator 6 | 7 | # Create the service account, if needed 8 | getent passwd $SERVICE_USER > /dev/null || useradd -s /bin/false --no-create-home --system --user-group $SERVICE_USER 9 | 10 | # Create directories 11 | mkdir -p /etc/prysm 12 | mkdir -p /var/lib/prysm 13 | install -d -m 0700 -o $SERVICE_USER -g $SERVICE_USER /var/lib/prysm/validator -------------------------------------------------------------------------------- /beacon-chain/p2p/peers/benchmark_test.go: -------------------------------------------------------------------------------- 1 | package peers 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/go-bitfield" 7 | ) 8 | 9 | func Benchmark_retrieveIndicesFromBitfield(b *testing.B) { 10 | bv := bitfield.NewBitvector64() 11 | for i := uint64(0); i < bv.Len(); i++ { 12 | bv.SetBitAt(i, true) 13 | } 14 | b.ResetTimer() 15 | for i := 0; i < b.N; i++ { 16 | indicesFromBitfield(bv) 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /beacon-chain/package/preinst.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | SERVICE_USER=prysm-beacon 6 | 7 | # Create the service account, if needed 8 | getent passwd $SERVICE_USER > /dev/null || useradd -s /bin/false --no-create-home --system --user-group $SERVICE_USER 9 | 10 | # Create directories 11 | mkdir -p /etc/prysm 12 | mkdir -p /var/lib/prysm 13 | install -d -m 0700 -o $SERVICE_USER -g $SERVICE_USER /var/lib/prysm/beacon-chain -------------------------------------------------------------------------------- /beacon-chain/state/v2/spec_parameters.go: -------------------------------------------------------------------------------- 1 | package v2 2 | 3 | import "github.com/prysmaticlabs/prysm/config/params" 4 | 5 | func (b *BeaconState) ProportionalSlashingMultiplier() (uint64, error) { 6 | return params.BeaconConfig().ProportionalSlashingMultiplierAltair, nil 7 | } 8 | 9 | func (b *BeaconState) InactivityPenaltyQuotient() (uint64, error) { 10 | return params.BeaconConfig().InactivityPenaltyQuotientAltair, nil 11 | } 12 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/altair/ssz_static/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("@prysm//tools/go:def.bzl", "go_test") 2 | 3 | go_test( 4 | name = "go_default_test", 5 | size = "small", 6 | srcs = ["ssz_static_test.go"], 7 | data = glob(["*.yaml"]) + [ 8 | "@consensus_spec_tests_mainnet//:test_data", 9 | ], 10 | tags = ["spectest"], 11 | deps = ["//testing/spectest/shared/altair/ssz_static:go_default_library"], 12 | ) 13 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/bellatrix/rewards/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("@prysm//tools/go:def.bzl", "go_test") 2 | 3 | go_test( 4 | name = "go_default_test", 5 | size = "small", 6 | srcs = ["rewards_test.go"], 7 | data = glob(["*.yaml"]) + [ 8 | "@consensus_spec_tests_mainnet//:test_data", 9 | ], 10 | tags = ["spectest"], 11 | deps = ["//testing/spectest/shared/bellatrix/rewards:go_default_library"], 12 | ) 13 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/phase0/ssz_static/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("@prysm//tools/go:def.bzl", "go_test") 2 | 3 | go_test( 4 | name = "go_default_test", 5 | size = "small", 6 | srcs = ["ssz_static_test.go"], 7 | data = glob(["*.yaml"]) + [ 8 | "@consensus_spec_tests_mainnet//:test_data", 9 | ], 10 | tags = ["spectest"], 11 | deps = ["//testing/spectest/shared/phase0/ssz_static:go_default_library"], 12 | ) 13 | -------------------------------------------------------------------------------- /beacon-chain/state/v3/spec_parameters.go: -------------------------------------------------------------------------------- 1 | package v3 2 | 3 | import "github.com/prysmaticlabs/prysm/config/params" 4 | 5 | func (b *BeaconState) ProportionalSlashingMultiplier() (uint64, error) { 6 | return params.BeaconConfig().ProportionalSlashingMultiplierBellatrix, nil 7 | } 8 | 9 | func (b *BeaconState) InactivityPenaltyQuotient() (uint64, error) { 10 | return params.BeaconConfig().InactivityPenaltyQuotientBellatrix, nil 11 | } 12 | -------------------------------------------------------------------------------- /runtime/debug/maxprocs_metric.go: -------------------------------------------------------------------------------- 1 | package debug 2 | 3 | import ( 4 | "runtime" 5 | 6 | "github.com/prometheus/client_golang/prometheus" 7 | "github.com/prometheus/client_golang/prometheus/promauto" 8 | ) 9 | 10 | var ( 11 | _ = promauto.NewGaugeFunc(prometheus.GaugeOpts{ 12 | Name: "go_maxprocs", 13 | Help: "The result of runtime.GOMAXPROCS(0)", 14 | }, func() float64 { 15 | return float64(runtime.GOMAXPROCS(0)) 16 | }) 17 | ) 18 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/altair/fork_transition/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("@prysm//tools/go:def.bzl", "go_test") 2 | 3 | go_test( 4 | name = "go_default_test", 5 | timeout = "short", 6 | srcs = ["transition_test.go"], 7 | data = glob(["*.yaml"]) + [ 8 | "@consensus_spec_tests_mainnet//:test_data", 9 | ], 10 | tags = ["spectest"], 11 | deps = ["//testing/spectest/shared/altair/fork:go_default_library"], 12 | ) 13 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/bellatrix/fork_transition/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("@prysm//tools/go:def.bzl", "go_test") 2 | 3 | go_test( 4 | name = "go_default_test", 5 | size = "small", 6 | srcs = ["transition_test.go"], 7 | data = glob(["*.yaml"]) + [ 8 | "@consensus_spec_tests_mainnet//:test_data", 9 | ], 10 | tags = ["spectest"], 11 | deps = ["//testing/spectest/shared/bellatrix/fork:go_default_library"], 12 | ) 13 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/bellatrix/ssz_static/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("@prysm//tools/go:def.bzl", "go_test") 2 | 3 | go_test( 4 | name = "go_default_test", 5 | size = "small", 6 | srcs = ["ssz_static_test.go"], 7 | data = glob(["*.yaml"]) + [ 8 | "@consensus_spec_tests_mainnet//:test_data", 9 | ], 10 | tags = ["spectest"], 11 | deps = ["//testing/spectest/shared/bellatrix/ssz_static:go_default_library"], 12 | ) 13 | -------------------------------------------------------------------------------- /tools/cross-toolchain/regenerate.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | export RBE_AUTOCONF_ROOT=$(bazel info workspace) 6 | 7 | rm -rf "${RBE_AUTOCONF_ROOT}/tools/cross-toolchain/configs/*" 8 | cp -vf "${RBE_AUTOCONF_ROOT}/tools/cross-toolchain/empty.bzl" "${RBE_AUTOCONF_ROOT}/tools/cross-toolchain/configs/versions.bzl" 9 | 10 | # Bazel query is the right command so bazel won't fail itself. 11 | bazel query "@rbe_ubuntu_clang_gen//..." 12 | -------------------------------------------------------------------------------- /network/authorization/authorization_method.go: -------------------------------------------------------------------------------- 1 | package authorization 2 | 3 | // AuthorizationMethod is an authorization method such as 'Basic' or 'Bearer'. 4 | type AuthorizationMethod uint8 5 | 6 | const ( 7 | // None represents no authorization method. 8 | None AuthorizationMethod = iota 9 | // Basic represents Basic Authentication. 10 | Basic 11 | // Bearer represents Bearer Authentication (token authentication). 12 | Bearer 13 | ) 14 | -------------------------------------------------------------------------------- /runtime/version/fork.go: -------------------------------------------------------------------------------- 1 | package version 2 | 3 | const ( 4 | Phase0 = iota 5 | Altair 6 | Bellatrix 7 | BellatrixBlind 8 | ) 9 | 10 | func String(version int) string { 11 | switch version { 12 | case Phase0: 13 | return "phase0" 14 | case Altair: 15 | return "altair" 16 | case Bellatrix: 17 | return "bellatrix" 18 | case BellatrixBlind: 19 | return "bellatrix-blind" 20 | default: 21 | return "unknown version" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /config/params/values.go: -------------------------------------------------------------------------------- 1 | package params 2 | 3 | const ( 4 | DevnetName = "devnet" 5 | EndToEndName = "end-to-end" 6 | EndToEndMainnetName = "end-to-end-mainnet" 7 | InteropName = "interop" 8 | MainnetName = "mainnet" 9 | MainnetTestName = "mainnet-test" 10 | MinimalName = "minimal" 11 | PraterName = "prater" 12 | RopstenName = "ropsten" 13 | SepoliaName = "sepolia" 14 | ) 15 | -------------------------------------------------------------------------------- /runtime/maxprocs/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("@prysm//tools/go:def.bzl", "go_library") 2 | 3 | go_library( 4 | name = "go_default_library", 5 | srcs = ["maxprocs.go"], 6 | importpath = "github.com/prysmaticlabs/prysm/runtime/maxprocs", 7 | visibility = ["//visibility:public"], 8 | deps = [ 9 | "@com_github_sirupsen_logrus//:go_default_library", 10 | "@org_uber_go_automaxprocs//maxprocs:go_default_library", 11 | ], 12 | ) 13 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/altair/random/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("@prysm//tools/go:def.bzl", "go_test") 2 | 3 | go_test( 4 | name = "go_default_test", 5 | size = "medium", 6 | timeout = "short", 7 | srcs = ["random_test.go"], 8 | data = glob(["*.yaml"]) + [ 9 | "@consensus_spec_tests_mainnet//:test_data", 10 | ], 11 | tags = ["spectest"], 12 | deps = ["//testing/spectest/shared/altair/sanity:go_default_library"], 13 | ) 14 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/phase0/random/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("@prysm//tools/go:def.bzl", "go_test") 2 | 3 | go_test( 4 | name = "go_default_test", 5 | size = "medium", 6 | timeout = "short", 7 | srcs = ["random_test.go"], 8 | data = glob(["*.yaml"]) + [ 9 | "@consensus_spec_tests_mainnet//:test_data", 10 | ], 11 | tags = ["spectest"], 12 | deps = ["//testing/spectest/shared/phase0/sanity:go_default_library"], 13 | ) 14 | -------------------------------------------------------------------------------- /tools/analyzers/README.md: -------------------------------------------------------------------------------- 1 | # Running analyzer unit tests 2 | 3 | Analyzers' unit tests are ignored in bazel's build files, and therefore are not being triggered as part of the CI 4 | pipeline. Because of this they should be invoked manually when writing a new analyzer or making changes to an existing 5 | one. Otherwise, any issues will go unnoticed during the CI build. 6 | 7 | The easiest way to run all unit tests for all analyzers is `go test ./tools/analyzers/...` -------------------------------------------------------------------------------- /crypto/bls/blst/aliases.go: -------------------------------------------------------------------------------- 1 | //go:build ((linux && amd64) || (linux && arm64) || (darwin && amd64) || (darwin && arm64) || (windows && amd64)) && !blst_disabled 2 | 3 | package blst 4 | 5 | import blst "github.com/supranational/blst/bindings/go" 6 | 7 | // Internal types for blst. 8 | type blstPublicKey = blst.P1Affine 9 | type blstSignature = blst.P2Affine 10 | type blstAggregateSignature = blst.P2Aggregate 11 | type blstAggregatePublicKey = blst.P1Aggregate 12 | -------------------------------------------------------------------------------- /hack/workspace_status.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Note: The STABLE_ prefix will force a relink when the value changes when using rules_go x_defs. 4 | 5 | echo STABLE_GIT_COMMIT "$(git rev-parse HEAD)" 6 | echo DATE "$(date --rfc-3339=seconds --utc)" 7 | echo DATE_UNIX "$(date --utc +%s)" 8 | echo DOCKER_TAG "$(git rev-parse --abbrev-ref HEAD)-$(git rev-parse --short=6 HEAD)" 9 | echo STABLE_GIT_TAG "$(git describe --tags "$(git rev-list --tags --max-count=1)")" 10 | -------------------------------------------------------------------------------- /monitoring/progress/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("@prysm//tools/go:def.bzl", "go_library") 2 | 3 | go_library( 4 | name = "go_default_library", 5 | srcs = ["progress.go"], 6 | importpath = "github.com/prysmaticlabs/prysm/monitoring/progress", 7 | visibility = ["//visibility:public"], 8 | deps = [ 9 | "@com_github_k0kubun_go_ansi//:go_default_library", 10 | "@com_github_schollz_progressbar_v3//:go_default_library", 11 | ], 12 | ) 13 | -------------------------------------------------------------------------------- /testing/spectest/minimal/altair/random/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("@prysm//tools/go:def.bzl", "go_test") 2 | 3 | go_test( 4 | name = "go_default_test", 5 | size = "small", 6 | srcs = ["random_test.go"], 7 | data = glob(["*.yaml"]) + [ 8 | "@consensus_spec_tests_minimal//:test_data", 9 | ], 10 | eth_network = "minimal", 11 | tags = ["spectest"], 12 | deps = ["//testing/spectest/shared/altair/sanity:go_default_library"], 13 | ) 14 | -------------------------------------------------------------------------------- /beacon-chain/slasher/types/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("@prysm//tools/go:def.bzl", "go_library") 2 | 3 | go_library( 4 | name = "go_default_library", 5 | srcs = ["types.go"], 6 | importpath = "github.com/prysmaticlabs/prysm/beacon-chain/slasher/types", 7 | visibility = ["//beacon-chain:__subpackages__"], 8 | deps = [ 9 | "//consensus-types/primitives:go_default_library", 10 | "//proto/prysm/v1alpha1:go_default_library", 11 | ], 12 | ) 13 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/altair/fork_helper/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("@prysm//tools/go:def.bzl", "go_test") 2 | 3 | go_test( 4 | name = "go_default_test", 5 | size = "small", 6 | srcs = ["upgrade_to_altair_test.go"], 7 | data = glob(["*.yaml"]) + [ 8 | "@consensus_spec_tests_mainnet//:test_data", 9 | ], 10 | shard_count = 4, 11 | tags = ["spectest"], 12 | deps = ["//testing/spectest/shared/altair/fork:go_default_library"], 13 | ) 14 | -------------------------------------------------------------------------------- /beacon-chain/db/kv/encoding_test.go: -------------------------------------------------------------------------------- 1 | package kv 2 | 3 | import ( 4 | "context" 5 | "testing" 6 | 7 | testpb "github.com/prysmaticlabs/prysm/proto/testing" 8 | "github.com/prysmaticlabs/prysm/testing/require" 9 | ) 10 | 11 | func Test_encode_handlesNilFromFunction(t *testing.T) { 12 | foo := func() *testpb.Puzzle { 13 | return nil 14 | } 15 | _, err := encode(context.Background(), foo()) 16 | require.ErrorContains(t, "cannot encode nil message", err) 17 | } 18 | -------------------------------------------------------------------------------- /testing/assert/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("@prysm//tools/go:def.bzl", "go_library") 2 | 3 | go_library( 4 | name = "go_default_library", 5 | testonly = True, 6 | srcs = ["assertions.go"], 7 | importpath = "github.com/prysmaticlabs/prysm/testing/assert", 8 | visibility = ["//visibility:public"], 9 | deps = [ 10 | "//testing/assertions:go_default_library", 11 | "@com_github_sirupsen_logrus//hooks/test:go_default_library", 12 | ], 13 | ) 14 | -------------------------------------------------------------------------------- /testing/require/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("@prysm//tools/go:def.bzl", "go_library") 2 | 3 | go_library( 4 | name = "go_default_library", 5 | testonly = True, 6 | srcs = ["requires.go"], 7 | importpath = "github.com/prysmaticlabs/prysm/testing/require", 8 | visibility = ["//visibility:public"], 9 | deps = [ 10 | "//testing/assertions:go_default_library", 11 | "@com_github_sirupsen_logrus//hooks/test:go_default_library", 12 | ], 13 | ) 14 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/bellatrix/fork_helper/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("@prysm//tools/go:def.bzl", "go_test") 2 | 3 | go_test( 4 | name = "go_default_test", 5 | size = "small", 6 | srcs = ["upgrade_to_altair_test.go"], 7 | data = glob(["*.yaml"]) + [ 8 | "@consensus_spec_tests_mainnet//:test_data", 9 | ], 10 | shard_count = 4, 11 | tags = ["spectest"], 12 | deps = ["//testing/spectest/shared/bellatrix/fork:go_default_library"], 13 | ) 14 | -------------------------------------------------------------------------------- /beacon-chain/state/state-native/ssz.go: -------------------------------------------------------------------------------- 1 | package state_native 2 | 3 | import ( 4 | "github.com/pkg/errors" 5 | ssz "github.com/prysmaticlabs/fastssz" 6 | ) 7 | 8 | var errAssertionFailed = errors.New("failed to convert interface to proto state") 9 | 10 | func (b *BeaconState) MarshalSSZ() ([]byte, error) { 11 | proto := b.ToProto() 12 | 13 | s, ok := proto.(ssz.Marshaler) 14 | if !ok { 15 | return nil, errAssertionFailed 16 | } 17 | return s.MarshalSSZ() 18 | } 19 | -------------------------------------------------------------------------------- /beacon-chain/rpc/prysm/v1alpha1/slasher/server.go: -------------------------------------------------------------------------------- 1 | // Package slasher defines a gRPC server implementation of a slasher service 2 | // which allows for checking if attestations or blocks are slashable. 3 | package slasher 4 | 5 | import ( 6 | slasherservice "github.com/prysmaticlabs/prysm/beacon-chain/slasher" 7 | ) 8 | 9 | // Server defines a server implementation of the gRPC slasher service. 10 | type Server struct { 11 | SlashingChecker slasherservice.SlashingChecker 12 | } 13 | -------------------------------------------------------------------------------- /beacon-chain/state/stategen/metrics.go: -------------------------------------------------------------------------------- 1 | package stategen 2 | 3 | import ( 4 | "github.com/prometheus/client_golang/prometheus" 5 | "github.com/prometheus/client_golang/prometheus/promauto" 6 | ) 7 | 8 | var ( 9 | replayBlockCount = promauto.NewHistogram( 10 | prometheus.HistogramOpts{ 11 | Name: "replay_blocks_count", 12 | Help: "The number of blocks to replay to generate a state", 13 | Buckets: []float64{64, 256, 1024, 2048, 4096}, 14 | }, 15 | ) 16 | ) 17 | -------------------------------------------------------------------------------- /runtime/version/metrics.go: -------------------------------------------------------------------------------- 1 | package version 2 | 3 | import ( 4 | "github.com/prometheus/client_golang/prometheus" 5 | "github.com/prometheus/client_golang/prometheus/promauto" 6 | ) 7 | 8 | var prysmInfo = promauto.NewGauge(prometheus.GaugeOpts{ 9 | Name: "prysm_version", 10 | ConstLabels: prometheus.Labels{ 11 | "version": gitTag, 12 | "commit": gitCommit, 13 | "buildDate": buildDateUnix}, 14 | }) 15 | 16 | func init() { 17 | prysmInfo.Set(float64(1)) 18 | } 19 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/altair/finality/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("@prysm//tools/go:def.bzl", "go_test") 2 | 3 | go_test( 4 | name = "go_default_test", 5 | size = "medium", 6 | timeout = "short", 7 | srcs = ["finality_test.go"], 8 | data = glob(["*.yaml"]) + [ 9 | "@consensus_spec_tests_mainnet//:test_data", 10 | ], 11 | shard_count = 4, 12 | tags = ["spectest"], 13 | deps = ["//testing/spectest/shared/altair/finality:go_default_library"], 14 | ) 15 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/phase0/epoch_processing/epoch_processing_test.go: -------------------------------------------------------------------------------- 1 | package epoch_processing 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/config/params" 7 | ) 8 | 9 | func TestMain(m *testing.M) { 10 | prevConfig := params.BeaconConfig().Copy() 11 | defer params.OverrideBeaconConfig(prevConfig) 12 | c := params.BeaconConfig().Copy() 13 | c.MinGenesisActiveValidatorCount = 16384 14 | params.OverrideBeaconConfig(c) 15 | 16 | m.Run() 17 | } 18 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/phase0/finality/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("@prysm//tools/go:def.bzl", "go_test") 2 | 3 | go_test( 4 | name = "go_default_test", 5 | size = "medium", 6 | timeout = "short", 7 | srcs = ["finality_test.go"], 8 | data = glob(["*.yaml"]) + [ 9 | "@consensus_spec_tests_mainnet//:test_data", 10 | ], 11 | shard_count = 4, 12 | tags = ["spectest"], 13 | deps = ["//testing/spectest/shared/phase0/finality:go_default_library"], 14 | ) 15 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/phase0/shuffling/core/shuffle/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("@prysm//tools/go:def.bzl", "go_test") 2 | 3 | go_test( 4 | name = "go_default_test", 5 | size = "medium", 6 | timeout = "short", 7 | srcs = ["shuffle_test.go"], 8 | data = glob(["*.yaml"]) + [ 9 | "@consensus_spec_tests_mainnet//:test_data", 10 | ], 11 | tags = ["spectest"], 12 | deps = ["//testing/spectest/shared/phase0/shuffling/core/shuffle:go_default_library"], 13 | ) 14 | -------------------------------------------------------------------------------- /testing/spectest/minimal/phase0/epoch_processing/epoch_processing_test.go: -------------------------------------------------------------------------------- 1 | package epoch_processing 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/config/params" 7 | ) 8 | 9 | func TestMain(m *testing.M) { 10 | prevConfig := params.BeaconConfig().Copy() 11 | defer params.OverrideBeaconConfig(prevConfig) 12 | c := params.BeaconConfig().Copy() 13 | c.MinGenesisActiveValidatorCount = 16384 14 | params.OverrideBeaconConfig(c) 15 | 16 | m.Run() 17 | } 18 | -------------------------------------------------------------------------------- /crypto/bls/blst/init.go: -------------------------------------------------------------------------------- 1 | //go:build ((linux && amd64) || (linux && arm64) || (darwin && amd64) || (darwin && arm64) || (windows && amd64)) && !blst_disabled 2 | 3 | package blst 4 | 5 | import ( 6 | "runtime" 7 | 8 | blst "github.com/supranational/blst/bindings/go" 9 | ) 10 | 11 | func init() { 12 | // Reserve 1 core for general application work 13 | maxProcs := runtime.GOMAXPROCS(0) - 1 14 | if maxProcs <= 0 { 15 | maxProcs = 1 16 | } 17 | blst.SetMaxProcs(maxProcs) 18 | } 19 | -------------------------------------------------------------------------------- /testing/endtoend/types/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("@prysm//tools/go:def.bzl", "go_library") 2 | 3 | go_library( 4 | name = "go_default_library", 5 | testonly = True, 6 | srcs = ["types.go"], 7 | importpath = "github.com/prysmaticlabs/prysm/testing/endtoend/types", 8 | visibility = ["//testing/endtoend:__subpackages__"], 9 | deps = [ 10 | "//consensus-types/primitives:go_default_library", 11 | "@org_golang_google_grpc//:go_default_library", 12 | ], 13 | ) 14 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/bellatrix/finality/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("@prysm//tools/go:def.bzl", "go_test") 2 | 3 | go_test( 4 | name = "go_default_test", 5 | size = "medium", 6 | timeout = "short", 7 | srcs = ["finality_test.go"], 8 | data = glob(["*.yaml"]) + [ 9 | "@consensus_spec_tests_mainnet//:test_data", 10 | ], 11 | shard_count = 4, 12 | tags = ["spectest"], 13 | deps = ["//testing/spectest/shared/bellatrix/finality:go_default_library"], 14 | ) 15 | -------------------------------------------------------------------------------- /time/utils.go: -------------------------------------------------------------------------------- 1 | // Package time is a wrapper around the go standard time library. 2 | package time 3 | 4 | import ( 5 | "time" 6 | ) 7 | 8 | // Since returns the duration since t. 9 | func Since(t time.Time) time.Duration { 10 | return Now().Sub(t) 11 | } 12 | 13 | // Until returns the duration until t. 14 | func Until(t time.Time) time.Duration { 15 | return t.Sub(Now()) 16 | } 17 | 18 | // Now returns the current local time. 19 | func Now() time.Time { 20 | return time.Now() 21 | } 22 | -------------------------------------------------------------------------------- /tools/analyzers/nop/analyzer_test.go: -------------------------------------------------------------------------------- 1 | package nop 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/build/bazel" 7 | "golang.org/x/tools/go/analysis/analysistest" 8 | ) 9 | 10 | func init() { 11 | if bazel.BuiltWithBazel() { 12 | bazel.SetGoEnv() 13 | } 14 | } 15 | 16 | func TestAnalyzer(t *testing.T) { 17 | testdata := bazel.TestDataPath(t) 18 | analysistest.TestData = func() string { return testdata } 19 | analysistest.Run(t, testdata, Analyzer) 20 | } 21 | -------------------------------------------------------------------------------- /beacon-chain/operations/slashings/mock/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("@prysm//tools/go:def.bzl", "go_library") 2 | 3 | go_library( 4 | name = "go_default_library", 5 | testonly = True, 6 | srcs = ["mock.go"], 7 | importpath = "github.com/prysmaticlabs/prysm/beacon-chain/operations/slashings/mock", 8 | visibility = ["//visibility:public"], 9 | deps = [ 10 | "//beacon-chain/state:go_default_library", 11 | "//proto/prysm/v1alpha1:go_default_library", 12 | ], 13 | ) 14 | -------------------------------------------------------------------------------- /tools/analyzers/ineffassign/testdata/ctx_assignment.go: -------------------------------------------------------------------------------- 1 | package testdata 2 | 3 | import ( 4 | "context" 5 | "fmt" 6 | ) 7 | 8 | // This returns the head state. 9 | // It does a full copy on head state for immutability. 10 | func headState(ctx context.Context) { 11 | ctx, span := StartSpan(ctx, "blockChain.headState") 12 | fmt.Print(span) 13 | return 14 | } 15 | 16 | // StartSpan -- 17 | func StartSpan(ctx context.Context, name string) (context.Context, int) { 18 | return ctx, 42 19 | } 20 | -------------------------------------------------------------------------------- /beacon-chain/blockchain/error_test.go: -------------------------------------------------------------------------------- 1 | package blockchain 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/pkg/errors" 7 | "github.com/prysmaticlabs/prysm/testing/require" 8 | ) 9 | 10 | func TestIsInvalidBlock(t *testing.T) { 11 | require.Equal(t, false, IsInvalidBlock(ErrInvalidPayload)) 12 | err := invalidBlock{ErrInvalidPayload} 13 | require.Equal(t, true, IsInvalidBlock(err)) 14 | 15 | newErr := errors.Wrap(err, "wrap me") 16 | require.Equal(t, true, IsInvalidBlock(newErr)) 17 | } 18 | -------------------------------------------------------------------------------- /beacon-chain/p2p/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package p2p implements the Ethereum consensus networking specification. 3 | 4 | Canonical spec reference: https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/p2p-interface.md 5 | 6 | Prysm specific implementation design docs 7 | - Networking Design Doc: https://docs.google.com/document/d/1VyhobQRkEjEkEPxmmdWvaHfKWn0j6dEae_wLZlrFtfU/view 8 | 9 | This package is heavily utilizes the libp2p go implementation by Protocol Labs. 10 | */ 11 | package p2p 12 | -------------------------------------------------------------------------------- /consensus-types/primitives/sszbytes.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | import ( 4 | fssz "github.com/prysmaticlabs/fastssz" 5 | ) 6 | 7 | // SSZBytes -- 8 | type SSZBytes []byte 9 | 10 | // HashTreeRoot -- 11 | func (b *SSZBytes) HashTreeRoot() ([32]byte, error) { 12 | return fssz.HashWithDefaultHasher(b) 13 | } 14 | 15 | // HashTreeRootWith -- 16 | func (b *SSZBytes) HashTreeRootWith(hh *fssz.Hasher) error { 17 | indx := hh.Index() 18 | hh.PutBytes(*b) 19 | hh.Merkleize(indx) 20 | return nil 21 | } 22 | -------------------------------------------------------------------------------- /container/queue/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("@prysm//tools/go:def.bzl", "go_library", "go_test") 2 | 3 | go_library( 4 | name = "go_default_library", 5 | srcs = ["priority_queue.go"], 6 | importpath = "github.com/prysmaticlabs/prysm/container/queue", 7 | visibility = ["//visibility:public"], 8 | ) 9 | 10 | go_test( 11 | name = "go_default_test", 12 | srcs = ["priority_queue_test.go"], 13 | embed = [":go_default_library"], 14 | deps = ["//testing/require:go_default_library"], 15 | ) 16 | -------------------------------------------------------------------------------- /crypto/bls/common/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("@prysm//tools/go:def.bzl", "go_library") 2 | 3 | go_library( 4 | name = "go_default_library", 5 | srcs = [ 6 | "constants.go", 7 | "error.go", 8 | "interface.go", 9 | ], 10 | importpath = "github.com/prysmaticlabs/prysm/crypto/bls/common", 11 | visibility = [ 12 | "//crypto/bls:__subpackages__", 13 | "//testing:__subpackages__", 14 | ], 15 | deps = ["//config/fieldparams:go_default_library"], 16 | ) 17 | -------------------------------------------------------------------------------- /crypto/bls/common/constants.go: -------------------------------------------------------------------------------- 1 | package common 2 | 3 | import fieldparams "github.com/prysmaticlabs/prysm/config/fieldparams" 4 | 5 | // ZeroSecretKey represents a zero secret key. 6 | var ZeroSecretKey = [32]byte{} 7 | 8 | // InfinitePublicKey represents an infinite public key (G1 Point at Infinity). 9 | var InfinitePublicKey = [fieldparams.BLSPubkeyLength]byte{0xC0} 10 | 11 | // InfiniteSignature represents an infinite signature (G2 Point at Infinity). 12 | var InfiniteSignature = [96]byte{0xC0} 13 | -------------------------------------------------------------------------------- /testing/spectest/minimal/phase0/random/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("@prysm//tools/go:def.bzl", "go_test") 2 | 3 | go_test( 4 | name = "go_default_test", 5 | size = "small", 6 | srcs = ["random_test.go"], 7 | data = glob(["*.yaml"]) + [ 8 | "@consensus_spec_tests_minimal//:test_data", 9 | ], 10 | eth_network = "minimal", 11 | tags = [ 12 | "minimal", 13 | "spectest", 14 | ], 15 | deps = ["//testing/spectest/shared/phase0/sanity:go_default_library"], 16 | ) 17 | -------------------------------------------------------------------------------- /tools/analyzers/comparesame/analyzer_test.go: -------------------------------------------------------------------------------- 1 | package comparesame 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/build/bazel" 7 | "golang.org/x/tools/go/analysis/analysistest" 8 | ) 9 | 10 | func init() { 11 | if bazel.BuiltWithBazel() { 12 | bazel.SetGoEnv() 13 | } 14 | } 15 | 16 | func TestAnalyzer(t *testing.T) { 17 | testdata := bazel.TestDataPath(t) 18 | analysistest.TestData = func() string { return testdata } 19 | analysistest.Run(t, testdata, Analyzer) 20 | } 21 | -------------------------------------------------------------------------------- /tools/analyzers/cryptorand/analyzer_test.go: -------------------------------------------------------------------------------- 1 | package cryptorand 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/build/bazel" 7 | "golang.org/x/tools/go/analysis/analysistest" 8 | ) 9 | 10 | func init() { 11 | if bazel.BuiltWithBazel() { 12 | bazel.SetGoEnv() 13 | } 14 | } 15 | 16 | func TestAnalyzer(t *testing.T) { 17 | testdata := bazel.TestDataPath(t) 18 | analysistest.TestData = func() string { return testdata } 19 | analysistest.Run(t, testdata, Analyzer) 20 | } 21 | -------------------------------------------------------------------------------- /tools/analyzers/ineffassign/analyzer_test.go: -------------------------------------------------------------------------------- 1 | package ineffassign 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/build/bazel" 7 | "golang.org/x/tools/go/analysis/analysistest" 8 | ) 9 | 10 | func init() { 11 | if bazel.BuiltWithBazel() { 12 | bazel.SetGoEnv() 13 | } 14 | } 15 | 16 | func TestAnalyzer(t *testing.T) { 17 | testdata := bazel.TestDataPath(t) 18 | analysistest.TestData = func() string { return testdata } 19 | analysistest.Run(t, testdata, Analyzer) 20 | } 21 | -------------------------------------------------------------------------------- /tools/analyzers/slicedirect/analyzer_test.go: -------------------------------------------------------------------------------- 1 | package slicedirect 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/build/bazel" 7 | "golang.org/x/tools/go/analysis/analysistest" 8 | ) 9 | 10 | func init() { 11 | if bazel.BuiltWithBazel() { 12 | bazel.SetGoEnv() 13 | } 14 | } 15 | 16 | func TestAnalyzer(t *testing.T) { 17 | testdata := bazel.TestDataPath(t) 18 | analysistest.TestData = func() string { return testdata } 19 | analysistest.Run(t, testdata, Analyzer) 20 | } 21 | -------------------------------------------------------------------------------- /beacon-chain/db/kv/kv_test.go: -------------------------------------------------------------------------------- 1 | package kv 2 | 3 | import ( 4 | "context" 5 | "testing" 6 | 7 | "github.com/prysmaticlabs/prysm/testing/require" 8 | ) 9 | 10 | // setupDB instantiates and returns a Store instance. 11 | func setupDB(t testing.TB) *Store { 12 | db, err := NewKVStore(context.Background(), t.TempDir(), &Config{}) 13 | require.NoError(t, err, "Failed to instantiate DB") 14 | t.Cleanup(func() { 15 | require.NoError(t, db.Close(), "Failed to close database") 16 | }) 17 | return db 18 | } 19 | -------------------------------------------------------------------------------- /beacon-chain/operations/attestations/mock/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("@prysm//tools/go:def.bzl", "go_library") 2 | 3 | go_library( 4 | name = "go_default_library", 5 | testonly = True, 6 | srcs = ["mock.go"], 7 | importpath = "github.com/prysmaticlabs/prysm/beacon-chain/operations/attestations/mock", 8 | visibility = ["//visibility:public"], 9 | deps = [ 10 | "//consensus-types/primitives:go_default_library", 11 | "//proto/prysm/v1alpha1:go_default_library", 12 | ], 13 | ) 14 | -------------------------------------------------------------------------------- /runtime/maxprocs/maxprocs.go: -------------------------------------------------------------------------------- 1 | // Package maxprocs automatically sets GOMAXPROCS to match the Linux 2 | // container CPU quota, if any. This will not override the environment 3 | // variable of GOMAXPROCS. 4 | package maxprocs 5 | 6 | import ( 7 | log "github.com/sirupsen/logrus" 8 | "go.uber.org/automaxprocs/maxprocs" 9 | ) 10 | 11 | // Initialize Uber maxprocs. 12 | func init() { 13 | _, err := maxprocs.Set() 14 | if err != nil { 15 | log.WithError(err).Debug("Failed to set maxprocs") 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/altair/sanity/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("@prysm//tools/go:def.bzl", "go_test") 2 | 3 | go_test( 4 | name = "go_default_test", 5 | size = "medium", 6 | timeout = "short", 7 | srcs = [ 8 | "blocks_test.go", 9 | "slots_test.go", 10 | ], 11 | data = glob(["*.yaml"]) + [ 12 | "@consensus_spec_tests_mainnet//:test_data", 13 | ], 14 | tags = ["spectest"], 15 | deps = ["//testing/spectest/shared/altair/sanity:go_default_library"], 16 | ) 17 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/phase0/sanity/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("@prysm//tools/go:def.bzl", "go_test") 2 | 3 | go_test( 4 | name = "go_default_test", 5 | size = "medium", 6 | timeout = "short", 7 | srcs = [ 8 | "blocks_test.go", 9 | "slots_test.go", 10 | ], 11 | data = glob(["*.yaml"]) + [ 12 | "@consensus_spec_tests_mainnet//:test_data", 13 | ], 14 | tags = ["spectest"], 15 | deps = ["//testing/spectest/shared/phase0/sanity:go_default_library"], 16 | ) 17 | -------------------------------------------------------------------------------- /testing/spectest/minimal/altair/rewards/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("@prysm//tools/go:def.bzl", "go_test") 2 | 3 | go_test( 4 | name = "go_default_test", 5 | size = "small", 6 | srcs = ["rewards_test.go"], 7 | data = glob(["*.yaml"]) + [ 8 | "@consensus_spec_tests_minimal//:test_data", 9 | ], 10 | eth_network = "minimal", 11 | tags = [ 12 | "minimal", 13 | "spectest", 14 | ], 15 | deps = ["//testing/spectest/shared/altair/rewards:go_default_library"], 16 | ) 17 | -------------------------------------------------------------------------------- /testing/spectest/minimal/phase0/rewards/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("@prysm//tools/go:def.bzl", "go_test") 2 | 3 | go_test( 4 | name = "go_default_test", 5 | size = "small", 6 | srcs = ["rewards_test.go"], 7 | data = glob(["*.yaml"]) + [ 8 | "@consensus_spec_tests_minimal//:test_data", 9 | ], 10 | eth_network = "minimal", 11 | tags = [ 12 | "minimal", 13 | "spectest", 14 | ], 15 | deps = ["//testing/spectest/shared/phase0/rewards:go_default_library"], 16 | ) 17 | -------------------------------------------------------------------------------- /tools/analyzers/recursivelock/analyzer_test.go: -------------------------------------------------------------------------------- 1 | package recursivelock 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/build/bazel" 7 | "golang.org/x/tools/go/analysis/analysistest" 8 | ) 9 | 10 | func init() { 11 | if bazel.BuiltWithBazel() { 12 | bazel.SetGoEnv() 13 | } 14 | } 15 | 16 | func TestAnalyzer(t *testing.T) { 17 | testdata := bazel.TestDataPath(t) 18 | analysistest.TestData = func() string { return testdata } 19 | analysistest.Run(t, testdata, Analyzer) 20 | } 21 | -------------------------------------------------------------------------------- /tools/analyzers/shadowpredecl/analyzer_test.go: -------------------------------------------------------------------------------- 1 | package shadowpredecl 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/build/bazel" 7 | "golang.org/x/tools/go/analysis/analysistest" 8 | ) 9 | 10 | func init() { 11 | if bazel.BuiltWithBazel() { 12 | bazel.SetGoEnv() 13 | } 14 | } 15 | 16 | func TestAnalyzer(t *testing.T) { 17 | testdata := bazel.TestDataPath(t) 18 | analysistest.TestData = func() string { return testdata } 19 | analysistest.Run(t, testdata, Analyzer) 20 | } 21 | -------------------------------------------------------------------------------- /beacon-chain/core/feed/block/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("@prysm//tools/go:def.bzl", "go_library") 2 | 3 | go_library( 4 | name = "go_default_library", 5 | srcs = [ 6 | "events.go", 7 | "notifier.go", 8 | ], 9 | importpath = "github.com/prysmaticlabs/prysm/beacon-chain/core/feed/block", 10 | visibility = ["//beacon-chain:__subpackages__"], 11 | deps = [ 12 | "//async/event:go_default_library", 13 | "//consensus-types/interfaces:go_default_library", 14 | ], 15 | ) 16 | -------------------------------------------------------------------------------- /beacon-chain/core/feed/operation/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("@prysm//tools/go:def.bzl", "go_library") 2 | 3 | go_library( 4 | name = "go_default_library", 5 | srcs = [ 6 | "events.go", 7 | "notifier.go", 8 | ], 9 | importpath = "github.com/prysmaticlabs/prysm/beacon-chain/core/feed/operation", 10 | visibility = ["//beacon-chain:__subpackages__"], 11 | deps = [ 12 | "//async/event:go_default_library", 13 | "//proto/prysm/v1alpha1:go_default_library", 14 | ], 15 | ) 16 | -------------------------------------------------------------------------------- /testing/spectest/mainnet/bellatrix/sanity/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("@prysm//tools/go:def.bzl", "go_test") 2 | 3 | go_test( 4 | name = "go_default_test", 5 | size = "medium", 6 | timeout = "short", 7 | srcs = [ 8 | "blocks_test.go", 9 | "slots_test.go", 10 | ], 11 | data = glob(["*.yaml"]) + [ 12 | "@consensus_spec_tests_mainnet//:test_data", 13 | ], 14 | tags = ["spectest"], 15 | deps = ["//testing/spectest/shared/bellatrix/sanity:go_default_library"], 16 | ) 17 | -------------------------------------------------------------------------------- /testing/spectest/minimal/bellatrix/rewards/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("@prysm//tools/go:def.bzl", "go_test") 2 | 3 | go_test( 4 | name = "go_default_test", 5 | size = "small", 6 | srcs = ["rewards_test.go"], 7 | data = glob(["*.yaml"]) + [ 8 | "@consensus_spec_tests_minimal//:test_data", 9 | ], 10 | eth_network = "minimal", 11 | tags = [ 12 | "minimal", 13 | "spectest", 14 | ], 15 | deps = ["//testing/spectest/shared/bellatrix/rewards:go_default_library"], 16 | ) 17 | -------------------------------------------------------------------------------- /validator/accounts/petnames/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("@prysm//tools/go:def.bzl", "go_library") 2 | 3 | go_library( 4 | name = "go_default_library", 5 | srcs = ["names.go"], 6 | importpath = "github.com/prysmaticlabs/prysm/validator/accounts/petnames", 7 | visibility = [ 8 | "//cmd/validator:__subpackages__", 9 | "//validator:__subpackages__", 10 | ], 11 | deps = [ 12 | "//crypto/hash:go_default_library", 13 | "//crypto/rand:go_default_library", 14 | ], 15 | ) 16 | -------------------------------------------------------------------------------- /validator/client/iface/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("@prysm//tools/go:def.bzl", "go_library") 2 | 3 | go_library( 4 | name = "go_default_library", 5 | srcs = ["validator.go"], 6 | importpath = "github.com/prysmaticlabs/prysm/validator/client/iface", 7 | visibility = ["//validator:__subpackages__"], 8 | deps = [ 9 | "//config/fieldparams:go_default_library", 10 | "//consensus-types/primitives:go_default_library", 11 | "//validator/keymanager:go_default_library", 12 | ], 13 | ) 14 | -------------------------------------------------------------------------------- /.golangci.yml: -------------------------------------------------------------------------------- 1 | run: 2 | skip-files: 3 | - validator/web/site_data.go 4 | - .*_test.go 5 | skip-dirs: 6 | - proto 7 | - tools/analyzers 8 | timeout: 10m 9 | go: '1.18' 10 | 11 | linters: 12 | disable-all: true 13 | enable: 14 | - deadcode 15 | - errcheck 16 | - gosimple 17 | - gocognit 18 | 19 | linters-settings: 20 | gocognit: 21 | # TODO: We should target for < 50 22 | min-complexity: 65 23 | 24 | output: 25 | print-issued-lines: true 26 | sort-results: true 27 | -------------------------------------------------------------------------------- /beacon-chain/slasher/mock/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("@prysm//tools/go:def.bzl", "go_library") 2 | 3 | go_library( 4 | name = "go_default_library", 5 | srcs = ["mock_slashing_checker.go"], 6 | importpath = "github.com/prysmaticlabs/prysm/beacon-chain/slasher/mock", 7 | visibility = ["//visibility:public"], 8 | deps = [ 9 | "//config/params:go_default_library", 10 | "//consensus-types/primitives:go_default_library", 11 | "//proto/prysm/v1alpha1:go_default_library", 12 | ], 13 | ) 14 | -------------------------------------------------------------------------------- /config/params/interop.go: -------------------------------------------------------------------------------- 1 | package params 2 | 3 | // InteropConfig provides a generic config suitable for interop testing. 4 | func InteropConfig() *BeaconChainConfig { 5 | c := MainnetConfig().Copy() 6 | 7 | // Prysm constants. 8 | c.ConfigName = InteropName 9 | c.GenesisForkVersion = []byte{0, 0, 0, 235} 10 | c.AltairForkVersion = []byte{1, 0, 0, 235} 11 | c.BellatrixForkVersion = []byte{2, 0, 0, 235} 12 | c.ShardingForkVersion = []byte{3, 0, 0, 235} 13 | 14 | c.InitializeForkSchedule() 15 | return c 16 | } 17 | -------------------------------------------------------------------------------- /crypto/bls/herumi/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("@prysm//tools/go:def.bzl", "go_library") 2 | 3 | # gazelle:resolve go github.com/herumi/bls-eth-go-binary/bls @herumi_bls_eth_go_binary//:go_default_library 4 | 5 | go_library( 6 | name = "go_default_library", 7 | srcs = ["init.go"], 8 | importpath = "github.com/prysmaticlabs/prysm/crypto/bls/herumi", 9 | visibility = [ 10 | "//crypto/bls:__pkg__", 11 | ], 12 | deps = [ 13 | "@herumi_bls_eth_go_binary//:go_default_library", 14 | ], 15 | ) 16 | -------------------------------------------------------------------------------- /testing/benchmark/pregen_test.go: -------------------------------------------------------------------------------- 1 | package benchmark 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/require" 7 | ) 8 | 9 | func TestPreGenFullBlock(t *testing.T) { 10 | _, err := PreGenFullBlock() 11 | require.NoError(t, err) 12 | } 13 | 14 | func TestPreGenState1Epoch(t *testing.T) { 15 | _, err := PreGenFullBlock() 16 | require.NoError(t, err) 17 | } 18 | 19 | func TestPreGenstateFullEpochs(t *testing.T) { 20 | _, err := PreGenFullBlock() 21 | require.NoError(t, err) 22 | } 23 | -------------------------------------------------------------------------------- /testing/bls/utils/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("@prysm//tools/go:def.bzl", "go_library") 2 | 3 | go_library( 4 | name = "go_default_library", 5 | testonly = True, 6 | srcs = ["utils.go"], 7 | importpath = "github.com/prysmaticlabs/prysm/testing/bls/utils", 8 | visibility = ["//testing/bls:__subpackages__"], 9 | deps = [ 10 | "//io/file:go_default_library", 11 | "//testing/require:go_default_library", 12 | "@io_bazel_rules_go//go/tools/bazel:go_default_library", 13 | ], 14 | ) 15 | -------------------------------------------------------------------------------- /testing/spectest/minimal/altair/ssz_static/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("@prysm//tools/go:def.bzl", "go_test") 2 | 3 | go_test( 4 | name = "go_default_test", 5 | size = "small", 6 | srcs = ["ssz_static_test.go"], 7 | data = glob(["*.yaml"]) + [ 8 | "@consensus_spec_tests_minimal//:test_data", 9 | ], 10 | eth_network = "minimal", 11 | tags = [ 12 | "minimal", 13 | "spectest", 14 | ], 15 | deps = ["//testing/spectest/shared/altair/ssz_static:go_default_library"], 16 | ) 17 | -------------------------------------------------------------------------------- /testing/spectest/minimal/phase0/ssz_static/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("@prysm//tools/go:def.bzl", "go_test") 2 | 3 | go_test( 4 | name = "go_default_test", 5 | size = "small", 6 | srcs = ["ssz_static_test.go"], 7 | data = glob(["*.yaml"]) + [ 8 | "@consensus_spec_tests_minimal//:test_data", 9 | ], 10 | eth_network = "minimal", 11 | tags = [ 12 | "minimal", 13 | "spectest", 14 | ], 15 | deps = ["//testing/spectest/shared/phase0/ssz_static:go_default_library"], 16 | ) 17 | -------------------------------------------------------------------------------- /tools/analyzers/properpermissions/analyzer_test.go: -------------------------------------------------------------------------------- 1 | package properpermissions 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/build/bazel" 7 | "golang.org/x/tools/go/analysis/analysistest" 8 | ) 9 | 10 | func init() { 11 | if bazel.BuiltWithBazel() { 12 | bazel.SetGoEnv() 13 | } 14 | } 15 | 16 | func TestAnalyzer(t *testing.T) { 17 | testdata := bazel.TestDataPath(t) 18 | analysistest.TestData = func() string { return testdata } 19 | analysistest.Run(t, testdata, Analyzer) 20 | } 21 | -------------------------------------------------------------------------------- /beacon-chain/db/slasherkv/kv_test.go: -------------------------------------------------------------------------------- 1 | package slasherkv 2 | 3 | import ( 4 | "context" 5 | "testing" 6 | 7 | "github.com/prysmaticlabs/prysm/testing/require" 8 | ) 9 | 10 | // setupDB instantiates and returns a Store instance. 11 | func setupDB(t testing.TB) *Store { 12 | db, err := NewKVStore(context.Background(), t.TempDir(), &Config{}) 13 | require.NoError(t, err, "Failed to instantiate DB") 14 | t.Cleanup(func() { 15 | require.NoError(t, db.Close(), "Failed to close database") 16 | }) 17 | return db 18 | } 19 | -------------------------------------------------------------------------------- /config/validator/service/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("@prysm//tools/go:def.bzl", "go_library") 2 | 3 | go_library( 4 | name = "go_default_library", 5 | srcs = ["proposer-settings.go"], 6 | importpath = "github.com/prysmaticlabs/prysm/config/validator/service", 7 | visibility = ["//visibility:public"], 8 | deps = [ 9 | "//config/fieldparams:go_default_library", 10 | "//config/params:go_default_library", 11 | "@com_github_ethereum_go_ethereum//common:go_default_library", 12 | ], 13 | ) 14 | -------------------------------------------------------------------------------- /network/forks/errors.go: -------------------------------------------------------------------------------- 1 | package forks 2 | 3 | import "github.com/pkg/errors" 4 | 5 | // ErrVersionNotFound indicates the config package couldn't determine the version for an epoch using the fork schedule. 6 | var ErrVersionNotFound = errors.New("could not find an entry in the fork schedule") 7 | 8 | // ErrNoPreviousVersion indicates that a version prior to the given version could not be found, because the given version 9 | // is the first one in the list 10 | var ErrNoPreviousVersion = errors.New("no previous version") 11 | -------------------------------------------------------------------------------- /testing/spectest/minimal/bellatrix/ssz_static/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("@prysm//tools/go:def.bzl", "go_test") 2 | 3 | go_test( 4 | name = "go_default_test", 5 | size = "small", 6 | srcs = ["ssz_static_test.go"], 7 | data = glob(["*.yaml"]) + [ 8 | "@consensus_spec_tests_minimal//:test_data", 9 | ], 10 | eth_network = "minimal", 11 | tags = [ 12 | "minimal", 13 | "spectest", 14 | ], 15 | deps = ["//testing/spectest/shared/bellatrix/ssz_static:go_default_library"], 16 | ) 17 | -------------------------------------------------------------------------------- /testing/util/wait_timeout.go: -------------------------------------------------------------------------------- 1 | package util 2 | 3 | import ( 4 | "sync" 5 | "time" 6 | ) 7 | 8 | // WaitTimeout will wait for a WaitGroup to resolve within a timeout interval. 9 | // Returns true if the waitgroup exceeded the timeout. 10 | func WaitTimeout(wg *sync.WaitGroup, timeout time.Duration) bool { 11 | ch := make(chan struct{}) 12 | go func() { 13 | defer close(ch) 14 | wg.Wait() 15 | }() 16 | select { 17 | case <-ch: 18 | return false 19 | case <-time.After(timeout): 20 | return true 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /.deepsource.toml: -------------------------------------------------------------------------------- 1 | version = 1 2 | 3 | exclude_patterns = [ 4 | "tools/analyzers/**", 5 | "validator/keymanager/remote/keymanager_test.go", 6 | "validator/web/site_data.go" 7 | ] 8 | 9 | [[analyzers]] 10 | name = "go" 11 | enabled = true 12 | 13 | [analyzers.meta] 14 | import_paths = ["github.com/prysmaticlabs/prysm"] 15 | 16 | [[analyzers]] 17 | name = "test-coverage" 18 | enabled = true 19 | 20 | [[analyzers]] 21 | name = "shell" 22 | enabled = true 23 | 24 | [[analyzers]] 25 | name = "secrets" 26 | enabled = true 27 | -------------------------------------------------------------------------------- /crypto/bls/herumi/init.go: -------------------------------------------------------------------------------- 1 | package herumi 2 | 3 | import "github.com/herumi/bls-eth-go-binary/bls" 4 | 5 | // HerumiInit allows the required curve orders and appropriate sub-groups to be initialized. 6 | func HerumiInit() { 7 | if err := bls.Init(bls.BLS12_381); err != nil { 8 | panic(err) 9 | } 10 | if err := bls.SetETHmode(bls.EthModeDraft07); err != nil { 11 | panic(err) 12 | } 13 | // Check subgroup order for pubkeys and signatures. 14 | bls.VerifyPublicKeyOrder(true) 15 | bls.VerifySignatureOrder(true) 16 | } 17 | -------------------------------------------------------------------------------- /beacon-chain/builder/testing/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("@prysm//tools/go:def.bzl", "go_library") 2 | 3 | go_library( 4 | name = "go_default_library", 5 | testonly = True, 6 | srcs = ["mock.go"], 7 | importpath = "github.com/prysmaticlabs/prysm/beacon-chain/builder/testing", 8 | visibility = ["//visibility:public"], 9 | deps = [ 10 | "//consensus-types/primitives:go_default_library", 11 | "//proto/engine/v1:go_default_library", 12 | "//proto/prysm/v1alpha1:go_default_library", 13 | ], 14 | ) 15 | -------------------------------------------------------------------------------- /beacon-chain/state/v1/field_roots.go: -------------------------------------------------------------------------------- 1 | package v1 2 | 3 | import ( 4 | "context" 5 | 6 | "github.com/prysmaticlabs/prysm/beacon-chain/state/stateutil" 7 | ethpb "github.com/prysmaticlabs/prysm/proto/prysm/v1alpha1" 8 | ) 9 | 10 | // computeFieldRoots returns the hash tree root computations of every field in 11 | // the beacon state as a list of 32 byte roots. 12 | func computeFieldRoots(ctx context.Context, state *ethpb.BeaconState) ([][]byte, error) { 13 | return stateutil.ComputeFieldRootsWithHasherPhase0(ctx, state) 14 | } 15 | -------------------------------------------------------------------------------- /cmd/prysmctl/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "os" 5 | 6 | "github.com/prysmaticlabs/prysm/cmd/prysmctl/checkpoint" 7 | log "github.com/sirupsen/logrus" 8 | "github.com/urfave/cli/v2" 9 | ) 10 | 11 | var prysmctlCommands []*cli.Command 12 | 13 | func main() { 14 | app := &cli.App{ 15 | Commands: prysmctlCommands, 16 | } 17 | err := app.Run(os.Args) 18 | if err != nil { 19 | log.Fatal(err) 20 | } 21 | } 22 | 23 | func init() { 24 | prysmctlCommands = append(prysmctlCommands, checkpoint.Commands...) 25 | } 26 | -------------------------------------------------------------------------------- /io/logs/stream_test.go: -------------------------------------------------------------------------------- 1 | package logs 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prysmaticlabs/prysm/testing/require" 7 | ) 8 | 9 | func TestStreamServer_BackfillsMessages(t *testing.T) { 10 | ss := NewStreamServer() 11 | msgs := [][]byte{ 12 | []byte("foo"), 13 | []byte("bar"), 14 | []byte("buzz"), 15 | } 16 | for _, msg := range msgs { 17 | _, err := ss.Write(msg) 18 | require.NoError(t, err) 19 | } 20 | 21 | recentMessages := ss.GetLastFewLogs() 22 | require.DeepEqual(t, msgs, recentMessages) 23 | } 24 | -------------------------------------------------------------------------------- /time/slots/testing/mock.go: -------------------------------------------------------------------------------- 1 | // Package testing includes useful mocks for slot tickers in unit tests. 2 | package testing 3 | 4 | import types "github.com/prysmaticlabs/prysm/consensus-types/primitives" 5 | 6 | // MockTicker defines a useful struct for mocking the Ticker interface 7 | // from the slotutil package. 8 | type MockTicker struct { 9 | Channel chan types.Slot 10 | } 11 | 12 | // C -- 13 | func (m *MockTicker) C() <-chan types.Slot { 14 | return m.Channel 15 | } 16 | 17 | // Done -- 18 | func (_ *MockTicker) Done() {} 19 | -------------------------------------------------------------------------------- /validator/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("//tools:target_migration.bzl", "moved_targets") 2 | 3 | moved_targets( 4 | [ 5 | ":push_images_debug", 6 | ":push_images_alpine", 7 | ":push_images", 8 | ":image_bundle_debug", 9 | ":image_debug", 10 | ":image_bundle_alpine", 11 | ":image_bundle", 12 | ":image_with_creation_time", 13 | ":image_alpine", 14 | ":image", 15 | ":go_default_test", 16 | ":validator", 17 | ], 18 | "//cmd/validator", 19 | ) 20 | -------------------------------------------------------------------------------- /beacon-chain/state/v2/field_roots.go: -------------------------------------------------------------------------------- 1 | package v2 2 | 3 | import ( 4 | "context" 5 | 6 | "github.com/prysmaticlabs/prysm/beacon-chain/state/stateutil" 7 | ethpb "github.com/prysmaticlabs/prysm/proto/prysm/v1alpha1" 8 | ) 9 | 10 | // computeFieldRoots returns the hash tree root computations of every field in 11 | // the beacon state as a list of 32 byte roots. 12 | func computeFieldRoots(ctx context.Context, state *ethpb.BeaconStateAltair) ([][]byte, error) { 13 | return stateutil.ComputeFieldRootsWithHasherAltair(ctx, state) 14 | } 15 | -------------------------------------------------------------------------------- /monitoring/prometheus/simple_server.go: -------------------------------------------------------------------------------- 1 | package prometheus 2 | 3 | import ( 4 | "net/http" 5 | "time" 6 | 7 | "github.com/prometheus/client_golang/prometheus/promhttp" 8 | ) 9 | 10 | // RunSimpleServerOrDie is a blocking call to serve /metrics at the given 11 | // address. 12 | func RunSimpleServerOrDie(addr string) { 13 | mux := http.NewServeMux() 14 | mux.Handle("/metrics", promhttp.Handler()) 15 | 16 | svr := &http.Server{Addr: addr, Handler: mux, ReadHeaderTimeout: time.Second} 17 | log.Fatal(svr.ListenAndServe()) 18 | } 19 | -------------------------------------------------------------------------------- /testing/spectest/minimal/altair/finality/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("@prysm//tools/go:def.bzl", "go_test") 2 | 3 | go_test( 4 | name = "go_default_test", 5 | size = "small", 6 | srcs = ["finality_test.go"], 7 | data = glob(["*.yaml"]) + [ 8 | "@consensus_spec_tests_minimal//:test_data", 9 | ], 10 | eth_network = "minimal", 11 | shard_count = 4, 12 | tags = [ 13 | "minimal", 14 | "spectest", 15 | ], 16 | deps = ["//testing/spectest/shared/altair/finality:go_default_library"], 17 | ) 18 | -------------------------------------------------------------------------------- /testing/spectest/minimal/altair/fork/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("@prysm//tools/go:def.bzl", "go_test") 2 | 3 | go_test( 4 | name = "go_default_test", 5 | size = "small", 6 | srcs = ["upgrade_to_altair_test.go"], 7 | data = glob(["*.yaml"]) + [ 8 | "@consensus_spec_tests_minimal//:test_data", 9 | ], 10 | eth_network = "minimal", 11 | shard_count = 4, 12 | tags = [ 13 | "minimal", 14 | "spectest", 15 | ], 16 | deps = ["//testing/spectest/shared/altair/fork:go_default_library"], 17 | ) 18 | -------------------------------------------------------------------------------- /testing/spectest/minimal/phase0/finality/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("@prysm//tools/go:def.bzl", "go_test") 2 | 3 | go_test( 4 | name = "go_default_test", 5 | size = "small", 6 | srcs = ["finality_test.go"], 7 | data = glob(["*.yaml"]) + [ 8 | "@consensus_spec_tests_minimal//:test_data", 9 | ], 10 | eth_network = "minimal", 11 | shard_count = 4, 12 | tags = [ 13 | "minimal", 14 | "spectest", 15 | ], 16 | deps = ["//testing/spectest/shared/phase0/finality:go_default_library"], 17 | ) 18 | -------------------------------------------------------------------------------- /testing/spectest/minimal/phase0/shuffling/core/shuffle/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("@prysm//tools/go:def.bzl", "go_test") 2 | 3 | go_test( 4 | name = "go_default_test", 5 | size = "small", 6 | srcs = ["shuffle_test.go"], 7 | data = glob(["*.yaml"]) + [ 8 | "@consensus_spec_tests_minimal//:test_data", 9 | ], 10 | eth_network = "minimal", 11 | tags = [ 12 | "minimal", 13 | "spectest", 14 | ], 15 | deps = ["//testing/spectest/shared/phase0/shuffling/core/shuffle:go_default_library"], 16 | ) 17 | -------------------------------------------------------------------------------- /beacon-chain/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("//tools:target_migration.bzl", "moved_targets") 2 | 3 | moved_targets( 4 | [ 5 | ":push_images_debug", 6 | ":push_images_alpine", 7 | ":push_images", 8 | ":image_bundle_debug", 9 | ":image_debug", 10 | ":image_bundle_alpine", 11 | ":image_bundle", 12 | ":image_with_creation_time", 13 | ":image_alpine", 14 | ":image", 15 | ":go_default_test", 16 | ":beacon-chain", 17 | ], 18 | "//cmd/beacon-chain", 19 | ) 20 | -------------------------------------------------------------------------------- /beacon-chain/state/v3/field_roots.go: -------------------------------------------------------------------------------- 1 | package v3 2 | 3 | import ( 4 | "context" 5 | 6 | "github.com/prysmaticlabs/prysm/beacon-chain/state/stateutil" 7 | ethpb "github.com/prysmaticlabs/prysm/proto/prysm/v1alpha1" 8 | ) 9 | 10 | // computeFieldRoots returns the hash tree root computations of every field in 11 | // the beacon state as a list of 32 byte roots. 12 | func computeFieldRoots(ctx context.Context, state *ethpb.BeaconStateBellatrix) ([][]byte, error) { 13 | return stateutil.ComputeFieldRootsWithHasherBellatrix(ctx, state) 14 | } 15 | -------------------------------------------------------------------------------- /crypto/bls/common/error.go: -------------------------------------------------------------------------------- 1 | package common 2 | 3 | import "errors" 4 | 5 | // ErrZeroKey describes an error due to a zero secret key. 6 | var ErrZeroKey = errors.New("received secret key is zero") 7 | 8 | // ErrSecretUnmarshal describes an error which happens during unmarshalling 9 | // a secret key. 10 | var ErrSecretUnmarshal = errors.New("could not unmarshal bytes into secret key") 11 | 12 | // ErrInfinitePubKey describes an error due to an infinite public key. 13 | var ErrInfinitePubKey = errors.New("received an infinite public key") 14 | -------------------------------------------------------------------------------- /testing/spectest/README.md: -------------------------------------------------------------------------------- 1 | # Spec Tests 2 | 3 | Spec testing vectors: https://github.com/ethereum/consensus-spec-tests 4 | 5 | To run all `mainnet` spec tests: 6 | 7 | ```bash 8 | bazel test //... --test_tag_filters=spectest 9 | ``` 10 | 11 | Minimal tests require `--define ssz=minimal` setting and are not triggered 12 | automatically when `//...` is selected. One can run minimal tests manually, though: 13 | 14 | ```bash 15 | bazel query 'tests(attr("tags", "minimal, spectest", //...))' | xargs bazel test --define ssz=minimal 16 | ``` 17 | -------------------------------------------------------------------------------- /testing/spectest/minimal/bellatrix/finality/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("@prysm//tools/go:def.bzl", "go_test") 2 | 3 | go_test( 4 | name = "go_default_test", 5 | size = "small", 6 | srcs = ["finality_test.go"], 7 | data = glob(["*.yaml"]) + [ 8 | "@consensus_spec_tests_minimal//:test_data", 9 | ], 10 | eth_network = "minimal", 11 | shard_count = 4, 12 | tags = [ 13 | "minimal", 14 | "spectest", 15 | ], 16 | deps = ["//testing/spectest/shared/bellatrix/finality:go_default_library"], 17 | ) 18 | -------------------------------------------------------------------------------- /testing/spectest/minimal/bellatrix/fork/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("@prysm//tools/go:def.bzl", "go_test") 2 | 3 | go_test( 4 | name = "go_default_test", 5 | size = "small", 6 | srcs = ["upgrade_to_altair_test.go"], 7 | data = glob(["*.yaml"]) + [ 8 | "@consensus_spec_tests_minimal//:test_data", 9 | ], 10 | eth_network = "minimal", 11 | shard_count = 4, 12 | tags = [ 13 | "minimal", 14 | "spectest", 15 | ], 16 | deps = ["//testing/spectest/shared/bellatrix/fork:go_default_library"], 17 | ) 18 | -------------------------------------------------------------------------------- /beacon-chain/state/v3/setters_payload_header.go: -------------------------------------------------------------------------------- 1 | package v3 2 | 3 | import enginev1 "github.com/prysmaticlabs/prysm/proto/engine/v1" 4 | 5 | // SetLatestExecutionPayloadHeader for the beacon state. 6 | func (b *BeaconState) SetLatestExecutionPayloadHeader(val *enginev1.ExecutionPayloadHeader) error { 7 | if !b.hasInnerState() { 8 | return ErrNilInnerState 9 | } 10 | b.lock.Lock() 11 | defer b.lock.Unlock() 12 | 13 | b.state.LatestExecutionPayloadHeader = val 14 | b.markFieldAsDirty(latestExecutionPayloadHeader) 15 | return nil 16 | } 17 | -------------------------------------------------------------------------------- /beacon-chain/sync/sync_test.go: -------------------------------------------------------------------------------- 1 | package sync 2 | 3 | import ( 4 | "io" 5 | "testing" 6 | 7 | "github.com/prysmaticlabs/prysm/cmd/beacon-chain/flags" 8 | "github.com/sirupsen/logrus" 9 | ) 10 | 11 | func TestMain(m *testing.M) { 12 | logrus.SetLevel(logrus.DebugLevel) 13 | logrus.SetOutput(io.Discard) 14 | 15 | resetFlags := flags.Get() 16 | flags.Init(&flags.GlobalFlags{ 17 | BlockBatchLimit: 64, 18 | BlockBatchLimitBurstFactor: 10, 19 | }) 20 | defer func() { 21 | flags.Init(resetFlags) 22 | }() 23 | m.Run() 24 | } 25 | -------------------------------------------------------------------------------- /tools/specs-checker/data/extra.md: -------------------------------------------------------------------------------- 1 | ```python 2 | def Sign(SK: int, message: Bytes) -> BLSSignature 3 | ``` 4 | ```python 5 | def Verify(PK: BLSPubkey, message: Bytes, signature: BLSSignature) -> bool 6 | ``` 7 | ```python 8 | def AggregateVerify(pairs: Sequence[PK: BLSPubkey, message: Bytes], signature: BLSSignature) -> bool 9 | ``` 10 | ```python 11 | def FastAggregateVerify(PKs: Sequence[BLSPubkey], message: Bytes, signature: BLSSignature) -> bool 12 | ``` 13 | ```python 14 | def Aggregate(signatures: Sequence[BLSSignature]) -> BLSSignature 15 | ``` -------------------------------------------------------------------------------- /validator/keymanager/remote-utils/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("@prysm//tools/go:def.bzl", "go_library") 2 | 3 | go_library( 4 | name = "go_default_library", 5 | srcs = ["format.go"], 6 | importpath = "github.com/prysmaticlabs/prysm/validator/keymanager/remote-utils", 7 | visibility = [ 8 | "//validator:__pkg__", 9 | "//validator:__subpackages__", 10 | ], 11 | deps = [ 12 | "//validator/accounts/petnames:go_default_library", 13 | "@com_github_logrusorgru_aurora//:go_default_library", 14 | ], 15 | ) 16 | -------------------------------------------------------------------------------- /proto/prysm/v1alpha1/metadata/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("@prysm//tools/go:def.bzl", "go_library") 2 | 3 | go_library( 4 | name = "go_default_library", 5 | srcs = ["metadata_interfaces.go"], 6 | importpath = "github.com/prysmaticlabs/prysm/proto/prysm/v1alpha1/metadata", 7 | visibility = ["//visibility:public"], 8 | deps = [ 9 | "//proto/prysm/v1alpha1:go_default_library", 10 | "@com_github_prysmaticlabs_fastssz//:go_default_library", 11 | "@com_github_prysmaticlabs_go_bitfield//:go_default_library", 12 | ], 13 | ) 14 | --------------------------------------------------------------------------------