79bb7efbf8
* Check init sync before getting payload attributes This PR adds a helper to forkchoice to return the delay of the latest imported block. It also adds a helper with an heuristic to check if the node is during init sync. If the highest imported node was imported with a delay of less than an epoch then the node is considered in regular sync. If on the other hand, in addition the highest imported node is more than two epochs old, then the node is considered in init Sync. The helper to check this only uses forkchoice and therefore requires a read lock. There are four paths to call this 1) During regular block processing, we defer a function to send the second FCU call with attributes. This function may not be called at all if we are not regularly syncing 2) During regular block processing, we check in the path `postBlockProces->getFCUArgs->computePayloadAttributes` the payload attributes if we are syncing a late block. In this case forkchoice is already locked and we add a call in `getFCUArgs` to return early if not regularly syncing 3) During handling of late blocks on `lateBlockTasks` we simply return early if not in regular sync (This is the biggest change as it takes a longer FC lock for lateBlockTasks) 4) On Attestation processing, in UpdateHead, we are already locked so we just add a check to not update head on this path if not regularly syncing. * fix build * Fix mocks |
||
---|---|---|
.github | ||
.well-known | ||
api | ||
async | ||
beacon-chain | ||
build | ||
cache | ||
cmd | ||
config | ||
consensus-types | ||
container | ||
contracts/deposit | ||
crypto | ||
encoding | ||
hack | ||
io | ||
math | ||
monitoring | ||
network | ||
proto | ||
runtime | ||
testing | ||
third_party | ||
time | ||
tools | ||
validator | ||
.bazelrc | ||
.bazelversion | ||
.buildkite-bazelrc | ||
.codecov.yml | ||
.deepsource.toml | ||
.dockerignore | ||
.gitattributes | ||
.gitignore | ||
.golangci.yml | ||
.policy.yml | ||
.travis.yml | ||
bazel.sh | ||
BUILD.bazel | ||
CONTRIBUTING.md | ||
DEPENDENCIES.md | ||
deps.bzl | ||
fuzzbuzz.yaml | ||
go.mod | ||
go.sum | ||
INTEROP.md | ||
LICENSE.md | ||
MODULE.bazel | ||
MODULE.bazel.lock | ||
nogo_config.json | ||
prysm.bat | ||
prysm.ps1 | ||
prysm.sh | ||
README.md | ||
SECURITY.md | ||
service-account.json.enc | ||
TERMS_OF_SERVICE.md | ||
WORKSPACE |
Prysm: An Ethereum Consensus Implementation Written in Go
This is the core repository for Prysm, a Golang implementation of the Ethereum Consensus specification, developed by Offchain Labs. See the Changelog for details of the latest releases and upcoming breaking changes.
Getting Started
A detailed set of installation and usage instructions as well as breakdowns of each individual component are available in the official documentation portal. If you still have questions, feel free to stop by our Discord.
Staking on Mainnet
To participate in staking, you can join the official eth2 launchpad. The launchpad is the only recommended way to become a validator on mainnet. You can explore validator rewards/penalties via Bitfly's block explorer: beaconcha.in, and follow the latest blocks added to the chain on beaconscan.
Contributing
Branches
Prysm maintains two permanent branches:
- master: This points to the latest stable release. It is ideal for most users.
- develop: This is used for development, it contains the latest PRs. Developers should base their PRs on this branch.
Guide
Want to get involved? Check out our Contribution Guide to learn more!
License
GNU General Public License v3.0