add light prover support

This commit is contained in:
Cassandra Heart 2024-11-09 14:46:53 -06:00
parent 812939a97a
commit 67d454acb9
No known key found for this signature in database
GPG Key ID: 6352152859385958
5 changed files with 21 additions and 5 deletions

View File

@ -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

View File

@ -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()

View File

@ -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 {

View File

@ -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 {

View File

@ -52,9 +52,9 @@ import (
const (
minPeersPerBitmask = 4
minBootstrapPeers = 3
discoveryParallelism = 1
discoveryParallelism = 10
discoveryPeerLimit = 1000
bootstrapParallelism = 1
bootstrapParallelism = 10
)
type BlossomSub struct {