CCF icon indicating copy to clipboard operation
CCF copied to clipboard

Support `make_read_only_endpoint` to be used with historical query adapter

Open letmaik opened this issue 3 years ago • 2 comments

https://github.com/microsoft/CCF/blob/1430f4dc48184ad0002176e2bc8557600299ee9f/samples/apps/logging/logging.cpp#L844-L848

I'm assuming the reason why the historical query adapter is written around EndpointContext instead of ReadOnlyEndpointContext is to give more flexibility in case something has to written to the KV when a historical query was made. Even though a rare use case, it may exist.

From a dev perspective though it seems odd that this means I have to disable the static guarantees that come from using make_read_only_endpoint. It would be nice if the adapter somehow supported read-only endpoint functions as well.

letmaik avatar May 20 '22 14:05 letmaik

@letmaik that's a good point, we could have read_only_adapter_v1 and write_only_adapter_v1 I suppose?

achamayou avatar May 20 '22 15:05 achamayou

write_only is weird, since you can also read. I would mirror the existing naming with make_endpoint and leave the existing adapter as is, while adding a new one as read_only_adapter_v*

letmaik avatar May 20 '22 16:05 letmaik