Skip to content

Commit

Permalink
806 Adding BITE
Browse files Browse the repository at this point in the history
  • Loading branch information
kladkogex committed Feb 25, 2025
1 parent 59d57a3 commit e5d01ca
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 31 deletions.
25 changes: 14 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,18 +74,21 @@ add_definitions("-DUSER_SPACE")
add_definitions("-DZMQ_EXPERIMENTAL")
add_definitions("-DZMQ_NONBLOCKING")

if (PL)
set(BITE)
endif()

if (PL)
add_definitions(-DPL)

if (DEFINED PL)
add_definitions("-DPL")
set(BITE ON)
endif()

if (BITE)
add_definitions(-DBITE)

if (DEFINED BITE)
add_definitions("-DBITE")
endif()

message(STATUS "PL value is: ${PL}")
message(STATUS "BITE value is: ${BITE}")


#add_definitions(-DGOOGLE_PROFILE) // uncomment to profile

Expand Down Expand Up @@ -146,10 +149,10 @@ AUX_SOURCE_DIRECTORY(monitoring monitoring_src)
AUX_SOURCE_DIRECTORY(utils utils_src)
AUX_SOURCE_DIRECTORY(statusserver statusserver_src)
AUX_SOURCE_DIRECTORY(sgxclient sgxclient_src)
if (NOT PL)
if (NOT DEFINED PL)
AUX_SOURCE_DIRECTORY(oracle oracle_src)
endif()
if (BITE)
if (DEFINED BITE)
AUX_SOURCE_DIRECTORY( bite bite_src)
AUX_SOURCE_DIRECTORY( bite/client bite_client_src)
AUX_SOURCE_DIRECTORY( bite/server bite_server_src)
Expand Down Expand Up @@ -197,11 +200,11 @@ SET(SRC_FILES
${sgxclient_src}
Agent.h Agent.cpp SkaleCommon.cpp Log.cpp microprofile.cpp miniz.c db/VersionUpdateHistory.cpp db/VersionUpdateHistory.h)

if (NOT PL)
if (NOT DEFINED PL)
SET(SRC_FILES ${SRC_FILES} ${oracle_src})
endif()

if (BITE`)
if (DEFINED BITE)
SET(SRC_FILES ${SRC_FILES} ${bite_src} ${bite_client_src} ${bite_server_src})
endif()

Expand Down
2 changes: 1 addition & 1 deletion bite/BITEManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#ifndef SKALED_BITEMANAGER_H
#define SKALED_BITEMANAGER_H

#include "BITEClient.h"
#include "bite/client/BITEClient.h"

class BITEManager {

Expand Down
File renamed without changes.
File renamed without changes.
12 changes: 0 additions & 12 deletions bite/server/BiteBlockFinalizeAndDecryptServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,26 +27,14 @@
#include "chains/Schain.h"
#include "exceptions/FatalError.h"
#include "node/Node.h"
#include "node/NodeInfo.h"
#include <db/MsgDB.h>

#include "unordered_set"


#include "exceptions/ExitRequestedException.h"
#include "exceptions/InvalidMessageFormatException.h"
#include "protocols/blockconsensus/BlockConsensusAgent.h"

#include "utils/Time.h"
#include "threads/GlobalThreadRegistry.h"

#include "BiteBlockFinalizeAndDecryptServer.h"

void BiteBlockFinalizeAndDecryptServer::startThreads() {
}



BiteBlockFinalizeAndDecryptServer::BiteBlockFinalizeAndDecryptServer( Schain& _sChain )
: Agent( _sChain, true ) {

Expand Down
7 changes: 1 addition & 6 deletions bite/server/BiteBlockFinalizeAndDecryptServer.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,13 @@
class Schain;
class Node;

enum TransportType { ZMQ };

class BiteBlockFinalizeAndDecryptServer : public Agent {
protected:

public:

explicit BiteBlockFinalizeAndDecryptServer( Schain& _sChain );


public:
void startThreads();

~BiteBlockFinalizeAndDecryptServer() override;

};
12 changes: 12 additions & 0 deletions chains/Schain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,15 @@
#include "protocols/blockconsensus/BlockConsensusAgent.h"


#ifdef BITE
#include "bite/server/BiteBlockFinalizeAndDecryptServer.h"
#endif


#include "Schain.h"

#include <statusserver/StatusServer.h>

#include "SchainMessageThreadPool.h"
#include "SchainTest.h"
#include "TestConfig.h"
Expand Down Expand Up @@ -1227,6 +1235,10 @@ void Schain::constructServers( const ptr< Sockets >& _sockets ) {

catchupServerAgent = make_shared< CatchupServerAgent >( *this, _sockets->catchupSocket );

#ifdef BITE
biteBlockFinalizeAndDecryptServer = make_shared< BiteBlockFinalizeAndDecryptServer >( *this);
#endif


if ( getNode()->isSyncOnlyNode() )
return;
Expand Down
10 changes: 9 additions & 1 deletion chains/Schain.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ class StatusServer;
class OracleClient;
class OracleResultAssemblyAgent;

#ifdef BITE
class BiteBlockFinalizeAndDecryptServer;
#endif

class Schain : public Agent {
queue< ptr< MessageEnvelope > > messageQueue;

Expand All @@ -115,7 +119,11 @@ class Schain : public Agent {

ptr< BlockProposalServerAgent > blockProposalServerAgent;

ptr< CatchupServerAgent > catchupServerAgent;
ptr< CatchupServerAgent > catchupServerAgent;

#ifdef BITE
ptr <BiteBlockFinalizeAndDecryptServer> biteBlockFinalizeAndDecryptServer;
#endif

ptr< MonitoringAgent > monitoringAgent;

Expand Down

0 comments on commit e5d01ca

Please sign in to comment.