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

bug(AztecMacro): Oddly sized return values with packed structs #5821

Open
Tracked by #5077
LHerskind opened this issue Apr 17, 2024 · 1 comment
Open
Tracked by #5077

bug(AztecMacro): Oddly sized return values with packed structs #5821

LHerskind opened this issue Apr 17, 2024 · 1 comment
Labels
T-bug Type: Bug. Something is broken.

Comments

@LHerskind
Copy link
Contributor

LHerskind commented Apr 17, 2024

Ran into an issue in #5819 when purging unconstrained function when dealing with returning a struct whose serialization and deserialization is packing to fewer fields.

The offender was the Asset struct

struct Asset {
    interest_accumulator: U128,
    last_updated_ts: u64,
    loan_to_value: U128,
    oracle: AztecAddress,
}

As it was serializing to 4 elements. But the return_types is expecting 6 elements since U128 is actually 2 fields, a lo and hi.

For my specific case, I simply remove the optimization from the amount of storage 😭, now using 6 Fields.

@github-project-automation github-project-automation bot moved this to Todo in A3 Apr 17, 2024
@LHerskind LHerskind added the T-bug Type: Bug. Something is broken. label Apr 17, 2024
@Thunkar
Copy link
Contributor

Thunkar commented Apr 19, 2024

Unfortunately I don't think this is going to be possible to address. We have to respect the "canonical" ACVM (de)serialization so that it can be replicated in TS land, and we will probably move to automatically implementing it rather than letting users do it.

Optimizations, if any, will have to be done at that level or will be incompatible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-bug Type: Bug. Something is broken.
Projects
Status: Todo
Development

No branches or pull requests

2 participants