Building a Blockchain: Towards Beam Synchronization

Remote Stores

The retrieve of a remote value associated with a key could be described in this diagram and steps description:

Remote Store Retrieving Value
  1. Remote Store receives a request: given a key (byte array) retrieve the associated value (byte array)
  2. Remote Store sends a request to Send Processor, and waits for a future instance completion.
  3. Send Processor sends a request message to some of the peer nodes.
  4. One peer node sends the value in a message. KeyValueProcessor check the consistency (ie key as a hash correspond to the supplied value, in case the key value store is the Account Trie).
  5. Key Value Processor completes the pending future for Remote Store.
  6. Remote Store response with the required value.
Dual Store to Build a Local Store using Remote Data incrementally
  1. Dual Store receives a request: given a key (byte array) retrieve the associated value (byte array)
  2. It checks the existence of the corresponding value consulting Local Store. If it exists, jump to step 4.
  3. It retrieves the value using the Remote Store. If the value is retrieved, it is ALSO SAVED into Local Store. In this way, the local store is populated incrementally, using the most required data first.
  4. Remote Store response with the required value.

A Beam Execution

This is a fragment of a test code that executes a block using dual stores:

Executing a Block using Dual and Remote Stores

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store