syntax = "proto3";

package sentry.v1;

import "google/protobuf/field_mask.proto";
import "google/protobuf/timestamp.proto";
import "sentry/v1/resource.proto";

message LimitInfoRequest {
  // block height to get limit info from contract.
  //uint32 height = 1;
}

message LimitInfoResponse {
  // tx count in one batchTx.
  uint32 batch_tx_count = 1;
  // batchTx count in one block.
  uint32 block_batch_count = 2;
}

message CommitBatchTxRequest {
  bytes txdata = 1;
  int64  size =2;  //为了合约计算提交了多少个交易；
}

message CommitBatchTxResponse {
  string txhash = 1;
  string err_msg = 2;
}

message GetReceiptRequest {
  string txhash = 1;
}

message GetReceiptResponse {
  bytes receipt_data = 1;
  string err_msg = 2;
}

message GetNewBlockRequest {
  uint32 last_block = 1;
}

message GetNewBlockResponse {
  uint32 block_num = 1;
  uint64 block_time = 2;
  string batch_txs = 3;
}

message CommitBlockRequest {
  string validator = 1;
  uint64 block_number = 2;
  bytes  block_data = 3;
}

message CommitBlockResponse {
  string txhash = 1;
  string err_msg = 2;
}

message GetConsensusedBlockRequest {
  uint64 block_number = 1;
}

message GetConsensusedBlockResponse {
  uint64 block_number = 1;
  bytes  block_data = 2;
}


