pipeline

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2026 License: Apache-2.0 Imports: 15 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package pipeline is one BRC-22 submission through the host: parse, SPV with overlay-bridge pkg/spv, the fee floor, then the engine's admission (topic managers, the BEEF blob, the index rows), each stage timed for R1 and each object's work counted for R2.

Verification runs here, before the engine, on the raw bytes, and the engine is told so through the context: its Verifier (the fork's one patch, see third_party/FORK.md) accepts a transaction this pipeline already verified and verifies anything else itself, with the same verifier. There is one Go verifier in the stack and it runs once per object.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error struct {
	Kind Kind
	Err  error
}

Error is a failed submission.

func (*Error) Error

func (e *Error) Error() string

func (*Error) Unwrap

func (e *Error) Unwrap() error

type Kind

type Kind string

Kind classifies a failed submission; the HTTP layer maps it to a status.

const (
	KindMalformed   Kind = metrics.ResultMalformed
	KindRefused     Kind = metrics.ResultRefused
	KindUnavailable Kind = metrics.ResultUnavailable
	KindPending     Kind = metrics.ResultPending
	KindError       Kind = metrics.ResultError
)

Kinds, matching the overlay_go_submits_total result labels.

func KindOf

func KindOf(err error) Kind

KindOf returns the kind of err, KindError for anything unclassified.

type Pipeline

type Pipeline struct {
	Engine  *engine.Engine
	Tracker chaintracker.ChainTracker
	// Network and Finality configure pkg/spv (ruling R-g: finality ignore).
	Network  spv.Network
	Finality spv.FinalityPolicy
	// VerifyTimeout bounds one verification; zero is pkg/spv's 5 s.
	VerifyTimeout time.Duration
	// MinFeeSatPerKB refuses a subject paying less; 0 measures the fee stage
	// and refuses nothing (the TypeScript engine checks no fee).
	MinFeeSatPerKB uint64
	// CommitTimeout bounds the engine's part of a submission. The engine runs
	// on a context detached from the client's, so a client that hangs up
	// cannot abandon the store writes halfway.
	CommitTimeout time.Duration
	Metrics       *metrics.Metrics
	Log           *slog.Logger
	// contains filtered or unexported fields
}

Pipeline submits objects into one engine.

func (*Pipeline) EngineVerifier

func (p *Pipeline) EngineVerifier(ctx context.Context, tx *transaction.Transaction, txid *chainhash.Hash) error

EngineVerifier is the engine's Verifier. It accepts a subject this pipeline verified (the same parsed BEEF travels in the context) and verifies anything else in full with pkg/spv, so a submission that reaches the engine some other way (GASP, a future in-process caller) is never admitted unverified.

func (*Pipeline) Submit

func (p *Pipeline) Submit(ctx context.Context, raw []byte, topics []string) (overlay.Steak, error)

Submit runs one object through the host. topics must already be validated against the carried set.

Jump to

Keyboard shortcuts

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