Skip to content

Commit

Permalink
Merge pull request #1586 from skalenetwork/ticket-1584/network-re-dis…
Browse files Browse the repository at this point in the history
…covery-issues

Ticket-1584 Fixed re-discovery issues for own S-chain and connected S-chains
  • Loading branch information
sergiy-skalelabs authored Sep 13, 2023
2 parents b914ef5 + 862c5eb commit 0d09858
Show file tree
Hide file tree
Showing 5 changed files with 216 additions and 67 deletions.
11 changes: 7 additions & 4 deletions agent/bls.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ function discoverPublicKeyByIndex( nNodeIndex, joSChainNetworkInfo, details, isT
const imaState = state.get();
joSChainNetworkInfo = joSChainNetworkInfo || imaState.joSChainNetworkInfo;
const jarrNodes = joSChainNetworkInfo.network;
const cntNodes = jarrNodes.length;
const joNode = jarrNodes[nNodeIndex];
if( joNode && "imaInfo" in joNode && typeof joNode.imaInfo === "object" &&
"BLSPublicKey0" in joNode.imaInfo &&
Expand All @@ -159,10 +160,12 @@ function discoverPublicKeyByIndex( nNodeIndex, joSChainNetworkInfo, details, isT
};
}
details.write( cc.fatal( "CRITICAL ERROR:" ) +
cc.error( " BLS 1/16 public key discovery failed for node #" ) + cc.info( nNodeIndex ) +
cc.error( ", node data is: " ) + cc.j( joNode ) + "\n" );
if( isThrowException )
throw new Error( "BLS 1/16 public key discovery failed for node #" + nNodeIndex );
cc.error( " BLS 1/" + cntNodes + " public key discovery failed for node #" ) +
cc.info( nNodeIndex ) + cc.error( ", node data is: " ) + cc.j( joNode ) + "\n" );
if( isThrowException ) {
throw new Error(
"BLS 1/" + cntNodes + " public key discovery failed for node #" + nNodeIndex );
}
return null;
}

Expand Down
Loading

0 comments on commit 0d09858

Please sign in to comment.