Documentation ¶
Index ¶
- type Ledger
- func (ledger *Ledger) ApplyBlockTxs(block *core.Block) result.Result
- func (ledger *Ledger) ApplyBlockTxsForChainCorrection(block *core.Block) (common.Hash, result.Result)
- func (ledger *Ledger) FinalizeState(height uint64, rootHash common.Hash) result.Result
- func (ledger *Ledger) GetCurrentBlock() *core.Block
- func (ledger *Ledger) GetDeliveredSnapshot() (*st.StoreView, error)
- func (ledger *Ledger) GetEliteEdgeNodePoolOfLastCheckpoint(blockHash common.Hash) (core.EliteEdgeNodePool, error)
- func (ledger *Ledger) GetFinalizedSnapshot() (*st.StoreView, error)
- func (ledger *Ledger) GetFinalizedValidatorCandidatePool(blockHash common.Hash, isNext bool) (*core.ValidatorCandidatePool, error)
- func (ledger *Ledger) GetGuardianCandidatePool(blockHash common.Hash) (*core.GuardianCandidatePool, error)
- func (ledger *Ledger) GetScreenedSnapshot() (*st.StoreView, error)
- func (ledger *Ledger) ProposeBlockTxs(block *core.Block, shouldIncludeValidatorUpdateTxs bool) (stateRootHash common.Hash, blockRawTxs []common.Bytes, res result.Result)
- func (ledger *Ledger) PruneState(targetEndHeight uint64) error
- func (ledger *Ledger) ResetState(block *core.Block) result.Result
- func (ledger *Ledger) ScreenTx(rawTx common.Bytes) (txInfo *core.TxInfo, res result.Result)
- func (ledger *Ledger) ScreenTxUnsafe(rawTx common.Bytes) (res result.Result)
- func (ledger *Ledger) State() *st.LedgerState
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Ledger ¶
type Ledger struct {
// contains filtered or unexported fields
}
Ledger implements the core.Ledger interface
func NewLedger ¶
func NewLedger(chainID string, db database.Database, tagger st.Tagger, chain *blockchain.Chain, consensus core.ConsensusEngine, valMgr core.ValidatorManager, mempool *mp.Mempool) *Ledger
NewLedger creates an instance of Ledger
func (*Ledger) ApplyBlockTxs ¶
ApplyBlockTxs applies the given block transactions. If any of the transactions failed, it returns an error immediately. If all the transactions execute successfully, it then validates the state root hash. If the states root hash matches the expected value, it clears the transactions from the mempool
func (*Ledger) ApplyBlockTxsForChainCorrection ¶
func (ledger *Ledger) ApplyBlockTxsForChainCorrection(block *core.Block) (common.Hash, result.Result)
ApplyBlockTxsForChainCorrection applies all block's txs and re-calculate root hash
func (*Ledger) FinalizeState ¶
FinalizeState sets the ledger state with the finalized root
func (*Ledger) GetCurrentBlock ¶
GetCurrentBlock returns the block currently being processed
func (*Ledger) GetDeliveredSnapshot ¶
GetDeliveredSnapshot returns a snapshot of delivered ledger state to query about accounts, etc.
func (*Ledger) GetEliteEdgeNodePoolOfLastCheckpoint ¶
func (ledger *Ledger) GetEliteEdgeNodePoolOfLastCheckpoint(blockHash common.Hash) (core.EliteEdgeNodePool, error)
GetEliteEdgeNodePoolOfLastCheckpoint returns the elite edge node pool of the given block.
func (*Ledger) GetFinalizedSnapshot ¶
GetFinalizedSnapshot returns a snapshot of finalized ledger state to query about accounts, etc.
func (*Ledger) GetFinalizedValidatorCandidatePool ¶
func (ledger *Ledger) GetFinalizedValidatorCandidatePool(blockHash common.Hash, isNext bool) (*core.ValidatorCandidatePool, error)
GetFinalizedValidatorCandidatePool returns the validator candidate pool of the latest DIRECTLY finalized block
func (*Ledger) GetGuardianCandidatePool ¶
func (ledger *Ledger) GetGuardianCandidatePool(blockHash common.Hash) (*core.GuardianCandidatePool, error)
GetGuardianCandidatePool returns the guardian candidate pool of the given block.
func (*Ledger) GetScreenedSnapshot ¶
GetScreenedSnapshot returns a snapshot of screened ledger state to query about accounts, etc.
func (*Ledger) ProposeBlockTxs ¶
func (ledger *Ledger) ProposeBlockTxs(block *core.Block, shouldIncludeValidatorUpdateTxs bool) (stateRootHash common.Hash, blockRawTxs []common.Bytes, res result.Result)
ProposeBlockTxs collects and executes a list of transactions, which will be used to assemble the next blockl It also clears these transactions from the mempool.
func (*Ledger) PruneState ¶
PruneState attempts to prune the state up to the targetEndHeight
func (*Ledger) ResetState ¶
ResetState sets the ledger state with the designated root func (ledger *Ledger) ResetState(height uint64, rootHash common.Hash) result.Result {
func (*Ledger) ScreenTxUnsafe ¶
ScreenTxUnsafe screens the given transaction without locking.
func (*Ledger) State ¶
func (ledger *Ledger) State() *st.LedgerState
State returns the state of the ledger
Directories ¶
Path | Synopsis |
---|---|
Package vm implements the Ethereum Virtual Machine.
|
Package vm implements the Ethereum Virtual Machine. |
asm
Provides support for dealing with EVM assembly instructions (e.g., disassembling them).
|
Provides support for dealing with EVM assembly instructions (e.g., disassembling them). |