-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
feat: add transactions.mempool.lockedTransactions and chainlocks.blockHeight stats #6237
base: develop
Are you sure you want to change the base?
Changes from 10 commits
021e499
5b1af45
b794170
18b509d
0e4f46d
83d9f73
ebbc1dd
38d7892
d5dbbdb
abcba59
c3b1b3e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2579,7 +2579,7 @@ bool CChainState::ConnectBlock(const CBlock& block, BlockValidationState& state, | |
|
||
::g_stats_client->timing("ConnectBlock_ms", (nTime8 - nTimeStart) / 1000, 1.0f); | ||
::g_stats_client->gauge("blocks.tip.SizeBytes", ::GetSerializeSize(block, PROTOCOL_VERSION), 1.0f); | ||
::g_stats_client->gauge("blocks.tip.Height", m_chain.Height(), 1.0f); | ||
::g_stats_client->gauge("blocks.tip.Height", m_chain.Height() + 1, 1.0f); // without the +1, the "tip.Height" doesn't match rpc calls like `getblockcount` | ||
::g_stats_client->gauge("blocks.tip.Version", block.nVersion, 1.0f); | ||
::g_stats_client->gauge("blocks.tip.NumTransactions", block.vtx.size(), 1.0f); | ||
::g_stats_client->gauge("blocks.tip.SigOps", nSigOps, 1.0f); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should drop all updates for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because chain tip is updated in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
@@ -2901,6 +2901,8 @@ bool CChainState::DisconnectTip(BlockValidationState& state, DisconnectedBlockTr | |
AssertLockHeld(cs_main); | ||
if (m_mempool) AssertLockHeld(m_mempool->cs); | ||
|
||
int64_t nTime1 = GetTimeMicros(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider using here
|
||
|
||
CBlockIndex *pindexDelete = m_chain.Tip(); | ||
assert(pindexDelete); | ||
// Read block from disk. | ||
|
@@ -2959,6 +2961,19 @@ bool CChainState::DisconnectTip(BlockValidationState& state, DisconnectedBlockTr | |
// Let wallets know transactions went from 1-confirmed to | ||
// 0-confirmed or conflicted: | ||
GetMainSignals().BlockDisconnected(pblock, pindexDelete); | ||
|
||
int64_t nTime2 = GetTimeMicros(); | ||
|
||
unsigned int nSigOps = 0; | ||
for (const auto& tx : block.vtx) { | ||
nSigOps += GetLegacySigOpCount(*tx); | ||
} | ||
::g_stats_client->timing("DisconnectTip_ms", (nTime2 - nTime1) / 1000, 1.0f); | ||
::g_stats_client->gauge("blocks.tip.SizeBytes", ::GetSerializeSize(block, PROTOCOL_VERSION), 1.0f); | ||
::g_stats_client->gauge("blocks.tip.Height", m_chain.Height(), 1.0f); | ||
::g_stats_client->gauge("blocks.tip.Version", block.nVersion, 1.0f); | ||
::g_stats_client->gauge("blocks.tip.NumTransactions", block.vtx.size(), 1.0f); | ||
::g_stats_client->gauge("blocks.tip.SigOps", nSigOps, 1.0f); | ||
return true; | ||
} | ||
|
||
|
@@ -3077,7 +3092,16 @@ bool CChainState::ConnectTip(BlockValidationState& state, CBlockIndex* pindexNew | |
LogPrint(BCLog::BENCHMARK, " - Connect postprocess: %.2fms [%.2fs (%.2fms/blk)]\n", (nTime6 - nTime5) * MILLI, nTimePostConnect * MICRO, nTimePostConnect * MILLI / nBlocksTotal); | ||
LogPrint(BCLog::BENCHMARK, "- Connect block: %.2fms [%.2fs (%.2fms/blk)]\n", (nTime6 - nTime1) * MILLI, nTimeTotal * MICRO, nTimeTotal * MILLI / nBlocksTotal); | ||
|
||
unsigned int nSigOps = 0; | ||
for (const auto& tx : blockConnecting.vtx) { | ||
nSigOps += GetLegacySigOpCount(*tx); | ||
} | ||
::g_stats_client->timing("ConnectTip_ms", (nTime6 - nTime1) / 1000, 1.0f); | ||
::g_stats_client->gauge("blocks.tip.SizeBytes", ::GetSerializeSize(blockConnecting, PROTOCOL_VERSION), 1.0f); | ||
::g_stats_client->gauge("blocks.tip.Height", m_chain.Height(), 1.0f); | ||
::g_stats_client->gauge("blocks.tip.Version", blockConnecting.nVersion, 1.0f); | ||
::g_stats_client->gauge("blocks.tip.NumTransactions", blockConnecting.vtx.size(), 1.0f); | ||
::g_stats_client->gauge("blocks.tip.SigOps", nSigOps, 1.0f); | ||
|
||
connectTrace.BlockConnected(pindexNew, std::move(pthisBlock)); | ||
return true; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it seems as this map can indefinitely grow and eat
allsignificant amount of RAMThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved in d5dbbdb