Documentation ¶
Index ¶
- type ImmutableState
- func (s *ImmutableState) ConsensusParameters(ctx context.Context) (*roothash.ConsensusParameters, error)
- func (s *ImmutableState) RuntimeState(ctx context.Context, id common.Namespace) (*RuntimeState, error)
- func (s *ImmutableState) Runtimes(ctx context.Context) ([]*RuntimeState, error)
- func (s *ImmutableState) RuntimesWithRoundTimeouts(ctx context.Context, height int64) ([]common.Namespace, error)
- func (s *ImmutableState) RuntimesWithRoundTimeoutsAny(ctx context.Context) ([]common.Namespace, []int64, error)
- type MutableState
- func (s *MutableState) ClearRoundTimeout(ctx context.Context, runtimeID common.Namespace, height int64) error
- func (s *MutableState) ScheduleRoundTimeout(ctx context.Context, runtimeID common.Namespace, height int64) error
- func (s *MutableState) SetConsensusParameters(ctx context.Context, params *roothash.ConsensusParameters) error
- func (s *MutableState) SetRuntimeState(ctx context.Context, state *RuntimeState) error
- type RuntimeState
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) RuntimeState ¶
func (s *ImmutableState) RuntimeState(ctx context.Context, id common.Namespace) (*RuntimeState, error)
RuntimeState returns the roothash runtime state for a specific runtime.
func (*ImmutableState) Runtimes ¶
func (s *ImmutableState) Runtimes(ctx context.Context) ([]*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.
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) 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.
func (*MutableState) SetRuntimeState ¶
func (s *MutableState) SetRuntimeState(ctx context.Context, state *RuntimeState) error
SetRuntimeState sets a runtime's roothash state.
type RuntimeState ¶
type RuntimeState struct { Runtime *registry.Runtime `json:"runtime"` Suspended bool `json:"suspended,omitempty"` GenesisBlock *block.Block `json:"genesis_block"` CurrentBlock *block.Block `json:"current_block"` CurrentBlockHeight int64 `json:"current_block_height"` ExecutorPool *commitment.Pool `json:"executor_pool"` }
RuntimeState is the per-runtime roothash state.