trantor

package
v0.0.0-...-9727c61 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

README

Trantor: Modular State Machine Replication

Trantor is a modular state machine replication (SMR) system. It decomposes the concept of SMR into multiple smaller components and draws carefully designed, simple yet powerful abstractions around them. Trantor aims at being practical, not neglecting important technical aspects such as checkpointing, state transfer, garbage collection, reconfiguration, or weighted voting, making them an integral part of the design. Trantor’s modularity allows it to be flexible, maintainable, adaptable, and future-proof. Components such as the total-order broadcast protocol can easily be swapped in and out, potentially even at runtime.

Even though the focus of Trantor is not on performance, a preliminary performance evaluation of our Byzantine fault-tolerant implementation shows an attractive throughput of over 30k tx/s with a latency of under 1.3 seconds (and 0.5 seconds at 5’000 tx/s) at a moderate scale of 32 replicas dispersed over 5 different continents, despite a naive implementation of many of Trantor’s components.

To learn more about Trantor, have a look at the detailed Trantor design document.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenesisCheckpoint

func GenesisCheckpoint(initialAppState []byte, params Params) (*checkpoint.StableCheckpoint, error)

GenesisCheckpoint returns an initial stable checkpoint used for bootstrapping. It is a special checkpoint for epoch 0, corresponding to the state of the application (the serialization of which is passed as the initialAppState parameter) before applying any transactions. The associated certificate is empty (and should still be considered valid, as a special case).

func PerturbMessages

func PerturbMessages(params *eventmangler.ModuleParams, moduleID stdtypes.ModuleID, sys *System) error

PerturbMessages configures the SMR system to randomly drop and delay some of the messages sent over the network. Useful for debugging and stress-testing. The params argument defines parameters of the perturbation, such as how many messages should be dropped and how the remaining messages should be delayed.

Types

type ModuleConfig

type ModuleConfig struct {
	App                t.ModuleID
	Availability       t.ModuleID
	BatchDB            t.ModuleID
	BatchFetcher       t.ModuleID
	Checkpointing      t.ModuleID
	ChkpValidator      t.ModuleID
	Crypto             t.ModuleID
	Hasher             t.ModuleID
	ISS                t.ModuleID // TODO: Rename this when Trantor is generalized to use other high-level protocols
	Mempool            t.ModuleID
	Net                t.ModuleID
	Null               t.ModuleID
	Ordering           t.ModuleID
	PPrepValidator     t.ModuleID
	PPrepValidatorChkp t.ModuleID
	Timer              t.ModuleID
}

func DefaultModuleConfig

func DefaultModuleConfig() ModuleConfig

func (ModuleConfig) ConfigureBatchFetcher

func (mc ModuleConfig) ConfigureBatchFetcher() batchfetcher.ModuleConfig

func (ModuleConfig) ConfigureCheckpointing

func (mc ModuleConfig) ConfigureCheckpointing() checkpoint.ModuleConfig

func (ModuleConfig) ConfigureChkpValidator

func (mc ModuleConfig) ConfigureChkpValidator() chkpvalidator.ModuleConfig

func (ModuleConfig) ConfigureFakeBatchDB

func (mc ModuleConfig) ConfigureFakeBatchDB() fakebatchdb.ModuleConfig

func (ModuleConfig) ConfigureISS

func (mc ModuleConfig) ConfigureISS() iss.ModuleConfig

func (ModuleConfig) ConfigureMultisigCollector

func (mc ModuleConfig) ConfigureMultisigCollector() multisigcollector.ModuleConfig

func (ModuleConfig) ConfigureOrdering

func (mc ModuleConfig) ConfigureOrdering() ordererscommon.ModuleConfig

func (ModuleConfig) ConfigurePreprepareValidator

func (mc ModuleConfig) ConfigurePreprepareValidator() pprepvalidator.ModuleConfig

func (ModuleConfig) ConfigurePreprepareValidatorChkp

func (mc ModuleConfig) ConfigurePreprepareValidatorChkp() pprepvalidator.ModuleConfig

func (ModuleConfig) ConfigureSimpleMempool

func (mc ModuleConfig) ConfigureSimpleMempool() simplemempool.ModuleConfig

type Params

type Params struct {
	Mempool      *simplemempool.ModuleParams
	Iss          *issconfig.ModuleParams
	Net          grpc.Params
	Availability multisigcollector.ModuleParams
}

func DefaultParams

func DefaultParams(initialMembership *trantorpbtypes.Membership) Params

func (*Params) AdjustSpeed

func (p *Params) AdjustSpeed(maxProposeDelay time.Duration) *Params

type System

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

System represents a Trantor system. It groups and configures the various Mir modules that need to work together to implement state machine replication.

func New

func New(

	ownID stdtypes.NodeID,

	transport net.Transport,

	startingCheckpoint *checkpoint.StableCheckpoint,

	cryptoImpl mircrypto.Crypto,

	app appmodule.AppLogic,

	params Params,

	logger logging.Logger,
) (*System, error)

New creates a new SMR system. It instantiates the various Mir modules that make up the system and configures them to work together. The returned system's Start method must be called before the system can be used. The returned system's Stop method should be called when the system is no longer needed. The returned system's Modules method can be used to obtain the Mir modules to be passed to mir.NewNode.

func (*System) Modules

func (sys *System) Modules() modules.Modules

Modules returns the Mir modules that make up the system. The return value of Modules is to be used as an argument to mir.NewNode.

func (*System) Start

func (sys *System) Start() error

Start starts the operation of the modules of the SMR system. It starts the network transport and connects to the initial members of the system.

func (*System) Stop

func (sys *System) Stop()

Stop stops the operation of the modules of the SMR system. Currently, it only stops the network transport, as no other modules need to be stopped.

func (*System) WithModule

func (sys *System) WithModule(moduleID stdtypes.ModuleID, module modules.Module) *System

WithModule associates the given module ID within the SMR system with the given module. If a module with the given ID already exists, it is replaced. WithModule returns the SMR system itself (not a copy of it), so calls can be chained.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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