Closed danielntmd closed 1 month ago
Looking at it. Thank you for reporting.
This is weird because outside of a workspace it seems to work. I tried to make more functions and structs public but it seems not to be the issue.
Is this related ? https://github.com/software-mansion/scarb/pull/1593
Not sure.. I don't think it has to do with features since the error doesn't explicitly incorporate them, but perhaps the error is adjacent?
Copying my response from telegram below:
If you build your package as a workspace member, only profiles and cairo section defined in workspace root manifest are taken into account. This means, that you need to put the sierra-replace-ids = false there, for it to take effect. That is the difference between workspace/no workspace build that makes it fail for you.
I cannot speak as of why it fails with debug ids, if you think this should work, please report it as a bug in the compiler repository.
The PR you've linked should not be related at all, it only changes some validation logic in Scarb itself.
Hey, so the issue comes from function names (or maybe recursive types from circuit) in Garaga being too large.
As generated by the garaga generator, adding in Scarb.toml
[cairo]
sierra-replace-ids = false
Fixes this.
But as @maciektr mention, one need to add this at the top of the workspace's scarb.toml I tested on the provided repo and it now compiles without issues.
I'm investigating if I can put it at the garaga lib level so contracts that import it don't have to add it themselves.
I'm investigating if I can put it at the garaga lib level so contracts that import it don't have to add it themselves.
Apparently no.
So the solution is to add
[cairo]
sierra-replace-ids = false
as suggested above in the top-level .toml of the workspace.
Bug Report
Garaga version:
v0.13.2.3 scarb version: 2.8.0
Current behavior: When building the verifier contract as a member of a Scarb workspace, the error
error: Invalid order of type declarations for serialization.
occurs. The functionmulti_pairing_check_bn254_3P_2F_with_extra_miller_loop_result
inside of the verifier contract seems to be the culprit. Commenting out this function compiles the package properly.Expected behavior:
The package should build properly.
Steps to reproduce:
Related code:
This repo contains the bug. Code: https://github.com/danielntmd/garaga_scarb_workplace_bug
Other information:
Disclaimer: This issue might be revolved around a lack of fundamental understanding of how Scarb handles its workspace. Any feedback is greatly appreciated.