limits

package
v0.6.6 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2026 License: Apache-2.0 Imports: 3 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 limits holds the measurements behind docs/limits.md: carrier sizes on the plane for envelope contents and funding tree sizes, from real carriers minted with bcommon.

Index

Constants

View Source
const (
	FragmentPayload = 1128
	// PlaneContentWarn is the envelope content above which a sender on the
	// plane is warned: with the default tree its carrier is 8 packets, the
	// size at which no object was lost in the measurements.
	PlaneContentWarn = 6144
	// 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
	// DefaultTreeSats is each funding output's value. A carrier carries
	// its funding output's whole value and is never mined, so one satoshi
	// is enough.
	DefaultTreeSats = 1
	// DefaultAhead is how few outputs a tree has left when the next is
	// minted ahead.
	DefaultAhead = 4
)

Funding trees.

View Source
const (
	// DefaultRate and MaxRate bound the envelopes a sender sends per
	// second, per office.
	DefaultRate = 1.0
	MaxRate     = 20.0
	// PaymentExpires is the default life of an envelope that carries a
	// payment: the recipient internalizes it only until an hour before
	// expires, and the sender reclaims it only an hour after.
	PaymentExpires = 24 * time.Hour
	// MaxExpires is the longest life an envelope is given: the answer
	// window, after which no free question answers it anyway.
	MaxExpires = 30 * 24 * time.Hour
	// MaxRefs is the most references one message carries (the record
	// bound, boxrec.MaxRefs).
	MaxRefs = boxrec.MaxRefs
)

Sending.

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 (
	// PageSize is the most envelopes one answer page holds (the spec's).
	PageSize = 64
	// MaxPages is the most pages one list reads per host: 4096 envelopes.
	MaxPages = 64
	// DefaultMaxPrice is the most a priced question is paid without
	// -max-sats: a price is per question, and a host that asks more than
	// this is asked by the user, not paid by default.
	DefaultMaxPrice = 1000
	// DefaultBudget is the most a command that asks several priced
	// questions pays in all without -budget.
	DefaultBudget = 16 * DefaultMaxPrice
	// MaxAnswer is the most bytes a reader takes for one lookup answer: a
	// full page of the largest envelopes fits several times over.
	MaxAnswer = 16 << 20
)

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 an object it submitted to the plane, at each host it names, before it offers the object 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

func Gap

func Gap(rate float64) time.Duration

Gap is the least time between two envelopes at rate per second.

Types

type Send

type Send struct {
	Plane       bool
	Hosts       int
	Need        int
	TreeCount   int
	ObjectBound int
	Content     int
	Refs        int
	Expires     time.Duration
}

Send is a sender's settings, as the checks see them.

func (Send) Check

func (s Send) 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