Requiring collateral to be in cache on verification causes problems

Open
#58 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Quiet
Tech stack
rust

Research direction

Start by tracing the verifier function and how it currently requires collateral to be cached. Compare the synchronous-fetch and attester-side-fetch approaches described in the issue, including their effects on retries, payloads, and planned network-backed verification checks. Done means verification no longer requires a pre-warmed collateral cache and the chosen approach is covered by tests.

Written by the indexing model from the issue text.

Description

I've been trying to use this library to replace cvm-reverse-proxy for Flashbox. And needing to have the collateral already in cache for verification to pass is quite annoying. In the end i decided its safest to use the older EKM-based protocol for Flashbox.

The proxy client is generally targeting a single host (the proxy server) so it doesn't make sense to do a full PCCS 'pre-warm' and fetch all available collateral when we will only need one of them. So we rather have to do a failed connection (missing collateral), and then keep waiting and retrying. With a one second delay between retries, i currently need to wait till the third attempt to get a successful connection.

This feels cumbersome, inefficient and error prone, and like there must be a better way.

Worse still, we have planned additions to verification which will also require network fetch:

Related issue: https://github.com/flashbots/attested-tls/issues/2

Possible solutions i am considering:

  1. Just doing a synchronous fetch during the verifier function. This is not ideal, but its made slightly better with dcap-qvl's new ColleratalClient api which allows us to pass in a custom HTTP client (eg: ureq) and still use dcap-qvl collateral fetch code. Implemented in https://github.com/flashbots/attested-tls/pull/63
  2. Do collateral fetching on the attester side. That is, when generating an attestation, we also fetch collateral and include it in the payload. Good because we do just one fetch regardless of how verifications, even if the verifications are by different peers. Bad, because this is an API breaking change, increases payload size/complexity, diverges from standards, and is quite opinionated / use-case-specific. https://github.com/flashbots/attested-tls/pull/65

Personally i am leaning towards option 1.

cc: @0x416e746f6e

Dominant language
Rust
Stars
6
Forks
3
Avg merge
4d 5h
Merged PRs (30d)
7

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from flashbots/attested-tls

All issues in flashbots/attested-tls

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.