Documentation
¶
Overview ¶
Package mesh defines the main store point for all the persisted mesh objects such as ATXs, ballots and blocks.
Index ¶
- type Mesh
- func (msh *Mesh) AddBallot(ballot *types.Ballot) error
- func (msh *Mesh) AddBlockWithTXs(ctx context.Context, block *types.Block) error
- func (msh *Mesh) AddTXsFromProposal(ctx context.Context, layerID types.LayerID, proposalID types.ProposalID, ...) error
- func (msh *Mesh) GetATXs(ctx context.Context, atxIds []types.ATXID) (map[types.ATXID]*types.VerifiedActivationTx, []types.ATXID)
- func (msh *Mesh) GetLayer(lid types.LayerID) (*types.Layer, error)
- func (msh *Mesh) GetRewards(coinbase types.Address) ([]*types.Reward, error)
- func (msh *Mesh) LastVerified() types.LayerID
- func (msh *Mesh) LatestLayer() types.LayerID
- func (msh *Mesh) LatestLayerInState() types.LayerID
- func (msh *Mesh) MissingLayer() types.LayerID
- func (msh *Mesh) ProcessLayer(ctx context.Context, layerID types.LayerID) error
- func (msh *Mesh) ProcessLayerPerHareOutput(ctx context.Context, layerID types.LayerID, blockID types.BlockID) error
- func (msh *Mesh) ProcessedLayer() types.LayerID
- func (msh *Mesh) SetZeroBlockLayer(ctx context.Context, lid types.LayerID) error
- func (msh *Mesh) UpdateBlockValidity(bid types.BlockID, lid types.LayerID, newValid bool) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Mesh ¶
type Mesh struct {
// contains filtered or unexported fields
}
Mesh is the logic layer above our mesh.DB database.
func NewMesh ¶
func NewMesh(cdb *datastore.CachedDB, trtl system.Tortoise, state conservativeState, logger log.Log) (*Mesh, error)
NewMesh creates a new instant of a mesh.
func (*Mesh) AddBlockWithTXs ¶ added in v1.0.0
AddBlockWithTXs adds the block and its TXs in into the database.
func (*Mesh) AddTXsFromProposal ¶ added in v1.0.0
func (msh *Mesh) AddTXsFromProposal(ctx context.Context, layerID types.LayerID, proposalID types.ProposalID, txIDs []types.TransactionID) error
AddTXsFromProposal adds the TXs in a Proposal into the database.
func (*Mesh) GetATXs ¶
func (msh *Mesh) GetATXs(ctx context.Context, atxIds []types.ATXID) (map[types.ATXID]*types.VerifiedActivationTx, []types.ATXID)
GetATXs uses GetFullAtx to return a list of atxs corresponding to atxIds requested.
func (*Mesh) GetRewards ¶ added in v1.0.0
GetRewards retrieves account's rewards by the coinbase address.
func (*Mesh) LastVerified ¶ added in v1.0.0
LastVerified returns the latest layer verified by tortoise.
func (*Mesh) LatestLayer ¶
LatestLayer - returns the latest layer we saw from the network.
func (*Mesh) LatestLayerInState ¶
LatestLayerInState returns the latest layer we applied to state.
func (*Mesh) MissingLayer ¶
MissingLayer is a layer in (latestLayerInState, processLayer]. this layer is missing critical data (valid blocks or transactions) and can't be applied to the state.
First valid layer starts with 1. 0 is empty layer and can be ignored.
func (*Mesh) ProcessLayer ¶ added in v1.0.0
ProcessLayer performs fairly heavy lifting: it triggers tortoise to process the full contents of the layer (i.e., all of its blocks), then to attempt to validate all unvalidated layers up to this layer. It also applies state for newly-validated layers.
func (*Mesh) ProcessLayerPerHareOutput ¶ added in v1.0.0
func (msh *Mesh) ProcessLayerPerHareOutput(ctx context.Context, layerID types.LayerID, blockID types.BlockID) error
ProcessLayerPerHareOutput receives hare output once it finishes running for a given layer.
func (*Mesh) ProcessedLayer ¶
ProcessedLayer returns the last processed layer ID.
func (*Mesh) SetZeroBlockLayer ¶ added in v0.1.6
SetZeroBlockLayer advances the latest layer in the network with a layer that truly has no data.