Skip to content

Commit 83f47c9

Browse files
committed
fix issues
1 parent a86e38f commit 83f47c9

File tree

6 files changed

+28
-16
lines changed

6 files changed

+28
-16
lines changed

coordinator/internal/logic/provertask/batch_prover_task.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,10 @@ func (bp *BatchProverTask) Assign(ctx *gin.Context, getTaskParameter *coordinato
8787
if getTaskParameter.TaskID != "" {
8888
tmpBatchTask, getTaskError = bp.batchOrm.GetBatchByHash(ctx.Copy(), getTaskParameter.TaskID)
8989
if getTaskError != nil {
90-
log.Error("failed to get expected batch", "taskID", taskCtx.hasAssignedTask.TaskID, "err", getTaskError)
90+
log.Error("failed to get expected batch", "taskID", getTaskParameter.TaskID, "err", getTaskError)
9191
return nil, ErrCoordinatorInternalFailure
9292
} else if tmpBatchTask == nil {
93-
return nil, fmt.Errorf("Expected task (%s) is already dropped",
94-
taskCtx.hasAssignedTask.TaskID)
93+
return nil, fmt.Errorf("Expected task (%s) is already dropped", getTaskParameter.TaskID)
9594
}
9695
}
9796

coordinator/internal/logic/provertask/bundle_prover_task.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,10 @@ func (bp *BundleProverTask) Assign(ctx *gin.Context, getTaskParameter *coordinat
8585
if getTaskParameter.TaskID != "" {
8686
tmpBundleTask, getTaskError = bp.bundleOrm.GetBundleByHash(ctx.Copy(), getTaskParameter.TaskID)
8787
if getTaskError != nil {
88-
log.Error("failed to get expected bundle", "taskID", taskCtx.hasAssignedTask.TaskID, "err", getTaskError)
88+
log.Error("failed to get expected bundle", "taskID", getTaskParameter.TaskID, "err", getTaskError)
8989
return nil, ErrCoordinatorInternalFailure
9090
} else if tmpBundleTask == nil {
91-
return nil, fmt.Errorf("Expected task (%s) is already dropped",
92-
taskCtx.hasAssignedTask.TaskID)
91+
return nil, fmt.Errorf("Expected task (%s) is already dropped", getTaskParameter.TaskID)
9392
}
9493
}
9594

coordinator/internal/logic/provertask/chunk_prover_task.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,10 @@ func (cp *ChunkProverTask) Assign(ctx *gin.Context, getTaskParameter *coordinato
8383
if getTaskParameter.TaskID != "" {
8484
tmpChunkTask, getTaskError = cp.chunkOrm.GetChunkByHash(ctx.Copy(), getTaskParameter.TaskID)
8585
if getTaskError != nil {
86-
log.Error("failed to get expected chunk", "taskID", taskCtx.hasAssignedTask.TaskID, "err", getTaskError)
86+
log.Error("failed to get expected chunk", "taskID", getTaskParameter.TaskID, "err", getTaskError)
8787
return nil, ErrCoordinatorInternalFailure
8888
} else if tmpChunkTask == nil {
89-
return nil, fmt.Errorf("Expected task (%s) is already dropped",
90-
taskCtx.hasAssignedTask.TaskID)
89+
return nil, fmt.Errorf("Expected task (%s) is already dropped", getTaskParameter.TaskID)
9190
}
9291
}
9392

crates/prover-bin/src/main.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ mod zk_circuits_handler;
55
use clap::{ArgAction, Parser, Subcommand};
66
use prover::{LocalProver, LocalProverConfig};
77
use scroll_proving_sdk::{
8-
prover::ProverBuilder,
8+
prover::{ProverBuilder, types::ProofType},
99
utils::{get_version, init_tracing},
1010
};
1111
use std::{fs::File, path::Path, io::BufReader};
@@ -86,11 +86,11 @@ async fn main() -> eyre::Result<()> {
8686

8787
let prover = std::sync::Arc::new(prover);
8888
println!("Handling task set 1: chunks ...");
89-
prover.clone().one_shot(&handle_set.chunks).await;
89+
assert!(prover.clone().one_shot(&handle_set.chunks, ProofType::Chunk).await);
9090
println!("Done! Handling task set 2: batches ...");
91-
prover.clone().one_shot(&handle_set.batches).await;
91+
assert!(prover.clone().one_shot(&handle_set.batches, ProofType::Batch).await);
9292
println!("Done! Handling task set 3: bundles ...");
93-
prover.clone().one_shot(&handle_set.bundles).await;
93+
assert!(prover.clone().one_shot(&handle_set.bundles, ProofType::Bundle).await);
9494
println!("All done!");
9595
}
9696
None => {

rollup/tests/integration_tool/imports.go

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ func importData(ctx context.Context, beginBlk, endBlk uint64, chkNum, batchNum,
7878
}
7979

8080
batchSep := randomPickKfromN(chkNum, batchNum, rng)
81-
batchSep = append(batchSep, batchNum)
81+
batchSep = append(batchSep, chkNum)
8282
log.Info("separated batch", "border", batchSep)
8383

8484
headChk := int(0)
@@ -99,7 +99,7 @@ func importData(ctx context.Context, beginBlk, endBlk uint64, chkNum, batchNum,
9999
}
100100

101101
bundleSep := randomPickKfromN(batchNum, bundleNum, rng)
102-
bundleSep = append(bundleSep, bundleNum)
102+
bundleSep = append(bundleSep, batchNum)
103103
log.Info("separated bundle", "border", bundleSep)
104104

105105
headBatch := int(0)
@@ -141,6 +141,10 @@ func importChunk(ctx context.Context, db *gorm.DB, beginBlk, endBlk uint64, prev
141141
if err != nil {
142142
return nil, nil, err
143143
}
144+
err = blockOrm.UpdateChunkHashInRange(ctx, beginBlk, endBlk, dbChk.Hash)
145+
if err != nil {
146+
return nil, nil, err
147+
}
144148
log.Info("insert chunk", "From", beginBlk, "To", endBlk)
145149
return dbChk, theChunk, nil
146150
}
@@ -173,6 +177,11 @@ func importBatch(ctx context.Context, db *gorm.DB, chks []*orm.Chunk, encChks []
173177
if err != nil {
174178
return nil, err
175179
}
180+
err = orm.NewChunk(db).UpdateBatchHashInRange(ctx, chks[0].Index, chks[len(chks)-1].Index, dbBatch.Hash)
181+
if err != nil {
182+
return nil, err
183+
}
184+
176185
log.Info("insert batch", "index", index)
177186
return dbBatch, nil
178187
}
@@ -184,6 +193,11 @@ func importBundle(ctx context.Context, db *gorm.DB, batches []*orm.Batch) (strin
184193
if err != nil {
185194
return "", err
186195
}
196+
err = orm.NewBatch(db).UpdateBundleHashInRange(ctx, batches[0].Index, batches[len(batches)-1].Index, bundle.Hash)
197+
if err != nil {
198+
return "", err
199+
}
200+
187201
log.Info("insert bundle", "hash", bundle.Hash)
188202
return bundle.Hash, nil
189203
}

tests/prover-e2e/.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
build
1+
build/*
2+
testset.json

0 commit comments

Comments
 (0)