Skip to content

tapgarden/custodian: check the local proof archive/universe when looking to receipt proofs #578

Closed
@Roasbeef

Description

@Roasbeef

Today the custodian looks at the local proof archive (in the database and flat flies on disk) to figure out if it has the receipt proof it needs to spend received assets. It should also create a notification service that uses the local universe instance to detect if it has received proofs. This'll allow users to use tapcli universe proofs insert to grab proofs from w/e and insert locally.

Steps To Completion

  • Give the custodian a new multi archive wrapper that'll return inserted proofs at this point:
    // We check if the local proof is already available. We check the same
    // source that would notify us and not the proof archive (which might
    // be a multi archiver that includes file based storage) to make sure
    // the proof is available in the relational database. If the proof is
    // not in the DB, we can't update the event.
    blob, err := c.cfg.ProofNotifier.FetchProof(ctxt, proof.Locator{
    AssetID: fn.Ptr(event.Addr.AssetID),
    GroupKey: event.Addr.GroupKey,
    ScriptKey: event.Addr.ScriptKey,
    })
    switch {
    case errors.Is(err, proof.ErrProofNotFound):
    .
  • This should be allowed to short circuit the normal courier here:
    // Attempt to receive proof via proof courier service.
    loc := proof.Locator{
    AssetID: &assetID,
    ScriptKey: addr.ScriptKey,
    OutPoint: &op,
    }
    addrProof, err := courier.ReceiveProof(ctx, loc)
    if err != nil {
    log.Errorf("unable to recv proof: %v", err)
    return
    }
    .

Metadata

Metadata

Assignees

Type

No type

Projects

Status

✅ Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions