Skip to content
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

cleanup: Remove ProcessBlockStats #4819

Closed
wants to merge 14 commits into from

Conversation

iansuvak
Copy link
Contributor

@iansuvak iansuvak commented Nov 21, 2022

Summary

ProcessBlockStats is largely replaced by AssembleBlockMetrics and is currently only being emitted by a single network participant. This PR removes it since #4795 split out the missing granularity for transactions not included. The only currently missing piece of functionality is tracking of unknownCommitted transactions. That requires an additional loop through all transactions to create the counter so didn't include it by default unless we think it's necessary.

The last commit of this PR 39b9dc8d... is a sed replace to remove references to EnableProcessBlockStats from configs and templates. Relevant code changes are in prior commits. Here is a convenient link that excludes the last sed commit https://github.com/algorand/go-algorand/pull/4819/files/7aae739ad857144c41c2637fac4b42642832a1b1

Test Plan

Should pass existing tests

@codecov
Copy link

codecov bot commented Nov 21, 2022

Codecov Report

Merging #4819 (a46d5ba) into master (3abde76) will increase coverage by 0.03%.
The diff coverage is 75.00%.

@@            Coverage Diff             @@
##           master    #4819      +/-   ##
==========================================
+ Coverage   53.40%   53.44%   +0.03%     
==========================================
  Files         422      422              
  Lines       53859    53832      -27     
==========================================
+ Hits        28762    28768       +6     
+ Misses      22800    22767      -33     
  Partials     2297     2297              
Impacted Files Coverage Δ
config/localTemplate.go 40.00% <ø> (ø)
logging/telemetryspec/metric.go 82.45% <ø> (+1.42%) ⬆️
data/pools/transactionPool.go 50.72% <75.00%> (+0.72%) ⬆️
ledger/roundlru.go 90.56% <0.00%> (-5.67%) ⬇️
data/transactions/verify/txn.go 73.61% <0.00%> (-0.86%) ⬇️
ledger/testing/randomAccounts.go 56.61% <0.00%> (-0.62%) ⬇️
ledger/acctupdates.go 69.34% <0.00%> (-0.25%) ⬇️
network/wsNetwork.go 65.19% <0.00%> (+0.26%) ⬆️
catchup/service.go 69.45% <0.00%> (+1.23%) ⬆️
network/wsPeer.go 68.97% <0.00%> (+1.90%) ⬆️
... and 1 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@iansuvak iansuvak marked this pull request as ready for review November 21, 2022 16:53
config/localTemplate.go Show resolved Hide resolved
@@ -548,20 +534,9 @@ func (pool *TransactionPool) OnNewBlock(block bookkeeping.Block, delta ledgercor
stats = pool.recomputeBlockEvaluator(committedTxids, knownCommitted)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the knownCommitted var is passed uninitialized

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've actually removed it entirely in the latest change since it was only used for hint computation and only nodes with enableProcessBlockStats ever went into the loop that would initialize it.

pool.pendingMu.RLock()
for txid := range committedTxids {
if _, ok := pool.pendingTxids[txid]; ok {
knownCommitted++
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe leave these two

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that we should probably leave this and based on other feedback I'm putting EnableProcessBlockStats config back. The open question here is should we leave this block for both EnableAssembleMetrics and this or just for the former.

The concern with enabling for both is that it increases pool locking for all relays emitting AssembleBlock which is many more than currently have ProcessBlockStats enabled

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We actually already have earlyCommittedCount on the stat which should be a proxy for knownCommitted here?

@iansuvak iansuvak closed this May 15, 2023
@iansuvak
Copy link
Contributor Author

Closing stale PR for now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants