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

StatefulSyncer Refactor #74

Closed
patrick-ogrady opened this issue Jul 24, 2020 · 0 comments · Fixed by #75
Closed

StatefulSyncer Refactor #74

patrick-ogrady opened this issue Jul 24, 2020 · 0 comments · Fixed by #75
Labels
enhancement New feature or request

Comments

@patrick-ogrady
Copy link
Contributor

patrick-ogrady commented Jul 24, 2020

Is your feature request related to a problem? Please describe.
The BlockStorage backend that handles persistence of synced blocks (and is used to provide orphaned blocks during re-orgs) is very tightly coupled to Data API validation. It includes (in addition to block persistence) hash persistence (transaction hash duplicate checks) and balance tracking.

To support automated Construction API testing, we also need to make use of a block persistence layer but don't want or need any of the additional balance tracking logic. We may also want to add more modules to the block syncing loop and don't want to continue overloading this extraction (like tracking UTXOs).

Describe the solution you'd like
I propose:

  • greatly simplifying the BlockStorage interface (just to handle the storage/retrieval of blocks and keeping track of sync progress across restarts)
  • adding a new package called StatefulSyncer that exposes the same Handler interface as the syncer package (except that BlockRemoved returns the actual block removed instead of just the identifier)
  • adding a new BalanceStorage backend that contains all balance tracking logic formerly in BlockStorage
  • adding a new tx querying functionality that allows for querying for the existence of certain hashes (and hashes at a certain depth)
  • adding a utils.go file that contains all common encoding/decoding logic in /internal/storage
@patrick-ogrady patrick-ogrady added the enhancement New feature or request label Jul 24, 2020
@patrick-ogrady patrick-ogrady changed the title [WIP] StatefulSyncer Refactor StatefulSyncer Refactor Jul 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

Successfully merging a pull request may close this issue.

1 participant