Skip to content

Commit

Permalink
[master] ZIL-5507 Let mongo ops run on a separate thread (#3890)
Browse files Browse the repository at this point in the history
* Update release version to v9.3.0rc0

* Tweak constants for blocktime and txn distribution (#3838)

* (feat) ZIL-5423: Deployment instructions for reward control contracts. (#3823) (#3840)

Co-authored-by: Richard Watts <108257153+rrw-zilliqa@users.noreply.github.com>

* Update release version to v9.3.0rc1 (#3841)

* [release/v9.3] Merge master to release/v9.3 (#3843)

* (feat) ZIL-5423: Deployment instructions for reward control contracts. (#3823)

* Tweak constants for blocktime and txn distribution (#3839)

* Fixing double enter into consensus in case gossip arrives early (#3842)

Co-authored-by: bzawisto <bartosz@zilliqa.com>

* Update release version to v9.3.0rc0

* Update release version to v9.3.0rc1 (#3841)

---------

Co-authored-by: Richard Watts <108257153+rrw-zilliqa@users.noreply.github.com>
Co-authored-by: Bartosz Zawistowski <39065214+bzawisto@users.noreply.github.com>
Co-authored-by: bzawisto <bartosz@zilliqa.com>

* Update release version to v9.3.0rc2 (#3844)

* [master] ZIL-5406: add support for a cdn (#3848)

* Make the bucket name in localdev.py configurable.
* Update download & upload scripts to use a CDN.

* Update version to v9.3.0rc3.

* [release/v9.3] release v9.3.0rc4 preparation (#3853)

* (feat) ZIL-5423: Deployment instructions for reward control contracts. (#3823)

* Tweak constants for blocktime and txn distribution (#3839)

* Fixing double enter into consensus in case gossip arrives early (#3842)

Co-authored-by: bzawisto <bartosz@zilliqa.com>

* [master] Zil 5450 network native tests improve (#3845)

* chore: update response stats for debugging

* Add logs when txn forwarding happens

* Fix for mismatch in txn pool data

* Some helpful addons

* Fixing cosig retrieval

* Fixes

* Remove unnecessary logging

* Adding more logging

* More logs

* Followup investigation

* Another one

* Hard revert

* Close socket

* Save the changes that have been tested and verified

* Save the changes that have been tested and verified

* Save the changes that have been tested and verified

* Save the changes that have been tested and verified

* Save the changes that have been tested and verified

* Save the changes that have been tested and verified

* updates and experiment
Renamed branch to help ci

* updates and experiment
Renamed branch to help ci

---------

Co-authored-by: Chetan Phirke <chetan@zilliqa.com>
Co-authored-by: bzawisto <bartosz@zilliqa.com>

* [master] ZIL-5406: add support for a cdn (#3848)

* Make the bucket name in localdev.py configurable.
* Update download & upload scripts to use a CDN.

* Fixes to the scripts and startups - does not touch cpp files. (#3849)

* Fix CI issue regarding installing nodejs (#3852)

* feat: update Zilliqa SW version

* Adding more helpful logs and remove unneeded peer check (#3846)

Co-authored-by: bzawisto <bartosz@zilliqa.com>

---------

Co-authored-by: Richard Watts <108257153+rrw-zilliqa@users.noreply.github.com>
Co-authored-by: chetan-zilliqa <66236813+chetan-zilliqa@users.noreply.github.com>
Co-authored-by: Bartosz Zawistowski <39065214+bzawisto@users.noreply.github.com>
Co-authored-by: bzawisto <bartosz@zilliqa.com>
Co-authored-by: Stephen White <93026204+Steve-White-UK@users.noreply.github.com>
Co-authored-by: Chetan Phirke <chetan@zilliqa.com>
Co-authored-by: Yaron <yaron@zilliqa.com>
Co-authored-by: Saeed Dadkhah <saeed@zilliqa.com>

* Update the version to v9.3.0rc5

* [release/v9.3] Merge master to release/v9.3 (#3865)

* [master] Support legacy transactions without replay protection. (#3847)

* Increase initial funds of signers (#3860)

* Support creating signers using a zil-based account in setup script (#3861)

* Support creating signers using a zil-based account in setup script

* Move SignerHelpers to helpers folder

* Fix some compilation error

* Add refund signers task

* Update setup task

* update config

* (fix) ZIL-5457: Don't segfault when asked for a block after the end of the chain (plus some additional protection for illformed internal calls). (#3856)

* DEVOPS-1093: Pass along otterscan options so that zblockchain can tell localdev what to ask testnet to do. (#3863)

* [master] Make setup script more user-friendly.  (#3862)

* [master] Proper check for receiving announce msg early (#3864)

* Proper check for receiving announce msg early

* Proper check for receiving announce msg early (2)

---------

Co-authored-by: bzawisto <bartosz@zilliqa.com>

* Update release version to v9.3.0rc6

---------

Co-authored-by: Saeed Dadkhah <saeed@zilliqa.com>
Co-authored-by: Richard Watts <108257153+rrw-zilliqa@users.noreply.github.com>
Co-authored-by: Bartosz Zawistowski <39065214+bzawisto@users.noreply.github.com>
Co-authored-by: bzawisto <bartosz@zilliqa.com>

* [release/v9.3] Merge master to release/v9.3 branch (#3870)

* [master] Support legacy transactions without replay protection. (#3847)

* Increase initial funds of signers (#3860)

* Support creating signers using a zil-based account in setup script (#3861)

* Support creating signers using a zil-based account in setup script

* Move SignerHelpers to helpers folder

* Fix some compilation error

* Add refund signers task

* Update setup task

* update config

* (fix) ZIL-5457: Don't segfault when asked for a block after the end of the chain (plus some additional protection for illformed internal calls). (#3856)

* DEVOPS-1093: Pass along otterscan options so that zblockchain can tell localdev what to ask testnet to do. (#3863)

* [master] Make setup script more user-friendly.  (#3862)

* [master] Proper check for receiving announce msg early (#3864)

* Proper check for receiving announce msg early

* Proper check for receiving announce msg early (2)

---------

Co-authored-by: bzawisto <bartosz@zilliqa.com>

* [master] Change balances task so that it gets balances in parallel. (#3866)

* Change blaances task so that it gets balances in parallel

* run lint

* Return 0x0 if the signature passed to eth_sendRawTransaction is invalid. (#3867)

* [master] Zil 5473 localdev changes gossip (#3869)

* Enhance the configuration to allow localdev to operate with gossip mode
start the full set of dameons including prometheus and not hang waiting for ip addresses to be assigned
disable tracing until it has been fully tested.
Enable prometheus only in this version.

* Enhance the configuration to allow localdev to operate with gossip mode
start the full set of dameons including prometheus and not hang waiting for ip addresses to be assigned
disable tracing until it has been fully tested.
Enable prometheus only in this version.
Move change of commit_window to localdev and not the constants.xml

* Shuffle signers to use them evenly in tests. (#3868)

* [master] ZIL-5447: Implement header hash customisation for remote miners (#3857)

* ZIL-5447: Implement header hash customisation for remote miners

* ZIL-5447: Fix out-of-bounds iterator access

---------

Co-authored-by: Saeed Dadkhah <saeed@zilliqa.com>
Co-authored-by: Richard Watts <108257153+rrw-zilliqa@users.noreply.github.com>
Co-authored-by: Bartosz Zawistowski <39065214+bzawisto@users.noreply.github.com>
Co-authored-by: bzawisto <bartosz@zilliqa.com>
Co-authored-by: Stephen White <93026204+Steve-White-UK@users.noreply.github.com>
Co-authored-by: James Hinshelwood <JamesHinshelwood@users.noreply.github.com>

* Bumping versions

* Update release version to v9.3.0rc9

* Update release version to v9.3.0rc10

* Update release version to v9.3.0rc12

* [release/v9.3] Exclude complete persistence from cdn cache (#3882)

* Exclude complete persistence from cdn cache

* Update release version to v9.3.0rc13

* Update release version to v9.3.0rc14

* Don't print the same thing twice

* fix typo

* More useful comments

* More useful comments (2)

* typo

* Some improvements

* Some improvements (2)

* Slow mongo fixes

* Fixing version

* Another place

* SwInfo fix

* kikc

* Make this debug

* Cleanup

---------

Co-authored-by: Chetan Phirke <chetan@zilliqa.com>
Co-authored-by: chetan-zilliqa <66236813+chetan-zilliqa@users.noreply.github.com>
Co-authored-by: Richard Watts <108257153+rrw-zilliqa@users.noreply.github.com>
Co-authored-by: bzawisto <bartosz@zilliqa.com>
Co-authored-by: Yaron <yaron@zilliqa.com>
Co-authored-by: Mauro Medda <mauromedda@users.noreply.github.com>
Co-authored-by: Stephen White <93026204+Steve-White-UK@users.noreply.github.com>
Co-authored-by: Saeed Dadkhah <saeed@zilliqa.com>
Co-authored-by: James Hinshelwood <JamesHinshelwood@users.noreply.github.com>
  • Loading branch information
10 people committed Dec 6, 2023
1 parent 15b0596 commit 99e8f80
Show file tree
Hide file tree
Showing 10 changed files with 848 additions and 795 deletions.
57 changes: 35 additions & 22 deletions src/libCrypto/EthCrypto.cpp
Expand Up @@ -102,7 +102,6 @@ zbytes DerivePubkey(zbytes rs, int vSelect, const unsigned char* signingHash) {
secp256k1_ec_pubkey_serialize(ctx, serializedPubkey.data(),
&serializedPubkeySize, &rawPubkey,
SECP256K1_EC_UNCOMPRESSED);
LOG_GENERAL(WARNING, "serialized pub key: " << DataConversion::Uint8VecToHexStrRet(serializedPubkey));

return serializedPubkey;
}
Expand Down Expand Up @@ -356,8 +355,7 @@ zbytes RecoverLegacyTransaction(zbytes transaction, int chain_id) {

// Fields R and S
if (i == 7 || i == 8) {
if (beforeEip155Tx == false)
rlpStreamRecreated << zbytes{};
if (beforeEip155Tx == false) rlpStreamRecreated << zbytes{};
zbytes b = dev::toBigEndian(dev::u256(item));
rs.insert(rs.end(), b.begin(), b.end());
}
Expand Down Expand Up @@ -392,7 +390,9 @@ zbytes RecoverLegacyTransaction(zbytes transaction, int chain_id) {
return {};
}

auto messageRecreatedBytes = beforeEip155Tx ? rlpStreamRecreatedBeforeEip155.out() : rlpStreamRecreated.out();
auto messageRecreatedBytes = beforeEip155Tx
? rlpStreamRecreatedBeforeEip155.out()
: rlpStreamRecreated.out();

// Sign original message
auto signingHash = ethash::keccak256(messageRecreatedBytes.data(),
Expand All @@ -402,7 +402,8 @@ zbytes RecoverLegacyTransaction(zbytes transaction, int chain_id) {
}

zbytes RecoverEip2930Transaction(zbytes transaction, int expectedChainId) {
dev::RLP rlpStream(transaction, dev::RLP::FailIfTooBig | dev::RLP::FailIfTooSmall);
dev::RLP rlpStream(transaction,
dev::RLP::FailIfTooBig | dev::RLP::FailIfTooSmall);
dev::RLPStream rlpStreamRecreated(8);

if (rlpStream.isNull()) {
Expand All @@ -426,21 +427,23 @@ zbytes RecoverEip2930Transaction(zbytes transaction, int expectedChainId) {
rlpStreamRecreated << fields.accessList;

if (chainId != expectedChainId) {
LOG_GENERAL(WARNING, "Chain ID mismatch: expected: " << expectedChainId << ", got: " << chainId);
LOG_GENERAL(WARNING, "Chain ID mismatch: expected: "
<< expectedChainId << ", got: " << chainId);
}

auto messageRecreatedBytes = rlpStreamRecreated.out();
// Prepend the message type specifier.
messageRecreatedBytes.insert(messageRecreatedBytes.begin(), 0x01);

auto hashed = ethash::keccak256(messageRecreatedBytes.data(), messageRecreatedBytes.size());
auto hashed = ethash::keccak256(messageRecreatedBytes.data(),
messageRecreatedBytes.size());

return DerivePubkey(fields.signature, signatureYParity, &hashed.bytes[0]);
}


zbytes RecoverEip1559Transaction(zbytes transaction, int expectedChainId) {
dev::RLP rlpStream(transaction, dev::RLP::FailIfTooBig | dev::RLP::FailIfTooSmall);
dev::RLP rlpStream(transaction,
dev::RLP::FailIfTooBig | dev::RLP::FailIfTooSmall);
dev::RLPStream rlpStreamRecreated(9);

if (rlpStream.isNull()) {
Expand All @@ -465,14 +468,16 @@ zbytes RecoverEip1559Transaction(zbytes transaction, int expectedChainId) {
rlpStreamRecreated << fields.accessList;

if (chainId != expectedChainId) {
LOG_GENERAL(WARNING, "Chain ID mismatch: expected: " << expectedChainId << ", got: " << chainId);
LOG_GENERAL(WARNING, "Chain ID mismatch: expected: "
<< expectedChainId << ", got: " << chainId);
}

auto messageRecreatedBytes = rlpStreamRecreated.out();
// Prepend the message type specifier.
messageRecreatedBytes.insert(messageRecreatedBytes.begin(), 0x02);

auto hashed = ethash::keccak256(messageRecreatedBytes.data(), messageRecreatedBytes.size());
auto hashed = ethash::keccak256(messageRecreatedBytes.data(),
messageRecreatedBytes.size());

return DerivePubkey(fields.signature, signatureYParity, &hashed.bytes[0]);
}
Expand All @@ -495,21 +500,25 @@ zbytes RecoverECDSAPubKey(std::string const& message, int chain_id) {
zbytes transaction(asBytes.begin() + 1, asBytes.end());
return RecoverEip1559Transaction(transaction, chain_id);
} else if ((firstByte >= 0xc0) && (firstByte <= 0xfe)) {
// See https://eips.ethereum.org/EIPS/eip-2718 section "Backwards Compatibility"
// See https://eips.ethereum.org/EIPS/eip-2718 section "Backwards
// Compatibility"
return RecoverLegacyTransaction(asBytes, chain_id);
} else {
LOG_GENERAL(WARNING, "invalid transaction. Tx: " << message << " First byte: " << firstByte);
LOG_GENERAL(WARNING, "invalid transaction. Tx: "
<< message << " First byte: " << firstByte);
return {};
}
}

// nonce, gasprice, startgas, to, value, data, chainid, 0, 0
zbytes GetOriginalHash(TransactionCoreInfo const& info, uint64_t chainId, uint32_t v) {
zbytes GetOriginalHash(TransactionCoreInfo const& info, uint64_t chainId,
uint32_t v) {
uint16_t version = DataConversion::UnpackB(info.version);
const bool beforeEip155Tx = v == 27 || v == 28;
switch (version) {
case TRANSACTION_VERSION_ETH_LEGACY: {
dev::RLPStream rlpStreamRecreated = beforeEip155Tx ? dev::RLPStream() : dev::RLPStream(9);
dev::RLPStream rlpStreamRecreated =
beforeEip155Tx ? dev::RLPStream() : dev::RLPStream(9);

rlpStreamRecreated << info.nonce - 1;
rlpStreamRecreated << info.gasPrice;
Expand All @@ -532,8 +541,8 @@ zbytes GetOriginalHash(TransactionCoreInfo const& info, uint64_t chainId, uint32
rlpStreamRecreated << zbytes{};
}

auto const signingHash = ethash::keccak256(rlpStreamRecreated.out().data(),
rlpStreamRecreated.out().size());
auto const signingHash = ethash::keccak256(
rlpStreamRecreated.out().data(), rlpStreamRecreated.out().size());

return zbytes{&signingHash.bytes[0], &signingHash.bytes[32]};
}
Expand All @@ -560,7 +569,8 @@ zbytes GetOriginalHash(TransactionCoreInfo const& info, uint64_t chainId, uint32
// Prepend the message type specifier.
messageRecreatedBytes.insert(messageRecreatedBytes.begin(), 0x01);

auto hashed = ethash::keccak256(messageRecreatedBytes.data(), messageRecreatedBytes.size());
auto hashed = ethash::keccak256(messageRecreatedBytes.data(),
messageRecreatedBytes.size());
return zbytes{&hashed.bytes[0], &hashed.bytes[32]};
}
case TRANSACTION_VERSION_ETH_EIP_1559: {
Expand All @@ -587,7 +597,8 @@ zbytes GetOriginalHash(TransactionCoreInfo const& info, uint64_t chainId, uint32
// Prepend the message type specifier.
messageRecreatedBytes.insert(messageRecreatedBytes.begin(), 0x02);

auto hashed = ethash::keccak256(messageRecreatedBytes.data(), messageRecreatedBytes.size());
auto hashed = ethash::keccak256(messageRecreatedBytes.data(),
messageRecreatedBytes.size());
return zbytes{&hashed.bytes[0], &hashed.bytes[32]};
}
default:
Expand Down Expand Up @@ -624,8 +635,8 @@ zbytes GetTransmittedRLP(TransactionCoreInfo const& info, uint64_t chainId,
bool beforeEip155Tx = v == 27 || v == 28;
dev::RLPStream rlpStreamRecreated(9);

// Note: the nonce is decremented because of the difference between Zil and
// Eth TXs
// Note: the nonce is decremented because of the difference between Zil
// and Eth TXs
rlpStreamRecreated << info.nonce - 1;
rlpStreamRecreated << info.gasPrice;
rlpStreamRecreated << info.gasLimit;
Expand Down Expand Up @@ -777,7 +788,9 @@ zbytes CreateHash(zbytes const& rawTx) {
}

bool IsEthTransactionVersion(uint32_t version) {
return version == TRANSACTION_VERSION_ETH_LEGACY || version == TRANSACTION_VERSION_ETH_EIP_2930 || version == TRANSACTION_VERSION_ETH_EIP_1559;
return version == TRANSACTION_VERSION_ETH_LEGACY ||
version == TRANSACTION_VERSION_ETH_EIP_2930 ||
version == TRANSACTION_VERSION_ETH_EIP_1559;
}

zbytes CreateContractAddr(zbytes const& senderAddr, int nonce) {
Expand Down
1 change: 0 additions & 1 deletion src/libData/AccountData/Transaction.cpp
Expand Up @@ -121,7 +121,6 @@ Transaction::Transaction(const uint32_t &version, const uint64_t &nonce,
maxFeePerGas),
m_signature(signature),
m_signature_validation(signature_validation) {
LOG_MARKER();
zbytes txnData;
SerializeCoreFields(txnData, 0);

Expand Down
124 changes: 76 additions & 48 deletions src/libLookup/Lookup.cpp
Expand Up @@ -5285,20 +5285,63 @@ bool Lookup::AddTxnToMemPool(const Transaction& tx) {
return AddTxnToMemPool(tx, m_txnMemPool, m_txnMemPoolMutex);
}

void Lookup::AddTxnToMemPool(const std::vector<Transaction>& txns) {
LOG_MARKER();
if (!LOOKUP_NODE_MODE) {
LOG_GENERAL(WARNING,
"Lookup::AddTxnToMemPool not expected to be called from "
"other than the LookUp node.");
return;
}

unsigned long toAddCount = 0;
{
lock_guard<mutex> g(m_txnMemPoolMutex);

if (std::size(m_txnMemPool) >= TXN_STORAGE_LIMIT) {
LOG_GENERAL(INFO, "Number of txns exceeded limit");
return;
}

// Add no more than TXN_STORAGE_LIMIT and available in txns
toAddCount =
std::min(TXN_STORAGE_LIMIT - std::size(m_txnMemPool), std::size(txns));

m_txnMemPool.insert(std::end(m_txnMemPool), std::begin(txns),
std::begin(txns) + toAddCount);

// Remove duplicates
std::sort(std::begin(m_txnMemPool), std::end(m_txnMemPool));
m_txnMemPool.erase(
std::unique(std::begin(m_txnMemPool), std::end(m_txnMemPool)),
std::end(m_txnMemPool));
}

if (REMOTESTORAGE_DB_ENABLE && !ARCHIVAL_LOOKUP) {
auto mongoInsertFunc =
[transactions =
std::vector<Transaction>{
std::make_move_iterator(std::begin(txns)),
std::make_move_iterator(std::begin(txns) + toAddCount)},
epoch = m_mediator.m_currentEpochNum]() {
for (const auto& txn : transactions) {
RemoteStorageDB::GetInstance().InsertTxn(txn, TxnStatus::DISPATCHED,
epoch);
}
};
DetachedFunction(1, mongoInsertFunc);
}
}

bool Lookup::ClearTxnMemPool() {
if (!LOOKUP_NODE_MODE) {
LOG_GENERAL(WARNING,
"Lookup::ClearTxnMemPool not expected to be called from "
"other than the LookUp node.");
return true;
}
const auto content = boost::algorithm::join(
m_txnMemPool | boost::adaptors::transformed([](const Transaction& txn) {
return txn.GetTranID().hex();
}),
", ");
LOG_GENERAL(INFO,
"Clearing m_txnMemPool, current content: [" << content << "]");
"Clearing m_txnMemPool, current size: " << m_txnMemPool.size());

m_txnMemPool.clear();

Expand Down Expand Up @@ -5328,39 +5371,37 @@ void Lookup::SendTxnPacketToShard(std::vector<Transaction> transactions) {
bool result = false;
uint64_t epoch = m_mediator.m_currentEpochNum;

{
unique_lock<mutex> g(m_txnMemPoolMutex, defer_lock);
unique_lock<mutex> g2(m_txnMemPoolGeneratedMutex, defer_lock);
lock(g, g2);
auto transactionNumber = transactions.size();

LOG_GENERAL(INFO, "Txn number generated: " << transactionNumber);
auto transactionNumber = transactions.size();

if (transactions.empty()) {
LOG_GENERAL(INFO, "No txns to send to ds shard");
return;
}
if (REMOTESTORAGE_DB_ENABLE && !ARCHIVAL_LOOKUP) {
for (const auto& tx : transactions) {
LOG_GENERAL(INFO, "InsertTxn " << tx.GetTranID().hex() << " fromAddr "
<< tx.GetSenderAddr()
<< ", nonce: " << tx.GetNonce());
RemoteStorageDB::GetInstance().InsertTxn(tx, TxnStatus::DISPATCHED,
m_mediator.m_currentEpochNum);
}
RemoteStorageDB::GetInstance().ExecuteWriteDetached();
}
LOG_GENERAL(INFO, "Txn number generated: " << transactionNumber);

result = Messenger::SetNodeForwardTxnBlock(
msg, MessageOffset::BODY, epoch,
m_mediator.m_dsBlockChain.GetLastBlock().GetHeader().GetBlockNum(),
m_mediator.m_node->GetShardId(), m_mediator.m_selfKey, transactions);
if (transactions.empty()) {
LOG_GENERAL(INFO, "No txns to send to ds shard");
return;
}

result = Messenger::SetNodeForwardTxnBlock(
msg, MessageOffset::BODY, epoch,
m_mediator.m_dsBlockChain.GetLastBlock().GetHeader().GetBlockNum(),
m_mediator.m_node->GetShardId(), m_mediator.m_selfKey, transactions);

if (!result) {
LOG_EPOCH(WARNING, epoch, "Messenger::SetNodeForwardTxnBlock failed.");
return;
}
if (REMOTESTORAGE_DB_ENABLE && !ARCHIVAL_LOOKUP) {
auto mongoInsertFunc = [transactions = std::move(transactions), epoch]() {
for (const auto& tx : transactions) {
LOG_GENERAL(DEBUG, "InsertTxn " << tx.GetTranID().hex() << " fromAddr "
<< tx.GetSenderAddr()
<< ", nonce: " << tx.GetNonce());
RemoteStorageDB::GetInstance().InsertTxn(tx, TxnStatus::DISPATCHED,
epoch);
}
RemoteStorageDB::GetInstance().ExecuteWriteDetached();
};
DetachedFunction(1, mongoInsertFunc);
}

vector<Peer> toSend;
{
Expand Down Expand Up @@ -5522,31 +5563,18 @@ bool Lookup::ProcessForwardTxn(const zbytes& message, unsigned int offset,
return false;
}

const auto content = boost::algorithm::join(
transactions | boost::adaptors::transformed([](const Transaction& txn) {
return txn.GetTranID().hex();
}),
", ");

// I'm either upper seed (archival lookup) for external node or a Lookup for
// private seed nodes
if (ARCHIVAL_LOOKUP && LOOKUP_NODE_MODE) {
// I'm seed/external-seed - forward message to next layer of 'lookups'
LOG_GENERAL(INFO, "Sending from seed to next layer transactions batch: ["
<< content << "]");
LOG_GENERAL(INFO,
"Sending from seed to next layer transactions batch with size: "
<< transactions.size());
SendMessageToRandomSeedNode(message);
} else {
// I'm a lookup (non-seed & non-external) - save this message into mempool.
// Mempool will be sent to ds members when final block arrives
for (const auto& tx : transactions) {
if (!AddTxnToMemPool(tx)) {
LOG_GENERAL(WARNING, "Unable to add: " << tx.GetTranID().hex()
<< " to mempool!");
} else {
LOG_GENERAL(INFO, "Successfully added: " << tx.GetTranID().hex()
<< " to mempool!");
}
}
AddTxnToMemPool(transactions);
}

return true;
Expand Down
2 changes: 2 additions & 0 deletions src/libLookup/Lookup.h
Expand Up @@ -284,6 +284,8 @@ class Lookup : public Executable {
bool AddTxnToMemPool(const Transaction& tx, TxnMemPool& txnMemPool,
std::mutex& txnMemPoolMutex);

void AddTxnToMemPool(const std::vector<Transaction>& tx);

void CheckBufferTxBlocks();

bool ClearTxnMemPool();
Expand Down

0 comments on commit 99e8f80

Please sign in to comment.