diff --git a/node/config/engine.go b/node/config/engine.go index 2e7acbf..028a2a5 100644 --- a/node/config/engine.go +++ b/node/config/engine.go @@ -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 diff --git a/node/consensus/data/consensus_frames.go b/node/consensus/data/consensus_frames.go index a03be51..1a195dd 100644 --- a/node/consensus/data/consensus_frames.go +++ b/node/consensus/data/consensus_frames.go @@ -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() diff --git a/node/execution/intrinsics/token/token_execution_engine.go b/node/execution/intrinsics/token/token_execution_engine.go index bff4aa8..a84e609 100644 --- a/node/execution/intrinsics/token/token_execution_engine.go +++ b/node/execution/intrinsics/token/token_execution_engine.go @@ -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 { diff --git a/node/main.go b/node/main.go index 14284e9..84c3a72 100644 --- a/node/main.go +++ b/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 { diff --git a/node/p2p/blossomsub.go b/node/p2p/blossomsub.go index 2abfb19..d3c8c44 100644 --- a/node/p2p/blossomsub.go +++ b/node/p2p/blossomsub.go @@ -52,9 +52,9 @@ import ( const ( minPeersPerBitmask = 4 minBootstrapPeers = 3 - discoveryParallelism = 1 + discoveryParallelism = 10 discoveryPeerLimit = 1000 - bootstrapParallelism = 1 + bootstrapParallelism = 10 ) type BlossomSub struct {