appstate

package
v0.27.0 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2021 License: LGPL-3.0 Imports: 12 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ShortSessionFlipKeyDeadline = time.Second * 25
)

Functions

This section is empty.

Types

type AppState

type AppState struct {
	ValidatorsCache *validators.ValidatorsCache
	State           *state.StateDB
	NonceCache      *state.NonceCache
	IdentityState   *state.IdentityStateDB
	EvidenceMap     *EvidenceMap
	// contains filtered or unexported fields
}

func NewAppState

func NewAppState(db dbm.DB, bus eventbus.Bus) (*AppState, error)

func (*AppState) Commit

func (s *AppState) Commit(block *types.Block) error

func (*AppState) CommitAt

func (s *AppState) CommitAt(height uint64) error

func (*AppState) CommitTrees added in v0.26.3

func (s *AppState) CommitTrees(block *types.Block, diff *state.IdentityStateDiff) error

func (*AppState) FinalizePrecommit added in v0.26.6

func (s *AppState) FinalizePrecommit(block *types.Block) error

func (*AppState) ForCheck added in v0.19.3

func (s *AppState) ForCheck(height uint64) (*AppState, error)

func (*AppState) ForCheckWithOverwrite added in v0.19.3

func (s *AppState) ForCheckWithOverwrite(height uint64) (*AppState, error)

loads appState

func (*AppState) Initialize

func (s *AppState) Initialize(height uint64) error

func (*AppState) Precommit

func (s *AppState) Precommit() ([]*state.StateTreeDiff, *state.IdentityStateDiff)

func (*AppState) Readonly

func (s *AppState) Readonly(height uint64) (*AppState, error)

func (*AppState) Reset

func (s *AppState) Reset()

func (*AppState) ResetTo

func (s *AppState) ResetTo(height uint64) error

func (*AppState) SetPredefinedState

func (s *AppState) SetPredefinedState(predefinedState *models.ProtoPredefinedState)

type EvidenceMap

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

func NewEvidenceMap

func NewEvidenceMap(bus eventbus.Bus) *EvidenceMap

func (*EvidenceMap) CalculateApprovedCandidates

func (m *EvidenceMap) CalculateApprovedCandidates(candidates []common.Address, maps [][]byte) []common.Address

func (*EvidenceMap) CalculateBitmap

func (m *EvidenceMap) CalculateBitmap(candidates []common.Address, additional []common.Address, reqFlips func(common.Address) uint8) *common.Bitmap

func (*EvidenceMap) Clear

func (m *EvidenceMap) Clear()

func (*EvidenceMap) ContainsAnswer

func (m *EvidenceMap) ContainsAnswer(candidate common.Address) bool

func (*EvidenceMap) ContainsKey

func (m *EvidenceMap) ContainsKey(candidate common.Address) bool

func (*EvidenceMap) GetShortSessionBeginningTime

func (m *EvidenceMap) GetShortSessionBeginningTime() time.Time

func (*EvidenceMap) GetShortSessionEndingTime

func (m *EvidenceMap) GetShortSessionEndingTime() time.Time

func (*EvidenceMap) IsCompleted

func (m *EvidenceMap) IsCompleted() bool

func (*EvidenceMap) NewFlipsKey

func (m *EvidenceMap) NewFlipsKey(author common.Address)

func (*EvidenceMap) SetShortSessionTime

func (m *EvidenceMap) SetShortSessionTime(timestamp time.Time, shortSessionDuration time.Duration)

Jump to

Keyboard shortcuts

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