@@ -1207,7 +1207,8 @@ async function prepareSignMessagesImpl( optsSignOperation ) {
1207
1207
optsSignOperation . nCountOfBlsPartsToCollect = 0 + optsSignOperation . nThreshold ;
1208
1208
if ( log . verboseGet ( ) >= log . verboseReversed ( ) . trace ) {
1209
1209
optsSignOperation . details . write ( optsSignOperation . strLogPrefix +
1210
- cc . debug ( "Will collect " ) + cc . info ( optsSignOperation . nCountOfBlsPartsToCollect ) +
1210
+ cc . debug ( "Will BLS-collect " ) +
1211
+ cc . info ( optsSignOperation . nCountOfBlsPartsToCollect ) +
1211
1212
cc . debug ( " from " ) + cc . info ( optsSignOperation . jarrNodes . length ) +
1212
1213
cc . debug ( " nodes" ) + cc . debug ( ", " ) + cc . notice ( "sequence ID" ) +
1213
1214
cc . debug ( " is " ) + cc . attention ( optsSignOperation . sequenceId ) + "\n" ) ;
@@ -1223,6 +1224,24 @@ async function gatherSigningStartImpl( optsSignOperation ) {
1223
1224
optsSignOperation . errGathering = null ;
1224
1225
optsSignOperation . promiseCompleteGathering = new Promise ( ( resolve , reject ) => {
1225
1226
const iv = setInterval ( function ( ) {
1227
+ if ( optsSignOperation . joGatheringTracker . nCountReceivedPrevious !=
1228
+ optsSignOperation . joGatheringTracker . nCountReceived ) {
1229
+ if ( log . verboseGet ( ) >= log . verboseReversed ( ) . debug ) {
1230
+ optsSignOperation . details . write (
1231
+ cc . bright ( optsSignOperation . strDirection ) + cc . debug ( "/" ) +
1232
+ cc . attention ( "#" ) + cc . sunny ( optsSignOperation . nTransferLoopCounter ) +
1233
+ cc . debug ( " BLS signature gathering progress updated, now have " ) +
1234
+ cc . info ( optsSignOperation . joGatheringTracker . nCountReceived ) +
1235
+ cc . debug ( " BLS parts of " ) +
1236
+ cc . info ( optsSignOperation . nCountOfBlsPartsToCollect ) +
1237
+ cc . debug ( " arrived, have " ) + cc . info ( optsSignOperation . cntSuccess ) +
1238
+ cc . debug ( " success(es) and " ) +
1239
+ cc . info ( optsSignOperation . joGatheringTracker . nCountErrors ) +
1240
+ cc . debug ( " error(s)" ) + "\n" ) ;
1241
+ }
1242
+ optsSignOperation . joGatheringTracker . nCountReceivedPrevious =
1243
+ 0 + optsSignOperation . joGatheringTracker . nCountReceived ;
1244
+ }
1226
1245
++ optsSignOperation . joGatheringTracker . nWaitIntervalStepsDone ;
1227
1246
optsSignOperation . cntSuccess =
1228
1247
optsSignOperation . joGatheringTracker . nCountReceived -
@@ -1297,7 +1316,7 @@ async function gatherSigningStartImpl( optsSignOperation ) {
1297
1316
cc . debug ( ", glue result is " ) + cc . j ( joGlueResult ) + "\n" ;
1298
1317
if ( log . verboseGet ( ) >= log . verboseReversed ( ) . trace )
1299
1318
optsSignOperation . details . write ( strCallbackCallDescription ) ;
1300
- optsSignOperation . fn ( // NOTICE: no await here, executed async
1319
+ optsSignOperation . fn (
1301
1320
strError , optsSignOperation . jarrMessages , joGlueResult )
1302
1321
. catch ( ( err ) => {
1303
1322
if ( log . verboseGet ( ) >= log . verboseReversed ( ) . critical ) {
@@ -1325,7 +1344,7 @@ async function gatherSigningStartImpl( optsSignOperation ) {
1325
1344
if ( optsSignOperation . joGatheringTracker . nCountReceived >=
1326
1345
optsSignOperation . jarrNodes . length ) {
1327
1346
clearInterval ( iv ) ;
1328
- optsSignOperation . fn ( // NOTICE: no await here, executed async
1347
+ optsSignOperation . fn (
1329
1348
"signature error(2), got " +
1330
1349
optsSignOperation . joGatheringTracker . nCountErrors +
1331
1350
" errors(s) for " + optsSignOperation . jarrNodes . length +
@@ -1360,7 +1379,7 @@ async function gatherSigningStartImpl( optsSignOperation ) {
1360
1379
optsSignOperation . joGatheringTracker . nWaitIntervalMaxSteps
1361
1380
) {
1362
1381
clearInterval ( iv ) ;
1363
- optsSignOperation . fn ( // NOTICE: no await here, executed async
1382
+ optsSignOperation . fn (
1364
1383
"signature error(3), got " +
1365
1384
optsSignOperation . joGatheringTracker . nCountErrors +
1366
1385
" errors(s) for " + optsSignOperation . jarrNodes . length + " node(s)" ,
@@ -1548,7 +1567,7 @@ async function doSignProcessHandleCall(
1548
1567
joNode , joParams ,
1549
1568
joIn , joOut , err , strNodeURL , i
1550
1569
) {
1551
- ++ optsSignOperation . joGatheringTracker . nCountReceived ; // including errors
1570
+ ++ optsSignOperation . joGatheringTracker . nCountReceived ;
1552
1571
if ( err ) {
1553
1572
++ optsSignOperation . joGatheringTracker . nCountErrors ;
1554
1573
const strErrorMessage =
@@ -1742,10 +1761,10 @@ async function doSignProcessOneImpl( i, optsSignOperation ) {
1742
1761
cc . debug ( ", " ) + cc . notice ( "sequence ID" ) + cc . debug ( " is " ) +
1743
1762
cc . attention ( optsSignOperation . sequenceId ) ;
1744
1763
const rpcCallOpts = null ;
1745
- rpcCall . create ( // NOTICE: no await here, executed async
1764
+ rpcCall . create (
1746
1765
strNodeURL , rpcCallOpts , async function ( joCall , err ) {
1747
1766
if ( err ) {
1748
- ++ optsSignOperation . joGatheringTracker . nCountReceived ; // including errors
1767
+ ++ optsSignOperation . joGatheringTracker . nCountReceived ;
1749
1768
++ optsSignOperation . joGatheringTracker . nCountErrors ;
1750
1769
const strErrorMessage =
1751
1770
optsSignOperation . strLogPrefix + cc . fatal ( "CRITICAL ERROR:" ) +
@@ -1844,7 +1863,8 @@ async function doSignMessagesImpl(
1844
1863
cc . attention ( optsSignOperation . imaState . isCrossImaBlsMode ? "IMA agent" : "skaled" ) +
1845
1864
cc . info ( ":" ) + " " ;
1846
1865
optsSignOperation . joGatheringTracker = {
1847
- nCountReceived : 0 , // including errors
1866
+ nCountReceivedPrevious : 0 ,
1867
+ nCountReceived : 0 ,
1848
1868
nCountErrors : 0 ,
1849
1869
nCountSkipped : 0 ,
1850
1870
nWaitIntervalStepMilliseconds : 100 ,
@@ -1877,7 +1897,7 @@ async function doSignMessagesImpl(
1877
1897
}
1878
1898
break ;
1879
1899
}
1880
- await doSignProcessOneImpl ( i , optsSignOperation ) ;
1900
+ doSignProcessOneImpl ( i , optsSignOperation ) ;
1881
1901
}
1882
1902
await gatherSigningStartImpl ( optsSignOperation ) ;
1883
1903
await gatherSigningFinishImpl ( optsSignOperation ) ;
@@ -2032,8 +2052,8 @@ async function doSignU256OneImpl( optsSignU256 ) {
2032
2052
cc . debug ( ", ID " ) + cc . info ( joNode . nodeID ) + cc . debug ( ")" ) ;
2033
2053
const rpcCallOpts = null ;
2034
2054
await rpcCall . create ( strNodeURL , rpcCallOpts , async function ( joCall , err ) {
2055
+ ++ optsSignU256 . joGatheringTracker . nCountReceived ;
2035
2056
if ( err ) {
2036
- ++ optsSignU256 . joGatheringTracker . nCountReceived ; // including errors
2037
2057
++ optsSignU256 . joGatheringTracker . nCountErrors ;
2038
2058
const strErrorMessage =
2039
2059
optsSignU256 . strLogPrefix + cc . fatal ( "CRITICAL ERROR:" ) +
@@ -2062,7 +2082,7 @@ async function doSignU256OneImpl( optsSignU256 ) {
2062
2082
"valueToSign" : optsSignU256 . u256 // must be 0x string, came from outside 0x string
2063
2083
}
2064
2084
} , async function ( joIn , joOut , err ) {
2065
- ++ optsSignU256 . joGatheringTracker . nCountReceived ; // including errors
2085
+ ++ optsSignU256 . joGatheringTracker . nCountReceived ;
2066
2086
if ( err ) {
2067
2087
++ optsSignU256 . joGatheringTracker . nCountErrors ;
2068
2088
const strErrorMessage =
@@ -2220,6 +2240,23 @@ async function doSignU256Gathering( optsSignU256 ) {
2220
2240
optsSignU256 . errGathering = null ;
2221
2241
optsSignU256 . promiseCompleteGathering = new Promise ( ( resolve , reject ) => {
2222
2242
const iv = setInterval ( function ( ) {
2243
+ if ( optsSignU256 . joGatheringTracker . nCountReceivedPrevious !=
2244
+ optsSignU256 . joGatheringTracker . nCountReceived ) {
2245
+ if ( log . verboseGet ( ) >= log . verboseReversed ( ) . debug ) {
2246
+ optsSignU256 . details . write (
2247
+ cc . info ( "BLS u256" ) +
2248
+ cc . debug ( " BLS signature gathering progress updated, now have " ) +
2249
+ cc . info ( optsSignU256 . joGatheringTracker . nCountReceived ) +
2250
+ cc . debug ( " BLS parts of " ) +
2251
+ cc . info ( optsSignU256 . nCountOfBlsPartsToCollect ) +
2252
+ cc . debug ( " arrived, have " ) + cc . info ( optsSignU256 . cntSuccess ) +
2253
+ cc . debug ( " success(es) and " ) +
2254
+ cc . info ( optsSignU256 . joGatheringTracker . nCountErrors ) +
2255
+ cc . debug ( " error(s)" ) + "\n" ) ;
2256
+ }
2257
+ optsSignU256 . joGatheringTracker . nCountReceivedPrevious =
2258
+ 0 + optsSignU256 . joGatheringTracker . nCountReceived ;
2259
+ }
2223
2260
++ optsSignU256 . joGatheringTracker . nWaitIntervalStepsDone ;
2224
2261
const cntSuccess =
2225
2262
optsSignU256 . joGatheringTracker . nCountReceived -
@@ -2291,7 +2328,7 @@ async function doSignU256Gathering( optsSignU256 ) {
2291
2328
cc . debug ( ", glue result is " ) + cc . j ( joGlueResult ) + "\n" ;
2292
2329
if ( log . verboseGet ( ) >= log . verboseReversed ( ) . trace )
2293
2330
optsSignU256 . details . write ( strCallbackCallDescription ) ;
2294
- optsSignU256 . fn ( // NOTICE: no await here, executed async
2331
+ optsSignU256 . fn (
2295
2332
strError , optsSignU256 . u256 , joGlueResult )
2296
2333
. catch ( ( err ) => {
2297
2334
if ( log . verboseGet ( ) >= log . verboseReversed ( ) . critical ) {
@@ -2318,7 +2355,7 @@ async function doSignU256Gathering( optsSignU256 ) {
2318
2355
if ( optsSignU256 . joGatheringTracker . nCountReceived >=
2319
2356
optsSignU256 . jarrNodes . length ) {
2320
2357
clearInterval ( iv ) ;
2321
- optsSignU256 . fn ( // NOTICE: no await here, executed async
2358
+ optsSignU256 . fn (
2322
2359
"signature error(2, u256), got " +
2323
2360
optsSignU256 . joGatheringTracker . nCountErrors +
2324
2361
" errors(s) for " + optsSignU256 . jarrNodes . length + " node(s)" ,
@@ -2350,7 +2387,7 @@ async function doSignU256Gathering( optsSignU256 ) {
2350
2387
optsSignU256 . joGatheringTracker . nWaitIntervalMaxSteps
2351
2388
) {
2352
2389
clearInterval ( iv ) ;
2353
- optsSignU256 . fn ( // NOTICE: no await here, executed async
2390
+ optsSignU256 . fn (
2354
2391
"signature error(3, u256), got " +
2355
2392
optsSignU256 . joGatheringTracker . nCountErrors +
2356
2393
" errors(s) for " + optsSignU256 . jarrNodes . length + " node(s)" ,
@@ -2389,7 +2426,8 @@ export async function doSignU256( u256, details, fn ) {
2389
2426
imaState : state . get ( ) ,
2390
2427
strLogPrefix : cc . info ( "Sign u256:" ) + " " ,
2391
2428
joGatheringTracker : {
2392
- nCountReceived : 0 , // including errors
2429
+ nCountReceivedPrevious : 0 ,
2430
+ nCountReceived : 0 ,
2393
2431
nCountErrors : 0 ,
2394
2432
nCountSkipped : 0 ,
2395
2433
nWaitIntervalStepMilliseconds : 100 ,
0 commit comments