Skip to content

Commit c8ddbb8

Browse files
committed
fix(reku): autocc fromBlock starts from latest+1 rather than latest in realtime mode
1 parent f2ab8b1 commit c8ddbb8

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/reku/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
### AutoCrossCheck
2020
Conceptually it supports 'catchup', 'realtime', 'mix' modes, controled by `fromBlock` and `toBlock`;
21-
- realtime mode: run over the latest block data; enter when `fromBlock` and `toBlock` are NOT present; starts from `latestblocknum` and never ends, always waits until `latestblocknum >= lastcheckpoint + batchBlocksCount`;
21+
- realtime mode: run over the latest block data; enter when `fromBlock` and `toBlock` are NOT present; starts from `latestblocknum+1` and never ends, always waits until `latestblocknum >= lastcheckpoint + batchBlocksCount`;
2222
- catchup mode: run over historical block data; enter when `fromBlock` and `toBlock` is present; starts from `fromBlock` and ends at `toBlock`;
2323
- mix mode: start in catchup mode and transit to realtime mode; enter when `fromBlock` is present and `toBlock` is NOT; auto-transit when `lastcheckpoint > latestblocknum - batchBlocksCount`;
2424

packages/reku/event/crosschecker/autochecker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export class AutoCrossChecker extends BaseCrossChecker {
5454
// TODO: use blockNumber for performance
5555
const latestblocknum = await retryOnNull(async () => await this.provider.provider?.getBlockNumber())
5656
const {
57-
fromBlock = latestblocknum,
57+
fromBlock = latestblocknum + 1,
5858
batchBlocksCount = 10,
5959
pollingInterval = 1000,
6060
blockInterval = ETH_BLOCK_INTERVAL,

0 commit comments

Comments
 (0)