mirror of
https://github.com/QuilibriumNetwork/ceremonyclient.git
synced 2026-03-03 23:37:27 +08:00
add light prover support
This commit is contained in:
parent
812939a97a
commit
67d454acb9
@ -19,6 +19,8 @@ type EngineConfig struct {
|
||||
// Alternative configuration path to manually specify data workers by multiaddr
|
||||
DataWorkerMultiaddrs []string `yaml:"dataWorkerMultiaddrs"`
|
||||
MultisigProverEnrollmentPaths []string `yaml:"multisigProverEnrollmentPaths"`
|
||||
// Does not verify execution, enables light provers
|
||||
LightNode bool
|
||||
|
||||
// Values used only for testing – do not override these in production, your
|
||||
// node will get kicked out
|
||||
|
||||
@ -59,7 +59,7 @@ func (e *DataClockConsensusEngine) collect(
|
||||
func (e *DataClockConsensusEngine) prove(
|
||||
previousFrame *protobufs.ClockFrame,
|
||||
) (*protobufs.ClockFrame, error) {
|
||||
if e.lastProven >= previousFrame.FrameNumber {
|
||||
if e.lastProven >= previousFrame.FrameNumber && e.lastProven != 0 {
|
||||
return previousFrame, nil
|
||||
}
|
||||
e.stagedTransactionsMx.Lock()
|
||||
|
||||
@ -200,8 +200,10 @@ func NewTokenExecutionEngine(
|
||||
[]*tries.RollingFrecencyCritbitTrie,
|
||||
error,
|
||||
) {
|
||||
if err := e.VerifyExecution(frame, triesAtFrame); err != nil {
|
||||
return nil, err
|
||||
if !e.engineConfig.LightNode {
|
||||
if err := e.VerifyExecution(frame, triesAtFrame); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
var tries []*tries.RollingFrecencyCritbitTrie
|
||||
if tries, err = e.ProcessFrame(txn, frame, triesAtFrame); err != nil {
|
||||
|
||||
12
node/main.go
12
node/main.go
@ -124,6 +124,11 @@ var (
|
||||
false,
|
||||
"runs an integrity check on the store, helpful for confirming backups are not corrupted (defaults to false)",
|
||||
)
|
||||
lightProver = flag.Bool(
|
||||
"light-prover",
|
||||
false,
|
||||
"when enabled, frame execution validation is skipped",
|
||||
)
|
||||
)
|
||||
|
||||
func signatureCheckDefault() bool {
|
||||
@ -322,6 +327,13 @@ func main() {
|
||||
)
|
||||
}
|
||||
|
||||
if *lightProver {
|
||||
nodeConfig.Engine.LightNode = true
|
||||
fmt.Println(
|
||||
"Node is running in light mode – be sure you intended to do this.",
|
||||
)
|
||||
}
|
||||
|
||||
clearIfTestData(*configDirectory, nodeConfig)
|
||||
|
||||
if *dbConsole {
|
||||
|
||||
@ -52,9 +52,9 @@ import (
|
||||
const (
|
||||
minPeersPerBitmask = 4
|
||||
minBootstrapPeers = 3
|
||||
discoveryParallelism = 1
|
||||
discoveryParallelism = 10
|
||||
discoveryPeerLimit = 1000
|
||||
bootstrapParallelism = 1
|
||||
bootstrapParallelism = 10
|
||||
)
|
||||
|
||||
type BlossomSub struct {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user