log

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2018 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package log includes code that is specific to Trillian's log mode, particularly code for running sequencing operations.

Index

Constants

This section is empty.

Variables

View Source
var (

	// QuotaIncreaseFactor is the multiplier used for the number of tokens added back to
	// sequencing-based quotas. The resulting PutTokens call is equivalent to
	// "PutTokens(_, numLeaves * QuotaIncreaseFactor, _)".
	// A factor >1 adds resilience to token leakage, on the risk of a system that's overly
	// optimistic in face of true token shortages. The higher the factor, the higher the quota
	// "optimism" is. A factor that's too high (say, >1.5) is likely a sign that the quota
	// configuration should be changed instead.
	// A factor <1 WILL lead to token shortages, therefore it'll be normalized to 1.
	QuotaIncreaseFactor = 1.1
)

Functions

This section is empty.

Types

type Sequencer

type Sequencer struct {
	// contains filtered or unexported fields
}

Sequencer instances are responsible for integrating new leaves into a single log. Leaves will be assigned unique sequence numbers when they are processed. There is no strong ordering guarantee but in general entries will be processed in order of submission to the log.

func NewSequencer

func NewSequencer(
	hasher hashers.LogHasher,
	timeSource util.TimeSource,
	logStorage storage.LogStorage,
	signer *tcrypto.Signer,
	mf monitoring.MetricFactory,
	qm quota.Manager) *Sequencer

NewSequencer creates a new Sequencer instance for the specified inputs.

func (Sequencer) IntegrateBatch added in v1.0.7

func (s Sequencer) IntegrateBatch(ctx context.Context, tree *trillian.Tree, limit int, guardWindow, maxRootDurationInterval time.Duration) (int, error)

IntegrateBatch wraps up all the operations needed to take a batch of queued or sequenced leaves and integrate them into the tree.

func (Sequencer) SignRoot

func (s Sequencer) SignRoot(ctx context.Context, tree *trillian.Tree) error

SignRoot wraps up all the operations for creating a new log signed root.

Jump to

Keyboard shortcuts

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