mirror of
https://gitlab.com/pulsechaincom/lighthouse-pulse.git
synced 2024-12-22 11:41:28 +00:00
c25825a539
*Replaces #4434. It is identical, but this PR has a smaller diff due to a curated commit history.* ## Issue Addressed NA ## Proposed Changes This PR moves the scheduling logic for the `BeaconProcessor` into a new crate in `beacon_node/beacon_processor`. Previously it existed in the `beacon_node/network` crate. This addresses a circular-dependency problem where it's not possible to use the `BeaconProcessor` from the `beacon_chain` crate. The `network` crate depends on the `beacon_chain` crate (`network -> beacon_chain`), but importing the `BeaconProcessor` into the `beacon_chain` crate would create a circular dependancy of `beacon_chain -> network`. The `BeaconProcessor` was designed to provide queuing and prioritized scheduling for messages from the network. It has proven to be quite valuable and I believe we'd make Lighthouse more stable and effective by using it elsewhere. In particular, I think we should use the `BeaconProcessor` for: 1. HTTP API requests. 1. Scheduled tasks in the `BeaconChain` (e.g., state advance). Using the `BeaconProcessor` for these tasks would help prevent the BN from becoming overwhelmed and would also help it to prioritize operations (e.g., choosing to process blocks from gossip before responding to low-priority HTTP API requests). ## Additional Info This PR is intended to have zero impact on runtime behaviour. It aims to simply separate the *scheduling* code (i.e., the `BeaconProcessor`) from the *business logic* in the `network` crate (i.e., the `Worker` impls). Future PRs (see #4462) can build upon these works to actually use the `BeaconProcessor` for more operations. I've gone to some effort to use `git mv` to make the diff look more like "file was moved and modified" rather than "file was deleted and a new one added". This should reduce review burden and help maintain commit attribution.
44 lines
1.5 KiB
TOML
44 lines
1.5 KiB
TOML
[package]
|
|
name = "beacon_node"
|
|
version = "4.3.0"
|
|
authors = ["Paul Hauner <paul@paulhauner.com>", "Age Manning <Age@AgeManning.com"]
|
|
edition = "2021"
|
|
|
|
[lib]
|
|
name = "beacon_node"
|
|
path = "src/lib.rs"
|
|
|
|
[dev-dependencies]
|
|
node_test_rig = { path = "../testing/node_test_rig" }
|
|
|
|
[features]
|
|
write_ssz_files = ["beacon_chain/write_ssz_files"] # Writes debugging .ssz files to /tmp during block processing.
|
|
|
|
[dependencies]
|
|
eth2_config = { path = "../common/eth2_config" }
|
|
beacon_chain = { path = "beacon_chain" }
|
|
types = { path = "../consensus/types" }
|
|
store = { path = "./store" }
|
|
client = { path = "client" }
|
|
clap = "2.33.3"
|
|
slog = { version = "2.5.2", features = ["max_level_trace", "release_max_level_trace"] }
|
|
dirs = "3.0.1"
|
|
directory = {path = "../common/directory"}
|
|
futures = "0.3.7"
|
|
environment = { path = "../lighthouse/environment" }
|
|
task_executor = { path = "../common/task_executor" }
|
|
genesis = { path = "genesis" }
|
|
eth2_network_config = { path = "../common/eth2_network_config" }
|
|
execution_layer = { path = "execution_layer" }
|
|
lighthouse_network = { path = "./lighthouse_network" }
|
|
serde = "1.0.116"
|
|
clap_utils = { path = "../common/clap_utils" }
|
|
hyper = "0.14.4"
|
|
lighthouse_version = { path = "../common/lighthouse_version" }
|
|
hex = "0.4.2"
|
|
slasher = { path = "../slasher" }
|
|
monitoring_api = { path = "../common/monitoring_api" }
|
|
sensitive_url = { path = "../common/sensitive_url" }
|
|
http_api = { path = "http_api" }
|
|
unused_port = { path = "../common/unused_port" }
|
|
strum = "0.24.1" |