state

package
v0.2103.12 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ImmutableState

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

ImmutableState is the immutable roothash state wrapper.

func NewImmutableState

func NewImmutableState(ctx context.Context, state api.ApplicationQueryState, version int64) (*ImmutableState, error)

func (*ImmutableState) ConsensusParameters

func (s *ImmutableState) ConsensusParameters(ctx context.Context) (*roothash.ConsensusParameters, error)

ConsensusParameters returns the roothash consensus parameters.

func (*ImmutableState) EvidenceHashExists added in v0.2100.0

func (s *ImmutableState) EvidenceHashExists(ctx context.Context, runtimeID common.Namespace, round uint64, hash hash.Hash) (bool, error)

EvidenceHashExists returns true if the evidence hash for the runtime exists.

func (*ImmutableState) IORoot added in v0.2100.0

func (s *ImmutableState) IORoot(ctx context.Context, id common.Namespace) (hash.Hash, error)

IORoot returns the state root for a specific runtime.

func (*ImmutableState) RejectTransactions added in v0.2100.0

func (s *ImmutableState) RejectTransactions(ctx context.Context) (bool, error)

RejectTransactions returns true iff all transactions should be rejected.

func (*ImmutableState) RuntimeState

RuntimeState returns the roothash runtime state for a specific runtime.

func (*ImmutableState) Runtimes

func (s *ImmutableState) Runtimes(ctx context.Context) ([]*roothash.RuntimeState, error)

Runtimes returns the list of all roothash runtime states.

func (*ImmutableState) RuntimesWithRoundTimeouts added in v0.2010.0

func (s *ImmutableState) RuntimesWithRoundTimeouts(ctx context.Context, height int64) ([]common.Namespace, error)

RuntimesWithRoundTimeouts returns the runtimes that have round timeouts scheduled at the given height.

func (*ImmutableState) RuntimesWithRoundTimeoutsAny added in v0.2010.0

func (s *ImmutableState) RuntimesWithRoundTimeoutsAny(ctx context.Context) ([]common.Namespace, []int64, error)

RuntimesWithRoundTimeoutsAny returns the runtimes that have round timeouts scheduled at any height.

func (*ImmutableState) StateRoot added in v0.2100.0

func (s *ImmutableState) StateRoot(ctx context.Context, id common.Namespace) (hash.Hash, error)

StateRoot returns the state root for a specific runtime.

type MutableState

type MutableState struct {
	*ImmutableState
	// contains filtered or unexported fields
}

MutableState is the mutable roothash state wrapper.

func NewMutableState

func NewMutableState(tree mkvs.KeyValueTree) *MutableState

func (*MutableState) ClearRejectTransactions added in v0.2100.0

func (s *MutableState) ClearRejectTransactions(ctx context.Context) error

ClearRejectTransactions clears the transaction disable.

func (*MutableState) ClearRoundTimeout added in v0.2010.0

func (s *MutableState) ClearRoundTimeout(ctx context.Context, runtimeID common.Namespace, height int64) error

ClearRoundTimeout clears a previously scheduled round timeout at a given height.

func (*MutableState) RemoveExpiredEvidence added in v0.2100.0

func (s *MutableState) RemoveExpiredEvidence(ctx context.Context, runtimeID common.Namespace, minRound uint64) error

RemoveExpiredEvidence removes expired evidence.

func (*MutableState) ScheduleRoundTimeout added in v0.2010.0

func (s *MutableState) ScheduleRoundTimeout(ctx context.Context, runtimeID common.Namespace, height int64) error

ScheduleRoundTimeout schedules a new runtime round timeout at a given height.

func (*MutableState) SetConsensusParameters

func (s *MutableState) SetConsensusParameters(ctx context.Context, params *roothash.ConsensusParameters) error

SetConsensusParameters sets roothash consensus parameters.

NOTE: This method must only be called from InitChain/EndBlock contexts.

func (*MutableState) SetEvidenceHash added in v0.2100.0

func (s *MutableState) SetEvidenceHash(ctx context.Context, runtimeID common.Namespace, round uint64, hash hash.Hash) error

SetEvidenceHash sets the provided evidence hash.

func (*MutableState) SetRejectTransactions added in v0.2100.0

func (s *MutableState) SetRejectTransactions(ctx context.Context) error

SetRejectTransactions sets the transaction disable.

func (*MutableState) SetRuntimeState

func (s *MutableState) SetRuntimeState(ctx context.Context, state *roothash.RuntimeState) error

SetRuntimeState sets a runtime's roothash state.

Jump to

Keyboard shortcuts

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