log

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2017 License: Apache-2.0 Imports: 15 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 *crypto.Signer,
	mf monitoring.MetricFactory,
	qm quota.Manager) *Sequencer

NewSequencer creates a new Sequencer instance for the specified inputs.

func (Sequencer) SequenceBatch

func (s Sequencer) SequenceBatch(ctx context.Context, logID int64, limit int, guardWindow, maxRootDurationInterval time.Duration) (int, error)

SequenceBatch wraps up all the operations needed to take a batch of queued leaves and integrate them into the tree. TODO(Martin2112): Can possibly improve by deferring a function that attempts to rollback, which will fail if the tx was committed. Should only do this if we can hide the details of the underlying storage transactions and it doesn't create other problems.

func (Sequencer) SignRoot

func (s Sequencer) SignRoot(ctx context.Context, logID int64) 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