Skip to content

ledger: move blockdb into a storage package (6 of N)#4841

Merged
algorandskiy merged 3 commits into
algorand:masterfrom
icorderi:refactor/accountdb-6
Dec 5, 2022
Merged

ledger: move blockdb into a storage package (6 of N)#4841
algorandskiy merged 3 commits into
algorand:masterfrom
icorderi:refactor/accountdb-6

Conversation

@icorderi
Copy link
Copy Markdown
Contributor

@icorderi icorderi commented Nov 30, 2022

Summary

A clean move of blockdb to its own package.
This is to reduce some noice on the next PR that would cause circular dependencies with ledger if blockdb was kept there.

Included moving the hashing since it will also be needed for the next PR.

Previous parts of this refactor:

What remains to be moved out:

  • setup stuff
    • table/index creations
    • table deletions
    • migrations
  • iterators
    • orderedAccountsIter
    • catchpointPendingHashesIterator
  • deltas
    • accountsLoadOld and resourcesLoadOld have a couple queries that we might want to move out to avoid pulling all the deltas into store

Test Plan

Existing tests.

@codecov
Copy link
Copy Markdown

codecov Bot commented Nov 30, 2022

Codecov Report

Merging #4841 (10be01d) into master (7aa2f8c) will decrease coverage by 0.12%.
The diff coverage is 43.20%.

@@            Coverage Diff             @@
##           master    #4841      +/-   ##
==========================================
- Coverage   53.44%   53.31%   -0.13%     
==========================================
  Files         422      422              
  Lines       53858    53698     -160     
==========================================
- Hits        28782    28628     -154     
- Misses      22782    22797      +15     
+ Partials     2294     2273      -21     
Impacted Files Coverage Δ
ledger/store/hashing.go 0.00% <0.00%> (ø)
ledger/store/hashkind_string.go 0.00% <0.00%> (ø)
ledger/trackerdb.go 47.05% <0.00%> (ø)
ledger/catchupaccessor.go 64.70% <75.00%> (ø)
ledger/accountdb.go 69.23% <83.33%> (ø)
ledger/catchpointtracker.go 58.88% <85.71%> (-0.96%) ⬇️
ledger/blockqueue.go 85.63% <100.00%> (-2.88%) ⬇️
ledger/ledger.go 70.53% <100.00%> (ø)
ledger/roundlru.go 90.56% <0.00%> (-5.67%) ⬇️
... and 10 more

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

@icorderi icorderi force-pushed the refactor/accountdb-6 branch from 9e234e1 to 299c75c Compare November 30, 2022 16:46
Comment thread ledger/blockdb_test.go
}

func checkBlockDB(t *testing.T, tx *sql.Tx, blocks []blockEntry) {
next, err := blockNext(tx)
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.

this file should go into blockdb package along with the code it tests

Comment thread ledger/store/hashing.go
Copy link
Copy Markdown
Contributor

@algorandskiy algorandskiy left a comment

Choose a reason for hiding this comment

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

Ok, blockdb_test moved in part 8

@algorandskiy algorandskiy merged commit a70260d into algorand:master Dec 5, 2022
@algorandskiy algorandskiy changed the title refactor: accountdb.go into a store package (6 of N) ledger: move blockdb into a storage package (6 of N) Dec 5, 2022
@icorderi icorderi deleted the refactor/accountdb-6 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