chain

package
v0.0.0-...-5d05a64 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2022 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chain

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

func NewChain

func NewChain(s *state.State) *Chain

func (*Chain) AccountDB

func (c *Chain) AccountDB() (*state2.StateDB, error)

func (*Chain) AccountDBForTrie

func (c *Chain) AccountDBForTrie(trieRoot common.Hash) (*state2.StateDB, error)

func (*Chain) AddBlock

func (c *Chain) AddBlock(b *block.Block) bool

func (*Chain) CalculateEpochMetaData

func (c *Chain) CalculateEpochMetaData(statedb *state2.StateDB, slotNumber uint64,
	parentHeaderHash common.Hash) (*metadata.EpochMetaData, error)

func (*Chain) Config

func (c *Chain) Config() *params.ChainConfig

func (*Chain) CurrentBlock

func (c *Chain) CurrentBlock() *block.Block

func (*Chain) CurrentFinalizedBlock

func (c *Chain) CurrentFinalizedBlock() *block.Block

func (*Chain) EVMCall

func (c *Chain) EVMCall(contractAddress common.Address, data []byte) ([]byte, error)

func (*Chain) GetAttestorsBySlotNumber

func (c *Chain) GetAttestorsBySlotNumber(trieRoot common.Hash,
	slotNumber uint64, parentHeaderHash common.Hash) ([][]byte, error)

func (*Chain) GetBlock

func (c *Chain) GetBlock(headerHash common.Hash) (*block.Block, error)

func (*Chain) GetBlockByNumber

func (c *Chain) GetBlockByNumber(number uint64) *block.Block

func (*Chain) GetBlockBySlotNumber

func (c *Chain) GetBlockBySlotNumber(n uint64) (*block.Block, error)

func (*Chain) GetBlockHashBySlotNumber

func (c *Chain) GetBlockHashBySlotNumber(n uint64) common.Hash

func (*Chain) GetBlockMetaData

func (c *Chain) GetBlockMetaData(headerHash common.Hash) (*metadata.BlockMetaData, error)

func (*Chain) GetEpochHeaderHashes

func (c *Chain) GetEpochHeaderHashes(epoch uint64) (*protos.EpochBlockHashesMetaData, error)

func (*Chain) GetEpochMetaData

func (c *Chain) GetEpochMetaData(trieRoot common.Hash,
	slotNumber uint64, parentHeaderHash common.Hash) (*metadata.EpochMetaData, error)

func (*Chain) GetFinalizedHeaderHash

func (c *Chain) GetFinalizedHeaderHash() (common.Hash, error)

func (*Chain) GetLastBlock

func (c *Chain) GetLastBlock() *block.Block

func (*Chain) GetLogsByHash

func (c *Chain) GetLogsByHash(headerHash common.Hash) ([][]*types.Log, error)

func (*Chain) GetMaxPossibleSlotNumber

func (c *Chain) GetMaxPossibleSlotNumber() uint64

func (*Chain) GetNonce

func (c *Chain) GetNonce(address common.Address) (uint64, error)

func (*Chain) GetReceiptsByHash

func (c *Chain) GetReceiptsByHash(headerHash common.Hash, isProtocolTransaction bool) types.Receipts

func (*Chain) GetSlotLeaderDilithiumPKBySlotNumber

func (c *Chain) GetSlotLeaderDilithiumPKBySlotNumber(trieRoot common.Hash,
	slotNumber uint64, parentHeaderHash common.Hash) ([]byte, error)

func (*Chain) GetSlotValidatorsMetaDataBySlotNumber

func (c *Chain) GetSlotValidatorsMetaDataBySlotNumber(trieRoot common.Hash,
	slotNumber uint64, parentHeaderHash common.Hash) (*metadata.SlotValidatorsMetaData, error)

GetSlotValidatorsMetaDataBySlotNumber returns a map of all the validators for a specific slot number. The value of map is 1 for slot leader and 0 for the attestors.

func (*Chain) GetStartingNonFinalizedEpoch

func (c *Chain) GetStartingNonFinalizedEpoch() (uint64, error)

func (*Chain) GetStateContext

func (c *Chain) GetStateContext() (*state.StateContext, error)

func (*Chain) GetStateContext2

func (c *Chain) GetStateContext2(slotNumber uint64, blockProposer []byte,
	parentHeaderHash common.Hash, partialBlockSigningHash common.Hash) (*state.StateContext, error)

func (*Chain) GetTotalStakeAmount

func (c *Chain) GetTotalStakeAmount() (*big.Int, error)

func (*Chain) GetTransactionMetaDataByHash

func (c *Chain) GetTransactionMetaDataByHash(txHash common.Hash) (*protos.Transaction, common.Hash, uint64, uint64)

func (*Chain) GetTransactionPool

func (c *Chain) GetTransactionPool() *pool.TransactionPool

func (*Chain) GetVMConfig

func (c *Chain) GetVMConfig() *vm.Config

GetVMConfig returns the chain VM config.

func (*Chain) GetValidators

func (c *Chain) GetValidators() (*metadata.EpochMetaData, error)

func (*Chain) Height

func (c *Chain) Height() uint64

func (*Chain) Load

func (c *Chain) Load() error

func (*Chain) StateAt

func (c *Chain) StateAt(root common.Hash) (*state2.StateDB, error)

func (*Chain) ValidateAttestTransaction

func (c *Chain) ValidateAttestTransaction(protoTx *protos.ProtocolTransaction, validatorsType *metadata.SlotValidatorsMetaData, partialBlockSigningHash common.Hash, slotNumber, parentSlotNumber uint64) error

func (*Chain) ValidateCoinBaseTransaction

func (c *Chain) ValidateCoinBaseTransaction(protoTx *protos.ProtocolTransaction, validatorsType *metadata.SlotValidatorsMetaData, blockSigningHash common.Hash, slotNumber, parentSlotNumber uint64, isGenesis bool) error

func (*Chain) ValidateProtocolTransaction

func (c *Chain) ValidateProtocolTransaction(protoTx *protos.ProtocolTransaction, slotValidatorsMetaData *metadata.SlotValidatorsMetaData, blockSigningHash common.Hash, slotNumber, parentSlotNumber uint64, isGenesis bool) error

func (*Chain) ValidateTransaction

func (c *Chain) ValidateTransaction(protoTx *protos.Transaction) error

Jump to

Keyboard shortcuts

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