Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions beacon_chain/sync/light_client_manager.nim
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,31 @@ type
GetSyncCommitteePeriodCallback* =
proc(): SyncCommitteePeriod {.gcsafe, raises: [].}

LightClientBootstrapProc = proc(
id: uint64, blockRoot: Eth2Digest
): Future[NetRes[ForkedLightClientBootstrap]] {.async: (raises: [CancelledError]).}
LightClientUpdatesByRangeProc = proc(
id: uint64, startPeriod: SyncCommitteePeriod, count: uint64
): Future[LightClientUpdatesByRangeResponse] {.async: (raises: [CancelledError]).}
LightClientFinalityUpdateProc = proc(
id: uint64
): Future[NetRes[ForkedLightClientFinalityUpdate]] {.
async: (raises: [CancelledError])
.}
LightClientOptimisticUpdateProc = proc(
id: uint64
): Future[NetRes[ForkedLightClientOptimisticUpdate]] {.
async: (raises: [CancelledError])
.}
UpdateScoreProc = proc(id: uint64, value: int) {.gcsafe, raises: [].}

EthLCBackend* = object
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Light client naming is already sufficiently confusing with all the types of light clients.

I would suggest to either stick here with naming scheme of the existing file: LightClientBackend.
Or to call it ConsensusLightClientBackend

getLightClientBootstrap*: LightClientBootstrapProc
getLightClientUpdatesByRange*: LightClientUpdatesByRangeProc
getLightClientFinalityUpdate*: LightClientFinalityUpdateProc
getLightClientOptimisticUpdate*: LightClientOptimisticUpdateProc
updateScore*: UpdateScoreProc

LightClientManager* = object
network: Eth2Node
rng: ref HmacDrbgContext
Expand Down
Loading