cleanup pre-deneb fallback
This commit is contained in:
parent
9c9f2df0ca
commit
c2d5a55d95
|
@ -173,7 +173,7 @@ from ../consensus_object_pools/block_clearance import
|
||||||
proc storeBackfillBlock(
|
proc storeBackfillBlock(
|
||||||
self: var BlockProcessor,
|
self: var BlockProcessor,
|
||||||
signedBlock: ForkySignedBeaconBlock,
|
signedBlock: ForkySignedBeaconBlock,
|
||||||
blobsOpt: OptForkyBlobSidecars
|
blobsOpt: Opt[ForkyBlobSidecars]
|
||||||
): Result[void, VerifierError] =
|
): Result[void, VerifierError] =
|
||||||
const
|
const
|
||||||
consensusFork = typeof(signedBlock).kind
|
consensusFork = typeof(signedBlock).kind
|
||||||
|
@ -441,7 +441,7 @@ proc enqueueBlock*(
|
||||||
proc storeBlock(
|
proc storeBlock(
|
||||||
self: ref BlockProcessor, src: MsgSource, wallTime: BeaconTime,
|
self: ref BlockProcessor, src: MsgSource, wallTime: BeaconTime,
|
||||||
signedBlock: ForkySignedBeaconBlock,
|
signedBlock: ForkySignedBeaconBlock,
|
||||||
blobsOpt: OptForkyBlobSidecars,
|
blobsOpt: Opt[ForkyBlobSidecars],
|
||||||
maybeFinalized = false,
|
maybeFinalized = false,
|
||||||
queueTick: Moment = Moment.now(),
|
queueTick: Moment = Moment.now(),
|
||||||
validationDur = Duration()
|
validationDur = Duration()
|
||||||
|
|
|
@ -1093,9 +1093,11 @@ proc installBeaconApiHandlers*(router: var RestRouter, node: BeaconNode) =
|
||||||
return RestApiResponse.jsonError(Http400, InvalidBlockObjectError)
|
return RestApiResponse.jsonError(Http400, InvalidBlockObjectError)
|
||||||
|
|
||||||
let res = withBlck(forked):
|
let res = withBlck(forked):
|
||||||
|
const blobFork =
|
||||||
|
blobForkAtConsensusFork(consensusFork).get(BlobFork.Deneb)
|
||||||
forkyBlck.root = hash_tree_root(forkyBlck.message)
|
forkyBlck.root = hash_tree_root(forkyBlck.message)
|
||||||
await node.router.routeSignedBeaconBlock(
|
await node.router.routeSignedBeaconBlock(
|
||||||
forkyBlck, Opt.none(seq[deneb.BlobSidecar]),
|
forkyBlck, Opt.none(seq[blobFork.BlobSidecar]),
|
||||||
checkValidator = true)
|
checkValidator = true)
|
||||||
|
|
||||||
if res.isErr():
|
if res.isErr():
|
||||||
|
@ -1176,9 +1178,11 @@ proc installBeaconApiHandlers*(router: var RestRouter, node: BeaconNode) =
|
||||||
return RestApiResponse.jsonError(Http400, InvalidBlockObjectError)
|
return RestApiResponse.jsonError(Http400, InvalidBlockObjectError)
|
||||||
|
|
||||||
let res = withBlck(forked):
|
let res = withBlck(forked):
|
||||||
|
const blobFork =
|
||||||
|
blobForkAtConsensusFork(consensusFork).get(BlobFork.Deneb)
|
||||||
forkyBlck.root = hash_tree_root(forkyBlck.message)
|
forkyBlck.root = hash_tree_root(forkyBlck.message)
|
||||||
await node.router.routeSignedBeaconBlock(
|
await node.router.routeSignedBeaconBlock(
|
||||||
forkyBlck, Opt.none(seq[deneb.BlobSidecar]),
|
forkyBlck, Opt.none(seq[blobFork.BlobSidecar]),
|
||||||
checkValidator = true)
|
checkValidator = true)
|
||||||
|
|
||||||
if res.isErr():
|
if res.isErr():
|
||||||
|
|
|
@ -280,15 +280,9 @@ type
|
||||||
ForkyBlobSidecar* =
|
ForkyBlobSidecar* =
|
||||||
deneb.BlobSidecar
|
deneb.BlobSidecar
|
||||||
|
|
||||||
OptSeqForkyBlobSidecar* =
|
|
||||||
Opt[seq[deneb.BlobSidecar]]
|
|
||||||
|
|
||||||
ForkyBlobSidecars* =
|
ForkyBlobSidecars* =
|
||||||
deneb.BlobSidecars
|
deneb.BlobSidecars
|
||||||
|
|
||||||
OptForkyBlobSidecars* =
|
|
||||||
Opt[deneb.BlobSidecars]
|
|
||||||
|
|
||||||
ForkedBlobSidecar* = object
|
ForkedBlobSidecar* = object
|
||||||
case kind*: BlobFork
|
case kind*: BlobFork
|
||||||
of BlobFork.Deneb:
|
of BlobFork.Deneb:
|
||||||
|
|
|
@ -84,7 +84,7 @@ template getCurrentBeaconTime(router: MessageRouter): BeaconTime =
|
||||||
type RouteBlockResult = Result[Opt[BlockRef], string]
|
type RouteBlockResult = Result[Opt[BlockRef], string]
|
||||||
proc routeSignedBeaconBlock*(
|
proc routeSignedBeaconBlock*(
|
||||||
router: ref MessageRouter, blck: ForkySignedBeaconBlock,
|
router: ref MessageRouter, blck: ForkySignedBeaconBlock,
|
||||||
blobsOpt: OptSeqForkyBlobSidecar, checkValidator: bool):
|
blobsOpt: Opt[seq[ForkyBlobSidecar]], checkValidator: bool):
|
||||||
Future[RouteBlockResult] {.async: (raises: [CancelledError]).} =
|
Future[RouteBlockResult] {.async: (raises: [CancelledError]).} =
|
||||||
## Validate and broadcast beacon block, then add it to the block database
|
## Validate and broadcast beacon block, then add it to the block database
|
||||||
## Returns the new Head when block is added successfully to dag, none when
|
## Returns the new Head when block is added successfully to dag, none when
|
||||||
|
|
Loading…
Reference in New Issue