nimbus-eth2/beacon_chain/spec/mev/rest_bellatrix_mev_calls.nim
tersec d62d13a23c
MEV block proposal (#3883)
* MEV validator registration

* add nearby canary to detect new beacon chain forks

* remove special MEV graffiti

* web3signer support

* fix trace logging

* Nim 1.2 needs raises Defect

* use template rather than proc in REST JSON parsing

* use --payload-builder-enable and --payload-builder-url

* explicitly default MEV to disabled

* explicitly empty default value for payload builder URL

* revert attestation pool to unstable version
2022-08-01 09:41:47 +03:00

43 lines
1.8 KiB
Nim

# Copyright (c) 2022 Status Research & Development GmbH
# Licensed and distributed under either of
# * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT).
# * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0).
# at your option. This file may not be copied, modified, or distributed except according to those terms.
when (NimMajor, NimMinor) < (1, 4):
{.push raises: [Defect].}
else:
{.push raises: [].}
import
chronos, presto/client,
".."/eth2_apis/[rest_types, eth2_rest_serialization]
export chronos, client, rest_types, eth2_rest_serialization
proc registerValidator*(body: seq[SignedValidatorRegistrationV1]
): RestPlainResponse {.
rest, endpoint: "/eth/v1/builder/validators",
meth: MethodPost.}
## https://github.com/ethereum/builder-specs/blob/v0.2.0/apis/builder/validators.yaml
## https://github.com/ethereum/beacon-APIs/blob/master/apis/validator/register_validator.yaml
proc getHeader*(slot: Slot,
parent_hash: Eth2Digest,
pubkey: ValidatorPubKey
): RestResponse[GetHeaderResponse] {.
rest, endpoint: "/eth/v1/builder/header/{slot}/{parent_hash}/{pubkey}",
meth: MethodGet.}
## https://github.com/ethereum/builder-specs/blob/v0.2.0/apis/builder/header.yaml
proc submitBlindedBlock*(body: SignedBlindedBeaconBlock
): RestResponse[SubmitBlindedBlockResponse] {.
rest, endpoint: "/eth/v1/builder/blinded_blocks",
meth: MethodPost.}
## https://github.com/ethereum/builder-specs/blob/v0.2.0/apis/builder/blinded_blocks.yaml
proc checkBuilderStatus*(): RestPlainResponse {.
rest, endpoint: "/eth/v1/builder/status",
meth: MethodGet.}
## https://github.com/ethereum/builder-specs/blob/v0.2.0/apis/builder/status.yaml