Providers

Execution providers can use the provider role to run their nodes. This allows them to receive signed bids and issue commitments for execution. The Provider RPC API allows providers to receive signed bids that are being propagated in the network. Once they get a bid, they’ll need to communicate with the mev-commit node to Accept. Accepted bids result in the mev-commit node sending a signed commitment to the p2p network.

The Provider API is implemented using the gRPC framework, supporting two primary operations:

  • Receiving Bids: Providers receive streaming bids from the mev-commit node.
  • Sending Processed Bids: Providers send information about processed bids back to the mev-commit node.

RPC API Details

The protobuf file is available in the repository. The Go client has already been generated in the repository. To generate the RPC client for other languages, please follow the instructions in the gRPC documentation.

Primary RPC Operations:

// ReceiveBids is called by the execution provider to receive bids from the mev-commit node.
// The mev-commit node will stream bids to the execution provider.
rpc ReceiveBids(EmptyMessage) returns (stream Bid) {}

// SendProcessedBids is called by the provider to send processed bids to the mev-commit node.
// The execution provider will stream processed bids to the mev-commit node.
rpc SendProcessedBids(stream BidResponse) returns (EmptyMessage) {}

Message Structures

message Bid {
  string tx_hashes = 1;
  string bid_amount = 2;
  int64 block_number = 3;
  bytes bid_digest = 4;
  int64 decay_start_timestamp;
  int64 decay_end_timestamp;
};

message BidResponse {
  bytes bid_digest = 1;
  enum Status {
    STATUS_UNSPECIFIED = 0;
    STATUS_ACCEPTED = 1;
    STATUS_REJECTED = 2;
  }
  Status status = 2;
  int64 dispatch_timestamp;
};

HTTP API

The same API is also available on the HTTP port configured on the node. Please review the API docs to understand the usage.

An example client is implemented in the repository. This example showcases how to integrate a client into the provider’s operational framework. While the sample client automatically accepts every incoming bid, providers should incorporate their own decision-making logic to evaluate and respond to these bids.