2021-09-29 22:14:15 +00:00
|
|
|
[package]
|
|
|
|
name = "execution_layer"
|
|
|
|
version = "0.1.0"
|
2022-02-25 00:10:17 +00:00
|
|
|
edition = "2021"
|
2021-09-29 22:14:15 +00:00
|
|
|
|
|
|
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
|
|
|
|
|
|
|
[dependencies]
|
|
|
|
types = { path = "../../consensus/types"}
|
|
|
|
tokio = { version = "1.10.0", features = ["full"] }
|
|
|
|
async-trait = "0.1.51"
|
|
|
|
slog = "2.5.2"
|
|
|
|
futures = "0.3.7"
|
|
|
|
sensitive_url = { path = "../../common/sensitive_url" }
|
|
|
|
reqwest = { version = "0.11.0", features = ["json","stream"] }
|
2021-11-29 22:32:53 +00:00
|
|
|
eth2_serde_utils = "0.1.1"
|
2021-09-29 22:14:15 +00:00
|
|
|
serde_json = "1.0.58"
|
|
|
|
serde = { version = "1.0.116", features = ["derive"] }
|
2022-04-04 00:26:16 +00:00
|
|
|
warp = { version = "0.3.2", features = ["tls"] }
|
2022-03-08 06:46:24 +00:00
|
|
|
jsonwebtoken = "8"
|
2021-09-29 22:14:15 +00:00
|
|
|
environment = { path = "../../lighthouse/environment" }
|
|
|
|
bytes = "1.1.0"
|
|
|
|
task_executor = { path = "../../common/task_executor" }
|
|
|
|
hex = "0.4.2"
|
2022-06-29 09:07:09 +00:00
|
|
|
eth2_ssz = "0.4.1"
|
2021-11-29 03:57:54 +00:00
|
|
|
eth2_ssz_types = "0.2.2"
|
2022-06-29 09:07:09 +00:00
|
|
|
eth2 = { path = "../../common/eth2" }
|
|
|
|
state_processing = { path = "../../consensus/state_processing" }
|
2021-12-22 06:17:14 +00:00
|
|
|
lru = "0.7.1"
|
2021-09-29 22:14:15 +00:00
|
|
|
exit-future = "0.2.0"
|
2021-11-29 03:57:54 +00:00
|
|
|
tree_hash = "0.4.1"
|
2021-09-29 22:14:15 +00:00
|
|
|
tree_hash_derive = { path = "../../consensus/tree_hash_derive"}
|
2022-04-04 00:26:16 +00:00
|
|
|
parking_lot = "0.12.0"
|
2021-10-06 10:21:21 +00:00
|
|
|
slot_clock = { path = "../../common/slot_clock" }
|
2022-03-08 06:46:24 +00:00
|
|
|
tempfile = "3.1.0"
|
2022-04-04 00:26:16 +00:00
|
|
|
rand = "0.8.5"
|
2022-03-08 06:46:24 +00:00
|
|
|
zeroize = { version = "1.4.2", features = ["zeroize_derive"] }
|
2022-03-09 00:42:05 +00:00
|
|
|
lighthouse_metrics = { path = "../../common/lighthouse_metrics" }
|
2022-04-01 00:58:59 +00:00
|
|
|
lazy_static = "1.4.0"
|
Separate execution payloads in the DB (#3157)
## Proposed Changes
Reduce post-merge disk usage by not storing finalized execution payloads in Lighthouse's database.
:warning: **This is achieved in a backwards-incompatible way for networks that have already merged** :warning:. Kiln users and shadow fork enjoyers will be unable to downgrade after running the code from this PR. The upgrade migration may take several minutes to run, and can't be aborted after it begins.
The main changes are:
- New column in the database called `ExecPayload`, keyed by beacon block root.
- The `BeaconBlock` column now stores blinded blocks only.
- Lots of places that previously used full blocks now use blinded blocks, e.g. analytics APIs, block replay in the DB, etc.
- On finalization:
- `prune_abanonded_forks` deletes non-canonical payloads whilst deleting non-canonical blocks.
- `migrate_db` deletes finalized canonical payloads whilst deleting finalized states.
- Conversions between blinded and full blocks are implemented in a compositional way, duplicating some work from Sean's PR #3134.
- The execution layer has a new `get_payload_by_block_hash` method that reconstructs a payload using the EE's `eth_getBlockByHash` call.
- I've tested manually that it works on Kiln, using Geth and Nethermind.
- This isn't necessarily the most efficient method, and new engine APIs are being discussed to improve this: https://github.com/ethereum/execution-apis/pull/146.
- We're depending on the `ethers` master branch, due to lots of recent changes. We're also using a workaround for https://github.com/gakonst/ethers-rs/issues/1134.
- Payload reconstruction is used in the HTTP API via `BeaconChain::get_block`, which is now `async`. Due to the `async` fn, the `blocking_json` wrapper has been removed.
- Payload reconstruction is used in network RPC to serve blocks-by-{root,range} responses. Here the `async` adjustment is messier, although I think I've managed to come up with a reasonable compromise: the handlers take the `SendOnDrop` by value so that they can drop it on _task completion_ (after the `fn` returns). Still, this is introducing disk reads onto core executor threads, which may have a negative performance impact (thoughts appreciated).
## Additional Info
- [x] For performance it would be great to remove the cloning of full blocks when converting them to blinded blocks to write to disk. I'm going to experiment with a `put_block` API that takes the block by value, breaks it into a blinded block and a payload, stores the blinded block, and then re-assembles the full block for the caller.
- [x] We should measure the latency of blocks-by-root and blocks-by-range responses.
- [x] We should add integration tests that stress the payload reconstruction (basic tests done, issue for more extensive tests: https://github.com/sigp/lighthouse/issues/3159)
- [x] We should (manually) test the schema v9 migration from several prior versions, particularly as blocks have changed on disk and some migrations rely on being able to load blocks.
Co-authored-by: Paul Hauner <paul@paulhauner.com>
2022-05-12 00:42:17 +00:00
|
|
|
ethers-core = { git = "https://github.com/gakonst/ethers-rs", rev = "02ad93a1cfb7b62eb051c77c61dc4c0218428e4a" }
|
2022-07-01 01:15:19 +00:00
|
|
|
builder_client = { path = "../builder_client" }
|
2022-07-21 05:45:37 +00:00
|
|
|
fork_choice = { path = "../../consensus/fork_choice" }
|
2022-09-08 23:46:03 +00:00
|
|
|
mev-build-rs = {git = "https://github.com/ralexstokes/mev-rs", rev = "a088806575805c00d63fa59c002abc5eb1dc7709"}
|
|
|
|
ethereum-consensus = {git = "https://github.com/ralexstokes/ethereum-consensus", rev = "e1188b1" }
|
|
|
|
ssz-rs = {git = "https://github.com/ralexstokes/ssz-rs", rev = "cb08f1" }
|
2022-08-24 23:34:56 +00:00
|
|
|
tokio-stream = { version = "0.1.9", features = [ "sync" ] }
|
2022-08-19 04:27:23 +00:00
|
|
|
strum = "0.24.0"
|