-
Notifications
You must be signed in to change notification settings - Fork 298
modularise message routing for sidecars #7751
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: unstable
Are you sure you want to change the base?
Conversation
| let v = router.validateRouteBlock(blck, checkValidator) | ||
| if v.isErr(): | ||
| return err(v.error) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| let v = router.validateRouteBlock(blck, checkValidator) | |
| if v.isErr(): | |
| return err(v.error) | |
| ? router.validateRouteBlock(blck, checkValidator) |
| sidecarOpt = Opt.some(blobs.mapIt(newClone(it))) | ||
| proc publishSidecars( | ||
| router: ref MessageRouter, | ||
| blck: ForkySignedBeaconBlock, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| blck: ForkySignedBeaconBlock, | |
| blck: fulu.SignedBeaconBlock, |
we should not be defining this function for mismatching sidecar and block forks
| if not (sidecarsOpt.isSome() and typeof(blck).kind >= ConsensusFork.Fulu): | ||
| return Opt.none(fulu.DataColumnSidecars) | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| if not (sidecarsOpt.isSome() and typeof(blck).kind >= ConsensusFork.Fulu): | |
| return Opt.none(fulu.DataColumnSidecars) |
| const finalSidecars = noSidecars | ||
| elif someSidecarsOpt is NoSidecarsAtFork and | ||
| typeof(blck).kind in ConsensusFork.Deneb..ConsensusFork.Electra: | ||
| let finalSidecars = Opt.none(BlobSidecars) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is there no routing here?
| forkyBlck, Opt.some( | ||
| forkyBlck.create_blob_sidecars(kzg_proofs, blobs)), | ||
| Opt.none(seq[fulu.DataColumnSidecar]), | ||
| checkValidator = true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not overload routeSignedBeaconBlock too?
| MsgSource.api, blck, sidecarOpt) | ||
| proc publishSidecars*( | ||
| router: ref MessageRouter, | ||
| blck: ForkySignedBeaconBlock, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same point about mismatching block types/sidecar types
| if dc.index in allowed: | ||
| finalCols.add newClone(dc) | ||
|
|
||
| return Opt.some(finalCols) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can use implicit return (no return, just Opt.some(finalCols))
| NoSidecarsAtFork | | ||
| Opt[seq[BlobSidecar]] | | ||
| Opt[seq[fulu.DataColumnSidecar]] | | ||
| Opt[seq[gloas.DataColumnSidecar]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR doesn't seem to treat gloas.DataColumnSidecar at all?
| # proposer ownership checks | ||
| let vindex = ValidatorIndex(blck.message.proposer_index) | ||
| if checkValidator and (vindex in router.processor.validatorPool[]): | ||
| warn "A validator client attempts to send a block from validator that is also manager by beacon node", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
managed
| if checkValidator and (vindex in router.processor.validatorPool[]): | ||
| warn "A validator client attempts to send a block from validator that is also manager by beacon node", | ||
| validator_index = vindex | ||
| return err("Block could not be sent from validator that is also managed by the beacon node") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's no really that a block could not be sent, but that it wasn't
| for blob in blobs: | ||
| finalBlobs.add newClone(blob) | ||
|
|
||
| return Opt.some(finalBlobs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't need return here
No description provided.