validator

package
v4.0.15-alpha Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2023 License: AGPL-3.0 Imports: 25 Imported by: 2

Documentation

Index

Constants

View Source
const (
	DATABASE_NAME     = "DATABASE_NAME"
	DATABASE_HOSTNAME = "DATABASE_HOSTNAME"
	DATABASE_PORT     = "DATABASE_PORT"
	DATABASE_USER     = "DATABASE_USER"
	DATABASE_PASSWORD = "DATABASE_PASSWORD"
)

Env variables

Variables

View Source
var (
	DefaultRecoveryFormat = "./recover_validate_%s"
)

Functions

func InitIPFSBlockService

func InitIPFSBlockService(ipfsPath string) (blockservice.BlockService, error)

InitIPFSBlockService is used to configure and return a BlockService using an ipfs repo path (e.g. ~/.ipfs)

func LoadEnv

func LoadEnv(c *Config) error

func LoadViper

func LoadViper(c *Config)

func NewDB

func NewDB() (*sqlx.DB, error)

NewDB returns a new sqlx.DB from config/cli/env variables

func NewKVSDatabaseWithAncient

func NewKVSDatabaseWithAncient(kvs ethdb.KeyValueStore) ethdb.Database

Types

type Config

type Config struct {
	Hostname string
	Name     string
	User     string
	Password string
	Port     int
}

func (*Config) ConnString

func (c *Config) ConnString() string

type KVSWithAncient

type KVSWithAncient struct {
	ethdb.Database
	// contains filtered or unexported fields
}

type Params

type Params struct {
	Workers        uint
	RecoveryFormat string // %s substituted with traversal type
}

type TraversalType

type TraversalType = string

type Validator

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

Validator is used for validating Ethereum state and storage tries on PG-IPFS

func NewIPFSValidator

func NewIPFSValidator(bs blockservice.BlockService, par Params) *Validator

NewIPFSValidator returns a new trie validator ontop of an IPFS blockservice

func NewPGIPFSValidator

func NewPGIPFSValidator(db *sqlx.DB, par Params) *Validator

NewPGIPFSValidator returns a new trie validator ontop of a connection pool for an IPFS backing Postgres database

func NewValidator

func NewValidator(kvs ethdb.KeyValueStore, database ethdb.Database) *Validator

NewValidator returns a new trie validator Validating the completeness of a modified merkle patricia tries requires traversing the entire trie and verifying that every node is present, this is an expensive operation

func (*Validator) Close

func (v *Validator) Close() error

Close implements io.Closer it deregisters the groupcache name

func (*Validator) GetCacheStats

func (v *Validator) GetCacheStats() groupcache.Stats

func (*Validator) ValidateStateTrie

func (v *Validator) ValidateStateTrie(stateRoot common.Hash) error

ValidateStateTrie returns an error if the state trie for the provided state root cannot be confirmed as complete This does not consider child storage tries

func (*Validator) ValidateStorageTrie

func (v *Validator) ValidateStorageTrie(stateRoot common.Hash, address common.Address, storageRoot common.Hash) error

ValidateStorageTrie returns an error if the storage trie for the provided storage root and contract address cannot be confirmed as complete

func (*Validator) ValidateTrie

func (v *Validator) ValidateTrie(stateRoot common.Hash) error

ValidateTrie returns an error if the state and storage tries for the provided state root cannot be confirmed as complete This does consider child storage tries

Jump to

Keyboard shortcuts

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