Skip to content

Commit

Permalink
Merge pull request #320 from skalenetwork/bug/SKALE-2983-retry-sgx
Browse files Browse the repository at this point in the history
Bug/skale 2983 retry sgx
  • Loading branch information
olehnikolaiev authored Jul 31, 2020
2 parents 2c303a2 + ea9c315 commit 60d1b70
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
2 changes: 1 addition & 1 deletion libconsensus
Submodule libconsensus updated 54 files
+1 −0 Consensust.cpp
+1 −1 Consensust.h
+16 −0 JsonStubClient.h
+3 −1 SkaleCommon.h
+3 −3 blockproposal/pusher/BlockProposalClientAgent.cpp
+389 −320 crypto/CryptoManager.cpp
+23 −6 crypto/CryptoManager.h
+192 −0 crypto/OpenSSLECDSAKey.cpp
+58 −0 crypto/OpenSSLECDSAKey.h
+2 −1 db/CacheLevelDB.cpp
+25 −5 json/JSONFactory.cpp
+2 −9 messages/InternalMessageEnvelope.cpp
+1 −5 messages/InternalMessageEnvelope.h
+3 −3 network/Utils.cpp
+12 −5 network/ZMQSockets.cpp
+1 −1 network/ZMQSockets.h
+74 −70 node/ConsensusEngine.cpp
+13 −1 node/ConsensusEngine.h
+43 −0 node/Node.cpp
+2 −0 node/Node.h
+1 −1 protocols/binconsensus/BinConsensusInstance.cpp
+2 −3 scripts/tests.py
+0 −0 test/sixteennodes/node01/Node.json
+0 −3 test/sixteennodes/node01/schains/schain1.json
+0 −0 test/sixteennodes/node02/Node.json
+4 −6 test/sixteennodes/node02/schains/schain1.json
+0 −0 test/sixteennodes/node03/Node.json
+3 −6 test/sixteennodes/node03/schains/schain1.json
+0 −0 test/sixteennodes/node04/Node.json
+3 −6 test/sixteennodes/node04/schains/schain1.json
+0 −0 test/sixteennodes/node05/Node.json
+27 −0 test/sixteennodes/node05/schains/schain1.json
+0 −0 test/sixteennodes/node06/Node.json
+27 −0 test/sixteennodes/node06/schains/schain1.json
+0 −0 test/sixteennodes/node07/Node.json
+27 −0 test/sixteennodes/node07/schains/schain1.json
+0 −0 test/sixteennodes/node08/Node.json
+27 −0 test/sixteennodes/node08/schains/schain1.json
+0 −0 test/sixteennodes/node09/Node.json
+27 −0 test/sixteennodes/node09/schains/schain1.json
+3 −6 test/sixteennodes/node10/schains/schain1.json
+3 −6 test/sixteennodes/node11/schains/schain1.json
+3 −6 test/sixteennodes/node12/schains/schain1.json
+3 −6 test/sixteennodes/node13/schains/schain1.json
+3 −6 test/sixteennodes/node14/schains/schain1.json
+3 −6 test/sixteennodes/node15/schains/schain1.json
+3 −6 test/sixteennodes/node16/schains/schain1.json
+0 −30 test/sixteennodes/node5/schains/schain1.json
+0 −30 test/sixteennodes/node6/schains/schain1.json
+0 −30 test/sixteennodes/node7/schains/schain1.json
+0 −30 test/sixteennodes/node8/schains/schain1.json
+0 −30 test/sixteennodes/node9/schains/schain1.json
+91 −0 thirdparty/lru_ordered_cache.hpp
+1 −0 thirdparty/lrucache.hpp
24 changes: 22 additions & 2 deletions libweb3jsonrpc/Skale.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -326,8 +326,28 @@ Json::Value Skale::skale_getSnapshotSignature( unsigned blockNumber ) {
<< cc::warn( "connection refused" ) << std::endl;
}

std::cout << cc::ws_tx( ">>> SGX call >>>" ) << " " << cc::j( joCall ) << std::endl;
skutils::rest::data_t d = cli.call( joCall );
skutils::rest::data_t d;
while ( true ) {
std::cout << cc::ws_tx( ">>> SGX call >>>" ) << " " << cc::j( joCall ) << std::endl;
d = cli.call( joCall );
if ( d.ei_.et_ != skutils::http::common_network_exception::error_type::et_no_error ) {
if ( d.ei_.et_ == skutils::http::common_network_exception::error_type::et_unknown ||
d.ei_.et_ == skutils::http::common_network_exception::error_type::et_fatal ) {
std::cerr << cc::error( "ERROR:" )
<< cc::error( " Exception while trying to connect to sgx server: " )
<< cc::error( " error with connection: " )
<< cc::info( " retrying... " ) << std::endl;
} else {
std::cerr << cc::error( "ERROR:" )
<< cc::error( " Exception while trying to connect to sgx server: " )
<< cc::error( " error with ssl certificates " )
<< cc::error( d.ei_.strError_ ) << std::endl;
}
} else {
break;
}
}

if ( d.empty() ) {
static const char g_strErrMsg[] = "SGX Server call to blsSignMessageHash failed";
std::cout << cc::error( "!!! SGX call error !!!" ) << " " << cc::error( g_strErrMsg )
Expand Down

0 comments on commit 60d1b70

Please sign in to comment.