* Fix race on ReceibeBlock In the event two routines for `ReceiveBlock` are triggered with the same block (it may happen if one routine is triggered over gossip and the other in init-sync) it may happen that the second routine believes it's syncing the block for the first time. This is because the cache on `blocksBeingSynced` is not checked to be set and the block may still not be put in forkchoice by the first routine. In the normal case this would not cause any trouble as the second forkchoice insertion is a noop by design. However, if the second routine times out or has any error in processing (for example the engine will return an error if we try to send FCU to an older head) then the second routine will attempt to remove the inserted block from forkchoice and this bricks the node since forkchoice refuses to remove a valid node, the root is removed inconditionally from db and the node ends up with a root that is not in db and remains in forkchoice. This PR just prevents the race. As a followup perhaps we can gate the rollback function from db to nodes that are effectively not in forkchoice, alternatively, force removal from forkchoice when rolling back from db (although this version is complicated due to possible accounting issues on forkchoice). * Fix lint
Prysm: An Ethereum Consensus Implementation Written in Go
📖 Overview
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.
💬 Need help? Join our Discord Community for support.
🏆 Staking on Mainnet
To participate in staking, you can join the official Ethereum launchpad. The launchpad is the only recommended way to become a validator on mainnet.
🔍 Explore validator rewards/penalties:
🤝 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 and contains the latest PRs. Developers should base their PRs on this branch.
🛠 Contribution Guide
Want to get involved? Check out our Contribution Guide to learn more!
📜 License
This project is licensed under the GNU General Public License v3.0.
