state

package
v0.2202.3 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2022 License: Apache-2.0 Imports: 10 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) IncomingMessageQueue added in v0.2200.0

func (s *ImmutableState) IncomingMessageQueue(ctx context.Context, runtimeID common.Namespace, offset uint64, limit uint32) ([]*message.IncomingMessage, error)

IncomingMessageQueue returns a list of queued messages, starting with the passed offset.

func (*ImmutableState) IncomingMessageQueueMeta added in v0.2200.0

func (s *ImmutableState) IncomingMessageQueueMeta(ctx context.Context, runtimeID common.Namespace) (*message.IncomingMessageQueueMeta, error)

IncomingMessageQueueMeta returns the incoming message queue metadata for the given runtime.

func (*ImmutableState) LastRoundResults added in v0.2200.0

func (s *ImmutableState) LastRoundResults(ctx context.Context, id common.Namespace) (*roothash.RoundResults, error)

LastRoundResults returns the last normal round results for a specific runtime.

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) 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) RemoveIncomingMessageFromQueue added in v0.2200.0

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

RemoveIncomingMessageFromQueue removes an entry from the incoming message queue.

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) SetIncomingMessageInQueue added in v0.2200.0

func (s *MutableState) SetIncomingMessageInQueue(ctx context.Context, runtimeID common.Namespace, msg *message.IncomingMessage) error

SetIncomingMessageInQueue sets an entry in the incoming message queue.

func (*MutableState) SetIncomingMessageQueueMeta added in v0.2200.0

func (s *MutableState) SetIncomingMessageQueueMeta(ctx context.Context, runtimeID common.Namespace, meta *message.IncomingMessageQueueMeta) error

SetIncomingMessageQueueMeta sets the incoming message queue metadata.

func (*MutableState) SetLastRoundResults added in v0.2200.0

func (s *MutableState) SetLastRoundResults(ctx context.Context, runtimeID common.Namespace, results *roothash.RoundResults) error

SetLastRoundResults sets a runtime's last normal round results.

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