2022-11-22 18:27:48 +00:00
|
|
|
use crate::engines::ForkchoiceState;
|
2023-01-31 17:26:23 +00:00
|
|
|
use crate::http::{
|
2023-08-09 19:44:47 +00:00
|
|
|
ENGINE_FORKCHOICE_UPDATED_V1, ENGINE_FORKCHOICE_UPDATED_V2, ENGINE_FORKCHOICE_UPDATED_V3,
|
2023-07-31 23:51:39 +00:00
|
|
|
ENGINE_GET_PAYLOAD_BODIES_BY_HASH_V1, ENGINE_GET_PAYLOAD_BODIES_BY_RANGE_V1,
|
2023-08-08 06:33:32 +00:00
|
|
|
ENGINE_GET_PAYLOAD_V1, ENGINE_GET_PAYLOAD_V2, ENGINE_GET_PAYLOAD_V3, ENGINE_NEW_PAYLOAD_V1,
|
|
|
|
ENGINE_NEW_PAYLOAD_V2, ENGINE_NEW_PAYLOAD_V3,
|
2023-01-31 17:26:23 +00:00
|
|
|
};
|
2023-02-05 22:26:36 +00:00
|
|
|
use crate::BlobTxConversionError;
|
2023-08-09 19:44:47 +00:00
|
|
|
use eth2::types::{
|
|
|
|
SsePayloadAttributes, SsePayloadAttributesV1, SsePayloadAttributesV2, SsePayloadAttributesV3,
|
|
|
|
};
|
2023-06-29 19:35:43 +00:00
|
|
|
use ethers_core::types::Transaction;
|
2022-12-14 00:52:46 +00:00
|
|
|
use ethers_core::utils::rlp::{self, Decodable, Rlp};
|
2022-06-29 09:07:09 +00:00
|
|
|
use http::deposit_methods::RpcError;
|
2022-12-14 00:52:46 +00:00
|
|
|
pub use json_structures::{JsonWithdrawal, TransitionConfigurationV1};
|
Tidy formatting of `Reqwest` errors (#4336)
## Issue Addressed
NA
## Proposed Changes
Implements the `PrettyReqwestError` to wrap a `reqwest::Error` and give nicer `Debug` formatting. It also wraps the `Url` component in a `SensitiveUrl` to avoid leaking sensitive info in logs.
### Before
```
Reqwest(reqwest::Error { kind: Request, url: Url { scheme: "http", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("localhost")), port: Some(9999), path: "/eth/v1/node/version", query: None, fragment: None }, source: hyper::Error(Connect, ConnectError("tcp connect error", Os { code: 61, kind: ConnectionRefused, message: "Connection refused" })) })
```
### After
```
HttpClient(url: http://localhost:9999/, kind: request, detail: error trying to connect: tcp connect error: Connection refused (os error 61))
```
## Additional Info
I've also renamed the `Reqwest` error enum variants to `HttpClient`, to give people a better chance at knowing what's going on. Reqwest is pretty odd and looks like a typo.
I've implemented it in the `eth2` and `execution_layer` crates. This should affect most logs in the VC and EE-related ones in the BN.
I think the last crate that could benefit from the is the `beacon_node/eth1` crate. I haven't updated it in this PR since its error type is not so amenable to it (everything goes into a `String`). I don't have a whole lot of time to jig around with that at the moment and I feel that this PR as it stands is a significant enough improvement to merge on its own. Leaving it as-is is fine for the time being and we can always come back for it later (or implement in-protocol deposits!).
2023-06-27 01:06:50 +00:00
|
|
|
use pretty_reqwest_error::PrettyReqwestError;
|
2022-03-08 06:46:24 +00:00
|
|
|
use reqwest::StatusCode;
|
2021-09-29 22:14:15 +00:00
|
|
|
use serde::{Deserialize, Serialize};
|
2023-08-09 19:44:47 +00:00
|
|
|
use state_processing::per_block_processing::deneb::deneb::kzg_commitment_to_versioned_hash;
|
2022-12-14 00:52:46 +00:00
|
|
|
use std::convert::TryFrom;
|
2022-08-19 04:27:23 +00:00
|
|
|
use strum::IntoStaticStr;
|
2022-10-26 19:15:26 +00:00
|
|
|
use superstruct::superstruct;
|
2023-04-27 18:18:21 +00:00
|
|
|
use types::beacon_block_body::KzgCommitments;
|
|
|
|
use types::blob_sidecar::Blobs;
|
2022-03-31 07:52:23 +00:00
|
|
|
pub use types::{
|
2023-08-09 19:44:47 +00:00
|
|
|
Address, BeaconBlockRef, EthSpec, ExecutionBlockHash, ExecutionPayload, ExecutionPayloadHeader,
|
2023-03-19 23:15:59 +00:00
|
|
|
ExecutionPayloadRef, FixedVector, ForkName, Hash256, Transactions, Uint256, VariableList,
|
|
|
|
Withdrawal, Withdrawals,
|
2022-03-31 07:52:23 +00:00
|
|
|
};
|
2023-08-09 19:44:47 +00:00
|
|
|
use types::{
|
|
|
|
BeaconStateError, ExecutionPayloadCapella, ExecutionPayloadDeneb, ExecutionPayloadMerge,
|
|
|
|
KzgProofs, VersionedHash,
|
|
|
|
};
|
2022-02-20 21:54:35 +00:00
|
|
|
|
2022-04-05 20:55:42 +00:00
|
|
|
pub mod auth;
|
2021-09-29 22:14:15 +00:00
|
|
|
pub mod http;
|
2021-11-15 06:13:38 +00:00
|
|
|
pub mod json_structures;
|
2021-09-29 22:14:15 +00:00
|
|
|
|
2022-03-31 07:52:23 +00:00
|
|
|
pub const LATEST_TAG: &str = "latest";
|
|
|
|
|
2021-11-15 06:13:38 +00:00
|
|
|
pub type PayloadId = [u8; 8];
|
2021-09-29 22:14:15 +00:00
|
|
|
|
|
|
|
#[derive(Debug)]
|
|
|
|
pub enum Error {
|
Tidy formatting of `Reqwest` errors (#4336)
## Issue Addressed
NA
## Proposed Changes
Implements the `PrettyReqwestError` to wrap a `reqwest::Error` and give nicer `Debug` formatting. It also wraps the `Url` component in a `SensitiveUrl` to avoid leaking sensitive info in logs.
### Before
```
Reqwest(reqwest::Error { kind: Request, url: Url { scheme: "http", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("localhost")), port: Some(9999), path: "/eth/v1/node/version", query: None, fragment: None }, source: hyper::Error(Connect, ConnectError("tcp connect error", Os { code: 61, kind: ConnectionRefused, message: "Connection refused" })) })
```
### After
```
HttpClient(url: http://localhost:9999/, kind: request, detail: error trying to connect: tcp connect error: Connection refused (os error 61))
```
## Additional Info
I've also renamed the `Reqwest` error enum variants to `HttpClient`, to give people a better chance at knowing what's going on. Reqwest is pretty odd and looks like a typo.
I've implemented it in the `eth2` and `execution_layer` crates. This should affect most logs in the VC and EE-related ones in the BN.
I think the last crate that could benefit from the is the `beacon_node/eth1` crate. I haven't updated it in this PR since its error type is not so amenable to it (everything goes into a `String`). I don't have a whole lot of time to jig around with that at the moment and I feel that this PR as it stands is a significant enough improvement to merge on its own. Leaving it as-is is fine for the time being and we can always come back for it later (or implement in-protocol deposits!).
2023-06-27 01:06:50 +00:00
|
|
|
HttpClient(PrettyReqwestError),
|
2022-03-08 06:46:24 +00:00
|
|
|
Auth(auth::Error),
|
2021-09-29 22:14:15 +00:00
|
|
|
BadResponse(String),
|
|
|
|
RequestFailed(String),
|
2022-02-28 22:07:48 +00:00
|
|
|
InvalidExecutePayloadResponse(&'static str),
|
2021-09-29 22:14:15 +00:00
|
|
|
JsonRpc(RpcError),
|
|
|
|
Json(serde_json::Error),
|
2022-07-01 01:15:19 +00:00
|
|
|
ServerMessage { code: i64, message: String },
|
2021-09-29 22:14:15 +00:00
|
|
|
Eip155Failure,
|
|
|
|
IsSyncing,
|
2022-02-28 22:07:48 +00:00
|
|
|
ExecutionBlockNotFound(ExecutionBlockHash),
|
2021-09-29 22:14:15 +00:00
|
|
|
ExecutionHeadBlockNotFound,
|
2022-02-28 22:07:48 +00:00
|
|
|
ParentHashEqualsBlockHash(ExecutionBlockHash),
|
2021-11-15 06:13:38 +00:00
|
|
|
PayloadIdUnavailable,
|
2022-03-08 04:40:42 +00:00
|
|
|
TransitionConfigurationMismatch,
|
2022-03-31 07:52:23 +00:00
|
|
|
PayloadConversionLogicFlaw,
|
2023-02-05 21:55:55 +00:00
|
|
|
SszError(ssz_types::Error),
|
2022-10-26 19:15:26 +00:00
|
|
|
DeserializeWithdrawals(ssz_types::Error),
|
2022-07-01 01:15:19 +00:00
|
|
|
BuilderApi(builder_client::Error),
|
2022-10-26 19:15:26 +00:00
|
|
|
IncorrectStateVariant,
|
2022-11-22 18:27:48 +00:00
|
|
|
RequiredMethodUnsupported(&'static str),
|
|
|
|
UnsupportedForkVariant(String),
|
|
|
|
BadConversion(String),
|
2022-12-14 00:52:46 +00:00
|
|
|
RlpDecoderError(rlp::DecoderError),
|
2023-02-05 22:26:36 +00:00
|
|
|
BlobTxConversionError(BlobTxConversionError),
|
2021-09-29 22:14:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
impl From<reqwest::Error> for Error {
|
|
|
|
fn from(e: reqwest::Error) -> Self {
|
2022-03-08 06:46:24 +00:00
|
|
|
if matches!(
|
|
|
|
e.status(),
|
|
|
|
Some(StatusCode::UNAUTHORIZED) | Some(StatusCode::FORBIDDEN)
|
|
|
|
) {
|
|
|
|
Error::Auth(auth::Error::InvalidToken)
|
|
|
|
} else {
|
Tidy formatting of `Reqwest` errors (#4336)
## Issue Addressed
NA
## Proposed Changes
Implements the `PrettyReqwestError` to wrap a `reqwest::Error` and give nicer `Debug` formatting. It also wraps the `Url` component in a `SensitiveUrl` to avoid leaking sensitive info in logs.
### Before
```
Reqwest(reqwest::Error { kind: Request, url: Url { scheme: "http", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("localhost")), port: Some(9999), path: "/eth/v1/node/version", query: None, fragment: None }, source: hyper::Error(Connect, ConnectError("tcp connect error", Os { code: 61, kind: ConnectionRefused, message: "Connection refused" })) })
```
### After
```
HttpClient(url: http://localhost:9999/, kind: request, detail: error trying to connect: tcp connect error: Connection refused (os error 61))
```
## Additional Info
I've also renamed the `Reqwest` error enum variants to `HttpClient`, to give people a better chance at knowing what's going on. Reqwest is pretty odd and looks like a typo.
I've implemented it in the `eth2` and `execution_layer` crates. This should affect most logs in the VC and EE-related ones in the BN.
I think the last crate that could benefit from the is the `beacon_node/eth1` crate. I haven't updated it in this PR since its error type is not so amenable to it (everything goes into a `String`). I don't have a whole lot of time to jig around with that at the moment and I feel that this PR as it stands is a significant enough improvement to merge on its own. Leaving it as-is is fine for the time being and we can always come back for it later (or implement in-protocol deposits!).
2023-06-27 01:06:50 +00:00
|
|
|
Error::HttpClient(e.into())
|
2022-03-08 06:46:24 +00:00
|
|
|
}
|
2021-09-29 22:14:15 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl From<serde_json::Error> for Error {
|
|
|
|
fn from(e: serde_json::Error) -> Self {
|
|
|
|
Error::Json(e)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-03-08 06:46:24 +00:00
|
|
|
impl From<auth::Error> for Error {
|
|
|
|
fn from(e: auth::Error) -> Self {
|
|
|
|
Error::Auth(e)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-07-01 01:15:19 +00:00
|
|
|
impl From<builder_client::Error> for Error {
|
|
|
|
fn from(e: builder_client::Error) -> Self {
|
|
|
|
Error::BuilderApi(e)
|
|
|
|
}
|
2021-09-29 22:14:15 +00:00
|
|
|
}
|
|
|
|
|
2022-12-14 00:52:46 +00:00
|
|
|
impl From<rlp::DecoderError> for Error {
|
|
|
|
fn from(e: rlp::DecoderError) -> Self {
|
|
|
|
Error::RlpDecoderError(e)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-02-05 21:55:55 +00:00
|
|
|
impl From<ssz_types::Error> for Error {
|
|
|
|
fn from(e: ssz_types::Error) -> Self {
|
|
|
|
Error::SszError(e)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-02-05 22:26:36 +00:00
|
|
|
impl From<BlobTxConversionError> for Error {
|
|
|
|
fn from(e: BlobTxConversionError) -> Self {
|
|
|
|
Error::BlobTxConversionError(e)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-08-19 04:27:23 +00:00
|
|
|
#[derive(Clone, Copy, Debug, PartialEq, IntoStaticStr)]
|
|
|
|
#[strum(serialize_all = "snake_case")]
|
2022-02-17 21:47:06 +00:00
|
|
|
pub enum PayloadStatusV1Status {
|
2021-09-29 22:14:15 +00:00
|
|
|
Valid,
|
|
|
|
Invalid,
|
|
|
|
Syncing,
|
2022-02-17 21:47:06 +00:00
|
|
|
Accepted,
|
|
|
|
InvalidBlockHash,
|
2021-09-29 22:14:15 +00:00
|
|
|
}
|
|
|
|
|
2021-11-15 06:13:38 +00:00
|
|
|
#[derive(Clone, Debug, PartialEq)]
|
2022-02-17 21:47:06 +00:00
|
|
|
pub struct PayloadStatusV1 {
|
|
|
|
pub status: PayloadStatusV1Status,
|
2022-02-28 22:07:48 +00:00
|
|
|
pub latest_valid_hash: Option<ExecutionBlockHash>,
|
2021-12-12 09:04:21 +00:00
|
|
|
pub validation_error: Option<String>,
|
2021-09-29 22:14:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Clone, Copy, Debug, PartialEq, Serialize)]
|
|
|
|
#[serde(untagged)]
|
|
|
|
pub enum BlockByNumberQuery<'a> {
|
|
|
|
Tag(&'a str),
|
|
|
|
}
|
|
|
|
|
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
|
|
|
/// Representation of an exection block with enough detail to determine the terminal PoW block.
|
|
|
|
///
|
|
|
|
/// See `get_pow_block_hash_at_total_difficulty`.
|
2021-09-29 22:14:15 +00:00
|
|
|
#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize)]
|
|
|
|
#[serde(rename_all = "camelCase")]
|
|
|
|
pub struct ExecutionBlock {
|
2021-10-02 01:39:11 +00:00
|
|
|
#[serde(rename = "hash")]
|
2022-02-28 22:07:48 +00:00
|
|
|
pub block_hash: ExecutionBlockHash,
|
2023-04-28 01:15:40 +00:00
|
|
|
#[serde(rename = "number", with = "serde_utils::u64_hex_be")]
|
2021-09-29 22:14:15 +00:00
|
|
|
pub block_number: u64,
|
2022-02-28 22:07:48 +00:00
|
|
|
pub parent_hash: ExecutionBlockHash,
|
2021-09-29 22:14:15 +00:00
|
|
|
pub total_difficulty: Uint256,
|
2023-04-28 01:15:40 +00:00
|
|
|
#[serde(with = "serde_utils::u64_hex_be")]
|
2022-07-18 23:15:41 +00:00
|
|
|
pub timestamp: u64,
|
2021-09-29 22:14:15 +00:00
|
|
|
}
|
2021-11-15 06:13:38 +00:00
|
|
|
|
2022-10-26 19:15:26 +00:00
|
|
|
/// Representation of an execution block with enough detail to reconstruct a payload.
|
|
|
|
#[superstruct(
|
2023-03-26 15:49:16 +00:00
|
|
|
variants(Merge, Capella, Deneb),
|
2022-10-26 19:15:26 +00:00
|
|
|
variant_attributes(
|
|
|
|
derive(Clone, Debug, PartialEq, Serialize, Deserialize,),
|
|
|
|
serde(bound = "T: EthSpec", rename_all = "camelCase"),
|
|
|
|
),
|
|
|
|
cast_error(ty = "Error", expr = "Error::IncorrectStateVariant"),
|
|
|
|
partial_getter_error(ty = "Error", expr = "Error::IncorrectStateVariant")
|
|
|
|
)]
|
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
|
|
|
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
2022-10-26 19:15:26 +00:00
|
|
|
#[serde(bound = "T: EthSpec", rename_all = "camelCase", untagged)]
|
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
|
|
|
pub struct ExecutionBlockWithTransactions<T: EthSpec> {
|
|
|
|
pub parent_hash: ExecutionBlockHash,
|
|
|
|
#[serde(alias = "miner")]
|
|
|
|
pub fee_recipient: Address,
|
|
|
|
pub state_root: Hash256,
|
|
|
|
pub receipts_root: Hash256,
|
|
|
|
#[serde(with = "ssz_types::serde_utils::hex_fixed_vec")]
|
|
|
|
pub logs_bloom: FixedVector<u8, T::BytesPerLogsBloom>,
|
|
|
|
#[serde(alias = "mixHash")]
|
|
|
|
pub prev_randao: Hash256,
|
2023-04-28 01:15:40 +00:00
|
|
|
#[serde(rename = "number", with = "serde_utils::u64_hex_be")]
|
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
|
|
|
pub block_number: u64,
|
2023-04-28 01:15:40 +00:00
|
|
|
#[serde(with = "serde_utils::u64_hex_be")]
|
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
|
|
|
pub gas_limit: u64,
|
2023-04-28 01:15:40 +00:00
|
|
|
#[serde(with = "serde_utils::u64_hex_be")]
|
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
|
|
|
pub gas_used: u64,
|
2023-04-28 01:15:40 +00:00
|
|
|
#[serde(with = "serde_utils::u64_hex_be")]
|
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
|
|
|
pub timestamp: u64,
|
|
|
|
#[serde(with = "ssz_types::serde_utils::hex_var_list")]
|
|
|
|
pub extra_data: VariableList<u8, T::MaxExtraDataBytes>,
|
|
|
|
pub base_fee_per_gas: Uint256,
|
|
|
|
#[serde(rename = "hash")]
|
|
|
|
pub block_hash: ExecutionBlockHash,
|
|
|
|
pub transactions: Vec<Transaction>,
|
2023-03-26 15:49:16 +00:00
|
|
|
#[superstruct(only(Capella, Deneb))]
|
2022-12-14 00:52:46 +00:00
|
|
|
pub withdrawals: Vec<JsonWithdrawal>,
|
2023-03-26 15:49:16 +00:00
|
|
|
#[superstruct(only(Deneb))]
|
2023-06-29 19:35:43 +00:00
|
|
|
#[serde(with = "serde_utils::u64_hex_be")]
|
2023-08-09 19:44:47 +00:00
|
|
|
pub blob_gas_used: u64,
|
2023-06-29 19:35:43 +00:00
|
|
|
#[superstruct(only(Deneb))]
|
|
|
|
#[serde(with = "serde_utils::u64_hex_be")]
|
2023-08-09 19:44:47 +00:00
|
|
|
pub excess_blob_gas: u64,
|
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
|
|
|
}
|
|
|
|
|
2022-12-14 00:52:46 +00:00
|
|
|
impl<T: EthSpec> TryFrom<ExecutionPayload<T>> for ExecutionBlockWithTransactions<T> {
|
|
|
|
type Error = Error;
|
|
|
|
|
|
|
|
fn try_from(payload: ExecutionPayload<T>) -> Result<Self, Error> {
|
|
|
|
let json_payload = match payload {
|
2022-10-26 19:15:26 +00:00
|
|
|
ExecutionPayload::Merge(block) => Self::Merge(ExecutionBlockWithTransactionsMerge {
|
|
|
|
parent_hash: block.parent_hash,
|
|
|
|
fee_recipient: block.fee_recipient,
|
|
|
|
state_root: block.state_root,
|
|
|
|
receipts_root: block.receipts_root,
|
|
|
|
logs_bloom: block.logs_bloom,
|
|
|
|
prev_randao: block.prev_randao,
|
|
|
|
block_number: block.block_number,
|
|
|
|
gas_limit: block.gas_limit,
|
|
|
|
gas_used: block.gas_used,
|
|
|
|
timestamp: block.timestamp,
|
|
|
|
extra_data: block.extra_data,
|
|
|
|
base_fee_per_gas: block.base_fee_per_gas,
|
|
|
|
block_hash: block.block_hash,
|
|
|
|
transactions: block
|
|
|
|
.transactions
|
|
|
|
.iter()
|
|
|
|
.map(|tx| Transaction::decode(&Rlp::new(tx)))
|
2022-12-14 00:52:46 +00:00
|
|
|
.collect::<Result<Vec<_>, _>>()?,
|
2022-10-26 19:15:26 +00:00
|
|
|
}),
|
|
|
|
ExecutionPayload::Capella(block) => {
|
|
|
|
Self::Capella(ExecutionBlockWithTransactionsCapella {
|
|
|
|
parent_hash: block.parent_hash,
|
|
|
|
fee_recipient: block.fee_recipient,
|
|
|
|
state_root: block.state_root,
|
|
|
|
receipts_root: block.receipts_root,
|
|
|
|
logs_bloom: block.logs_bloom,
|
|
|
|
prev_randao: block.prev_randao,
|
|
|
|
block_number: block.block_number,
|
|
|
|
gas_limit: block.gas_limit,
|
|
|
|
gas_used: block.gas_used,
|
|
|
|
timestamp: block.timestamp,
|
|
|
|
extra_data: block.extra_data,
|
|
|
|
base_fee_per_gas: block.base_fee_per_gas,
|
|
|
|
block_hash: block.block_hash,
|
|
|
|
transactions: block
|
|
|
|
.transactions
|
|
|
|
.iter()
|
|
|
|
.map(|tx| Transaction::decode(&Rlp::new(tx)))
|
2022-12-14 00:52:46 +00:00
|
|
|
.collect::<Result<Vec<_>, _>>()?,
|
|
|
|
withdrawals: Vec::from(block.withdrawals)
|
|
|
|
.into_iter()
|
|
|
|
.map(|withdrawal| withdrawal.into())
|
|
|
|
.collect(),
|
2022-10-26 19:15:26 +00:00
|
|
|
})
|
|
|
|
}
|
2023-03-26 15:49:16 +00:00
|
|
|
ExecutionPayload::Deneb(block) => Self::Deneb(ExecutionBlockWithTransactionsDeneb {
|
|
|
|
parent_hash: block.parent_hash,
|
|
|
|
fee_recipient: block.fee_recipient,
|
|
|
|
state_root: block.state_root,
|
|
|
|
receipts_root: block.receipts_root,
|
|
|
|
logs_bloom: block.logs_bloom,
|
|
|
|
prev_randao: block.prev_randao,
|
|
|
|
block_number: block.block_number,
|
|
|
|
gas_limit: block.gas_limit,
|
|
|
|
gas_used: block.gas_used,
|
|
|
|
timestamp: block.timestamp,
|
|
|
|
extra_data: block.extra_data,
|
|
|
|
base_fee_per_gas: block.base_fee_per_gas,
|
|
|
|
block_hash: block.block_hash,
|
|
|
|
transactions: block
|
|
|
|
.transactions
|
|
|
|
.iter()
|
|
|
|
.map(|tx| Transaction::decode(&Rlp::new(tx)))
|
|
|
|
.collect::<Result<Vec<_>, _>>()?,
|
|
|
|
withdrawals: Vec::from(block.withdrawals)
|
|
|
|
.into_iter()
|
|
|
|
.map(|withdrawal| withdrawal.into())
|
|
|
|
.collect(),
|
2023-08-09 19:44:47 +00:00
|
|
|
blob_gas_used: block.blob_gas_used,
|
|
|
|
excess_blob_gas: block.excess_blob_gas,
|
2023-03-26 15:49:16 +00:00
|
|
|
}),
|
2022-12-14 00:52:46 +00:00
|
|
|
};
|
|
|
|
Ok(json_payload)
|
2022-10-26 19:15:26 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#[superstruct(
|
2023-08-09 19:44:47 +00:00
|
|
|
variants(V1, V2, V3),
|
2022-11-30 00:01:47 +00:00
|
|
|
variant_attributes(derive(Clone, Debug, Eq, Hash, PartialEq),),
|
2022-10-26 19:15:26 +00:00
|
|
|
cast_error(ty = "Error", expr = "Error::IncorrectStateVariant"),
|
|
|
|
partial_getter_error(ty = "Error", expr = "Error::IncorrectStateVariant")
|
|
|
|
)]
|
2022-11-30 00:01:47 +00:00
|
|
|
#[derive(Clone, Debug, Eq, Hash, PartialEq)]
|
2021-11-15 06:13:38 +00:00
|
|
|
pub struct PayloadAttributes {
|
2022-10-26 19:15:26 +00:00
|
|
|
#[superstruct(getter(copy))]
|
2021-11-15 06:13:38 +00:00
|
|
|
pub timestamp: u64,
|
2022-10-26 19:15:26 +00:00
|
|
|
#[superstruct(getter(copy))]
|
2022-03-03 02:10:57 +00:00
|
|
|
pub prev_randao: Hash256,
|
2022-10-26 19:15:26 +00:00
|
|
|
#[superstruct(getter(copy))]
|
2021-12-12 09:04:21 +00:00
|
|
|
pub suggested_fee_recipient: Address,
|
2023-08-09 19:44:47 +00:00
|
|
|
#[superstruct(only(V2, V3))]
|
2023-01-19 14:32:08 +00:00
|
|
|
pub withdrawals: Vec<Withdrawal>,
|
2023-08-09 19:44:47 +00:00
|
|
|
#[superstruct(only(V3), partial_getter(copy))]
|
|
|
|
pub parent_beacon_block_root: Hash256,
|
2022-11-22 18:27:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
impl PayloadAttributes {
|
2022-11-30 00:01:47 +00:00
|
|
|
pub fn new(
|
|
|
|
timestamp: u64,
|
|
|
|
prev_randao: Hash256,
|
|
|
|
suggested_fee_recipient: Address,
|
|
|
|
withdrawals: Option<Vec<Withdrawal>>,
|
2023-08-09 19:44:47 +00:00
|
|
|
parent_beacon_block_root: Option<Hash256>,
|
2022-11-30 00:01:47 +00:00
|
|
|
) -> Self {
|
2023-01-19 14:32:08 +00:00
|
|
|
match withdrawals {
|
2023-08-09 19:44:47 +00:00
|
|
|
Some(withdrawals) => match parent_beacon_block_root {
|
|
|
|
Some(parent_beacon_block_root) => PayloadAttributes::V3(PayloadAttributesV3 {
|
|
|
|
timestamp,
|
|
|
|
prev_randao,
|
|
|
|
suggested_fee_recipient,
|
|
|
|
withdrawals,
|
|
|
|
parent_beacon_block_root,
|
|
|
|
}),
|
|
|
|
None => PayloadAttributes::V2(PayloadAttributesV2 {
|
|
|
|
timestamp,
|
|
|
|
prev_randao,
|
|
|
|
suggested_fee_recipient,
|
|
|
|
withdrawals,
|
|
|
|
}),
|
|
|
|
},
|
2023-01-19 14:32:08 +00:00
|
|
|
None => PayloadAttributes::V1(PayloadAttributesV1 {
|
|
|
|
timestamp,
|
|
|
|
prev_randao,
|
|
|
|
suggested_fee_recipient,
|
|
|
|
}),
|
2022-11-22 18:27:48 +00:00
|
|
|
}
|
|
|
|
}
|
2021-11-15 06:13:38 +00:00
|
|
|
}
|
|
|
|
|
2023-03-05 23:43:30 +00:00
|
|
|
impl From<PayloadAttributes> for SsePayloadAttributes {
|
|
|
|
fn from(pa: PayloadAttributes) -> Self {
|
|
|
|
match pa {
|
|
|
|
PayloadAttributes::V1(PayloadAttributesV1 {
|
|
|
|
timestamp,
|
|
|
|
prev_randao,
|
|
|
|
suggested_fee_recipient,
|
|
|
|
}) => Self::V1(SsePayloadAttributesV1 {
|
|
|
|
timestamp,
|
|
|
|
prev_randao,
|
|
|
|
suggested_fee_recipient,
|
|
|
|
}),
|
|
|
|
PayloadAttributes::V2(PayloadAttributesV2 {
|
|
|
|
timestamp,
|
|
|
|
prev_randao,
|
|
|
|
suggested_fee_recipient,
|
|
|
|
withdrawals,
|
|
|
|
}) => Self::V2(SsePayloadAttributesV2 {
|
|
|
|
timestamp,
|
|
|
|
prev_randao,
|
|
|
|
suggested_fee_recipient,
|
|
|
|
withdrawals,
|
|
|
|
}),
|
2023-08-09 19:44:47 +00:00
|
|
|
PayloadAttributes::V3(PayloadAttributesV3 {
|
|
|
|
timestamp,
|
|
|
|
prev_randao,
|
|
|
|
suggested_fee_recipient,
|
|
|
|
withdrawals,
|
|
|
|
parent_beacon_block_root,
|
|
|
|
}) => Self::V3(SsePayloadAttributesV3 {
|
|
|
|
timestamp,
|
|
|
|
prev_randao,
|
|
|
|
suggested_fee_recipient,
|
|
|
|
withdrawals,
|
|
|
|
parent_beacon_block_root,
|
|
|
|
}),
|
2023-03-05 23:43:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-11-15 06:13:38 +00:00
|
|
|
#[derive(Clone, Debug, PartialEq)]
|
|
|
|
pub struct ForkchoiceUpdatedResponse {
|
2022-02-17 21:47:06 +00:00
|
|
|
pub payload_status: PayloadStatusV1,
|
2021-11-15 06:13:38 +00:00
|
|
|
pub payload_id: Option<PayloadId>,
|
|
|
|
}
|
2022-03-31 07:52:23 +00:00
|
|
|
|
|
|
|
#[derive(Clone, Copy, Debug, PartialEq)]
|
|
|
|
pub enum ProposeBlindedBlockResponseStatus {
|
|
|
|
Valid,
|
|
|
|
Invalid,
|
|
|
|
Syncing,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Clone, Debug, PartialEq)]
|
|
|
|
pub struct ProposeBlindedBlockResponse {
|
|
|
|
pub status: ProposeBlindedBlockResponseStatus,
|
|
|
|
pub latest_valid_hash: Option<Hash256>,
|
|
|
|
pub validation_error: Option<String>,
|
|
|
|
}
|
2022-11-22 18:27:48 +00:00
|
|
|
|
2023-01-19 14:32:08 +00:00
|
|
|
#[superstruct(
|
2023-03-26 15:49:16 +00:00
|
|
|
variants(Merge, Capella, Deneb),
|
2023-01-19 14:32:08 +00:00
|
|
|
variant_attributes(derive(Clone, Debug, PartialEq),),
|
2023-02-02 01:37:46 +00:00
|
|
|
map_into(ExecutionPayload),
|
|
|
|
map_ref_into(ExecutionPayloadRef),
|
2023-01-19 14:32:08 +00:00
|
|
|
cast_error(ty = "Error", expr = "Error::IncorrectStateVariant"),
|
|
|
|
partial_getter_error(ty = "Error", expr = "Error::IncorrectStateVariant")
|
|
|
|
)]
|
|
|
|
#[derive(Clone, Debug, PartialEq)]
|
|
|
|
pub struct GetPayloadResponse<T: EthSpec> {
|
|
|
|
#[superstruct(only(Merge), partial_getter(rename = "execution_payload_merge"))]
|
|
|
|
pub execution_payload: ExecutionPayloadMerge<T>,
|
|
|
|
#[superstruct(only(Capella), partial_getter(rename = "execution_payload_capella"))]
|
|
|
|
pub execution_payload: ExecutionPayloadCapella<T>,
|
2023-03-26 15:49:16 +00:00
|
|
|
#[superstruct(only(Deneb), partial_getter(rename = "execution_payload_deneb"))]
|
|
|
|
pub execution_payload: ExecutionPayloadDeneb<T>,
|
2023-01-19 14:32:08 +00:00
|
|
|
pub block_value: Uint256,
|
2023-04-27 18:18:21 +00:00
|
|
|
#[superstruct(only(Deneb))]
|
|
|
|
pub blobs_bundle: BlobsBundleV1<T>,
|
2023-08-09 19:44:47 +00:00
|
|
|
#[superstruct(only(Deneb), partial_getter(copy))]
|
|
|
|
pub should_override_builder: bool,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<E: EthSpec> GetPayloadResponse<E> {
|
|
|
|
pub fn fee_recipient(&self) -> Address {
|
|
|
|
ExecutionPayloadRef::from(self.to_ref()).fee_recipient()
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn block_hash(&self) -> ExecutionBlockHash {
|
|
|
|
ExecutionPayloadRef::from(self.to_ref()).block_hash()
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn block_number(&self) -> u64 {
|
|
|
|
ExecutionPayloadRef::from(self.to_ref()).block_number()
|
|
|
|
}
|
2023-01-19 14:32:08 +00:00
|
|
|
}
|
|
|
|
|
2023-02-02 01:37:46 +00:00
|
|
|
impl<'a, T: EthSpec> From<GetPayloadResponseRef<'a, T>> for ExecutionPayloadRef<'a, T> {
|
|
|
|
fn from(response: GetPayloadResponseRef<'a, T>) -> Self {
|
|
|
|
map_get_payload_response_ref_into_execution_payload_ref!(&'a _, response, |inner, cons| {
|
|
|
|
cons(&inner.execution_payload)
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<T: EthSpec> From<GetPayloadResponse<T>> for ExecutionPayload<T> {
|
|
|
|
fn from(response: GetPayloadResponse<T>) -> Self {
|
|
|
|
map_get_payload_response_into_execution_payload!(response, |inner, cons| {
|
|
|
|
cons(inner.execution_payload)
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-04-27 18:18:21 +00:00
|
|
|
impl<T: EthSpec> From<GetPayloadResponse<T>>
|
|
|
|
for (ExecutionPayload<T>, Uint256, Option<BlobsBundleV1<T>>)
|
|
|
|
{
|
2023-02-02 01:37:46 +00:00
|
|
|
fn from(response: GetPayloadResponse<T>) -> Self {
|
|
|
|
match response {
|
|
|
|
GetPayloadResponse::Merge(inner) => (
|
|
|
|
ExecutionPayload::Merge(inner.execution_payload),
|
|
|
|
inner.block_value,
|
2023-04-27 18:18:21 +00:00
|
|
|
None,
|
2023-02-02 01:37:46 +00:00
|
|
|
),
|
|
|
|
GetPayloadResponse::Capella(inner) => (
|
|
|
|
ExecutionPayload::Capella(inner.execution_payload),
|
|
|
|
inner.block_value,
|
2023-04-27 18:18:21 +00:00
|
|
|
None,
|
2023-02-02 01:37:46 +00:00
|
|
|
),
|
2023-03-26 15:49:16 +00:00
|
|
|
GetPayloadResponse::Deneb(inner) => (
|
|
|
|
ExecutionPayload::Deneb(inner.execution_payload),
|
2023-02-02 01:37:46 +00:00
|
|
|
inner.block_value,
|
2023-04-27 18:18:21 +00:00
|
|
|
Some(inner.blobs_bundle),
|
2023-02-02 01:37:46 +00:00
|
|
|
),
|
2023-01-19 14:32:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-02-02 01:37:46 +00:00
|
|
|
impl<T: EthSpec> GetPayloadResponse<T> {
|
|
|
|
pub fn execution_payload_ref(&self) -> ExecutionPayloadRef<T> {
|
|
|
|
self.to_ref().into()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-03-19 23:15:59 +00:00
|
|
|
#[derive(Clone, Debug)]
|
|
|
|
pub struct ExecutionPayloadBodyV1<E: EthSpec> {
|
|
|
|
pub transactions: Transactions<E>,
|
|
|
|
pub withdrawals: Option<Withdrawals<E>>,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<E: EthSpec> ExecutionPayloadBodyV1<E> {
|
|
|
|
pub fn to_payload(
|
|
|
|
self,
|
|
|
|
header: ExecutionPayloadHeader<E>,
|
|
|
|
) -> Result<ExecutionPayload<E>, String> {
|
|
|
|
match header {
|
|
|
|
ExecutionPayloadHeader::Merge(header) => {
|
|
|
|
if self.withdrawals.is_some() {
|
|
|
|
return Err(format!(
|
|
|
|
"block {} is merge but payload body has withdrawals",
|
|
|
|
header.block_hash
|
|
|
|
));
|
|
|
|
}
|
|
|
|
Ok(ExecutionPayload::Merge(ExecutionPayloadMerge {
|
|
|
|
parent_hash: header.parent_hash,
|
|
|
|
fee_recipient: header.fee_recipient,
|
|
|
|
state_root: header.state_root,
|
|
|
|
receipts_root: header.receipts_root,
|
|
|
|
logs_bloom: header.logs_bloom,
|
|
|
|
prev_randao: header.prev_randao,
|
|
|
|
block_number: header.block_number,
|
|
|
|
gas_limit: header.gas_limit,
|
|
|
|
gas_used: header.gas_used,
|
|
|
|
timestamp: header.timestamp,
|
|
|
|
extra_data: header.extra_data,
|
|
|
|
base_fee_per_gas: header.base_fee_per_gas,
|
|
|
|
block_hash: header.block_hash,
|
|
|
|
transactions: self.transactions,
|
|
|
|
}))
|
|
|
|
}
|
|
|
|
ExecutionPayloadHeader::Capella(header) => {
|
|
|
|
if let Some(withdrawals) = self.withdrawals {
|
|
|
|
Ok(ExecutionPayload::Capella(ExecutionPayloadCapella {
|
|
|
|
parent_hash: header.parent_hash,
|
|
|
|
fee_recipient: header.fee_recipient,
|
|
|
|
state_root: header.state_root,
|
|
|
|
receipts_root: header.receipts_root,
|
|
|
|
logs_bloom: header.logs_bloom,
|
|
|
|
prev_randao: header.prev_randao,
|
|
|
|
block_number: header.block_number,
|
|
|
|
gas_limit: header.gas_limit,
|
|
|
|
gas_used: header.gas_used,
|
|
|
|
timestamp: header.timestamp,
|
|
|
|
extra_data: header.extra_data,
|
|
|
|
base_fee_per_gas: header.base_fee_per_gas,
|
|
|
|
block_hash: header.block_hash,
|
|
|
|
transactions: self.transactions,
|
|
|
|
withdrawals,
|
|
|
|
}))
|
|
|
|
} else {
|
|
|
|
Err(format!(
|
|
|
|
"block {} is capella but payload body doesn't have withdrawals",
|
|
|
|
header.block_hash
|
|
|
|
))
|
|
|
|
}
|
|
|
|
}
|
2023-03-26 15:49:16 +00:00
|
|
|
ExecutionPayloadHeader::Deneb(header) => {
|
2023-03-24 18:24:21 +00:00
|
|
|
if let Some(withdrawals) = self.withdrawals {
|
2023-03-26 15:49:16 +00:00
|
|
|
Ok(ExecutionPayload::Deneb(ExecutionPayloadDeneb {
|
2023-03-24 18:24:21 +00:00
|
|
|
parent_hash: header.parent_hash,
|
|
|
|
fee_recipient: header.fee_recipient,
|
|
|
|
state_root: header.state_root,
|
|
|
|
receipts_root: header.receipts_root,
|
|
|
|
logs_bloom: header.logs_bloom,
|
|
|
|
prev_randao: header.prev_randao,
|
|
|
|
block_number: header.block_number,
|
|
|
|
gas_limit: header.gas_limit,
|
|
|
|
gas_used: header.gas_used,
|
|
|
|
timestamp: header.timestamp,
|
|
|
|
extra_data: header.extra_data,
|
|
|
|
base_fee_per_gas: header.base_fee_per_gas,
|
|
|
|
block_hash: header.block_hash,
|
|
|
|
transactions: self.transactions,
|
|
|
|
withdrawals,
|
2023-08-09 19:44:47 +00:00
|
|
|
blob_gas_used: header.blob_gas_used,
|
|
|
|
excess_blob_gas: header.excess_blob_gas,
|
2023-03-24 18:24:21 +00:00
|
|
|
}))
|
|
|
|
} else {
|
|
|
|
Err(format!(
|
|
|
|
"block {} is post capella but payload body doesn't have withdrawals",
|
|
|
|
header.block_hash
|
|
|
|
))
|
|
|
|
}
|
|
|
|
}
|
2023-03-19 23:15:59 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-04-27 18:18:21 +00:00
|
|
|
#[derive(Clone, Default, Debug, PartialEq)]
|
|
|
|
pub struct BlobsBundleV1<E: EthSpec> {
|
|
|
|
pub commitments: KzgCommitments<E>,
|
|
|
|
pub proofs: KzgProofs<E>,
|
|
|
|
pub blobs: Blobs<E>,
|
|
|
|
}
|
|
|
|
|
2023-08-09 19:44:47 +00:00
|
|
|
#[superstruct(
|
|
|
|
variants(Merge, Capella, Deneb),
|
|
|
|
variant_attributes(derive(Clone, Debug, PartialEq),),
|
|
|
|
map_into(ExecutionPayload),
|
|
|
|
map_ref_into(ExecutionPayloadRef),
|
|
|
|
cast_error(
|
|
|
|
ty = "BeaconStateError",
|
|
|
|
expr = "BeaconStateError::IncorrectStateVariant"
|
|
|
|
),
|
|
|
|
partial_getter_error(
|
|
|
|
ty = "BeaconStateError",
|
|
|
|
expr = "BeaconStateError::IncorrectStateVariant"
|
|
|
|
)
|
|
|
|
)]
|
|
|
|
#[derive(Clone, Debug, PartialEq)]
|
|
|
|
pub struct NewPayloadRequest<E: EthSpec> {
|
|
|
|
#[superstruct(only(Merge), partial_getter(rename = "execution_payload_merge"))]
|
|
|
|
pub execution_payload: ExecutionPayloadMerge<E>,
|
|
|
|
#[superstruct(only(Capella), partial_getter(rename = "execution_payload_capella"))]
|
|
|
|
pub execution_payload: ExecutionPayloadCapella<E>,
|
|
|
|
#[superstruct(only(Deneb), partial_getter(rename = "execution_payload_deneb"))]
|
|
|
|
pub execution_payload: ExecutionPayloadDeneb<E>,
|
|
|
|
#[superstruct(only(Deneb))]
|
|
|
|
pub versioned_hashes: Vec<VersionedHash>,
|
|
|
|
#[superstruct(only(Deneb))]
|
|
|
|
pub parent_beacon_block_root: Hash256,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<E: EthSpec> NewPayloadRequest<E> {
|
|
|
|
pub fn parent_hash(&self) -> ExecutionBlockHash {
|
|
|
|
match self {
|
|
|
|
Self::Merge(payload) => payload.execution_payload.parent_hash,
|
|
|
|
Self::Capella(payload) => payload.execution_payload.parent_hash,
|
|
|
|
Self::Deneb(payload) => payload.execution_payload.parent_hash,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn block_hash(&self) -> ExecutionBlockHash {
|
|
|
|
match self {
|
|
|
|
Self::Merge(payload) => payload.execution_payload.block_hash,
|
|
|
|
Self::Capella(payload) => payload.execution_payload.block_hash,
|
|
|
|
Self::Deneb(payload) => payload.execution_payload.block_hash,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn block_number(&self) -> u64 {
|
|
|
|
match self {
|
|
|
|
Self::Merge(payload) => payload.execution_payload.block_number,
|
|
|
|
Self::Capella(payload) => payload.execution_payload.block_number,
|
|
|
|
Self::Deneb(payload) => payload.execution_payload.block_number,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn into_execution_payload(self) -> ExecutionPayload<E> {
|
|
|
|
map_new_payload_request_into_execution_payload!(self, |request, cons| {
|
|
|
|
cons(request.execution_payload)
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<'a, E: EthSpec> TryFrom<BeaconBlockRef<'a, E>> for NewPayloadRequest<E> {
|
|
|
|
type Error = BeaconStateError;
|
|
|
|
|
|
|
|
fn try_from(block: BeaconBlockRef<'a, E>) -> Result<Self, Self::Error> {
|
|
|
|
match block {
|
|
|
|
BeaconBlockRef::Base(_) | BeaconBlockRef::Altair(_) => {
|
|
|
|
Err(Self::Error::IncorrectStateVariant)
|
|
|
|
}
|
|
|
|
BeaconBlockRef::Merge(block_ref) => Ok(Self::Merge(NewPayloadRequestMerge {
|
|
|
|
execution_payload: block_ref.body.execution_payload.execution_payload.clone(),
|
|
|
|
})),
|
|
|
|
BeaconBlockRef::Capella(block_ref) => Ok(Self::Capella(NewPayloadRequestCapella {
|
|
|
|
execution_payload: block_ref.body.execution_payload.execution_payload.clone(),
|
|
|
|
})),
|
|
|
|
BeaconBlockRef::Deneb(block_ref) => Ok(Self::Deneb(NewPayloadRequestDeneb {
|
|
|
|
execution_payload: block_ref.body.execution_payload.execution_payload.clone(),
|
|
|
|
versioned_hashes: block_ref
|
|
|
|
.body
|
|
|
|
.blob_kzg_commitments
|
|
|
|
.iter()
|
|
|
|
.map(kzg_commitment_to_versioned_hash)
|
|
|
|
.collect(),
|
|
|
|
parent_beacon_block_root: block_ref.parent_root,
|
|
|
|
})),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<E: EthSpec> TryFrom<ExecutionPayload<E>> for NewPayloadRequest<E> {
|
|
|
|
type Error = BeaconStateError;
|
|
|
|
|
|
|
|
fn try_from(payload: ExecutionPayload<E>) -> Result<Self, Self::Error> {
|
|
|
|
match payload {
|
|
|
|
ExecutionPayload::Merge(payload) => Ok(Self::Merge(NewPayloadRequestMerge {
|
|
|
|
execution_payload: payload,
|
|
|
|
})),
|
|
|
|
ExecutionPayload::Capella(payload) => Ok(Self::Capella(NewPayloadRequestCapella {
|
|
|
|
execution_payload: payload,
|
|
|
|
})),
|
|
|
|
ExecutionPayload::Deneb(_) => Err(Self::Error::IncorrectStateVariant),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-01-12 04:15:08 +00:00
|
|
|
#[derive(Clone, Copy, Debug)]
|
2023-01-31 17:26:23 +00:00
|
|
|
pub struct EngineCapabilities {
|
2022-11-22 18:27:48 +00:00
|
|
|
pub new_payload_v1: bool,
|
|
|
|
pub new_payload_v2: bool,
|
2023-01-19 14:32:08 +00:00
|
|
|
pub new_payload_v3: bool,
|
2022-11-22 18:27:48 +00:00
|
|
|
pub forkchoice_updated_v1: bool,
|
|
|
|
pub forkchoice_updated_v2: bool,
|
2023-08-09 19:44:47 +00:00
|
|
|
pub forkchoice_updated_v3: bool,
|
2023-03-19 23:15:59 +00:00
|
|
|
pub get_payload_bodies_by_hash_v1: bool,
|
|
|
|
pub get_payload_bodies_by_range_v1: bool,
|
2022-11-22 18:27:48 +00:00
|
|
|
pub get_payload_v1: bool,
|
|
|
|
pub get_payload_v2: bool,
|
2023-01-19 14:32:08 +00:00
|
|
|
pub get_payload_v3: bool,
|
2022-11-22 18:27:48 +00:00
|
|
|
}
|
2023-01-31 17:26:23 +00:00
|
|
|
|
|
|
|
impl EngineCapabilities {
|
|
|
|
pub fn to_response(&self) -> Vec<&str> {
|
|
|
|
let mut response = Vec::new();
|
|
|
|
if self.new_payload_v1 {
|
|
|
|
response.push(ENGINE_NEW_PAYLOAD_V1);
|
|
|
|
}
|
|
|
|
if self.new_payload_v2 {
|
|
|
|
response.push(ENGINE_NEW_PAYLOAD_V2);
|
|
|
|
}
|
2023-02-14 20:52:53 +00:00
|
|
|
if self.new_payload_v3 {
|
|
|
|
response.push(ENGINE_NEW_PAYLOAD_V3);
|
|
|
|
}
|
2023-01-31 17:26:23 +00:00
|
|
|
if self.forkchoice_updated_v1 {
|
|
|
|
response.push(ENGINE_FORKCHOICE_UPDATED_V1);
|
|
|
|
}
|
|
|
|
if self.forkchoice_updated_v2 {
|
|
|
|
response.push(ENGINE_FORKCHOICE_UPDATED_V2);
|
|
|
|
}
|
2023-08-09 19:44:47 +00:00
|
|
|
if self.forkchoice_updated_v3 {
|
|
|
|
response.push(ENGINE_FORKCHOICE_UPDATED_V3);
|
|
|
|
}
|
2023-03-19 23:15:59 +00:00
|
|
|
if self.get_payload_bodies_by_hash_v1 {
|
|
|
|
response.push(ENGINE_GET_PAYLOAD_BODIES_BY_HASH_V1);
|
|
|
|
}
|
|
|
|
if self.get_payload_bodies_by_range_v1 {
|
|
|
|
response.push(ENGINE_GET_PAYLOAD_BODIES_BY_RANGE_V1);
|
|
|
|
}
|
2023-01-31 17:26:23 +00:00
|
|
|
if self.get_payload_v1 {
|
|
|
|
response.push(ENGINE_GET_PAYLOAD_V1);
|
|
|
|
}
|
|
|
|
if self.get_payload_v2 {
|
|
|
|
response.push(ENGINE_GET_PAYLOAD_V2);
|
|
|
|
}
|
2023-02-14 20:52:53 +00:00
|
|
|
if self.get_payload_v3 {
|
|
|
|
response.push(ENGINE_GET_PAYLOAD_V3);
|
|
|
|
}
|
2023-01-31 17:26:23 +00:00
|
|
|
|
|
|
|
response
|
|
|
|
}
|
|
|
|
}
|