diff --git a/libconsensus b/libconsensus index edd89ea28..ad673965d 160000 --- a/libconsensus +++ b/libconsensus @@ -1 +1 @@ -Subproject commit edd89ea28671463df2c26dd4889ba3df8495f0c4 +Subproject commit ad673965d6ac193ded024a427c76c67df63663aa diff --git a/libethereum/ChainParams.cpp b/libethereum/ChainParams.cpp index d4363b600..ea78be838 100644 --- a/libethereum/ChainParams.cpp +++ b/libethereum/ChainParams.cpp @@ -270,11 +270,15 @@ ChainParams ChainParams::loadConfig( auto groupNodesObj = nodeGroupObj["nodes"].get_obj(); for ( const auto& groupNodeConf : groupNodesObj ) { auto groupNodeConfObj = groupNodeConf.second.get_array(); - u256 id = groupNodeConfObj[0].get_uint64(); - u256 sChainIndex = groupNodeConfObj[1].get_uint64(); + u256 sChainIndex = groupNodeConfObj[0].get_uint64(); + u256 id = groupNodeConfObj[1].get_uint64(); std::string publicKey = groupNodeConfObj[2].get_str(); groupNodes.push_back( { id, sChainIndex, publicKey } ); } + std::sort( groupNodes.begin(), groupNodes.end(), + []( const GroupNode& lhs, const GroupNode& rhs ) { + return lhs.schainIndex < rhs.schainIndex; + } ); nodeGroup.nodes = groupNodes; std::array< std::string, 4 > nodeGroupBlsPublicKey; diff --git a/libethereum/SkaleHost.cpp b/libethereum/SkaleHost.cpp index 3d15f2992..76c9cf142 100644 --- a/libethereum/SkaleHost.cpp +++ b/libethereum/SkaleHost.cpp @@ -201,7 +201,7 @@ void DefaultConsensusFactory::fillRotationHistory( ConsensusEngine& consensus ) std::vector< uint64_t > nodes; // add ecdsa keys info and historic groups info for ( const auto& node : nodeGroup.nodes ) { - historicECDSAKeys[u256toUint64( node.id )] = node.publicKey; + historicECDSAKeys[u256toUint64( node.id )] = node.publicKey.substr( 2 ); nodes.push_back( u256toUint64( node.id ) ); } historicNodeGroups[nodeGroup.finishTs] = nodes;