Merge branch 'dev/etan/df-forkedblobs' into feat_eip-7688

This commit is contained in:
Etan Kissling 2024-07-26 01:39:50 +02:00
commit 4c9da5f1af
No known key found for this signature in database
GPG Key ID: B21DA824C5A3D03D
5 changed files with 10 additions and 12 deletions

View File

@ -173,7 +173,7 @@ from ../consensus_object_pools/block_clearance import
proc storeBackfillBlock(
self: var BlockProcessor,
signedBlock: ForkySignedBeaconBlock,
blobsOpt: OptForkyBlobSidecars
blobsOpt: Opt[ForkyBlobSidecars]
): Result[void, VerifierError] =
const
consensusFork = typeof(signedBlock).kind
@ -441,7 +441,7 @@ proc enqueueBlock*(
proc storeBlock(
self: ref BlockProcessor, src: MsgSource, wallTime: BeaconTime,
signedBlock: ForkySignedBeaconBlock,
blobsOpt: OptForkyBlobSidecars,
blobsOpt: Opt[ForkyBlobSidecars],
maybeFinalized = false,
queueTick: Moment = Moment.now(),
validationDur = Duration()

View File

@ -275,7 +275,7 @@ proc processSignedBeaconBlock*(
proc processBlobSidecar*(
self: var Eth2Processor, src: MsgSource,
blobSidecar: deneb.BlobSidecar, subnet_id: BlobId): ValidationRes =
blobSidecar: ForkyBlobSidecar, subnet_id: BlobId): ValidationRes =
template block_header: untyped = blobSidecar.signed_block_header.message
let

View File

@ -1093,9 +1093,11 @@ proc installBeaconApiHandlers*(router: var RestRouter, node: BeaconNode) =
return RestApiResponse.jsonError(Http400, InvalidBlockObjectError)
let res = withBlck(forked):
const blobFork =
blobForkAtConsensusFork(consensusFork).get(BlobFork.Deneb)
forkyBlck.root = hash_tree_root(forkyBlck.message)
await node.router.routeSignedBeaconBlock(
forkyBlck, Opt.none(seq[deneb.BlobSidecar]),
forkyBlck, Opt.none(seq[blobFork.BlobSidecar]),
checkValidator = true)
if res.isErr():
@ -1176,9 +1178,11 @@ proc installBeaconApiHandlers*(router: var RestRouter, node: BeaconNode) =
return RestApiResponse.jsonError(Http400, InvalidBlockObjectError)
let res = withBlck(forked):
const blobFork =
blobForkAtConsensusFork(consensusFork).get(BlobFork.Deneb)
forkyBlck.root = hash_tree_root(forkyBlck.message)
await node.router.routeSignedBeaconBlock(
forkyBlck, Opt.none(seq[deneb.BlobSidecar]),
forkyBlck, Opt.none(seq[blobFork.BlobSidecar]),
checkValidator = true)
if res.isErr():

View File

@ -280,15 +280,9 @@ type
ForkyBlobSidecar* =
deneb.BlobSidecar
OptSeqForkyBlobSidecar* =
Opt[seq[deneb.BlobSidecar]]
ForkyBlobSidecars* =
deneb.BlobSidecars
OptForkyBlobSidecars* =
Opt[deneb.BlobSidecars]
ForkedBlobSidecar* = object
case kind*: BlobFork
of BlobFork.Deneb:

View File

@ -84,7 +84,7 @@ template getCurrentBeaconTime(router: MessageRouter): BeaconTime =
type RouteBlockResult = Result[Opt[BlockRef], string]
proc routeSignedBeaconBlock*(
router: ref MessageRouter, blck: ForkySignedBeaconBlock,
blobsOpt: OptSeqForkyBlobSidecar, checkValidator: bool):
blobsOpt: Opt[seq[ForkyBlobSidecar]], checkValidator: bool):
Future[RouteBlockResult] {.async: (raises: [CancelledError]).} =
## 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