feeder

package
v0.0.0-...-63a8751 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 17, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package feeder provides support for building witness feeder implementations.

Index

Constants

This section is empty.

Variables

View Source
var ErrNoSignaturesAdded = errors.New("no additional signatures added")

ErrNoSignaturesAdded is returned when the witness has already signed the presented checkpoint.

Functions

func FeedOnce

func FeedOnce(ctx context.Context, sizeHint uint64, opts FeedOpts) (uint64, error)

FeedOnce completes one feeding operation for the log and witness in the provided configuration. The provided sizeHint is size of the log that the caller believes is current on the target witness.

Returns a new hint on what the current size of the log on the target witness.

Types

type FeedOpts

type FeedOpts struct {
	// LogID is the ID for the log whose checkpoint is being fed.
	//
	// TODO(al/mhutchinson): should this be an impl detail of Witness
	// rather than present here just to be passed back in to Witness calls?
	LogID string

	// FetchCheckpoint should return a recent checkpoint from the source log.
	FetchCheckpoint func(ctx context.Context) ([]byte, error)

	// FetchProof should return a consistency proof from the source log.
	//
	// Note that if the witness knows the log but has no previous checkpoint stored, this
	// function will be called with a default `from` value - this allows compact-range
	// type proofs to be supported.  Implementations for non-compact-range type proofs
	// should return an empty proof and no error.
	FetchProof func(ctx context.Context, from uint64, to log.Checkpoint) ([][]byte, error)

	// LogSigVerifier a verifier for log checkpoint signatures.
	LogSigVerifier note.Verifier
	// LogOrigin is the expected first line of checkpoints from the source log.
	LogOrigin string

	// Update knows how to update a witness
	Update UpdateFn
}

FeedOpts holds parameters when calling the Feed function.

type UpdateFn

type UpdateFn func(ctx context.Context, oldSize uint64, newCP []byte, proof [][]byte) ([]byte, uint64, error)

UpdateFn is the signature of a function which knows how to update a witness.

Directories

Path Synopsis
Package pixelbt is an implementation of a witness feeder for the Pixel BT log.
Package pixelbt is an implementation of a witness feeder for the Pixel BT log.
Package rekor is an implementation of a witness feeder for the Sigstore log: Rekór.
Package rekor is an implementation of a witness feeder for the Sigstore log: Rekór.
Package serverless is an implementation of a witness feeder for serverless logs.
Package serverless is an implementation of a witness feeder for serverless logs.
Package sumdb implements a feeder for the Go SumDB log.
Package sumdb implements a feeder for the Go SumDB log.
Package tiles is an implementation of a witness feeder for C2SP tlog-tiles compatible logs.
Package tiles is an implementation of a witness feeder for C2SP tlog-tiles compatible logs.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL