File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed
packages/reku/src/event/crosschecker Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -88,6 +88,11 @@ export class AutoCrossChecker extends BaseCrossChecker {
88
88
89
89
const waitNextCrosscheck = async ( ) : Promise < boolean > => {
90
90
latestBlockNum = await timeoutWithRetry ( ( ) => this . provider . provider ?. getBlockNumber ( ) , 15 * 1000 , 3 )
91
+ if ( options . autoFollowLatestBlock ) {
92
+ ccrOptions . toBlock = latestBlockNum
93
+ return true
94
+ }
95
+
91
96
if ( ccrOptions . toBlock + delayBlockFromLatest > latestBlockNum ) {
92
97
// sleep until the toBlock
93
98
// await sleep((ccrOptions.toBlock + delayBlockFromLatest - latestBlockNum) * blockInterval)
Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ export interface AutoCrossCheckParam extends BaseCrossCheckParam {
35
35
storeKeyPrefix ?: string // set the prefix to all keys when set key-value to store (cache), e.g. key = prefix+txHashList
36
36
storeTtl ?: Milliseconds // the ttl for <txhash, log index> record in store
37
37
batchBlocksCount ?: number // how many blocks at most to get per check
38
+ autoFollowLatestBlock ?: boolean // whether to auto follow the latest block
38
39
delayBlockFromLatest ?: number // mostly for realtime mode; each time cc wait until latest height > toBlock + delayBlockFromLatest
39
40
blockInterval ?: Milliseconds // the block interval of the given chain, default: eth
40
41
pollingInterval ?: Milliseconds // mostly for limiting getLogs calling rate in catchup mode; how long does it take at least between 2 checks
You can’t perform that action at this time.
0 commit comments