schema

package
v0.0.0-...-22ab5e0 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// RoundStateTable is the name of the table that stores the consensus
	// state traces. Follows this schema:
	//
	// | time | height | round | step |
	RoundStateTable = "consensus_round_state"

	// StepFieldKey is the name of the field that stores the consensus step. The
	// value is a string.
	StepFieldKey = "step"
)

Schema constants for the consensus round state tracing database.

View Source
const (
	// BlockPartsTable is the name of the table that stores the consensus block
	// parts.
	// following schema:
	//
	// | time | height | round | index | peer | transfer type |
	BlockPartsTable = "consensus_block_parts"

	// BlockPartIndexFieldKey is the name of the field that stores the block
	// part
	BlockPartIndexFieldKey = "index"
)

Schema constants for the "consensus_block_parts" table.

View Source
const (
	// BlockTable is the name of the table that stores metadata about consensus blocks.
	// following schema:
	//
	//  | time  | height | timestamp |
	BlockTable = "consensus_block"

	// UnixMillisecondTimestampFieldKey is the name of the field that stores the timestamp in
	// the last commit in unix milliseconds.
	UnixMillisecondTimestampFieldKey = "unix_millisecond_timestamp"

	// TxCountFieldKey is the name of the field that stores the number of
	// transactions in the block.
	TxCountFieldKey = "tx_count"

	// SquareSizeFieldKey is the name of the field that stores the square size
	// of the block. SquareSize is the number of shares in a single row or
	// column of the original data square.
	SquareSizeFieldKey = "square_size"

	// BlockSizeFieldKey is the name of the field that stores the size of
	// the block data in bytes.
	BlockSizeFieldKey = "block_size"

	// ProposerFieldKey is the name of the field that stores the proposer of
	// the block.
	ProposerFieldKey = "proposer"

	// LastCommitRoundFieldKey is the name of the field that stores the round
	// of the last commit.
	LastCommitRoundFieldKey = "last_commit_round"
)
View Source
const (
	// VoteTable is the name of the table that stores the consensus
	// voting traces. Follows this schema:
	//
	// | time | height | round | vote_type | vote_height | vote_round
	// | vote_block_id| vote_unix_millisecond_timestamp
	// | vote_validator_address | vote_validator_index | peer
	// | transfer_type |
	VoteTable = "consensus_vote"

	VoteTypeFieldKey         = "vote_type"
	VoteHeightFieldKey       = "vote_height"
	VoteRoundFieldKey        = "vote_round"
	VoteBlockIDFieldKey      = "vote_block_id"
	VoteTimestampFieldKey    = "vote_unix_millisecond_timestamp"
	ValidatorAddressFieldKey = "vote_validator_address"
	ValidatorIndexFieldKey   = "vote_validator_index"
)

Schema constants for the consensus votes tracing database.

View Source
const (
	// MempoolTxTable is the tracing "measurement" (aka table) for the mempool
	// that stores tracing data related to gossiping transactions.
	//
	// The schema for this table is:
	// | time | peerID | tx size | tx hash | transfer type | mempool version |
	MempoolTxTable = "mempool_tx"

	// TxFieldKey is the tracing field key for receiving for sending a
	// tx. This should take the form of a tx hash as the value.
	TxFieldKey = "tx"

	// SizeFieldKey is the tracing field key for the size of a tx. This
	// should take the form of the size of the tx as the value.
	SizeFieldKey = "size"

	// VersionFieldKey is the tracing field key for the version of the mempool.
	// This is used to distinguish between versions of the mempool.
	VersionFieldKey = "version"

	// V1VersionFieldValue is a tracing field value for the version of
	// the mempool. This value is used by the "version" field key.
	V1VersionFieldValue = "v1"

	// CatVersionFieldValue is a tracing field value for the version of
	// the mempool. This value is used by the "version" field key.
	CatVersionFieldValue = "cat"
)

Schema constants for the mempool_tx table

View Source
const (
	// MempoolPeerState is the tracing "measurement" (aka table) for the mempool
	// that stores tracing data related to mempool state, specifically
	// the gossipping of "SeenTx" and "WantTx".
	//
	// The schema for this table is:
	// | time | peerID | update type | mempool version |
	MempoolPeerStateTable = "mempool_peer_state"

	// StateUpdateFieldKey is the tracing field key for state updates of the mempool.
	StateUpdateFieldKey = "update"

	// SeenTxStateUpdateFieldValue is a tracing field value for the state
	// update of the mempool. This value is used by the "update" field key.
	SeenTxStateUpdateFieldValue = "seen_tx"

	// WantTxStateUpdateFieldValue is a tracing field value for the state
	// update of the mempool. This value is used by the "update" field key.
	WantTxStateUpdateFieldValue = "want_tx"

	// RemovedTxStateUpdateFieldValue is a tracing field value for the local
	// state update of the mempool. This value is used by the "update" field
	// key.
	RemovedTxStateUpdateFieldValue = "removed_tx"

	// AddedTxStateUpdateFieldValue is a tracing field value for the local state
	// update of the mempool. This value is used by the "update" field key.
	AddedTxStateUpdateFieldValue = "added_tx"
)
View Source
const (
	MempoolRejectedTable = "mempool_rejected"
	ReasonFieldKey       = "reason"
)
View Source
const (
	// PeerFieldKey is the tracing field key for the peer that sent or
	// received a tx. This should take the form of the peer's address as the
	// value.
	PeerFieldKey = "peer"

	// TransferTypeFieldKey is the tracing field key for the class of a tx
	// and votes.
	TransferTypeFieldKey = "transfer_type"

	// TransferTypeDownload is a tracing field value for receiving some
	// data from a peer. This value is used by the "TransferType" field key.
	TransferTypeDownload = "download"

	// TransferTypeUpload is a tracing field value for sending some data
	// to a peer. This value is used by the "TransferType" field key.
	TransferTypeUpload = "upload"

	// RoundFieldKey is the name of the field that stores the consensus round.
	// The value is an int32.
	RoundFieldKey = "round"

	// HeightFieldKey is the name of the field that stores the consensus height.
	// The value is an int64.
	HeightFieldKey = "height"
)

General purpose schema constants used across multiple tables

Variables

This section is empty.

Functions

func AllTables

func AllTables() []string

func ConsensusTables

func ConsensusTables() []string

ConsensusTables returns the list of tables that are used for consensus tracing.

func MempoolTables

func MempoolTables() []string

MempoolTables returns the list of tables for mempool tracing.

func WriteBlock

func WriteBlock(client *trace.Client, block *types.Block, size int)

func WriteBlockPart

func WriteBlockPart(
	client *trace.Client,
	height int64,
	round int32,
	peer p2p.ID,
	index uint32,
	transferType string,
)

WriteBlockPart writes a tracing point for a BlockPart using the predetermined schema for consensus state tracing. This is used to create a table in the following schema:

| time | height | round | index | peer | transfer type |

func WriteMempoolPeerState

func WriteMempoolPeerState(client *trace.Client, peer p2p.ID, stateUpdate, transferType, version string)

WriteMempoolPeerState writes a tracing point for the mempool state using the predetermined schema for mempool tracing. This is used to create a table in the following schema:

| time | peerID | transfer type | state update | mempool version |

func WriteMempoolRejected

func WriteMempoolRejected(client *trace.Client, reason string)

WriteMempoolRejected records why a transaction was rejected.

func WriteMempoolTx

func WriteMempoolTx(client *trace.Client, peer p2p.ID, tx []byte, transferType, version string)

WriteMempoolTx writes a tracing point for a tx using the predetermined schema for mempool tracing. This is used to create a table in the following schema:

| time | peerID | tx size | tx hash | transfer type | mempool version |

func WriteRoundState

func WriteRoundState(client *trace.Client, height int64, round int32, step cstypes.RoundStepType)

WriteRoundState writes a tracing point for a tx using the predetermined schema for consensus state tracing. This is used to create a table in the following schema:

| time | height | round | step |

func WriteVote

func WriteVote(client *trace.Client,
	height int64,
	round int32,
	vote *types.Vote,
	peer p2p.ID,
	transferType string,
)

WriteVote writes a tracing point for a vote using the predetermined schema for consensus vote tracing. This is used to create a table in the following schema:

| time | height | round | vote_type | vote_height | vote_round | vote_block_id| vote_unix_millisecond_timestamp | vote_validator_address | vote_validator_index | peer | transfer_type |

Types

This section is empty.

Jump to

Keyboard shortcuts

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