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

Design Details #3

Open
cuteolaf opened this issue Mar 28, 2023 · 1 comment
Open

Design Details #3

cuteolaf opened this issue Mar 28, 2023 · 1 comment

Comments

@cuteolaf
Copy link

cuteolaf commented Mar 28, 2023

I'm going to write down how the overall Datagen project works.

You can read the whole application document here.

Key points from the application document

  • B-Datagray’s Datagen project concerns the development of a decentralized infrastructure for CPU/GPU cloud computing, in chain, through different blockchain components. The Datagen infrastructure requires the creation of a Substrate-based blockchain with some key features: low latency time, high efficiency (compatibly with the decentralized nature of the network), high degree of decentralization (higher than a traditional PoS would allow) of the physical hardware providing the cloud computing (therefore requiring a customized consensus protocol) and in-chain (or near-in-chain) computation (no off-chain based solutions).
  • The actual cloud computing will happen in our FB Datagen (substrate based).
  • The validator in the FB must solve the raw computational request and turn it into a hash, within the blocktime, so, the hashed data must propagate in the whole FB, but there is no need for the raw data to be processed multiple times (like in a PoW) in the FB.
  • While, what happens in the FB, will be asynchronously and randomly verified by the HB Parachain.

Technical Design

How mathematical works are performed in FB

A user will be paired with an FB validator in some criteria(e.g. geographical location) and request computational works.

The paired FB validator node should

  • read & parse raw data
  • perform the computation
  • save the result
  • submit the result to the heavy blockchain

All of the above will be done in an off-chain worker.

Representing & Storing a mathematical problem

  • A mathematical problem will be represented as a JSON file stored on decentralized storage systems like IPFS.
  • A user will pass the IPFS hash of a problem to FB validators.

Off-chain worker design

Off-chain worker is the core component of an FB node.

It will

  • Read problem data from IPFS
  • Parse JSON
  • Do the computation
  • Upload the result to IPFS and get hash
  • Calculate hash of the result
  • Submit a computation record to HB
    The record will contain
    • problem_hash (IPFS hash of the problem file)
    • result_hash (IPFS hash of the result file)
    • result (hash of the result e.g. H256)

Extrinsics of FB

@Lord-Nymphis
Copy link
Member

Lord-Nymphis commented Mar 29, 2023

As for the Milestone 2 of the Web3 foundation grant, there are some simplifications from the functional Datagen infra:

-The infrastructure (both Heavy and Fast Blockchain) is in local;

-The computational problem is simulated by the pallet_computational_work (that we developed in the first milestone of our Grant), which is asking to FB validators to compute the Fibonacci sequence;

-The mathematical problem is stored in the HB runtime (vs IPFS node in the functional infra);

-The user's request to FB validators to run the pallet_computational_work could be simply triggered by a function run in the FB runtime (given that the infra is still in local);

-Parity's Repo https://github.com/paritytech/solo-para-bridge-poc can be used as foundation for the bridge architecture (given that RPC are at their core not so different from off-chain workers / bridges)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants