@@ -96,77 +96,78 @@ func (p *Prover) initProofSubmitters(
96
96
txBuilder * transaction.ProveBlockTxBuilder ,
97
97
tiers []* rpc.TierProviderTierWithID ,
98
98
) (err error ) {
99
- for _ , tier := range p .sharedState .GetTiers () {
100
- var (
101
- bufferSize = p .cfg .SGXProofBufferSize
102
- producer proofProducer.ProofProducer
103
- submitter proofSubmitter.Submitter
104
- err error
105
- )
106
- switch tier .ID {
107
- case encoding .TierOptimisticID :
108
- producer = & proofProducer.OptimisticProofProducer {}
109
- case encoding .TierSgxID :
110
- producer = & proofProducer.SGXProofProducer {
111
- RaikoHostEndpoint : p .cfg .RaikoHostEndpoint ,
112
- JWT : p .cfg .RaikoJWT ,
113
- ProofType : proofProducer .ProofTypeSgx ,
114
- Dummy : p .cfg .Dummy ,
115
- RaikoRequestTimeout : p .cfg .RaikoRequestTimeout ,
116
- }
117
- case encoding .TierZkVMRisc0ID :
118
- producer = & proofProducer.ZKvmProofProducer {
119
- ZKProofType : proofProducer .ZKProofTypeR0 ,
120
- RaikoHostEndpoint : p .cfg .RaikoZKVMHostEndpoint ,
121
- JWT : p .cfg .RaikoJWT ,
122
- Dummy : p .cfg .Dummy ,
123
- RaikoRequestTimeout : p .cfg .RaikoRequestTimeout ,
99
+ if len (tiers ) > 0 {
100
+ for _ , tier := range p .sharedState .GetTiers () {
101
+ var (
102
+ bufferSize = p .cfg .SGXProofBufferSize
103
+ producer proofProducer.ProofProducer
104
+ submitter proofSubmitter.Submitter
105
+ err error
106
+ )
107
+ switch tier .ID {
108
+ case encoding .TierOptimisticID :
109
+ producer = & proofProducer.OptimisticProofProducer {}
110
+ case encoding .TierSgxID :
111
+ producer = & proofProducer.SGXProofProducer {
112
+ RaikoHostEndpoint : p .cfg .RaikoHostEndpoint ,
113
+ JWT : p .cfg .RaikoJWT ,
114
+ ProofType : proofProducer .ProofTypeSgx ,
115
+ Dummy : p .cfg .Dummy ,
116
+ RaikoRequestTimeout : p .cfg .RaikoRequestTimeout ,
117
+ }
118
+ case encoding .TierZkVMRisc0ID :
119
+ producer = & proofProducer.ZKvmProofProducer {
120
+ ZKProofType : proofProducer .ZKProofTypeR0 ,
121
+ RaikoHostEndpoint : p .cfg .RaikoZKVMHostEndpoint ,
122
+ JWT : p .cfg .RaikoJWT ,
123
+ Dummy : p .cfg .Dummy ,
124
+ RaikoRequestTimeout : p .cfg .RaikoRequestTimeout ,
125
+ }
126
+ bufferSize = p .cfg .ZKVMProofBufferSize
127
+ case encoding .TierZkVMSp1ID :
128
+ producer = & proofProducer.ZKvmProofProducer {
129
+ ZKProofType : proofProducer .ZKProofTypeSP1 ,
130
+ RaikoHostEndpoint : p .cfg .RaikoZKVMHostEndpoint ,
131
+ JWT : p .cfg .RaikoJWT ,
132
+ Dummy : p .cfg .Dummy ,
133
+ RaikoRequestTimeout : p .cfg .RaikoRequestTimeout ,
134
+ }
135
+ bufferSize = p .cfg .ZKVMProofBufferSize
136
+ case encoding .TierGuardianMinorityID :
137
+ producer = proofProducer .NewGuardianProofProducer (encoding .TierGuardianMinorityID , p .cfg .EnableLivenessBondProof )
138
+ bufferSize = 0
139
+ case encoding .TierGuardianMajorityID :
140
+ producer = proofProducer .NewGuardianProofProducer (encoding .TierGuardianMajorityID , p .cfg .EnableLivenessBondProof )
141
+ bufferSize = 0
142
+ default :
143
+ return fmt .Errorf ("unsupported tier: %d" , tier .ID )
124
144
}
125
- bufferSize = p .cfg .ZKVMProofBufferSize
126
- case encoding .TierZkVMSp1ID :
127
- producer = & proofProducer.ZKvmProofProducer {
128
- ZKProofType : proofProducer .ZKProofTypeSP1 ,
129
- RaikoHostEndpoint : p .cfg .RaikoZKVMHostEndpoint ,
130
- JWT : p .cfg .RaikoJWT ,
131
- Dummy : p .cfg .Dummy ,
132
- RaikoRequestTimeout : p .cfg .RaikoRequestTimeout ,
145
+
146
+ if submitter , err = proofSubmitter .NewProofSubmitterOntake (
147
+ p .rpc ,
148
+ producer ,
149
+ p .proofGenerationCh ,
150
+ p .batchProofGenerationCh ,
151
+ p .aggregationNotify ,
152
+ p .cfg .ProverSetAddress ,
153
+ p .cfg .TaikoL2Address ,
154
+ p .cfg .Graffiti ,
155
+ p .cfg .ProveBlockGasLimit ,
156
+ p .txmgr ,
157
+ p .privateTxmgr ,
158
+ txBuilder ,
159
+ tiers ,
160
+ p .IsGuardianProver (),
161
+ p .cfg .GuardianProofSubmissionDelay ,
162
+ bufferSize ,
163
+ p .cfg .ForceBatchProvingInterval ,
164
+ ); err != nil {
165
+ return err
133
166
}
134
- bufferSize = p .cfg .ZKVMProofBufferSize
135
- case encoding .TierGuardianMinorityID :
136
- producer = proofProducer .NewGuardianProofProducer (encoding .TierGuardianMinorityID , p .cfg .EnableLivenessBondProof )
137
- bufferSize = 0
138
- case encoding .TierGuardianMajorityID :
139
- producer = proofProducer .NewGuardianProofProducer (encoding .TierGuardianMajorityID , p .cfg .EnableLivenessBondProof )
140
- bufferSize = 0
141
- default :
142
- return fmt .Errorf ("unsupported tier: %d" , tier .ID )
143
- }
144
167
145
- if submitter , err = proofSubmitter .NewProofSubmitterOntake (
146
- p .rpc ,
147
- producer ,
148
- p .proofGenerationCh ,
149
- p .batchProofGenerationCh ,
150
- p .aggregationNotify ,
151
- p .cfg .ProverSetAddress ,
152
- p .cfg .TaikoL2Address ,
153
- p .cfg .Graffiti ,
154
- p .cfg .ProveBlockGasLimit ,
155
- p .txmgr ,
156
- p .privateTxmgr ,
157
- txBuilder ,
158
- tiers ,
159
- p .IsGuardianProver (),
160
- p .cfg .GuardianProofSubmissionDelay ,
161
- bufferSize ,
162
- p .cfg .ForceBatchProvingInterval ,
163
- ); err != nil {
164
- return err
168
+ p .proofSubmittersOntake = append (p .proofSubmittersOntake , submitter )
165
169
}
166
-
167
- p .proofSubmittersOntake = append (p .proofSubmittersOntake , submitter )
168
170
}
169
-
170
171
if p .proofSubmitterPacaya , err = proofSubmitter .NewProofSubmitterPacaya (
171
172
p .rpc ,
172
173
& proofProducer.OptimisticProofProducer {},
0 commit comments