limits

package
v0.6.5 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: Apache-2.0 Imports: 2 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

Index

Constants

View Source
const (
	FragmentPayload = 1128
	// OpenObjectBound is BRC-149's bound on an object submitted on the open
	// path; MaxObjectBound the authenticated path's. No plane admits more.
	OpenObjectBound = 1 << 20
	MaxObjectBound  = 8 << 20
	// DefaultObjectBound is the object bound assumed when none is set.
	DefaultObjectBound = OpenObjectBound
)

The plane's packets: an object larger than one is carried as fragments of FragmentPayload bytes (the IPv6 minimum MTU of 1280 less the IPv6, UDP and object fragment headers).

View Source
const (
	DefaultTreeCount   = 32
	MaxTreeCount       = 1000
	PlaneTreeCountWarn = 100
	// DefaultChainTreeCount and MaxChainTreeCount size a chain tree: a
	// vault's first token carries its chain tree whole.
	DefaultChainTreeCount = 8
	MaxChainTreeCount     = 32
	// DefaultTreeSats is each funding output's value. A carrier carries its
	// funding output's whole value and is never mined, and a first token
	// spends one chain-tree output, so one satoshi is enough.
	DefaultTreeSats = 1
	// DefaultAhead is how few outputs a secret tree has left when the next
	// is minted ahead.
	DefaultAhead = 4
)

Funding trees.

View Source
const (
	// SecretsWarn is the vault size above which a put is warned about: a
	// removal from the group then takes more than 4 blocks to settle.
	SecretsWarn = 256
	// PlaneChangesWarn is the most changes one token makes on the plane
	// before a warning, except while the vault is in debt.
	PlaneChangesWarn = 16
	// InlineValueWarn is the value size above which a put on the plane is
	// warned about: the carrier then passes 7 packets.
	InlineValueWarn = 4096
	// DefaultSegment is the plaintext bytes of one segment: an inline
	// secret is one segment.
	DefaultSegment = 16384
	// PadBlock is the multiple an encoded payload is padded to.
	PadBlock = 256
	// DefaultMaxFetch is the most ciphertext a reader fetches by hash;
	// MaxFetch the record bound.
	DefaultMaxFetch = 16 << 20
	MaxFetch        = 1 << 27
)

Secrets and transitions.

View Source
const (
	// DefaultDelay is the propagation delay after a mined object's block
	// is in the publisher's headers, before it is published; MaxDelay its
	// cap.
	DefaultDelay = 60 * time.Second
	MaxDelay     = 10 * time.Minute
	// DefaultFreshness and MaxFreshness bound how old a writer's or a
	// reader's evidence that a token is the latest may be (spec section
	// 7.1).
	DefaultFreshness = 60 * time.Second
	MaxFreshness     = 600 * time.Second
)

Publication and freshness.

View Source
const (
	MaxHosts         = 16
	UnicastHostsWarn = 5
	MinTimeout       = time.Second
	MaxTimeout       = 5 * time.Minute
	DefaultTimeout   = 15 * time.Second
)

Hosts, quorum and requests.

View Source
const (
	// TokenPage and CarrierPage are the most outputs one answer page holds
	// (the spec's): tokens, and secret carriers.
	TokenPage   = 64
	CarrierPage = 16
	// MaxPages is the most pages one question reads per host.
	MaxPages = 256
	// MaxVaults is the most vaults of one owner a client lists per host.
	MaxVaults = 4096
	// DefaultMaxPrice is the most a priced question is paid without
	// -max-sats.
	DefaultMaxPrice = 1000
	// RunVersions is the most unlisted versions above a listed one a
	// reader of an interval vault follows: a run is asked for version by
	// version, and what a host or an owner claims above it is never
	// walked to.
	RunVersions = 64
	// MaxAnswer is the most bytes a reader takes for one lookup answer: a
	// full page of the largest objects the plane carries fits several
	// times over.
	MaxAnswer = 16 << 20
	// DefaultBudget is the most a command that asks several priced
	// questions pays in all without -budget.
	DefaultBudget = 16 * DefaultMaxPrice
	// MaxBEEF is the most a reader takes for one answered object.
	MaxBEEF = 1 << 20
	// MaxUnminedPayments is how many of a payer's own payments may be
	// unmined at once with the next spending the change of the last: each
	// adds its transaction to the next payment's BEEF.
	MaxUnminedPayments = 16
)

Reading.

Variables

View Source
var PlaneWait = []time.Duration{500 * time.Millisecond, time.Second, 2 * time.Second}

PlaneWait are the waits between a publisher's lookups for a carrier it submitted to the plane, at each host it names, before it offers the carrier to that host directly: the plane delivers in well under a second.

View Source
var Retries = []time.Duration{time.Second, 2 * time.Second, 4 * time.Second}

Retries are the waits between the tries of a submission: four tries, then the host is reported missed and the object stays persisted.

Functions

This section is empty.

Types

type Publisher

type Publisher struct {
	Plane          bool
	Hosts          int
	Need           int
	TreeCount      int
	ChainTreeCount int
	ObjectBound    int
}

Publisher is a publisher's settings, as the checks see them.

func (Publisher) Check

func (p Publisher) Check() (warnings []string, err error)

Check applies the caps, returning the first broken as an error, and the recommendations, returning each passed as a warning.

Jump to

Keyboard shortcuts

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