snarkVM
snarkVM copied to clipboard
[Proposal] Increase Network Static Limits
💥 Proposal
Increase static limits for N network instances to allow more expressive programs.
I compile a program having many imports and nested data structures and I get the following error:
thread 'main' panicked at 'Plaintext member exceeds u16::MAX bits: out of range integral type conversion attempted', /Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/snarkvm-console-network-environment-0.9.8/src/environment.rs:62:9
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
This proposal is to review higher static limits which may allow for more complex programs, and to open discussion in that regard.
In testing the program it appears the following are not compiling:
- Structs with member types which are Structs
- Records with member types which are Structs
My current revision of the contract I am building resolves these constraints by flattening the record and avoiding nested usage of struct.
Also noticed, import structs cannot be used as a transition argument in a main transition, so I have had to abstract a struct in main that is broken down to within the 8 input limit, and sent by argument to a transition in the relavent import.
Something to also try would be implementing it Aleo instructions instead of Leo. I believe the input limit is higher than 8 but I haven't tested this recently.
It would similarly help to be able to use other data types and structs within mappings.
Something to also try would be implementing it Aleo instructions instead of Leo. I believe the input limit is higher than 8 but I haven't tested this recently.
I think it works with leo, but the key thing was Structs and Records can have member types as other Structs in main but not in imports.
It would similarly help to be able to use other data types and structs within mappings.
@evanmarshall load and store are being implemented in #1190 this will be useful to achieve what you are asking for. I also pointed out to @d0cd that we could use the increment notion combined with load and store to directly update properties of the loaded struct in a manner that is idempotent.
Closing as the feature freeze has taken place for mainnet. Future discussions can be raised as ARCs going forward.