consensus

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 57 Imported by: 0

Documentation

Overview

Package consensus implements an analyzer for the consensus layer.

Package consensus implements an analyzer for the consensus layer.

Package consensus implements an analyzer for the consensus layer.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAnalyzer

func NewAnalyzer(blockRange config.BlockRange, batchSize uint64, mode analyzer.BlockAnalysisMode, history config.History, source nodeapi.ConsensusApiLite, network sdkConfig.Network, target storage.TargetStorage, logger *log.Logger) (analyzer.Analyzer, error)

NewAnalyzer returns a new analyzer for the consensus layer.

func OpenSignedTxNoVerify

func OpenSignedTxNoVerify(signedTx *transaction.SignedTransaction) (*transaction.Transaction, error)

OpenSignedTxNoVerify decodes the Transaction inside a Signed transaction without verifying the signature. Callers should be sure to check if the transaction actually succeeded. Nexus trusts its oasis-node to provide the correct transaction result, which will indicate if there was an authentication problem. Skipping the verification saves CPU on the analyzer. Due to the chain context being global, we cannot verify transactions for multiple networks anyway.

func RuntimeFromID added in v0.2.10

func RuntimeFromID(rtid coreCommon.Namespace, network sdkConfig.Network) *common.Runtime

Types

type EventType

type EventType = apiTypes.ConsensusEventType // alias for brevity

type GenesisProcessor

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

GenesisProcessor generates sql statements for indexing the genesis state.

func NewGenesisProcessor

func NewGenesisProcessor(logger *log.Logger) *GenesisProcessor

NewGenesisProcessor creates a new GenesisProcessor.

func (*GenesisProcessor) Process

func (mg *GenesisProcessor) Process(document *nodeapi.GenesisDocument, nodesOverride []nodeapi.Node) (*storage.QueryBatch, error)

Process generates SQL statements for indexing the genesis state. `nodesOverride` can be nil; if non-nil, the behavior is as if the genesis document contained that set of nodes instead of whatever it contains.

type MessageData added in v0.3.0

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

type TransferType

type TransferType string

Enum of transfer types. We single out transfers that deduct from the special "fee accumulator" account. These deductions/disbursements happen at the end of each block. However, oasis-core returns each block's events in the following order: BeginBlockEvents, EndBlockEvents (which include disbursements), TxEvents (which fill the fee accumulator). Thus, processing the events in order results in a temporary negative balance for the fee accumulator, which violates our DB checks. We therefore artificially split transfer events into two: accumulator disbursements, and all others. We process the former at the very end. We might be able to remove this once https://github.com/oasisprotocol/oasis-core/pull/5117 is deployed, making oasis-core send the "correct" event order on its own. But Cobalt (pre-Damask network) will never be fixed.

const (
	TransferTypeAccumulatorDisbursement TransferType = "AccumulatorDisbursement"
	TransferTypeOther                   TransferType = "Other"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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