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

Blockstore use clean-up #1122

Merged
merged 13 commits into from
Mar 10, 2020
Merged

Blockstore use clean-up #1122

merged 13 commits into from
Mar 10, 2020

Conversation

AlexandraRoatis
Copy link
Contributor

Type of change

  • Bug fix.
  • New feature.
  • Enhancement.
  • Unit test.
  • Breaking change (a fix or feature that causes existing functionality to not work as expected).
  • Requires documentation update.

@AlexandraRoatis AlexandraRoatis added the enhancement New feature or request label Mar 4, 2020
@AlexandraRoatis AlexandraRoatis added this to the 1.4 milestone Mar 4, 2020
@AlexandraRoatis AlexandraRoatis self-assigned this Mar 4, 2020
@AlexandraRoatis AlexandraRoatis removed this from the 1.4 milestone Mar 4, 2020
@AionJayT AionJayT added this to the 1.5 milestone Mar 4, 2020
@@ -125,7 +120,7 @@ private void initializeHub(
blockchain.setEventManager(this.eventMgr);

try {
loadBlockchain();
startingBlock = this.blockchain.load(cfg.getGenesis(), genLOG);
Copy link
Collaborator

@AionJayT AionJayT Mar 4, 2020

Choose a reason for hiding this comment

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

the line 131 can be removed. duplicate assignation.

Copy link
Collaborator

@AionJayT AionJayT left a comment

Choose a reason for hiding this comment

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

LGTM

@AlexandraRoatis AlexandraRoatis force-pushed the blockstore branch 2 times, most recently from 424ff32 to c1487d7 Compare March 4, 2020 21:50
This is a step towards limiting access to the block store. The long term
goal is to allow only the repository to retrieve block data from the
block store and pass it further.
As a result DBUtils no longer accesses the block store directly.
The messages now give a better indications of when an error occured.
Reduces access to the block store by forwarding calls to the blockchain
and repository. Also removed the unnecessary hash wrapping.
Having all the functionality to load the blockchain inside the hub requires
exposing data elements that would otherwise be kept private. Additionally,
the method becomes easier to read when directly making use of the blockchain
internal attributes.
The method is no longer used outside the test that checks its functionality.
It was a hacky way of creating large chains for testing that can be replaced
with the chain generation functionality from BlockchainTestUtils.
Access to the block store must go though the repository.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants