Skip to content

Commit 5f90fba

Browse files
committed
Merge branch '928-move-to-new-bls-version' of https://github.com/skalenetwork/skale-consensus into 928-move-to-new-bls-version
2 parents a83e9d3 + 121aeb1 commit 5f90fba

29 files changed

+55
-84
lines changed

.github/workflows/buildm.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build and test skale-consensus Mirage
1+
name: Build and test skale-consensus FAIR
22
on: [push]
33
jobs:
44
build:
@@ -171,9 +171,9 @@ jobs:
171171
sudo apt-get install -y nettle-dev gnutls-dev
172172
cd deps && ./build.sh BUILD_LIBSEC256K1=1 && cd ..
173173
174-
- name: build consensus Mirage
174+
- name: build consensus Fair
175175
run: |
176-
cd scripts && ./build.py Debug -buildMIRAGE
176+
cd scripts && ./build.py Debug -buildFAIR
177177
- name: run tests
178178
run: cd scripts && export CI_BUILD=1 && ./tests.py && cd ..
179179

.idea/workspace.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CMakeLists.txt

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ if (BITE)
55
add_definitions(-DBITE)
66
endif ()
77

8-
if (MIRAGE)
9-
set(MIRAGE "1")
10-
add_definitions(-DMIRAGE)
8+
if (FAIR)
9+
set(FAIR "1")
10+
add_definitions(-DFAIR)
1111
set(BITE "1")
1212
add_definitions(-DBITE)
1313
endif ()
@@ -155,7 +155,7 @@ AUX_SOURCE_DIRECTORY(monitoring monitoring_src)
155155
AUX_SOURCE_DIRECTORY(utils utils_src)
156156
AUX_SOURCE_DIRECTORY(statusserver statusserver_src)
157157
AUX_SOURCE_DIRECTORY(sgxclient sgxclient_src)
158-
if (NOT DEFINED MIRAGE)
158+
if (NOT DEFINED FAIR)
159159
AUX_SOURCE_DIRECTORY(oracle oracle_src)
160160
endif ()
161161

@@ -232,10 +232,8 @@ SET(LINK_LIBRARIES
232232
"${DEPS_INSTALL_ROOT}/lib/libmicrohttpd.a"
233233
"${DEPS_INSTALL_ROOT}/lib/libjsonrpccpp-stub.a"
234234
"${DEPS_INSTALL_ROOT}/lib/libjsonrpccpp-common.a"
235-
bls
236235
"${DEPS_INSTALL_ROOT}/lib/libzmq.a"
237236
"${DEPS_INSTALL_ROOT}/lib/libsodium.a"
238-
ff
239237
"${DEPS_INSTALL_ROOT}/lib/libcryptopp.a"
240238
gmp
241239
gcov
@@ -283,7 +281,7 @@ add_library(consensus STATIC ${SRC_FILES})
283281

284282
target_compile_options(consensus PRIVATE -Wno-error=unused-variable)
285283

286-
target_link_libraries(consensus ${LINK_LIBRARIES})
284+
target_link_libraries(consensus PRIVATE ${LINK_LIBRARIES} PUBLIC bls)
287285

288286
# consensus test agent
289287

SkaleCommon.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ static const uint64_t ZMQ_RECEIVE_RETRY_MS = 10;
369369

370370
static const uint64_t DEFAULT_MIN_PRICE = 100000;
371371

372-
#ifdef MIRAGE
372+
#ifdef FAIR
373373
static const uint64_t CONSTANT_PRICING_DEFAULT_PRICE = 100 * 1000;
374374
#endif
375375

chains/Schain.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
#include "network/Sockets.h"
9999
#include "network/ZMQSockets.h"
100100
#include "node/NodeInfo.h"
101-
#ifndef MIRAGE
101+
#ifndef FAIR
102102
#include "oracle/OracleClient.h"
103103
#include "oracle/OracleMessageThreadPool.h"
104104
#include "oracle/OracleResultAssemblyAgent.h"
@@ -327,7 +327,7 @@ void Schain::constructChildAgents() {
327327

328328
try {
329329
optimizerAgent = make_shared<OptimizerAgent>(*this);
330-
#ifndef MIRAGE
330+
#ifndef FAIR
331331
oracleResultAssemblyAgent = make_shared< OracleResultAssemblyAgent >( *this );
332332
#endif
333333
pricingAgent = make_shared<PricingAgent>(*this);
@@ -352,7 +352,7 @@ void Schain::constructChildAgents() {
352352
blockProposalClient = make_shared<BlockProposalClientAgent>(*this);
353353

354354
testMessageGeneratorAgent = make_shared<TestMessageGeneratorAgent>(*this);
355-
#ifndef MIRAGE
355+
#ifndef FAIR
356356
oracleClient = make_shared< OracleClient >( *this );
357357
#endif
358358
} catch (...) {
@@ -1655,7 +1655,7 @@ u256 Schain::getRandomForBlockId(block_id _blockId) {
16551655

16561656
ptr<ofstream> Schain::visualizationDataStream = nullptr;
16571657

1658-
#ifndef MIRAGE
1658+
#ifndef FAIR
16591659
const ptr< OracleResultAssemblyAgent >& Schain::getOracleResultAssemblyAgent() const {
16601660
return oracleResultAssemblyAgent;
16611661
}

chains/Schain.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ class Schain : public Agent {
154154

155155
ptr< SchainMessageThreadPool > consensusMessageThreadPool;
156156

157-
#ifndef MIRAGE
157+
#ifndef FAIR
158158
ptr< OracleResultAssemblyAgent > oracleResultAssemblyAgent;
159159
#endif
160160

@@ -286,7 +286,7 @@ class Schain : public Agent {
286286

287287
ptr< BlockConsensusAgent > blockConsensusInstance;
288288

289-
#ifndef MIRAGE
289+
#ifndef FAIR
290290
ptr< OracleServerAgent > oracleServer;
291291
ptr< OracleClient > oracleClient;
292292
#endif
@@ -365,7 +365,7 @@ class Schain : public Agent {
365365

366366
ptr< BlockConsensusAgent > getBlockConsensusInstance();
367367

368-
#ifndef MIRAGE
368+
#ifndef FAIR
369369
ptr< OracleServerAgent > getOracleInstance();
370370
#endif
371371

chains/SchainGettersSetters.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ ptr< BlockConsensusAgent > Schain::getBlockConsensusInstance() {
157157
return blockConsensusInstance;
158158
}
159159

160-
#ifndef MIRAGE
160+
#ifndef FAIR
161161
ptr< OracleServerAgent > Schain::getOracleInstance() {
162162
CHECK_STATE( oracleServer != nullptr )
163163
return oracleServer;
@@ -290,7 +290,7 @@ void Schain::createBlockConsensusInstance() {
290290
blockConsensusInstance = make_shared< BlockConsensusAgent >( *this );
291291
}
292292

293-
#ifndef MIRAGE
293+
#ifndef FAIR
294294
void Schain::createOracleInstance() {
295295
oracleServer = make_shared< OracleServerAgent >( *this );
296296
}
@@ -347,7 +347,7 @@ void Schain::setLastCommittedBlockId( uint64_t _lastCommittedBlockId ) {
347347
lastCommittedBlockID = _lastCommittedBlockId;
348348
}
349349

350-
#ifndef MIRAGE
350+
#ifndef FAIR
351351
const ptr< OracleClient > Schain::getOracleClient() const {
352352
return oracleClient;
353353
}

crypto/CryptoManager.cpp

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525

2626
#include <boost/asio.hpp>
27+
#include <random>
2728

2829
#include "openssl/bio.h"
2930

@@ -51,8 +52,6 @@
5152

5253
#include "Log.h"
5354
#include "SkaleCommon.h"
54-
55-
#include <gmp.h>
5655
#include <network/ClientSocket.h>
5756

5857
#include "BLAKE3Hash.h"
@@ -353,15 +352,6 @@ Schain *CryptoManager::getSchain() const {
353352
return sChain;
354353
}
355354

356-
357-
MPZNumber::MPZNumber() {
358-
mpz_init(this->number);
359-
}
360-
361-
MPZNumber::~MPZNumber() {
362-
mpz_clear(this->number);
363-
}
364-
365355
using namespace std;
366356
unsigned long long int random_value = 0; // Declare value to store data into
367357
size_t size = sizeof(random_value); // Declare size of data

crypto/CryptoManager.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -72,18 +72,7 @@ namespace jsonrpc {
7272
class HttpClient;
7373
}
7474

75-
class MPZNumber {
76-
public:
77-
MPZNumber();
78-
79-
~MPZNumber();
80-
81-
mpz_t number;
82-
};
83-
84-
8575
class OpenSSLECDSAKey;
86-
8776
class OpenSSLEdDSAKey;
8877

8978
#ifdef BITE

crypto/bls_include.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,6 @@
5151
#pragma GCC diagnostic ignored "-Wparentheses"
5252
#pragma GCC diagnostic ignored "-Wreorder"
5353

54-
#include <libff/algebra/curves/alt_bn128/alt_bn128_g1.hpp>
55-
56-
5754
#include "bls.h"
5855
#pragma GCC diagnostic pop
5956

0 commit comments

Comments
 (0)