@@ -1744,19 +1744,16 @@ class AccountPatcher {
17441744 res . write ( `Total execution time: ${ totalTimeMs } ms\n` )
17451745 res . write ( `Total accounts processed: ${ report . summary . totalAccounts } \n` )
17461746 res . write ( `Fully matching accounts: ${ report . summary . fullyMatching } \n` )
1747- res . write ( `Cache-Trie timestamp matches: ${ report . summary . ctt } \n` )
17481747 res . write ( `Cache-Trie hash matches: ${ report . summary . cth } \n` )
17491748 res . write ( `Cache-Storage timestamp matches: ${ report . summary . cst } \n` )
17501749 res . write ( `Cache-Storage hash matches: ${ report . summary . csh } \n` )
1751- res . write ( `Trie-Storage timestamp matches: ${ report . summary . tst } \n` )
17521750 res . write ( `Trie-Storage hash matches: ${ report . summary . tsh } \n\n` )
17531751
17541752 res . write ( '=== CHUNK PERFORMANCE ===\n' )
17551753 for ( const chunk of report . summary . chunks ) {
17561754 if ( chunk . recordsProcessed > 0 ) {
17571755 res . write (
1758- `Chunk ${ chunk . chunkIndex } : ${ chunk . recordsProcessed } records in ${
1759- chunk . timeSpentMs
1756+ `Chunk ${ chunk . chunkIndex } : ${ chunk . recordsProcessed } records in ${ chunk . timeSpentMs
17601757 } ms (${ chunk . low . substring ( 0 , 4 ) } ...)\n`
17611758 )
17621759 }
@@ -1769,7 +1766,7 @@ class AccountPatcher {
17691766 let accountsToShow = report . accounts
17701767 if ( onlyMismatch ) {
17711768 accountsToShow = report . accounts . filter (
1772- ( account ) => ! account . ctt || ! account . cth || ! account . cst || ! account . csh || ! account . tst || ! account . tsh
1769+ ( account ) => ! account . cth || ! account . cst || ! account . csh || ! account . tsh
17731770 )
17741771 }
17751772
@@ -1788,7 +1785,7 @@ class AccountPatcher {
17881785 }
17891786 if ( account . trie ) {
17901787 res . write (
1791- ` Trie: hash=${ account . trie . hash . substring ( 0 , 8 ) } ... timestamp= ${ account . trie . timestamp || 'N/A' } \n`
1788+ ` Trie: hash=${ account . trie . hash . substring ( 0 , 8 ) } ...\n`
17921789 )
17931790 } else {
17941791 res . write ( ` Trie: [missing]\n` )
@@ -1801,7 +1798,7 @@ class AccountPatcher {
18011798 res . write ( ` Storage: [missing]\n` )
18021799 }
18031800 res . write (
1804- ` Matches: ctt= ${ account . ctt } cth=${ account . cth } cst=${ account . cst } csh=${ account . csh } tst= ${ account . tst } tsh=${ account . tsh } \n\n`
1801+ ` Matches: cth=${ account . cth } cst=${ account . cst } csh=${ account . csh } tsh=${ account . tsh } \n\n`
18051802 )
18061803 }
18071804 }
@@ -2454,8 +2451,7 @@ class AccountPatcher {
24542451 if ( coverageEntry == null || coverageEntry . firstChoice == null ) {
24552452 const numActiveNodes = this . stateManager . currentCycleShardData . nodes . length
24562453 this . statemanager_fatal (
2457- `getNodeForQuery null ${ coverageEntry == null } ${
2458- coverageEntry ?. firstChoice == null
2454+ `getNodeForQuery null ${ coverageEntry == null } ${ coverageEntry ?. firstChoice == null
24592455 } numActiveNodes:${ numActiveNodes } `,
24602456 `getNodeForQuery null ${ coverageEntry == null } ${ coverageEntry ?. firstChoice == null } `
24612457 )
@@ -2973,8 +2969,7 @@ class AccountPatcher {
29732969 /* prettier-ignore */ nestedCountersInstance . countEvent ( `accountPatcher` , `not enough votes ${ radix } ${ utils . makeShortHash ( votesMap . bestHash ) } uniqueVotes: ${ votesMap . allVotes . size } ` , 1 )
29742970 this . statemanager_fatal (
29752971 'debug findBadAccounts' ,
2976- `debug findBadAccounts ${ cycle } : ${ radix } bestVotes${
2977- votesMap . bestVotes
2972+ `debug findBadAccounts ${ cycle } : ${ radix } bestVotes${ votesMap . bestVotes
29782973 } < minVotes:${ minVotes } uniqueVotes: ${ votesMap . allVotes . size } ${ utils . stringifyReduce ( simpleMap ) } `
29792974 )
29802975 }
@@ -3042,10 +3037,8 @@ class AccountPatcher {
30423037 }
30433038 this . statemanager_fatal (
30443039 'debug findBadAccounts' ,
3045- `debug findBadAccounts ${ cycle } : ${
3046- radixToFix . radix
3047- } isInNonConsensusRange: ${ hasNonConsensusRange } isInNonStorageRange: ${ hasNonStorageRange } bestVotes ${
3048- votesMap . bestVotes
3040+ `debug findBadAccounts ${ cycle } : ${ radixToFix . radix
3041+ } isInNonConsensusRange: ${ hasNonConsensusRange } isInNonStorageRange: ${ hasNonStorageRange } bestVotes ${ votesMap . bestVotes
30493042 } minVotes:${ minVotes } uniqueVotes: ${ votesMap . allVotes . size } ${ utils . stringifyReduce ( simpleMap ) } `
30503043 )
30513044 }
@@ -3799,8 +3792,7 @@ class AccountPatcher {
37993792
38003793 if ( logFlags . debug ) {
38013794 this . mainLogger . debug (
3802- `badAccounts cycle: ${ cycle } , ourBadAccounts: ${
3803- results . badAccounts . length
3795+ `badAccounts cycle: ${ cycle } , ourBadAccounts: ${ results . badAccounts . length
38043796 } , ourBadAccounts: ${ Utils . safeStringify ( results . badAccounts ) } `
38053797 )
38063798 }
@@ -3810,8 +3802,7 @@ class AccountPatcher {
38103802 accountsTheyNeedToRepair = accountsTheyNeedToRepair . concat ( results . extraBadAccounts )
38113803 }
38123804 this . mainLogger . debug (
3813- `badAccounts cycle: ${ cycle } , accountsTheyNeedToRepair: ${
3814- accountsTheyNeedToRepair . length
3805+ `badAccounts cycle: ${ cycle } , accountsTheyNeedToRepair: ${ accountsTheyNeedToRepair . length
38153806 } , accountsTheyNeedToRepair: ${ Utils . safeStringify ( accountsTheyNeedToRepair ) } `
38163807 )
38173808 fireAndForget ( ( ) => this . requestOtherNodesToRepair ( accountsTheyNeedToRepair ) )
@@ -3883,8 +3874,7 @@ class AccountPatcher {
38833874 'checkAndSetAccountData updateTooOld' ,
38843875 `checkAndSetAccountData updateTooOld ${ cycle } : acc:${ utils . stringifyReduce (
38853876 wrappedData . accountId
3886- ) } updateTS:${ wrappedData . timestamp } updateHash:${ utils . stringifyReduce ( wrappedData . stateId ) } cacheTS:${
3887- accountMemData . t
3877+ ) } updateTS:${ wrappedData . timestamp } updateHash:${ utils . stringifyReduce ( wrappedData . stateId ) } cacheTS:${ accountMemData . t
38883878 } cacheHash:${ utils . stringifyReduce ( accountMemData . h ) } `
38893879 )
38903880 filterStats . tooOld ++
@@ -4101,8 +4091,7 @@ class AccountPatcher {
41014091 )
41024092 this . statemanager_fatal (
41034093 'isInSync = false' ,
4104- `bad accounts cycle:${ cycle } bad:${ results . badAccounts . length } received:${ wrappedDataList . length } failedH: ${
4105- failedHashes . length
4094+ `bad accounts cycle:${ cycle } bad:${ results . badAccounts . length } received:${ wrappedDataList . length } failedH: ${ failedHashes . length
41064095 } filtered:${ utils . stringifyReduce ( filterStats ) } stats:${ utils . stringifyReduce (
41074096 results . stats
41084097 ) } getAccountStats: ${ utils . stringifyReduce ( getAccountStats ) } details: ${ utils . stringifyReduceLimit (
@@ -4688,8 +4677,7 @@ class AccountPatcher {
46884677 }
46894678
46904679 stream . write (
4691- `node: ${ nodesCovered . id } ${ nodesCovered . ipPort } \tgraph: ${ partitionGraph } \thome: ${
4692- nodesCovered . hP
4680+ `node: ${ nodesCovered . id } ${ nodesCovered . ipPort } \tgraph: ${ partitionGraph } \thome: ${ nodesCovered . hP
46934681 } data:${ Utils . safeStringify ( nodesCovered ) } \n`
46944682 )
46954683 }
@@ -4737,11 +4725,9 @@ class AccountPatcher {
47374725 summary : {
47384726 totalAccounts : number
47394727 fullyMatching : number
4740- ctt : number // cache-trie timestamp matches
47414728 cth : number // cache-trie hash matches
47424729 cst : number // cache-storage timestamp matches
47434730 csh : number // cache-storage hash matches
4744- tst : number // trie-storage timestamp matches
47454731 tsh : number // trie-storage hash matches
47464732 chunks : Array < {
47474733 chunkIndex : number
@@ -4754,13 +4740,11 @@ class AccountPatcher {
47544740 accounts ?: Array < {
47554741 accountId : string
47564742 cache ?: { hash : string ; timestamp : number }
4757- trie ?: { hash : string ; timestamp ?: number }
4743+ trie ?: { hash : string }
47584744 storage ?: { hash : string ; timestamp : number }
4759- ctt : boolean
47604745 cth : boolean
47614746 cst : boolean
47624747 csh : boolean
4763- tst : boolean
47644748 tsh : boolean
47654749 } >
47664750 } > {
@@ -4770,11 +4754,9 @@ class AccountPatcher {
47704754 const summary = {
47714755 totalAccounts : 0 ,
47724756 fullyMatching : 0 ,
4773- ctt : 0 , // cache-trie timestamp matches
47744757 cth : 0 , // cache-trie hash matches
47754758 cst : 0 , // cache-storage timestamp matches
47764759 csh : 0 , // cache-storage hash matches
4777- tst : 0 , // trie-storage timestamp matches
47784760 tsh : 0 , // trie-storage hash matches
47794761 chunks : [ ] as Array < {
47804762 chunkIndex : number
@@ -4788,13 +4770,11 @@ class AccountPatcher {
47884770 const allAccountResults : Array < {
47894771 accountId : string
47904772 cache ?: { hash : string ; timestamp : number }
4791- trie ?: { hash : string ; timestamp ?: number }
4773+ trie ?: { hash : string }
47924774 storage ?: { hash : string ; timestamp : number }
4793- ctt : boolean
47944775 cth : boolean
47954776 cst : boolean
47964777 csh : boolean
4797- tst : boolean
47984778 tsh : boolean
47994779 } > = [ ]
48004780
@@ -4807,7 +4787,7 @@ class AccountPatcher {
48074787
48084788 // Maps to store data from each structure for this chunk
48094789 const cacheData = new Map < string , { hash : string ; timestamp : number } > ( )
4810- const trieData = new Map < string , { hash : string ; timestamp ?: number } > ( )
4790+ const trieData = new Map < string , { hash : string } > ( )
48114791 const storageData = new Map < string , { hash : string ; timestamp : number } > ( )
48124792 const allAccountIds = new Set < string > ( )
48134793
@@ -4914,24 +4894,20 @@ class AccountPatcher {
49144894 const storage = storageData . get ( accountId )
49154895
49164896 // Calculate comparison flags
4917- const ctt = cache && trie ? cache . timestamp === ( trie . timestamp || 0 ) : false
49184897 const cth = cache && trie ? cache . hash === trie . hash : false
49194898 const cst = cache && storage ? cache . timestamp === storage . timestamp : false
49204899 const csh = cache && storage ? cache . hash === storage . hash : false
4921- const tst = trie && storage ? ( trie . timestamp || 0 ) === storage . timestamp : false
49224900 const tsh = trie && storage ? trie . hash === storage . hash : false
49234901
49244902 // Update summary counters
49254903 summary . totalAccounts ++
4926- if ( ctt ) summary . ctt ++
49274904 if ( cth ) summary . cth ++
49284905 if ( cst ) summary . cst ++
49294906 if ( csh ) summary . csh ++
4930- if ( tst ) summary . tst ++
49314907 if ( tsh ) summary . tsh ++
49324908
4933- // Check if fully matching (all present and all match )
4934- if ( cache && trie && storage && ctt && cth && cst && csh && tst && tsh ) {
4909+ // Check if fully matching (all present and all hash matches )
4910+ if ( cache && trie && storage && cth && cst && csh && tsh ) {
49354911 summary . fullyMatching ++
49364912 }
49374913
@@ -4941,11 +4917,9 @@ class AccountPatcher {
49414917 cache,
49424918 trie,
49434919 storage,
4944- ctt,
49454920 cth,
49464921 cst,
49474922 csh,
4948- tst,
49494923 tsh,
49504924 } )
49514925
0 commit comments