validator

package
v5.0.0-alpha Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2023 License: AGPL-3.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CIDsRefIPLDBlocks = `` /* 252-byte string literal not displayed */

	UncleCIDsRefHeaderCIDs = `` /* 313-byte string literal not displayed */

	TransactionCIDsRefHeaderCIDs = `` /* 337-byte string literal not displayed */

	ReceiptCIDsRefTransactionCIDs = `` /* 394-byte string literal not displayed */

	StateCIDsRefHeaderCIDs = `` /* 313-byte string literal not displayed */

	StorageCIDsRefStateCIDs = `` /* 387-byte string literal not displayed */

	LogCIDsRefReceiptCIDs = `` /* 351-byte string literal not displayed */

)

Variables

View Source
var (
	ReferentialIntegrityErr = "referential integrity check failed at block %d, entry for %s not found"
	EntryNotFoundErr        = "entry for %s not found"
)

Functions

func EthAPI

func EthAPI(ctx context.Context, db *sqlx.DB, chainCfg *params.ChainConfig) (*ipldeth.PublicEthAPI, error)

func ValidateBlock

func ValidateBlock(blockToBeValidated *types.Block, b *ipldeth.Backend, blockNumber uint64) error

ValidateBlock validates block at the given height

func ValidateHeaderCIDsRef

func ValidateHeaderCIDsRef(tx *sqlx.Tx, blockNumber uint64) error

ValidateHeaderCIDsRef does a reference integrity check on references in eth.header_cids table

func ValidateIPFSBlocks

func ValidateIPFSBlocks(tx *sqlx.Tx, blockNumber uint64, CIDTable string, CIDField string) error

ValidateIPFSBlocks does a reference integrity check between the given CID table and IPFS blocks table on MHKey and block number

func ValidateLogCIDsRef

func ValidateLogCIDsRef(tx *sqlx.Tx, blockNumber uint64) error

ValidateLogCIDsRef does a reference integrity check on references in eth.log_cids table

func ValidateReceiptCIDsRef

func ValidateReceiptCIDsRef(tx *sqlx.Tx, blockNumber uint64) error

ValidateReceiptCIDsRef does a reference integrity check on references in eth.receipt_cids table

func ValidateReferentialIntegrity

func ValidateReferentialIntegrity(tx *sqlx.Tx, blockNumber uint64) error

ValidateReferentialIntegrity validates referential integrity at the given height

func ValidateStateCIDsRef

func ValidateStateCIDsRef(tx *sqlx.Tx, blockNumber uint64) error

ValidateStateCIDsRef does a reference integrity check on references in eth.state_cids table

func ValidateStorageCIDsRef

func ValidateStorageCIDsRef(tx *sqlx.Tx, blockNumber uint64) error

ValidateStorageCIDsRef does a reference integrity check on references in eth.storage_cids table

func ValidateTransactionCIDsRef

func ValidateTransactionCIDsRef(tx *sqlx.Tx, blockNumber uint64) error

ValidateTransactionCIDsRef does a reference integrity check on references in eth.header_cids table

func ValidateUncleCIDsRef

func ValidateUncleCIDsRef(tx *sqlx.Tx, blockNumber uint64) error

ValidateUncleCIDsRef does a reference integrity check on references in eth.uncle_cids table

Types

type ChainNotSyncedError

type ChainNotSyncedError struct {
	Head uint64
}

func (*ChainNotSyncedError) Error

func (e *ChainNotSyncedError) Error() string

type Config

type Config struct {
	DBConfig postgres.Config
	DBStats  bool

	ChainConfig *params.ChainConfig
	// Used to trigger writing state diffs for gaps in the index
	Client                *rpc.Client
	FromBlock, Trail      uint64
	RetryInterval         time.Duration
	StateDiffMissingBlock bool
	StateDiffTimeout      time.Duration
}

func NewConfig

func NewConfig() (*Config, error)

type Service

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

func NewService

func NewService(cfg *Config, progressChan chan<- uint64) (*Service, error)

func (*Service) Start

func (s *Service) Start(ctx context.Context, wg *sync.WaitGroup)

Start is used to begin the service

func (*Service) Stop

func (s *Service) Stop()

Stop is used to gracefully stop the service

func (*Service) Validate

func (s *Service) Validate(ctx context.Context, api *ipldeth.PublicEthAPI, idxBlockNum uint64) error

Jump to

Keyboard shortcuts

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