Skip to content

Substituter: a verified-NAR-bytes type at the unpack sink #92

Description

@aoinoikaz

unpackAndVerify enforces verify-then-unpack by statement order: verifyNarHash and verifyNarSize run before deserialise and the disk writes, but the NAR bytes have the same ByteString type before and after verification, so nothing structural prevents a future call path from reaching the unpack sink with unverified bytes. The exported surface (unpackNarEntry, NAR.deserialise) likewise accepts any bytes.

A VerifiedNar wrapper (constructed only by the verification pipeline, consumed by the unpack path) turns the ordering into a type. Small, local to the substituter; the main design question is whether the wrapper carries the decoded declared hash (pairing with the registration record) or stays a bare witness.

From the #85 audit (cache subsystem).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions