syntax = "proto3";

package exchain.node.v1;

import "google/protobuf/descriptor.proto";
import "google/protobuf/empty.proto";

option csharp_namespace = "ExChain.Node.V1";
option go_package = "github.com/exchain/go-exchain/exchain/protocol/node/v1";
option java_multiple_files = true;
option java_outer_classname = "EngineProto";
option java_package = "org.exchain.node.v1";
option php_namespace = "ExChain\\Node\\v1";

// define the engine service
service Engine {
  // NewPayload generate a new execution payload.
  rpc NewPayload(PayloadParams) returns (ExecutionPayload) {}

  // ProcessPayload execute a new execute payload that received from other node.
  rpc ProcessPayload(ExecutionPayload) returns (google.protobuf.Empty) {}
}

message PayloadParams {
  bytes parent_hash = 1;
  uint64 timestamp = 2;
  repeated bytes transactions = 3;
}

message ExecutionPayload {
  bytes parent_hash = 1;
  bytes block_hash = 2;
  uint64 block_number = 3;
  uint64 timestamp = 4;
  bytes state_root = 5;
  bytes receipts_root = 6;
  bytes extra_data = 7;
  repeated bytes transactions = 8;
}
