9
9
"github.com/gin-gonic/gin"
10
10
"github.com/prometheus/client_golang/prometheus"
11
11
"github.com/prometheus/client_golang/prometheus/promauto"
12
+ "github.com/scroll-tech/go-ethereum/common"
12
13
"github.com/scroll-tech/go-ethereum/log"
13
14
"github.com/scroll-tech/go-ethereum/params"
14
15
"gorm.io/gorm"
@@ -194,6 +195,11 @@ func (bp *BundleProverTask) formatProverTask(ctx context.Context, task *orm.Prov
194
195
return nil , fmt .Errorf ("failed to get batch proofs for bundle task id:%s, no batch found" , task .TaskID )
195
196
}
196
197
198
+ parentBatch , err := bp .batchOrm .GetBatchByHash (ctx , batches [0 ].ParentBatchHash )
199
+ if err != nil {
200
+ return nil , fmt .Errorf ("failed to get parent batch for batch task id:%s err:%w" , task .TaskID , err )
201
+ }
202
+
197
203
var batchProofs []message.BatchProof
198
204
for _ , batch := range batches {
199
205
proof := message .NewBatchProof (hardForkName )
@@ -207,6 +213,17 @@ func (bp *BundleProverTask) formatProverTask(ctx context.Context, task *orm.Prov
207
213
BatchProofs : batchProofs ,
208
214
}
209
215
216
+ taskDetail .BundleInfo = & message.OpenVMBundleInfo {
217
+ ChainID : bp .chainCfg .ChainID .Uint64 (),
218
+ PrevStateRoot : common .HexToHash (parentBatch .StateRoot ),
219
+ PostStateRoot : common .HexToHash (batches [len (batches )- 1 ].StateRoot ),
220
+ WithdrawRoot : common .HexToHash (batches [len (batches )- 1 ].WithdrawRoot ),
221
+ NumBatches : uint32 (len (batches )),
222
+ PrevBatchHash : common .HexToHash (batches [0 ].ParentBatchHash ),
223
+ BatchHash : common .HexToHash (batches [len (batches )- 1 ].Hash ),
224
+ // MsgQueueHash is omittable here, because it is introduced in phase-2.
225
+ }
226
+
210
227
batchProofsBytes , err := json .Marshal (taskDetail )
211
228
if err != nil {
212
229
return nil , fmt .Errorf ("failed to marshal batch proofs, taskID:%s err:%w" , task .TaskID , err )
0 commit comments