Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ora-stack",
"version": "0.3.4",
"version": "0.3.5",
"private": true,
"packageManager": "pnpm@9.7.0",
"description": "",
Expand Down
2 changes: 1 addition & 1 deletion packages/orap/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@ora-io/orap",
"type": "module",
"version": "0.3.4",
"version": "0.3.5",
"packageManager": "pnpm@8.10.5",
"description": "",
"author": "Norman (nom4dv3), MuRong",
Expand Down
2 changes: 1 addition & 1 deletion packages/reku/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@ora-io/reku",
"type": "module",
"version": "0.3.5",
"version": "0.3.7",
"packageManager": "pnpm@8.10.5",
"description": "",
"author": "Norman (nom4dv3), MuRong",
Expand Down
31 changes: 20 additions & 11 deletions packages/reku/src/event/crosschecker/autochecker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ export class AutoCrossChecker extends BaseCrossChecker {

const waitNextCrosscheck = async (): Promise<boolean> => {
latestBlockNum = await timeoutWithRetry(() => {
// console.log(this.provider, this.provider.provider)
if (!this.provider || !this.provider.provider)
throw new Error('provider not ready')
return this.provider.provider?.getBlockNumber()
Expand Down Expand Up @@ -143,19 +144,27 @@ export class AutoCrossChecker extends BaseCrossChecker {

// TODO: replace polling with schedule cron
await polling(async () => {
const wait = await waitOrUpdateToBlock()
debug('polling interval: %d, wait: %s, from block: %d, to block: %d', pollingInterval, wait, ccrOptions.fromBlock, ccrOptions.toBlock)
if (wait) {
await this.crossCheckRange(ccrOptions)
// only update options after cc succ
await updateCCROptions(ccrOptions)
try {
debug('start polling')
const wait = await waitOrUpdateToBlock()
debug('polling interval: %d, wait: %s, from block: %d, to block: %d', pollingInterval, wait, ccrOptions.fromBlock, ccrOptions.toBlock)
if (wait) {
await this.crossCheckRange(ccrOptions)
// only update options after cc succ
await updateCCROptions(ccrOptions)
}
else {
debug('Because the latest block %d is too old, skip this cross check', latestBlockNum)
}
debug('end condition')
const end = endingCondition()
debug('polling ending condition: %s', end)
return end
}
else {
debug('Because the latest block %d is too old, skip this cross check', latestBlockNum)
catch (error) {
debug('polling error', error)
return false
}
const end = endingCondition()
debug('polling ending condition: %s', end)
return end
}, pollingInterval)
}

Expand Down