Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors in make define.go #231

Open
gusiri opened this issue Jun 4, 2024 · 4 comments
Open

Errors in make define.go #231

gusiri opened this issue Jun 4, 2024 · 4 comments

Comments

@gusiri
Copy link
Contributor

gusiri commented Jun 4, 2024

Problem:

define.go has a syntax error and other errors described in the Appendix. Temporarily, for testing purposes, I manually fixed all the errors, and zkevm-monorepo/prover's make test passes. However, we need to figure out why make define.go does not generate a complete define.go file.


How to reproduce

envrionment:
rustc 1.78.0 (9b00956e5 2024-04-29)
corset 9.7.10 - master branch (c729dbc)
constraints - v0.1.0-prover-integration

run make define.go

error:

[INFO] Applying Sorts
[INFO] Applying Nhood
[INFO] Applying ExpandsIfs
[INFO] Applying Splatter
[INFO] Applying ColumnizeExpressions
[INFO] Applying ExpandInvs
[INFO] Compiling into constraint set, Elapsed=1.389492834s
[INFO] Running gofmt on define.go... 
[ERROR] failed:

define.go:2456:93: expected operand, found '.'
define.go:5617:3: missing ',' in argument list

define.go actually has some syntax errors.
ex) SOMETHING.,Mul() instead of SOMETHING.Mul().


One could temporarily bypass the gofmt error by commenting out gofmt()
in corset/src/exporters/mod.rs

fn gofmt(filename: &str) {
    info!("Running gofmt on {}... ", filename);
}

and

re-compile corset
make define.go

Appendix

Above trick will generate a define.go with many errors.

<1. Syntax Errors>

zkevm/arithmetization/define/define.go:2468:93: syntax error: unexpected ., expected expression
zkevm/arithmetization/define/define.go:2469:93: syntax error: unexpected ., expected expression
zkevm/arithmetization/define/define.go:2470:93: syntax error: unexpected ., expected expression
zkevm/arithmetization/define/define.go:1386:87: syntax error: unexpected EOF in argument list; possibly missing comma or )
...
and more

<2. Duplicate variables>
zkevm/arithmetization/define/define.go:580:33: no new variables on left side of :=
zkevm/arithmetization/define/define.go:614:33: no new variables on left side of :=
...
and more

<3. Missing prover config.TracesLimits >
I added missing trace limits to the prover config file.

<4. Declared and not used>
zkevm/arithmetization/define/define.go:533:2: mmio__ACC_1 declared and not used
zkevm/arithmetization/define/define.go:534:2: mmio__ACC_2 declared and not used
zkevm/arithmetization/define/define.go:535:2: mmio__ACC_3 declared and not used
zkevm/arithmetization/define/define.go:536:2: mmio__ACC_4 declared and not used
zkevm/arithmetization/define/define.go:538:2: mmio__BIT_1 declared and not used
zkevm/arithmetization/define/define.go:539:2: mmio__BIT_2 declared and not used
zkevm/arithmetization/define/define.go:567:2: mmio__POW_256_1 declared and not used
zkevm/arithmetization/define/define.go:568:2: mmio__POW_256_2 declared and not used
zkevm/arithmetization/define/define.go:569:2: mmio__SOURCE_BYTE_OFFSET declared and not used
zkevm/arithmetization/define/define.go:570:2: mmio__SOURCE_LIMB_OFFSET declared and not used
zkevm/arithmetization/define/define.go:572:2: mmio__TARGET_BYTE_OFFSET declared and not used
zkevm/arithmetization/define/define.go:573:2: mmio__TARGET_LIMB_OFFSET declared and not used

<5. Undefined Variables>
zkevm/arithmetization/define/define.go:1510:62: undefined: mmio__BYTE_B
zkevm/arithmetization/define/define.go:1510:76: undefined: mmio__BYTE_LIMB
zkevm/arithmetization/define/define.go:1510:93: undefined: mmio__BYTE_A
zkevm/arithmetization/define/define.go:1510:107: undefined: mmio__BYTE_C


@DavePearce
Copy link
Collaborator

Have created a corset issue to track these problems: Consensys/corset#173

@letypequividelespoubelles
Copy link
Collaborator

<4. Declared and not used>
zkevm/arithmetization/define/define.go:533:2: mmio__ACC_1 declared and not used
zkevm/arithmetization/define/define.go:534:2: mmio__ACC_2 declared and not used
...

This is normal, all the mmio constraints are disabled in the Makefile

@letypequividelespoubelles
Copy link
Collaborator

linked with #143 ?

@gusiri
Copy link
Contributor Author

gusiri commented Jun 6, 2024

In my case, #143 was resolved by #230

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants