Skip to content

Customn build sync=false #866

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 28 additions & 11 deletions chains/Schain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,8 @@ void Schain::printBlockLog( const ptr< CommittedBlock >& _block ) {
<< ":FDS:" << ConsensusEngine::getOpenDescriptors() << ":PRT:" << proposalReceiptTime
<< ":BTA:" << blockTimeAverageMs << ":BSA:" << blockSizeAverage << ":TPS:" << tpsAverage
<< ":LWT:" << CacheLevelDB::getWriteStats() << ":LRT:" << CacheLevelDB::getReadStats()
<< ":LWC:" << CacheLevelDB::getWrites() << ":LRC:" << CacheLevelDB::getReads();
<< ":LWC:" << CacheLevelDB::getWrites() << ":LRC:" << CacheLevelDB::getReads()
<< ":EPT:" << lastCommittedBlockEvmProcessingTimeMs;


if ( !getNode()->isSyncOnlyNode() ) {
Expand All @@ -657,8 +658,8 @@ void Schain::printBlockLog( const ptr< CommittedBlock >& _block ) {
<< ":SBT:" << CryptoManager::getBLSStats()
<< ":SEC:" << CryptoManager::getECDSATotals()
<< ":SBC:" << CryptoManager::getBLSTotals()
<< ":ZSC:" << getCryptoManager()->getZMQSocketCount()
<< ":EPT:" << lastCommittedBlockEvmProcessingTimeMs;
<< ":ZSC:" << getCryptoManager()->getZMQSocketCount();
// << ":EPT:" << lastCommittedBlockEvmProcessingTimeMs;
}

output << ":STAMP:" << stamp.toString();
Expand Down Expand Up @@ -705,15 +706,21 @@ void Schain::processCommittedBlock( const ptr< CommittedBlock >& _block ) {
try {
CHECK_STATE( getLastCommittedBlockID() + 1 == _block->getBlockID() )

auto printBlockLogStartTimeMs = Time::getCurrentTimeMs();
printBlockLog( _block );
auto printBlockLogTimeMs = Time::getCurrentTimeMs() - printBlockLogStartTimeMs;

proposalReceiptTime = 0;

CHECK_STATE( _block->getBlockID() = getLastCommittedBlockID() + 1 )

auto saveBlockStartTimeMs = Time::getCurrentTimeMs();
saveBlock( _block );
auto saveBlockTimeMs = Time::getCurrentTimeMs() - saveBlockStartTimeMs;

auto cleanupMemoryStartTimeMs = Time::getCurrentTimeMs();
cleanupUnneededMemoryBeforePushingToEvm( _block );
auto cleanupMemoryTimeMs = Time::getCurrentTimeMs() - cleanupMemoryStartTimeMs;

auto evmProcessingStartMs = Time::getCurrentTimeMs();
auto blockPushedToExtFaceTimeMs = evmProcessingStartMs;
Expand All @@ -733,13 +740,23 @@ void Schain::processCommittedBlock( const ptr< CommittedBlock >& _block ) {

auto stamp = TimeStamp( _block->getTimeStampS(), _block->getTimeStampMs() );

auto updateInfoStartTimeMs = Time::getCurrentTimeMs();
updateLastCommittedBlockInfo( ( uint64_t ) _block->getBlockID(), stamp,
_block->getTransactionList()->size(), evmProcessingTimeMs );
auto updateInfoTimeMs = Time::getCurrentTimeMs() - updateInfoStartTimeMs;

// the last thing is to run analyzers to log any errors that happened during
// block processing

auto analyzeErrorsStartTimeMs = Time::getCurrentTimeMs();
analyzeErrors( _block );
auto analyzeErrorsTimeMs = Time::getCurrentTimeMs() - analyzeErrorsStartTimeMs;

LOG( info, "PBLT:" << to_string( printBlockLogTimeMs )
<< ":SBT:" << to_string( saveBlockTimeMs )
<< ":CMT:" << to_string( cleanupMemoryTimeMs )
<< ":UIT:" << to_string( updateInfoTimeMs )
<< ":AET:" << to_string( analyzeErrorsTimeMs ) );

} catch ( ExitRequestedException& e ) {
throw;
Expand Down Expand Up @@ -976,14 +993,14 @@ void Schain::bootstrap( block_id _lastCommittedBlockID, uint64_t _lastCommittedB
// catch situations that should never happen


if ( lastCommittedBlockIDInConsensus > _lastCommittedBlockID + 128 ) {
LOG( critical,
"CRITICAL ERROR: consensus has way more blocks than skaled. This should never "
"happen,"
"since consensus passes blocks to skaled." );
BOOST_THROW_EXCEPTION( InvalidStateException(
"_lastCommittedBlockIDInConsensus > _lastCommittedBlockID + 128", __CLASS_NAME__ ) );
}
// if ( lastCommittedBlockIDInConsensus > _lastCommittedBlockID + 128 ) {
// LOG( critical,
// "CRITICAL ERROR: consensus has way more blocks than skaled. This should never "
// "happen,"
// "since consensus passes blocks to skaled." );
// BOOST_THROW_EXCEPTION( InvalidStateException(
// "_lastCommittedBlockIDInConsensus > _lastCommittedBlockID + 128", __CLASS_NAME__ ) );
// }


if ( lastCommittedBlockIDInConsensus < _lastCommittedBlockID ) {
Expand Down
7 changes: 6 additions & 1 deletion db/CacheLevelDB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,12 @@ CacheLevelDB::CacheLevelDB( Schain* _sChain, string& _dirName, string& _prefix,
this->maxDBSize = _maxDBSize;
this->options = _options;
this->readOptions.fill_cache = false;
this->writeOptions.sync = true;
if (_sChain->getNode()->isSyncOnlyNode()) {
// if we are a sync node we dont sync to disk to make it faster
this->writeOptions.sync = false;
} else {
this->writeOptions.sync = true;
}
this->isDuplicateAddOK = _isDuplicateAddOK;

boost::filesystem::path path( dirName );
Expand Down
Loading