Skip to content

Commit a24e0c5

Browse files
committed
debugging
1 parent 7f081d6 commit a24e0c5

File tree

7 files changed

+63
-27
lines changed

7 files changed

+63
-27
lines changed

Cargo.lock

Lines changed: 1 addition & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,13 @@ repository = "https://github.com/scroll-tech/scroll"
1717
version = "4.5.8"
1818

1919
[workspace.dependencies]
20-
scroll-zkvm-prover-euclid = { git = "https://github.com/scroll-tech/zkvm-prover", rev = "0dd7b19", package = "scroll-zkvm-prover" }
21-
scroll-zkvm-verifier-euclid = { git = "https://github.com/scroll-tech/zkvm-prover", rev = "0dd7b19", package = "scroll-zkvm-verifier" }
22-
scroll-zkvm-types = { git = "https://github.com/scroll-tech/zkvm-prover", rev = "0dd7b19" }
20+
#scroll-zkvm-prover-euclid = { git = "https://github.com/scroll-tech/zkvm-prover", rev = "0dd7b19", package = "scroll-zkvm-prover" }
21+
#scroll-zkvm-verifier-euclid = { git = "https://github.com/scroll-tech/zkvm-prover", rev = "0dd7b19", package = "scroll-zkvm-verifier" }
22+
#scroll-zkvm-types = { git = "https://github.com/scroll-tech/zkvm-prover", rev = "0dd7b19" }
23+
scroll-zkvm-prover-euclid = { path = "../zkvm-prover/crates/prover", package = "scroll-zkvm-prover" }
24+
scroll-zkvm-verifier-euclid = { path = "../zkvm-prover/crates/verifier", package = "scroll-zkvm-verifier" }
25+
scroll-zkvm-types = { path = "../zkvm-prover/crates/types" }
26+
2327

2428
sbv-primitives = { git = "https://github.com/scroll-tech/stateless-block-verifier", branch = "chore/upgrade", features = ["scroll"] }
2529
sbv-utils = { git = "https://github.com/scroll-tech/stateless-block-verifier", branch = "chore/upgrade" }

crates/prover-bin/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ edition.workspace = true
88
[dependencies]
99
scroll-zkvm-types.workspace = true
1010
scroll-zkvm-prover-euclid.workspace = true
11-
scroll-proving-sdk = { git = "https://github.com/scroll-tech/scroll-proving-sdk.git", branch = "refactor/scroll" }
11+
#scroll-proving-sdk = { git = "https://github.com/scroll-tech/scroll-proving-sdk.git", branch = "refactor/scroll" }
12+
scroll-proving-sdk = { path = "../../../scroll-proving-sdk" }
1213
serde.workspace = true
1314
serde_json.workspace = true
1415
once_cell.workspace =true

crates/prover-bin/src/main.rs

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ mod zk_circuits_handler;
55
use clap::{ArgAction, Parser, Subcommand};
66
use prover::{LocalProver, LocalProverConfig};
77
use scroll_proving_sdk::{
8-
prover::{ProverBuilder, types::ProofType},
8+
prover::{types::ProofType, ProverBuilder},
99
utils::{get_version, init_tracing},
1010
};
11-
use std::{fs::File, path::Path, io::BufReader};
11+
use std::{fs::File, io::BufReader, path::Path};
1212

1313
#[derive(Parser, Debug)]
1414
#[command(disable_version_flag = true)]
@@ -86,11 +86,26 @@ async fn main() -> eyre::Result<()> {
8686

8787
let prover = std::sync::Arc::new(prover);
8888
println!("Handling task set 1: chunks ...");
89-
assert!(prover.clone().one_shot(&handle_set.chunks, ProofType::Chunk).await);
89+
assert!(
90+
prover
91+
.clone()
92+
.one_shot(&handle_set.chunks, ProofType::Chunk)
93+
.await
94+
);
9095
println!("Done! Handling task set 2: batches ...");
91-
assert!(prover.clone().one_shot(&handle_set.batches, ProofType::Batch).await);
96+
assert!(
97+
prover
98+
.clone()
99+
.one_shot(&handle_set.batches, ProofType::Batch)
100+
.await
101+
);
92102
println!("Done! Handling task set 3: bundles ...");
93-
assert!(prover.clone().one_shot(&handle_set.bundles, ProofType::Bundle).await);
103+
assert!(
104+
prover
105+
.clone()
106+
.one_shot(&handle_set.bundles, ProofType::Bundle)
107+
.await
108+
);
94109
println!("All done!");
95110
}
96111
None => {

rollup/tests/integration_tool/imports.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ func importChunk(ctx context.Context, db *gorm.DB, beginBlk, endBlk uint64, prev
145145
if err != nil {
146146
return nil, nil, err
147147
}
148-
log.Info("insert chunk", "From", beginBlk, "To", endBlk)
148+
log.Info("insert chunk", "From", beginBlk, "To", endBlk, "hash", dbChk.Hash)
149149
return dbChk, theChunk, nil
150150
}
151151

rollup/tests/integration_tool/main.go

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,19 @@ var seedFlag = cli.Int64Flag{
4040
Value: 0,
4141
}
4242

43-
func parseThreeIntegers() (int, int, int, error) {
43+
var codecFlag = cli.IntFlag{
44+
Name: "codec",
45+
Usage: "codec version, valid from 6, default(auto) is 0",
46+
Value: 0,
47+
}
48+
49+
func parseThreeIntegers(value string) (int, int, int, error) {
4450
// Split the input string by comma
45-
parts := strings.Split(outputNumFlag.Value, ",")
51+
parts := strings.Split(value, ",")
4652

4753
// Check that we have exactly 3 parts
4854
if len(parts) != 3 {
49-
return 0, 0, 0, fmt.Errorf("input must contain exactly 3 comma-separated integers, got %s", outputNumFlag.Value)
55+
return 0, 0, 0, fmt.Errorf("input must contain exactly 3 comma-separated integers, got %s", value)
5056
}
5157

5258
// Parse the three integers
@@ -90,6 +96,7 @@ func init() {
9096
app.Name = "integration-test-tool"
9197
app.Usage = "The Scroll L2 Integration Test Tool"
9298
app.Version = version.Version
99+
app.Flags = append(app.Flags, &codecFlag, &seedFlag, &outputNumFlag, &outputPathFlag)
93100
app.Flags = append(app.Flags, utils.CommonFlags...)
94101
app.Before = func(ctx *cli.Context) error {
95102
if err := utils.LogSetup(ctx); err != nil {
@@ -127,6 +134,21 @@ func action(ctx *cli.Context) error {
127134
return fmt.Errorf("specify begin and end block number")
128135
}
129136

137+
codecFl := ctx.Int(codecFlag.Name)
138+
if codecFl != 0 {
139+
switch codecFl {
140+
case 6:
141+
codecCfg = encoding.CodecV6
142+
case 7:
143+
codecCfg = encoding.CodecV7
144+
case 8:
145+
codecCfg = encoding.CodecV8
146+
default:
147+
return fmt.Errorf("invalid codec version %d", codecFl)
148+
}
149+
log.Info("set codec", "version", codecCfg)
150+
}
151+
130152
beginBlk, err := strconv.ParseUint(ctx.Args().First(), 10, 64)
131153
if err != nil {
132154
return fmt.Errorf("invalid begin block number: %w", err)
@@ -136,17 +158,18 @@ func action(ctx *cli.Context) error {
136158
return fmt.Errorf("invalid begin block number: %w", err)
137159
}
138160

139-
chkNum, batchNum, bundleNum, err := parseThreeIntegers()
161+
chkNum, batchNum, bundleNum, err := parseThreeIntegers(ctx.String(outputNumFlag.Name))
140162
if err != nil {
141163
return err
142164
}
143165

144-
seed := seedFlag.Value
166+
seed := ctx.Int64(seedFlag.Name)
145167
if seed == 0 {
146168
seed = rand.Int63()
147169
}
148170

149-
log.Info("output", "Seed", seed, "file", outputPathFlag.Value)
171+
outputPath := ctx.String(outputPathFlag.Name)
172+
log.Info("output", "Seed", seed, "file", outputPath)
150173
ret, err := importData(ctx.Context, beginBlk, endBlk, chkNum, batchNum, bundleNum, seed)
151174
if err != nil {
152175
return err
@@ -158,9 +181,9 @@ func action(ctx *cli.Context) error {
158181
}
159182

160183
// Write the JSON data to the specified file
161-
err = os.WriteFile(outputPathFlag.Value, jsonData, 0644)
184+
err = os.WriteFile(outputPath, jsonData, 0644)
162185
if err != nil {
163-
return fmt.Errorf("failed to write result to file %s: %w", outputPathFlag.Value, err)
186+
return fmt.Errorf("failed to write result to file %s: %w", outputPath, err)
164187
}
165188

166189
return nil

tests/prover-e2e/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ test_tool:
3232
go build -o $(PWD)/build/bin/e2e_tool ../../rollup/tests/integration_tool
3333

3434
import_data: test_tool
35-
build/bin/e2e_tool --config ./config.json ${BEGIN_BLOCK} ${END_BLOCK}
35+
build/bin/e2e_tool --config ./config.json --codec 7 ${BEGIN_BLOCK} ${END_BLOCK}

0 commit comments

Comments
 (0)