Skip to content

proof: require verified proofs for archival - #2399

Open
jtobin wants to merge 4 commits into
lightninglabs:mainfrom
jtobin:issue1992
Open

jtobin wants to merge 4 commits into
lightninglabs:mainfrom
jtobin:issue1992

Conversation

@jtobin

@jtobin jtobin commented Nov 25, 2026

Copy link
Copy Markdown
Member

Resolves #1992.

Migrates remaining stuff over to the ImportVerifiedProofs pattern described in the linked issue, in which archivers are prohibited at the type level from importing non-verified proofs.

Archivers accept proofs that have already been verified. The cultivator
verifies minting proofs explicitly and stores them through this path.
Archivers import only pre-verified proofs, and MultiArchiver no longer
verifies proofs itself.
The asset store imports pre-verified proofs, in line with the Archiver
interface.
Tests verify proofs before importing them, or seed mock archives
directly where import verification isn't under test.
Comment thread tapdb/assets_store.go

ann := make([]*proof.AnnotatedProof, len(proofs))
for idx := range proofs {
ann[idx] = proofs[idx].AnnotatedProof()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A nil entry panics here. Match FileArchiver by returning an error, and test that a batch with a nil entry writes nothing.

Comment thread tapgarden/cultivator.go
}

err = b.cfg.ProofFiles.ImportProofs(ctx, vCtx, false, fullProof)
verified, err := proof.VerifyAnnotatedProofs(ctx, vCtx, fullProof)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NewMintingBlobs already verifies each proof. Can it return the verified snapshot so this path avoids decoding and verifying every proof twice?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: 🆕 New

Development

Successfully merging this pull request may close these issues.

[feature]: Retire proof.Archiver.ImportProofs in favour of the verified-import pattern

2 participants