Skip to content

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

Merged
algorandskiy merged 4 commits intoalgorand:masterfrom
icorderi:refactor/accountdb-3
Nov 23, 2022
Merged

ledger: move non-lookup methods into a storage package#4830
algorandskiy merged 4 commits intoalgorand:masterfrom
icorderi:refactor/accountdb-3

Conversation

@icorderi
Copy link
Copy Markdown
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
Copy Markdown

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 force-pushed the refactor/accountdb-3 branch from e3b3ab1 to 93f7678 Compare November 22, 2022 23:58
@icorderi icorderi force-pushed the refactor/accountdb-3 branch from 93f7678 to 60efece Compare November 23, 2022 16:56
@icorderi icorderi marked this pull request as ready for review November 23, 2022 17:21
Comment thread ledger/catchupaccessor.go
"github.com/algorand/go-algorand/util/db"
)

type accountsV2Reader struct {
Copy link
Copy Markdown
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
Copy Markdown
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
@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