add RPC signature; add type constraints on proposeBlockMEV (#5498)

This commit is contained in:
tersec 2023-10-12 11:49:48 +00:00 committed by GitHub
parent 40616b6243
commit eeac00d08e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 5 deletions

View File

@ -245,6 +245,12 @@ proc publishBlindedBlock*(body: capella_mev.SignedBlindedBeaconBlock):
meth: MethodPost.} meth: MethodPost.}
## https://ethereum.github.io/beacon-APIs/#/Beacon/publishBlindedBlock ## https://ethereum.github.io/beacon-APIs/#/Beacon/publishBlindedBlock
proc publishBlindedBlock*(body: deneb_mev.SignedBlindedBeaconBlockContents):
RestPlainResponse {.
rest, endpoint: "/eth/v1/beacon/blinded_blocks",
meth: MethodPost.}
## https://ethereum.github.io/beacon-APIs/#/Beacon/publishBlindedBlock
proc publishSszBlindedBlock*( proc publishSszBlindedBlock*(
client: RestClientRef, client: RestClientRef,
blck: ForkySignedBeaconBlock blck: ForkySignedBeaconBlock

View File

@ -730,10 +730,7 @@ proc getBlindedBlockParts[EPH: ForkyExecutionPayloadHeader](
# processing does not work directly using blinded blocks, fix up transactions # processing does not work directly using blinded blocks, fix up transactions
# root after running the state transition function on an otherwise equivalent # root after running the state transition function on an otherwise equivalent
# non-blinded block without transactions. # non-blinded block without transactions.
when EPH is bellatrix.ExecutionPayloadHeader: when EPH is capella.ExecutionPayloadHeader:
type PayloadType = bellatrix.ExecutionPayloadForSigning
let withdrawals_root = Opt.none Eth2Digest
elif EPH is capella.ExecutionPayloadHeader:
type PayloadType = capella.ExecutionPayloadForSigning type PayloadType = capella.ExecutionPayloadForSigning
let withdrawals_root = let withdrawals_root =
Opt.some executionPayloadHeader.get.blindedBlckPart.withdrawals_root Opt.some executionPayloadHeader.get.blindedBlckPart.withdrawals_root
@ -810,7 +807,9 @@ proc getBuilderBid[
return ok (unsignedBlindedBlock.get, bidValue) return ok (unsignedBlindedBlock.get, bidValue)
proc proposeBlockMEV( proc proposeBlockMEV(
node: BeaconNode, payloadBuilderClient: RestClientRef, blindedBlock: auto): node: BeaconNode, payloadBuilderClient: RestClientRef,
blindedBlock: capella_mev.SignedBlindedBeaconBlock |
deneb_mev.SignedBlindedBeaconBlockContents):
Future[Result[BlockRef, string]] {.async.} = Future[Result[BlockRef, string]] {.async.} =
let unblindedBlockRef = await node.unblindAndRouteBlockMEV( let unblindedBlockRef = await node.unblindAndRouteBlockMEV(
payloadBuilderClient, blindedBlock) payloadBuilderClient, blindedBlock)