f1r3fly-models 0.1.0

Common data model types for the F1r3fly blockchain, including protobuf definitions and Rust implementations
Documentation
/**
 * The main API is `DeployService`.
 */
syntax = "proto3";

package casper;

import "CasperMessage.proto";

// If you are building for other languages "scalapb.proto"
// can be manually obtained here:
// https://raw.githubusercontent.com/scalapb/ScalaPB/master/protobuf/scalapb/scalapb.proto
// make a scalapb directory in this file's location and place it inside

import "scalapb/scalapb.proto";
import "RhoTypes.proto";

option (scalapb.options) = {
  package_name: "coop.rchain.casper.protocol"
  flat_package: true
  single_file: true
  preamble: "sealed trait ReportEventProto"
  preserve_unknown_fields: false
};

message FindDeployQuery {
  bytes deployId = 1;
}

message BlockQuery {
  string hash = 1;
}

message ReportQuery{
  string hash      = 1;
  bool forceReplay = 2;
}

message BlocksQuery {
  int32 depth = 1;
}

message BlocksQueryByHeight{
  int64 startBlockNumber = 1;
  int64 endBlockNumber   = 2;
}

message DataAtNameQuery {
  int32 depth = 1;
  rhoapi.Par name    = 2 [(scalapb.field).no_box = true];
}

message DataAtNameByBlockQuery {
  rhoapi.Par par              = 1 [(scalapb.field).no_box = true];
  string blockHash     = 2;
  bool usePreStateHash = 3;
}

message ContinuationAtNameQuery {
  int32 depth        = 1;
  repeated rhoapi.Par names = 2;
}

message VisualizeDagQuery {
  int32 depth                 = 1;
  bool showJustificationLines = 2;
  int32 startBlockNumber      = 3;
}

message MachineVerifyQuery {
}

message PrivateNamePreviewQuery {
  bytes  user      = 1; // public key a la DeployData
  int64  timestamp = 2; // millisecond timestamp
  int32  nameQty   = 3; // how many names to preview? (max: 1024)
}

message LastFinalizedBlockQuery {
}

message IsFinalizedQuery {
  string hash = 1;
}

message BondStatusQuery {
  bytes publicKey = 1;
}

message ExploratoryDeployQuery{
  string term          = 1;
  string blockHash     = 2;
  bool usePreStateHash = 3;
}

message BondInfo{
  string validator = 1;
  int64  stake     = 2;
}

message JustificationInfo{
  string validator       = 1;
  string latestBlockHash = 2;
}

message DeployInfo{
  string deployer             = 1;
  string term                 = 2;
  int64  timestamp            = 3;
  string  sig                 = 4;
  string sigAlgorithm         = 5;
  int64 phloPrice             = 7;
  int64 phloLimit             = 8;
  int64 validAfterBlockNumber = 9;
  uint64 cost                 = 10;
  bool errored                = 11;
  string systemDeployError    = 12;
}

message LightBlockInfo {
  // BlockMessageProto message
  string blockHash    = 1;
  string sender       = 2;
  int64 seqNum        = 3;
  string sig          = 4;
  string sigAlgorithm = 5;
  string shardId      = 6;
  bytes  extraBytes   = 7;

  // HeaderProto message
  int64 version                   = 8;
  int64 timestamp                 = 9;
  bytes headerExtraBytes          = 10;
  repeated string parentsHashList = 11;

  // BodyProto message
  int64 blockNumber       = 12;
  string preStateHash     = 13;
  string postStateHash    = 14;
  bytes bodyExtraBytes    = 15;
  repeated BondInfo bonds = 16;

  // extra
  string blockSize     = 17;
  int32 deployCount    = 18;
  float faultTolerance = 19;

  repeated JustificationInfo justifications   = 20;
  repeated RejectedDeployInfo rejectedDeploys = 21;
}

message RejectedDeployInfo{
  string sig = 1;
}

// For node clients, see BlockMessage for actual Casper protocol Block representation
message BlockInfo {
  LightBlockInfo blockInfo    = 1 [(scalapb.field).no_box = true];
  repeated DeployInfo deploys = 2;
}

message DataWithBlockInfo {
  repeated rhoapi.Par postBlockData = 1;
  LightBlockInfo block       = 2 [(scalapb.field).no_box = true];
}

message ContinuationsWithBlockInfo {
  repeated WaitingContinuationInfo postBlockContinuations = 1;
  LightBlockInfo block                                    = 2 [(scalapb.field).no_box = true];
}

message WaitingContinuationInfo {
  repeated rhoapi.BindPattern postBlockPatterns = 1;
  rhoapi.Par postBlockContinuation              = 2 [(scalapb.field).no_box = true];
}


message ReportProduceProto{
  option (scalapb.message).extends = "ReportEventProto";

  rhoapi.Par channel            = 1 [(scalapb.field).no_box = true];
  rhoapi.ListParWithRandom data = 2 [(scalapb.field).no_box = true];
}

message ReportConsumeProto{
  option (scalapb.message).extends = "ReportEventProto";

  repeated rhoapi.Par channels         = 1;
  repeated rhoapi.BindPattern patterns = 2;
  // disable because can not work and it is not important actually
//  TaggedContinuation continuation=3;
  repeated PeekProto peeks = 4;
}

message ReportCommProto{
  option (scalapb.message).extends = "ReportEventProto";

  ReportConsumeProto consume           = 1 [(scalapb.field).no_box = true];
  repeated ReportProduceProto produces = 2;
}

message ReportProto{
  oneof report {
    ReportProduceProto produce = 1;
    ReportConsumeProto consume = 2;
    ReportCommProto comm       = 3;
  }
}

message SingleReport{
  repeated ReportProto events = 1;
}

message DeployInfoWithEventData{
  DeployInfo deployInfo        = 1 [(scalapb.field).no_box = true];
  repeated SingleReport report = 2;
}

message SystemDeployInfoWithEventData{
  SystemDeployDataProto systemDeploy = 1 [(scalapb.field).no_box = true];
  repeated SingleReport report       = 2;
}

message BlockEventInfo{
  LightBlockInfo blockInfo                             = 1 [(scalapb.field).no_box = true];
  repeated DeployInfoWithEventData deploys             = 2;
  repeated SystemDeployInfoWithEventData systemDeploys = 3;
  bytes postStateHash                                  = 4;
}

message Status {
  VersionInfo version = 1 [(scalapb.field).no_box = true];
  string address      = 2;
  string networkId    = 3;
  string shardId      = 4;
  int32 peers         = 5;
  int32 nodes         = 6;
  int64 minPhloPrice  = 7;
}

message VersionInfo {
  string api  = 1;
  string node = 2;
}