Main logic for interfacing machine learning models



Add Model

pub fn add_model(
    origin: OriginFor<T>, 
    model_path: Vec<u8>,
) -> DispatchResult




  • Voting

    • All new models require a vote to be added as well as a required minimum fee. You can read the documentation on how to initiate a proposal here (coming soon).

  • Cost

    • Once a model has been voted in successfully, a fee is required to add the model.

    • This fee is given to all peers currently hosting models interfaced with the blockchain that are in consensus on the following epoch.

  • Rewards

    • A model must be initialized for the minimum required amount of blocks before peer consensus can be initiated. Without peer consensus, rewards are not distributed to the peers within the model.

  • Consensus

    • Once a model is initialized for the required amount of epochs, peers can begin submitting consensus data on each epoch to generate incentives.

Remove Model

pub fn remove_model(
    origin: OriginFor<T>, 
    model_id: u32,
) -> DispatchResult




For a model to be able to be removed, the one of the following must be met

  1. The model has been voted off.

  2. The model has reached max consensus epochs errors.

  3. The model has been offline too many times.

  4. The model has not reached the minimum peer requirement after the initialization period.

Once a model meets one of these, there can no longer be peer consensus and any user can manually call the remove_model() function to remove all stored model data from the blockchain. Peers must also manually unstake their stake balance towards the model that is removed.

Last updated