@@ -24,7 +24,6 @@ import {
24
24
DisabledChainsUpdate ,
25
25
GlobalConfigUpdate ,
26
26
LiteChainsIdListUpdate ,
27
- Log ,
28
27
ParsedTokenConfig ,
29
28
RateModelUpdate ,
30
29
RouteRateModelUpdate ,
@@ -43,8 +42,8 @@ type ConfigStoreUpdateSuccess = {
43
42
chainId : number ;
44
43
searchEndBlock : number ;
45
44
events : {
46
- updatedTokenConfigEvents : Log [ ] ;
47
- updatedGlobalConfigEvents : Log [ ] ;
45
+ updatedTokenConfigEvents : SortableEvent [ ] ;
46
+ updatedGlobalConfigEvents : SortableEvent [ ] ;
48
47
globalConfigUpdateTimes : number [ ] ;
49
48
} ;
50
49
} ;
@@ -341,8 +340,13 @@ export class AcrossConfigStoreClient extends BaseAbstractClient {
341
340
paginatedEventQuery ( this . configStore , this . configStore . filters . UpdatedGlobalConfig ( ) , searchConfig ) ,
342
341
] ) ;
343
342
343
+ const updatedTokenConfigSortableEvents = updatedTokenConfigEvents . map ( spreadEventWithBlockNumber ) ;
344
+ const updatedGlobalConfigSortableEvents = updatedGlobalConfigEvents . map ( spreadEventWithBlockNumber ) ;
345
+
344
346
// Events *should* normally be received in ascending order, but explicitly enforce the ordering.
345
- [ updatedTokenConfigEvents , updatedGlobalConfigEvents ] . forEach ( ( events ) => sortEventsAscendingInPlace ( events ) ) ;
347
+ [ updatedTokenConfigSortableEvents , updatedGlobalConfigSortableEvents ] . forEach ( ( events ) =>
348
+ sortEventsAscendingInPlace ( events )
349
+ ) ;
346
350
347
351
const globalConfigUpdateTimes = (
348
352
await Promise . all ( updatedGlobalConfigEvents . map ( ( event ) => this . configStore . provider . getBlock ( event . blockNumber ) ) )
@@ -353,8 +357,8 @@ export class AcrossConfigStoreClient extends BaseAbstractClient {
353
357
chainId,
354
358
searchEndBlock : searchConfig . to ,
355
359
events : {
356
- updatedTokenConfigEvents,
357
- updatedGlobalConfigEvents,
360
+ updatedTokenConfigEvents : updatedTokenConfigSortableEvents ,
361
+ updatedGlobalConfigEvents : updatedGlobalConfigSortableEvents ,
358
362
globalConfigUpdateTimes,
359
363
} ,
360
364
} ;
@@ -380,13 +384,11 @@ export class AcrossConfigStoreClient extends BaseAbstractClient {
380
384
// Save new TokenConfig updates.
381
385
for ( const event of updatedTokenConfigEvents ) {
382
386
// If transaction hash is known to be invalid, skip it immediately to avoid creating extra logs.
383
- if ( KNOWN_INVALID_TOKEN_CONFIG_UPDATE_HASHES . includes ( event . transactionHash . toLowerCase ( ) ) ) {
387
+ if ( KNOWN_INVALID_TOKEN_CONFIG_UPDATE_HASHES . includes ( event . txnRef . toLowerCase ( ) ) ) {
384
388
continue ;
385
389
}
386
390
387
- const args = {
388
- ...( spreadEventWithBlockNumber ( event ) as TokenConfig ) ,
389
- } ;
391
+ const args = event as TokenConfig ;
390
392
391
393
try {
392
394
const { rateModel, routeRateModel, spokeTargetBalances } = this . validateTokenConfigUpdate ( args ) ;
@@ -418,7 +420,7 @@ export class AcrossConfigStoreClient extends BaseAbstractClient {
418
420
this . logger . debug ( {
419
421
at : "ConfigStoreClient::update" ,
420
422
message : `Skipping invalid historical update at block ${ event . blockNumber } ` ,
421
- transactionHash : event . transactionHash ,
423
+ txnRef : event . txnRef ,
422
424
} ) ;
423
425
}
424
426
continue ;
@@ -427,7 +429,7 @@ export class AcrossConfigStoreClient extends BaseAbstractClient {
427
429
428
430
// Save new Global config updates.
429
431
for ( let i = 0 ; i < updatedGlobalConfigEvents . length ; i ++ ) {
430
- const args = spreadEventWithBlockNumber ( updatedGlobalConfigEvents [ i ] ) as SortableEvent & {
432
+ const args = updatedGlobalConfigEvents [ i ] as SortableEvent & {
431
433
key : string ;
432
434
// eslint-disable-next-line @typescript-eslint/no-explicit-any
433
435
value : any ;
@@ -562,7 +564,7 @@ export class AcrossConfigStoreClient extends BaseAbstractClient {
562
564
rateModel : string | undefined ;
563
565
routeRateModel : RouteRateModelUpdate [ "routeRateModel" ] ;
564
566
} {
565
- const { value, key, transactionHash } = args ;
567
+ const { value, key, txnRef } = args ;
566
568
const parsedValue = parseJSONWithNumericString ( value ) as ParsedTokenConfig ;
567
569
const l1Token = key ;
568
570
@@ -578,7 +580,7 @@ export class AcrossConfigStoreClient extends BaseAbstractClient {
578
580
const rateModel = parsedValue . rateModel ;
579
581
assert (
580
582
this . isValidRateModel ( rateModel ) ,
581
- `Invalid rateModel UBar for ${ l1Token } at transaction ${ transactionHash } , ${ JSON . stringify ( rateModel ) } `
583
+ `Invalid rateModel UBar for ${ l1Token } at transaction ${ txnRef } , ${ JSON . stringify ( rateModel ) } `
582
584
) ;
583
585
rateModelForToken = JSON . stringify ( rateModel ) ;
584
586
@@ -601,7 +603,7 @@ export class AcrossConfigStoreClient extends BaseAbstractClient {
601
603
Object . entries ( parsedValue . routeRateModel ) . map ( ( [ path , routeRateModel ] ) => {
602
604
assert (
603
605
this . isValidRateModel ( routeRateModel ) &&
604
- `Invalid routeRateModel UBar for ${ path } for ${ l1Token } at transaction ${ transactionHash } , ${ JSON . stringify (
606
+ `Invalid routeRateModel UBar for ${ path } for ${ l1Token } at transaction ${ txnRef } , ${ JSON . stringify (
605
607
routeRateModel
606
608
) } `
607
609
) ;
0 commit comments