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

roundCowBase: use lookup() instead of going to ledger directly #3173

Merged
merged 1 commit into from
Nov 3, 2021

Conversation

tolikzinovyev
Copy link
Contributor

Summary

Going to ledger directly prevents caching of accounts.

I'm looking into poor indexer import performance on testnet at rounds > 17M, and I noticed that one account is looked up a lot of times in same round.

@tsachiherman
Copy link
Contributor

We can't do that. This is the one place that actually does go from the cow to the ledger. If ( from any reason ), we don't have the account preloaded, we need to have the ability to fetch it dynamically.

One common use case is the transaction pool. When a new transaction is received by the node, it attempts to add it to the current block evaluator. In turn, the block evaluator would call the ledger to fetch all the required resources.

@tolikzinovyev
Copy link
Contributor Author

I'm not following. lookup() will go to the ledger if the account is not cached and will cache it afterwards.

@tsachiherman
Copy link
Contributor

I'm not following. lookup() will go to the ledger if the account is not cached and will cache it afterwards.

sorry - my bad; I think that this change is fine.

@codecov-commenter
Copy link

codecov-commenter commented Nov 1, 2021

Codecov Report

Merging #3173 (0607d38) into master (168cfe5) will decrease coverage by 11.62%.
The diff coverage is 33.33%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master    #3173       +/-   ##
===========================================
- Coverage   43.81%   32.19%   -11.63%     
===========================================
  Files         392      390        -2     
  Lines       86885    86867       -18     
===========================================
- Hits        38073    27971    -10102     
- Misses      42782    54739    +11957     
+ Partials     6030     4157     -1873     
Impacted Files Coverage Δ
ledger/internal/eval.go 52.50% <33.33%> (-17.87%) ⬇️
util/condvar/timedwait.go 0.00% <0.00%> (-100.00%) ⬇️
data/transactions/payset.go 0.00% <0.00%> (-100.00%) ⬇️
ledger/internal/assetcow.go 0.00% <0.00%> (-100.00%) ⬇️
crypto/merklearray/worker.go 0.00% <0.00%> (-100.00%) ⬇️
crypto/compactcert/structs.go 0.00% <0.00%> (-100.00%) ⬇️
agreement/agreementtest/keyManager.go 0.00% <0.00%> (-100.00%) ⬇️
daemon/algod/api/server/lib/middlewares/auth.go 0.00% <0.00%> (-100.00%) ⬇️
agreement/agreementtest/simulate.go 0.00% <0.00%> (-87.68%) ⬇️
util/metrics/service.go 0.00% <0.00%> (-87.10%) ⬇️
... and 187 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 168cfe5...0607d38. Read the comment docs.

@tsachiherman tsachiherman merged commit 9b39c66 into algorand:master Nov 3, 2021
@tolikzinovyev tolikzinovyev deleted the cow-base-lookup branch November 5, 2021 18:06
@egieseke egieseke mentioned this pull request Nov 23, 2021
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