microsoft / LSKV

A Ledger-backed Secure Key-Value store (LSKV), built on the Confidential Consortium Framework (CCF)
https://microsoft.github.io/CCF
MIT License
33 stars 6 forks source link

Watch stream for committed requests #208

Open jeffa5 opened 1 year ago

jeffa5 commented 1 year ago

Is your feature request related to a problem? Please describe.

Currently there are a few ways of waiting for things to commit, either revolving around polling the servers, or when making lots of requests using the returned headers to check it (along with view history).

Describe the solution you'd like

When we get support for bidirectional streaming in CCF I think another, maybe more useful, method would be an endpoint such as

service Commits {
  rpc Watch(stream WatchRequest) returns (stream WatchResponse) {}
}
message WatchRequest {
  int64 revision = 1;
  uint64 raft_term = 2;
  // but more of an enum like the actual Watch service uses
}
message WatchResponse {
  int64 revision = 1;
  uint64 raft_term = 2;
  enum Status {
    Committed = 1;
    Invalid = 2;
    // maybe more states too, e.g. getting progress
  }
}

This would enable clients to efficiently wait for transactions to be committed, especially those processing lots of transactions or offering a wrapper service that is more consistent.

heidihoward commented 1 year ago

+1 - I love this idea!