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

Mismatch between TS simulator and circuit for kernel value output SLOAD_WRITE_OFFSET #7143

Closed
jeanmon opened this issue Jun 21, 2024 · 2 comments · Fixed by #7175
Closed
Assignees
Labels
C-avm Component: AVM related tickets (aka public VM) T-bug Type: Bug. Something is broken.

Comments

@jeanmon
Copy link
Contributor

jeanmon commented Jun 21, 2024

This is a follow-up of #7135.
After fixing the above bug pertaining the AVM circuit, a run of the end-to-end test bench_prover.test.ts shows that some AVM proofs are still failing in the verification step.
After some investigation, it was noticed that all the 3 failing proofs have a mismatch between the public inputs fed to the verifier (generated by TS simulator) vs. the public inputs produced in the AVM trace in the proving step.

All the AVM proofs generated in this e2e test were re-ran in a debugger and the full transcript is in comment below.
We observe that the mismatch is always at index 144 which corresponds to START_SLOAD_WRITE_OFFSET.
The simulator (VERIF in logs) has generated some entry at index 144 while the AVM circuit does not generate any.

@jeanmon jeanmon added this to A3 Jun 21, 2024
@jeanmon jeanmon converted this from a draft issue Jun 21, 2024
@jeanmon jeanmon added C-avm Component: AVM related tickets (aka public VM) T-bug Type: Bug. Something is broken. labels Jun 21, 2024
@jeanmon
Copy link
Contributor Author

jeanmon commented Jun 21, 2024

Bug Investigation - bench_prover.test.ts

Preserving working directory /tmp/bb-JvRWBw/tmp-nLDWjV
bb-prover INFO Proving avm-circuit for AuthRegistry:set_authorized...

Proof verified!

VERIF: 112 0x0000000000000000000000000000000000000000000000000000000000000001
VERIF: 210 0x000000000000000000000000000000000000000000000000000000000000000b

TRACE: 112 0x0000000000000000000000000000000000000000000000000000000000000001
TRACE: 210 0x000000000000000000000000000000000000000000000000000000000000000b

Preserving working directory /tmp/bb-JvRWBw/tmp-Bx0hwU
bb-prover INFO Proving avm-circuit for FPC:prepare_fee...

Proof verified!

VERIF: 32 0x062eb873a378f1bb056ba1fc6c75ea6e1305477d332a581cd6d708cf779ec839
VERIF: 210 0x0000000000000000000000000000000000000000000000000000000000000014

TRACE: 32 0x062eb873a378f1bb056ba1fc6c75ea6e1305477d332a581cd6d708cf779ec839
TRACE: 210 0x0000000000000000000000000000000000000000000000000000000000000014

Preserving working directory /tmp/bb-JvRWBw/tmp-78ESvR
bb-prover INFO Proving avm-circuit for Token:transfer_public...

Failing proof:

VERIF: 32 0x12ca2328e76ab9996cb6a1a9b93c98e57828093a80c4bf14c7cb0c727cd0e3c7
VERIF: 112 0x000000000000000000000000000000000000000000000000000000e42c8d4800
VERIF: 113 0x00000000000000000000000000000000000000000000000000000004a817c800
VERIF: 144 0x000000000000000000000000000000000000000000000000000000e8d4a51000
VERIF: 210 0x0000000000000000000000000000000000000000000000000000000000000014

TRACE: 32 0x12ca2328e76ab9996cb6a1a9b93c98e57828093a80c4bf14c7cb0c727cd0e3c7
TRACE: 112 0x000000000000000000000000000000000000000000000000000000e42c8d4800
TRACE: 113 0x00000000000000000000000000000000000000000000000000000004a817c800
TRACE: 210 0x0000000000000000000000000000000000000000000000000000000000000014

Preserving working directory /tmp/bb-JvRWBw/tmp-cBIkhb
bb-prover INFO Proving avm-circuit for AuthRegistry:consume...

Proof verified!

VERIF: 145 0x0000000000000000000000000000000000000000000000000000000000000001
VERIF: 210 0x0000000000000000000000000000000000000000000000000000000000000010

TRACE: 145 0x0000000000000000000000000000000000000000000000000000000000000001
TRACE: 210 0x0000000000000000000000000000000000000000000000000000000000000010

Preserving working directory /tmp/bb-JvRWBw/tmp-CmpMWw
bb-prover INFO Proving avm-circuit for Token:transfer_public...

Proof verified!

VERIF: 32 0x12ca2328e76ab9996cb6a1a9b93c98e57828093a80c4bf14c7cb0c727cd0e3c7
VERIF: 112 0x000000000000000000000000000000000000000000000000000000e42c8d4418
VERIF: 113 0x00000000000000000000000000000000000000000000000000000000000003e8
VERIF: 144 0x000000000000000000000000000000000000000000000000000000e42c8d4800
VERIF: 210 0x0000000000000000000000000000000000000000000000000000000000000019

TRACE: 32 0x12ca2328e76ab9996cb6a1a9b93c98e57828093a80c4bf14c7cb0c727cd0e3c7
TRACE: 112 0x000000000000000000000000000000000000000000000000000000e42c8d4418
TRACE: 113 0x00000000000000000000000000000000000000000000000000000000000003e8
TRACE: 144 0x000000000000000000000000000000000000000000000000000000e42c8d4800
TRACE: 210 0x0000000000000000000000000000000000000000000000000000000000000019

Preserving working directory /tmp/bb-JvRWBw/tmp-Ve077U
bb-prover INFO Proving avm-circuit for FPC:pay_refund...

Proof verified!

VERIF: 32 0x062eb873a378f1bb056ba1fc6c75ea6e1305477d332a581cd6d708cf779ec839
VERIF: 210 0x000000000000000000000000000000000000000000000000000000000000001f

TRACE: 32 0x062eb873a378f1bb056ba1fc6c75ea6e1305477d332a581cd6d708cf779ec839
TRACE: 210 0x000000000000000000000000000000000000000000000000000000000000001f

Preserving working directory /tmp/bb-JvRWBw/tmp-66uUCu
bb-prover INFO Proving avm-circuit for Token:transfer_public...

Proof verified!

VERIF: 32 0x12ca2328e76ab9996cb6a1a9b93c98e57828093a80c4bf14c7cb0c727cd0e3c7
VERIF: 112 0x000000000000000000000000000000000000000000000000000000000becd0ea
VERIF: 113 0x000000000000000000000000000000000000000000000000000000e8c8b83b2e
VERIF: 144 0x00000000000000000000000000000000000000000000000000000004a817c800
VERIF: 145 0x000000000000000000000000000000000000000000000000000000e42c8d4418
VERIF: 210 0x000000000000000000000000000000000000000000000000000000000000001f

TRACE: 32 0x12ca2328e76ab9996cb6a1a9b93c98e57828093a80c4bf14c7cb0c727cd0e3c7
TRACE: 112 0x000000000000000000000000000000000000000000000000000000000becd0ea
TRACE: 113 0x000000000000000000000000000000000000000000000000000000e8c8b83b2e
TRACE: 144 0x00000000000000000000000000000000000000000000000000000004a817c800
TRACE: 145 0x000000000000000000000000000000000000000000000000000000e42c8d4418
TRACE: 210 0x000000000000000000000000000000000000000000000000000000000000001f

Preserving working directory /tmp/bb-JvRWBw/tmp-yN1seO
bb-prover INFO Proving avm-circuit for Token:transfer_public...

Failing proof:

VERIF: 32 0x12ca2328e76ab9996cb6a1a9b93c98e57828093a80c4bf14c7cb0c727cd0e3c7
VERIF: 112 0x000000000000000000000000000000000000000000000000000000e42c8d4800
VERIF: 113 0x00000000000000000000000000000000000000000000000000000004a817c800
VERIF: 144 0x000000000000000000000000000000000000000000000000000000e8d4a51000
VERIF: 210 0x0000000000000000000000000000000000000000000000000000000000000014

TRACE: 32 0x12ca2328e76ab9996cb6a1a9b93c98e57828093a80c4bf14c7cb0c727cd0e3c7
TRACE: 112 0x000000000000000000000000000000000000000000000000000000e42c8d4800
TRACE: 113 0x00000000000000000000000000000000000000000000000000000004a817c800
TRACE: 210 0x0000000000000000000000000000000000000000000000000000000000000014

Preserving working directory /tmp/bb-JvRWBw/tmp-r9USr1
bb-prover INFO Proving avm-circuit for Token:transfer_public...

Failing proof:

VERIF: 32 0x12ca2328e76ab9996cb6a1a9b93c98e57828093a80c4bf14c7cb0c727cd0e3c7
VERIF: 112 0x000000000000000000000000000000000000000000000000000000e42c8d4800
VERIF: 113 0x00000000000000000000000000000000000000000000000000000004a817c800
VERIF: 144 0x000000000000000000000000000000000000000000000000000000e8d4a51000
VERIF: 210 0x0000000000000000000000000000000000000000000000000000000000000014

TRACE: 32 0x12ca2328e76ab9996cb6a1a9b93c98e57828093a80c4bf14c7cb0c727cd0e3c7
TRACE: 112 0x000000000000000000000000000000000000000000000000000000e42c8d4800
TRACE: 113 0x00000000000000000000000000000000000000000000000000000004a817c800
TRACE: 210 0x0000000000000000000000000000000000000000000000000000000000000014

@jeanmon
Copy link
Contributor Author

jeanmon commented Jun 21, 2024

bench-prover-proofs.tar.gz

Attached all the proof artifacts in an archive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-avm Component: AVM related tickets (aka public VM) T-bug Type: Bug. Something is broken.
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants