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

ledger: move non-lookup methods into a storage package #4830

Merged
merged 4 commits into from
Nov 23, 2022

Conversation

icorderi
Copy link
Contributor

Summary

Moving free methods that were related to the accounts db.
Staging them on a second type accountsV2ReaderWriter while I move them out before figuring out how to put it all in a single thing.

Previous parts of this refactor:

Test Plan

Existing tests.

@codecov
Copy link

codecov bot commented Nov 22, 2022

Codecov Report

Merging #4830 (a462d64) into master (9f466c0) will decrease coverage by 0.20%.
The diff coverage is 31.39%.

@@            Coverage Diff             @@
##           master    #4830      +/-   ##
==========================================
- Coverage   53.99%   53.78%   -0.21%     
==========================================
  Files         420      421       +1     
  Lines       53765    53789      +24     
==========================================
- Hits        29029    28932      -97     
- Misses      22359    22513     +154     
+ Partials     2377     2344      -33     
Impacted Files Coverage Δ
ledger/store/data.go 88.47% <0.00%> (-5.13%) ⬇️
ledger/store/accountsV2.go 7.92% <7.92%> (ø)
ledger/catchupaccessor.go 64.13% <76.00%> (+0.19%) ⬆️
ledger/txtail.go 78.66% <87.50%> (+0.28%) ⬆️
ledger/accountdb.go 68.30% <100.00%> (+0.23%) ⬆️
ledger/acctonline.go 78.29% <100.00%> (+0.16%) ⬆️
ledger/acctupdates.go 69.58% <100.00%> (+0.07%) ⬆️
ledger/catchpointtracker.go 59.36% <100.00%> (+0.09%) ⬆️
ledger/catchpointwriter.go 59.68% <100.00%> (+0.31%) ⬆️
ledger/tracker.go 74.26% <100.00%> (-0.64%) ⬇️
... and 8 more

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

@icorderi icorderi marked this pull request as ready for review November 23, 2022 17:21
ledger/catchupaccessor.go Outdated Show resolved Hide resolved
"github.com/algorand/go-algorand/util/db"
)

type accountsV2Reader struct {
Copy link
Contributor

Choose a reason for hiding this comment

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

why v2? is there is no accountsReader but AccountsReader. Call this differently to emphasize it is totals + round and not account data

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It will end up all in the same struct down the line.
A lot of this methods where free floating in the accountsdb file and called with the tx generated by doing atomics on the trackerDB.

@algorandskiy algorandskiy changed the title refactor: accountdb.go into a storage package (3 of N) ledger: move non-lookup methods from accountdb.go into a storage package Nov 23, 2022
@algorandskiy algorandskiy changed the title ledger: move non-lookup methods from accountdb.go into a storage package ledger: move non-lookup methods into a storage package Nov 23, 2022
@algorandskiy algorandskiy merged commit 1cf857f into algorand:master Nov 23, 2022
algolucky pushed a commit to algolucky/go-algorand that referenced this pull request Dec 15, 2022
@icorderi icorderi deleted the refactor/accountdb-3 branch December 16, 2022 21:39
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.

2 participants