APIs

The OVM module has only one state table consisting of a list of strings that are the trusted public keys.

Key Vault

The Public Keys is an entity that stores the public keys of the registered oracles which can verifiably push data to the blockchain. It contains:

  • public_keys: A list of allowed public keys.

The proto for the PublicKeys is as follows:

// KeyVault is the information of important keys stored in ovm state.
message KeyVault {
  // public_keys contains allowed public keys.
  repeated string public_keys = 1 [ (gogoproto.nullable) = false ];
}

PublicKeysChangeProposal

The public keys change proposal is store in the state to be used to change the compromised public keys.

// PublicKeysChangeProposal is the type for the proposal for additions and
// removals of pub keys.
message PublicKeysChangeProposal {
  // id is the sequential id of the proposal generated by the blockchain.
  uint64 id = 1;
  // creator is the account address of the proposal creator.
  string creator = 2;
  // modifications contain the ticket payload of the proposal.
  PubkeysChangeProposalPayload modifications = 3
      [ (gogoproto.nullable) = false ];
  // votes contains the votes of the proposal.
  repeated Vote votes = 4;
  // start_ts is the block time that the proposal is set.
  int64 start_ts = 5 [
    (gogoproto.customname) = "StartTS",
    (gogoproto.jsontag) = "start_ts",
    json_name = "start_ts"
  ];
  // result is the result of the finished proposal.
  ProposalResult result = 6;
  // result_meta is the metadata related to the result of the finished proposal.
  string result_meta = 7;
  // finish_ts is the block time that the proposal is set as finished.
  int64 finish_ts = 8 [
    (gogoproto.customname) = "FinishTS",
    (gogoproto.jsontag) = "finish_ts",
    json_name = "finish_ts"
  ];
  // status is the status of a proposal.
  ProposalStatus status = 9;
}

// ProposalResult is the enum type for the proposal result.
enum ProposalResult {
  // unchosen value
  PROPOSAL_RESULT_UNSPECIFIED = 0;
  // approved
  PROPOSAL_RESULT_APPROVED = 1;
  // rejected
  PROPOSAL_RESULT_REJECTED = 2;
  // expired
  PROPOSAL_RESULT_EXPIRED = 3;
}

// ProposalStatus is the enum type for the proposal status.
enum ProposalStatus {
  // unchosen value
  PROPOSAL_STATUS_UNSPECIFIED = 0;
  // active
  PROPOSAL_STATUS_ACTIVE = 1;
  // finished
  PROPOSAL_STATUS_FINISHED = 2;
}

Vote

The vote tracks the votes for the proposals.

// Vote is the type for the proposal vote.
message Vote {
  // public_key is the public key of the voter.
  string public_key = 1;
  // vote is the vote enum value.
  ProposalVote vote = 2;
}

// ProposalVote is the enum type for the proposal vote.
enum ProposalVote {
  // unchosen value
  PROPOSAL_VOTE_UNSPECIFIED = 0;
  // no
  PROPOSAL_VOTE_NO = 1;
  // yes
  PROPOSAL_VOTE_YES = 2;
}

ProposalStats

The proposal statistics are stored to keep track of the count of proposals.

// ProposalStats is the type for the proposal statistics.
message ProposalStats {
  // pubkeys_change_count is the pubkeys change proposals count.
  uint64 pubkeys_change_count = 1;
}

Last updated