|
36 | 36 | current: BlockNumber |
37 | 37 | highest: BlockNumber |
38 | 38 |
|
39 | | - SyncReqNewHeadCB* = proc(header: Header) {.gcsafe, raises: [].} |
40 | | - ## Update head for syncing |
41 | | - |
42 | | - ReqBeaconSyncerTargetCB* = proc(header: Header; finHash: Hash32) {.gcsafe, raises: [].} |
43 | | - ## Ditto (for beacon sync) |
| 39 | + FcHeaderClUpdateCB* = proc(header: Header; finHash: Hash32) {.gcsafe, raises: [].} |
| 40 | + ## Inform `CL` sub-module `chain_header_cache` about new head. |
44 | 41 |
|
45 | 42 | BeaconSyncerProgressCB* = proc(): tuple[start, current, target: BlockNumber] {.gcsafe, raises: [].} |
46 | 43 | ## Query syncer status |
|
70 | 67 | # synchronizer need this |
71 | 68 | syncProgress: SyncProgress |
72 | 69 |
|
73 | | - syncReqNewHead: SyncReqNewHeadCB |
74 | | - ## Call back function for the sync processor. This function stages |
75 | | - ## the arguent header to a private aerea for subsequent processing. |
76 | | - |
77 | | - reqBeaconSyncerTargetCB: ReqBeaconSyncerTargetCB |
| 70 | + fcHeaderClUpdateCB: FcHeaderClUpdateCB |
78 | 71 | ## Call back function for a sync processor that returns the canonical |
79 | 72 | ## header. |
80 | 73 |
|
@@ -340,16 +333,10 @@ proc proofOfStake*(com: CommonRef, header: Header, txFrame: CoreDbTxRef): bool = |
340 | 333 | func depositContractAddress*(com: CommonRef): Address = |
341 | 334 | com.config.depositContractAddress.get(default(Address)) |
342 | 335 |
|
343 | | -proc syncReqNewHead*(com: CommonRef; header: Header) |
344 | | - {.gcsafe, raises: [].} = |
| 336 | +proc fcHeaderClUpdate*(com: CommonRef; header: Header; finHash: Hash32) = |
345 | 337 | ## Used by RPC updater |
346 | | - if not com.syncReqNewHead.isNil: |
347 | | - com.syncReqNewHead(header) |
348 | | - |
349 | | -proc reqBeaconSyncerTarget*(com: CommonRef; header: Header; finHash: Hash32) = |
350 | | - ## Used by RPC updater |
351 | | - if not com.reqBeaconSyncerTargetCB.isNil: |
352 | | - com.reqBeaconSyncerTargetCB(header, finHash) |
| 338 | + if not com.fcHeaderClUpdateCB.isNil: |
| 339 | + com.fcHeaderClUpdateCB(header, finHash) |
353 | 340 |
|
354 | 341 | proc beaconSyncerProgress*(com: CommonRef): tuple[start, current, target: BlockNumber] = |
355 | 342 | ## Query syncer status |
@@ -460,13 +447,9 @@ func setTTD*(com: CommonRef, ttd: Opt[DifficultyInt]) = |
460 | 447 | # rebuild the MergeFork piece of the forkTransitionTable |
461 | 448 | com.forkTransitionTable.mergeForkTransitionThreshold = com.config.mergeForkTransitionThreshold |
462 | 449 |
|
463 | | -func `syncReqNewHead=`*(com: CommonRef; cb: SyncReqNewHeadCB) = |
464 | | - ## Activate or reset a call back handler for syncing. |
465 | | - com.syncReqNewHead = cb |
466 | | - |
467 | | -func `reqBeaconSyncerTarget=`*(com: CommonRef; cb: ReqBeaconSyncerTargetCB) = |
| 450 | +func `fcHeaderClUpdate=`*(com: CommonRef; cb: FcHeaderClUpdateCB) = |
468 | 451 | ## Activate or reset a call back handler for syncing. |
469 | | - com.reqBeaconSyncerTargetCB = cb |
| 452 | + com.fcHeaderClUpdateCB = cb |
470 | 453 |
|
471 | 454 | func `beaconSyncerProgress=`*(com: CommonRef; cb: BeaconSyncerProgressCB) = |
472 | 455 | ## Activate or reset a call back handler for querying syncer. |
|
0 commit comments