Skip to content

Commit f65586b

Browse files
authored
Merge pull request #28 from ora-io/dev
Dev
2 parents 8695959 + fcf5e42 commit f65586b

File tree

11 files changed

+1557
-1573
lines changed

11 files changed

+1557
-1573
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ora-stack",
3-
"version": "0.2.5",
3+
"version": "0.3.1",
44
"private": true,
55
"packageManager": "[email protected]",
66
"description": "",

packages/orap/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@ora-io/orap",
33
"type": "module",
4-
"version": "0.2.5",
4+
"version": "0.3.1",
55
"packageManager": "[email protected]",
66
"description": "",
77
"author": "Norman (nom4dv3), MuRong",

packages/reku/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@ora-io/reku",
33
"type": "module",
4-
"version": "0.2.4",
4+
"version": "0.3.1",
55
"packageManager": "[email protected]",
66
"description": "",
77
"author": "Norman (nom4dv3), MuRong",

packages/reku/src/event/crosschecker/autochecker.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,11 @@ export class AutoCrossChecker extends BaseCrossChecker {
8888

8989
const waitNextCrosscheck = async (): Promise<boolean> => {
9090
latestBlockNum = await timeoutWithRetry(() => this.provider.provider?.getBlockNumber(), 15 * 1000, 3)
91+
if (options.autoFollowLatestBlock) {
92+
ccrOptions.toBlock = latestBlockNum
93+
return true
94+
}
95+
9196
if (ccrOptions.toBlock + delayBlockFromLatest > latestBlockNum) {
9297
// sleep until the toBlock
9398
// await sleep((ccrOptions.toBlock + delayBlockFromLatest - latestBlockNum) * blockInterval)

packages/reku/src/event/crosschecker/cache/manager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export class CrossCheckerCacheManager extends SimpleStoreManager {
8989
await this.set(`${this.storeKeyPrefix}checkpoint`, checkpoint, this.ttl)
9090
}
9191

92-
async getCheckpoint(): Promise<number | undefined> {
92+
async getCheckpoint(): Promise<number | undefined | null> {
9393
return await this.get(`${this.storeKeyPrefix}checkpoint`)
9494
}
9595
}

packages/reku/src/event/crosschecker/interface.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ export interface AutoCrossCheckParam extends BaseCrossCheckParam {
3535
storeKeyPrefix?: string // set the prefix to all keys when set key-value to store (cache), e.g. key = prefix+txHashList
3636
storeTtl?: Milliseconds // the ttl for <txhash, log index> record in store
3737
batchBlocksCount?: number // how many blocks at most to get per check
38+
autoFollowLatestBlock?: boolean // whether to auto follow the latest block
3839
delayBlockFromLatest?: number // mostly for realtime mode; each time cc wait until latest height > toBlock + delayBlockFromLatest
3940
blockInterval?: Milliseconds // the block interval of the given chain, default: eth
4041
pollingInterval?: Milliseconds // mostly for limiting getLogs calling rate in catchup mode; how long does it take at least between 2 checks

packages/utils/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@ora-io/utils",
33
"type": "module",
4-
"version": "0.2.5",
4+
"version": "0.3.1",
55
"packageManager": "[email protected]",
66
"description": "",
77
"author": "Norman (nom4dv3), MuRong",
@@ -44,8 +44,8 @@
4444
},
4545
"dependencies": {
4646
"@murongg/utils": "^0.1.28",
47-
"cache-manager": "^5.7.6",
48-
"cache-manager-ioredis-yet": "^2.1.1",
47+
"cache-manager": "5.7.6",
48+
"cache-manager-ioredis-yet": "2.1.1",
4949
"debug": "^4.3.7",
5050
"ioredis": "^5.4.1",
5151
"lodash.clonedeep": "^4.5.0",

packages/utils/src/store/redisHash.ts

Lines changed: 0 additions & 147 deletions
This file was deleted.

packages/utils/src/store/types.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import type { Keyv } from 'keyv'
2+
3+
export type Store = Keyv

0 commit comments

Comments
 (0)