rm Capella builder API-related remote signer support (#6003)
This commit is contained in:
parent
684de046db
commit
84034c0379
|
@ -16,7 +16,7 @@ import
|
|||
../beacon_node,
|
||||
../consensus_object_pools/[blockchain_dag, spec_cache, validator_change_pool],
|
||||
../spec/[deposit_snapshots, eth2_merkleization, forks, network, validator],
|
||||
../spec/mev/bellatrix_mev,
|
||||
../spec/mev/[bellatrix_mev, capella_mev],
|
||||
../validators/message_router_mev
|
||||
|
||||
export rest_utils
|
||||
|
|
|
@ -11,7 +11,7 @@ import
|
|||
chronos, presto/client, chronicles,
|
||||
".."/".."/validators/slashing_protection_common,
|
||||
".."/datatypes/[phase0, altair, bellatrix],
|
||||
".."/mev/bellatrix_mev,
|
||||
".."/mev/[bellatrix_mev, capella_mev],
|
||||
".."/[helpers, forks, keystore, eth2_ssz_serialization],
|
||||
"."/[rest_types, rest_common, eth2_rest_serialization]
|
||||
|
||||
|
|
|
@ -17,13 +17,11 @@ import
|
|||
std/[json, tables],
|
||||
stew/base10, web3/primitives, httputils,
|
||||
".."/forks,
|
||||
".."/datatypes/[phase0, altair, bellatrix, deneb, electra],
|
||||
".."/mev/[capella_mev, deneb_mev]
|
||||
".."/mev/deneb_mev
|
||||
|
||||
from ".."/datatypes/capella import BeaconBlockBody
|
||||
|
||||
export forks, phase0, altair, bellatrix, capella, capella_mev, deneb_mev,
|
||||
tables, httputils
|
||||
export forks, phase0, altair, bellatrix, capella, deneb_mev, tables, httputils
|
||||
|
||||
const
|
||||
# https://github.com/ethereum/eth2.0-APIs/blob/master/apis/beacon/states/validator_balances.yaml#L17
|
||||
|
|
|
@ -674,18 +674,16 @@ proc getUnsignedBlindedBeaconBlock[T: deneb_mev.SignedBlindedBeaconBlock](
|
|||
deneb_mev.BlindedExecutionPayloadAndBlobsBundle):
|
||||
Result[T, string] =
|
||||
withBlck(forkedBlock):
|
||||
when consensusFork >= ConsensusFork.Capella:
|
||||
when consensusFork >= ConsensusFork.Deneb:
|
||||
when not (
|
||||
(T is deneb_mev.SignedBlindedBeaconBlock and
|
||||
consensusFork == ConsensusFork.Deneb) or
|
||||
(T is capella_mev.SignedBlindedBeaconBlock and
|
||||
consensusFork == ConsensusFork.Capella)):
|
||||
consensusFork == ConsensusFork.Deneb)):
|
||||
return err("getUnsignedBlindedBeaconBlock: mismatched block/payload types")
|
||||
else:
|
||||
return ok constructSignableBlindedBlock[T](
|
||||
forkyBlck, executionPayloadHeader)
|
||||
else:
|
||||
return err("getUnsignedBlindedBeaconBlock: attempt to construct pre-Capella blinded block")
|
||||
return err("getUnsignedBlindedBeaconBlock: attempt to construct pre-Deneb blinded block")
|
||||
|
||||
proc getBlindedBlockParts[
|
||||
EPH: capella.ExecutionPayloadHeader |
|
||||
|
@ -781,18 +779,14 @@ proc getBlindedBlockParts[
|
|||
executionPayloadHeader.get.blockValue,
|
||||
forkedBlck.blck))
|
||||
|
||||
proc getBuilderBid[
|
||||
SBBB: capella_mev.SignedBlindedBeaconBlock |
|
||||
deneb_mev.SignedBlindedBeaconBlock](
|
||||
proc getBuilderBid[SBBB: deneb_mev.SignedBlindedBeaconBlock](
|
||||
node: BeaconNode, payloadBuilderClient: RestClientRef, head: BlockRef,
|
||||
validator_pubkey: ValidatorPubKey, slot: Slot, randao: ValidatorSig,
|
||||
validator_index: ValidatorIndex):
|
||||
Future[BlindedBlockResult[SBBB]] {.async: (raises: [CancelledError]).} =
|
||||
## Returns the unsigned blinded block obtained from the Builder API.
|
||||
## Used by the BN's own validators, but not the REST server
|
||||
when SBBB is capella_mev.SignedBlindedBeaconBlock:
|
||||
type EPH = capella.ExecutionPayloadHeader
|
||||
elif SBBB is deneb_mev.SignedBlindedBeaconBlock:
|
||||
when SBBB is deneb_mev.SignedBlindedBeaconBlock:
|
||||
type EPH = deneb_mev.BlindedExecutionPayloadAndBlobsBundle
|
||||
else:
|
||||
static: doAssert false
|
||||
|
@ -819,8 +813,7 @@ proc getBuilderBid[
|
|||
|
||||
proc proposeBlockMEV(
|
||||
node: BeaconNode, payloadBuilderClient: RestClientRef,
|
||||
blindedBlock: capella_mev.SignedBlindedBeaconBlock |
|
||||
deneb_mev.SignedBlindedBeaconBlock):
|
||||
blindedBlock: deneb_mev.SignedBlindedBeaconBlock):
|
||||
Future[Result[BlockRef, string]] {.async: (raises: [CancelledError]).} =
|
||||
let unblindedBlockRef = await node.unblindAndRouteBlockMEV(
|
||||
payloadBuilderClient, blindedBlock)
|
||||
|
@ -865,8 +858,6 @@ proc makeBlindedBeaconBlockForHeadAndSlot*[BBB: ForkyBlindedBeaconBlock](
|
|||
## its own validators.
|
||||
when BBB is deneb_mev.BlindedBeaconBlock:
|
||||
type EPH = deneb_mev.BlindedExecutionPayloadAndBlobsBundle
|
||||
elif BBB is capella_mev.BlindedBeaconBlock:
|
||||
type EPH = capella.ExecutionPayloadHeader
|
||||
else:
|
||||
static: doAssert false
|
||||
|
||||
|
|
|
@ -502,7 +502,6 @@ proc getBlockSignature*(v: AttachedValidator, fork: Fork,
|
|||
block_root: Eth2Digest,
|
||||
blck: ForkedBeaconBlock | ForkedBlindedBeaconBlock |
|
||||
ForkedMaybeBlindedBeaconBlock |
|
||||
capella_mev.BlindedBeaconBlock |
|
||||
deneb_mev.BlindedBeaconBlock
|
||||
): Future[SignatureResult]
|
||||
{.async: (raises: [CancelledError]).} =
|
||||
|
@ -510,7 +509,6 @@ proc getBlockSignature*(v: AttachedValidator, fork: Fork,
|
|||
bellatrix.BeaconBlockBody |
|
||||
capella.BeaconBlockBody |
|
||||
deneb.BeaconBlockBody |
|
||||
capella_mev.BlindedBeaconBlockBody |
|
||||
deneb_mev.BlindedBeaconBlockBody
|
||||
|
||||
template blockPropertiesProofs(blockBody: SomeBlockBody,
|
||||
|
@ -538,21 +536,8 @@ proc getBlockSignature*(v: AttachedValidator, fork: Fork,
|
|||
let web3signerRequest =
|
||||
when blck is ForkedBlindedBeaconBlock:
|
||||
case blck.kind
|
||||
of ConsensusFork.Phase0, ConsensusFork.Altair, ConsensusFork.Bellatrix:
|
||||
return SignatureResult.err("Invalid beacon block fork version")
|
||||
of ConsensusFork.Capella:
|
||||
case v.data.remoteType
|
||||
of RemoteSignerType.Web3Signer:
|
||||
Web3SignerRequest.init(fork, genesis_validators_root,
|
||||
Web3SignerForkedBeaconBlock(kind: ConsensusFork.Capella,
|
||||
data: blck.capellaData.toBeaconBlockHeader))
|
||||
of RemoteSignerType.VerifyingWeb3Signer:
|
||||
let proofs = blockPropertiesProofs(
|
||||
blck.capellaData.body, capellaIndex)
|
||||
Web3SignerRequest.init(fork, genesis_validators_root,
|
||||
Web3SignerForkedBeaconBlock(kind: ConsensusFork.Capella,
|
||||
data: blck.capellaData.toBeaconBlockHeader),
|
||||
proofs)
|
||||
of ConsensusFork.Phase0 .. ConsensusFork.Capella:
|
||||
return SignatureResult.err("Invalid blinded beacon block fork")
|
||||
of ConsensusFork.Deneb:
|
||||
case v.data.remoteType
|
||||
of RemoteSignerType.Web3Signer:
|
||||
|
@ -566,19 +551,6 @@ proc getBlockSignature*(v: AttachedValidator, fork: Fork,
|
|||
Web3SignerForkedBeaconBlock(kind: ConsensusFork.Deneb,
|
||||
data: blck.denebData.toBeaconBlockHeader),
|
||||
proofs)
|
||||
elif blck is capella_mev.BlindedBeaconBlock:
|
||||
case v.data.remoteType
|
||||
of RemoteSignerType.Web3Signer:
|
||||
Web3SignerRequest.init(fork, genesis_validators_root,
|
||||
Web3SignerForkedBeaconBlock(kind: ConsensusFork.Capella,
|
||||
data: blck.toBeaconBlockHeader))
|
||||
of RemoteSignerType.VerifyingWeb3Signer:
|
||||
let proofs = blockPropertiesProofs(
|
||||
blck.body, capellaIndex)
|
||||
Web3SignerRequest.init(fork, genesis_validators_root,
|
||||
Web3SignerForkedBeaconBlock(kind: ConsensusFork.Capella,
|
||||
data: blck.toBeaconBlockHeader),
|
||||
proofs)
|
||||
elif blck is deneb_mev.BlindedBeaconBlock:
|
||||
case v.data.remoteType
|
||||
of RemoteSignerType.Web3Signer:
|
||||
|
|
|
@ -10,8 +10,10 @@
|
|||
import
|
||||
confutils, presto,
|
||||
../beacon_chain/spec/datatypes/capella,
|
||||
../beacon_chain/rpc/rest_utils,
|
||||
../beacon_chain/spec/eth2_apis/rest_beacon_client
|
||||
../beacon_chain/spec/eth2_apis/rest_beacon_client,
|
||||
../beacon_chain/rpc/rest_utils
|
||||
|
||||
from ../beacon_chain/spec/mev/capella_mev import SignedBlindedBeaconBlock
|
||||
|
||||
const HttpOk = 200
|
||||
|
||||
|
|
Loading…
Reference in New Issue