mirror of
https://github.com/QuilibriumNetwork/ceremonyclient.git
synced 2026-02-24 03:47:25 +08:00
* roll up v2.0.1-b2 to develop * b2-fixed * adjust return data of fast sync so it doesn't return the earliest frame * -b3 * fix: announce peer based on leading frame, not initial frame; fix: looping bug * fix: last batch fails due to underflow; qol: make logging chattier * -b4 * resolve frame cache issue * fix: mint loop + re-migrate * fix: register execution panic * fix: mint loop, other side * fix: handle unexpected return of nil status * final -b4 * handle subtle change to migration * qol: add heuristic to handle corruption scenario * bump genesis * qol: use separate channel for worker * final parameterization, parallelize streams * deprecate signers 10, 11, 14, 17 * adjust signatory check size to match rotated out signers
50 lines
1.3 KiB
Go
50 lines
1.3 KiB
Go
package consensus
|
|
|
|
import (
|
|
"crypto"
|
|
|
|
"source.quilibrium.com/quilibrium/monorepo/node/config"
|
|
"source.quilibrium.com/quilibrium/monorepo/node/execution"
|
|
"source.quilibrium.com/quilibrium/monorepo/node/keys"
|
|
"source.quilibrium.com/quilibrium/monorepo/node/protobufs"
|
|
)
|
|
|
|
type EngineState int
|
|
|
|
const (
|
|
EngineStateStopped EngineState = iota
|
|
EngineStateStarting
|
|
EngineStateLoading
|
|
EngineStateCollecting
|
|
EngineStateProving
|
|
EngineStatePublishing
|
|
EngineStateVerifying
|
|
EngineStateStopping
|
|
)
|
|
|
|
type ConsensusEngine interface {
|
|
Start() <-chan error
|
|
Stop(force bool) <-chan error
|
|
RegisterExecutor(exec execution.ExecutionEngine, frame uint64) <-chan error
|
|
UnregisterExecutor(name string, frame uint64, force bool) <-chan error
|
|
GetFrame() *protobufs.ClockFrame
|
|
GetDifficulty() uint32
|
|
GetState() EngineState
|
|
GetFrameChannel() <-chan *protobufs.ClockFrame
|
|
}
|
|
|
|
type DataConsensusEngine interface {
|
|
Start() <-chan error
|
|
Stop(force bool) <-chan error
|
|
RegisterExecutor(exec execution.ExecutionEngine, frame uint64) <-chan error
|
|
UnregisterExecutor(name string, frame uint64, force bool) <-chan error
|
|
GetFrame() *protobufs.ClockFrame
|
|
GetDifficulty() uint32
|
|
GetState() EngineState
|
|
GetProvingKey(
|
|
engineConfig *config.EngineConfig,
|
|
) (crypto.Signer, keys.KeyType, []byte, []byte)
|
|
IsInProverTrie(key []byte) bool
|
|
GetPeerInfo() *protobufs.PeerInfoResponse
|
|
}
|