@@ -14,7 +14,7 @@ import { ChallengeAndResolveClaimParams, challengeAndResolveClaim } from "./help
1414import { saveSnapshot , SaveSnapshotParams } from "./helpers/snapshot" ;
1515import { getTransactionHandler } from "./utils/transactionHandlers" ;
1616
17- const RPC_BLOCK_LIMIT = 500 ; // RPC_BLOCK_LIMIT is the limit of blocks that can be queried at once
17+ const RPC_BLOCK_LIMIT = 1000 ; // RPC_BLOCK_LIMIT is the limit of blocks that can be queried at once
1818
1919/**
2020 * @file This file contains the logic for watching bridge and validating/resolving for claims.
@@ -35,7 +35,7 @@ export const watch = async (
3535 const { path, toSaveSnapshot } = getBotPath ( { cliCommand } ) ;
3636 const networkConfigs = getNetworkConfig ( ) ;
3737 emitter . emit ( BotEvents . STARTED , path , networkConfigs [ 0 ] . networks ) ;
38- const transactionHandlers : { [ epoch : number ] : any } = { } ;
38+ const transactionHandlers : { [ key : string ] : any } = { } ;
3939 const toWatch : { [ key : string ] : { count : number ; epochs : number [ ] } } = { } ;
4040 while ( ! shutDownSignal . getIsShutdownSignal ( ) ) {
4141 for ( const networkConfig of networkConfigs ) {
@@ -49,7 +49,7 @@ async function processNetwork(
4949 path : number ,
5050 toSaveSnapshot : boolean ,
5151 networkConfig : NetworkConfig ,
52- transactionHandlers : { [ epoch : number ] : any } ,
52+ transactionHandlers : { [ key : string ] : any } ,
5353 toWatch : { [ key : string ] : { count : number ; epochs : number [ ] } } ,
5454 emitter : typeof defaultEmitter
5555) : Promise < void > {
@@ -112,7 +112,7 @@ interface ProcessEpochParams {
112112 outboxRPC : string ;
113113 routerRPC : string | undefined ;
114114 toWatch : { [ key : string ] : { count : number ; epochs : number [ ] } } ;
115- transactionHandlers : { [ epoch : number ] : any } ;
115+ transactionHandlers : { [ key : string ] : any } ;
116116 emitter : typeof defaultEmitter ;
117117}
118118async function processEpochsForNetwork ( {
@@ -141,6 +141,7 @@ async function processEpochsForNetwork({
141141 // Checks and saves the snapshot if needed
142142 if ( toSaveSnapshot ) {
143143 const TransactionHandler = getTransactionHandler ( chainId , network ) as any ;
144+ const txnHandlerKey = `${ routeConfig [ network ] . veaInbox . address } _${ currentEpoch } ` ;
144145 const transactionHandler =
145146 transactionHandlers [ currentEpoch ] ||
146147 new TransactionHandler ( {
@@ -163,7 +164,7 @@ async function processEpochsForNetwork({
163164 } as SaveSnapshotParams ) ;
164165 const count = toWatch [ networkKey ] . count ;
165166 if ( count == - 1 || count != latestCount ) {
166- transactionHandlers [ currentEpoch ] = updatedTransactionHandler ;
167+ transactionHandlers [ txnHandlerKey ] = updatedTransactionHandler ;
167168 toWatch [ networkKey ] . count = latestCount ;
168169 }
169170 }
@@ -176,7 +177,6 @@ async function processEpochsForNetwork({
176177 if ( latestBlock . number - epochBlock > RPC_BLOCK_LIMIT ) {
177178 toBlock = epochBlock + RPC_BLOCK_LIMIT ;
178179 }
179-
180180 const claim = await getClaim ( { chainId, veaOutbox, veaOutboxProvider, epoch, fromBlock : epochBlock , toBlock } ) ;
181181
182182 let updatedTransactions ;
0 commit comments