microsoft / scitt-ccf-ledger

Supply Chain Integrity Transparency and Trust ledger application using Confidential Consortium Framework (CCF)
MIT License
35 stars 16 forks source link

Don't store operation contexts in the KV. #137

Closed plietar closed 1 year ago

plietar commented 1 year ago

When performing an asynchronous operation, we need to propagate some data from the trigger phase to the completion callback. So far we'd been storing that data in the operations table in the KV, but this pollutes the KV with unprocessed data and requires a historical query on completion.

This is now replaced by passing the context to the external process' standard input, and having it include it back in the callback's payload.

In order to ensure the integrity of the callback context, it is hashed and the digest is stored in the KV. We still use a historical query to fetch the context, but in the future this may be replaced by caching the digest in the indexing strategy, since it is small enough.

Fixes #116