consensus

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2023 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Overview

Package consensus implements an analyzer for the consensus layer.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAnalyzer added in v0.1.0

func NewAnalyzer(cfg *config.BlockBasedAnalyzerConfig, genesisChainContext string, sourceClient *source.ConsensusClient, target storage.TargetStorage, logger *log.Logger) (analyzer.Analyzer, error)

NewAnalyzer returns a new analyzer for the consensus layer.

func OpenSignedTxNoVerify added in v0.0.15

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. The indexer 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 indexer. Due to the chain context being global, we cannot verify transactions for multiple networks anyway.

Types

type EventType added in v0.0.6

type EventType = apiTypes.ConsensusEventType // alias for brevity

type GenesisProcessor added in v0.0.3

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

GenesisProcessor generates sql statements for indexing the genesis state.

func NewGenesisProcessor added in v0.0.3

func NewGenesisProcessor(logger *log.Logger) *GenesisProcessor

NewGenesisProcessor creates a new GenesisProcessor.

func (*GenesisProcessor) Process added in v0.0.3

func (mg *GenesisProcessor) Process(document *genesis.Document) ([]string, error)

type TransferType added in v0.0.5

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"
)

Jump to

Keyboard shortcuts

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