When running the main snark with real data (output from the solver), I noticed that the balances were not updated correctly.
This is most likely due to pepper not handling structs with arrays well. Balances were modelled as an array of
struct Balance {
field254 tokens[TOKEN]
}
where each struct itself contained a subarray of token balances for this account.
This diff changes balances to being a single array of field elements, with account i's token balance for t being stored at index i*TOKENS + t.
I updated the unit tests and verified that state transitions are applied correctly when running the main snark with real data inside pepper (adding that functionality will come in a separate PR).
When running the main snark with real data (output from the solver), I noticed that the balances were not updated correctly.
This is most likely due to pepper not handling structs with arrays well. Balances were modelled as an array of
where each struct itself contained a subarray of token balances for this account.
This diff changes balances to being a single array of field elements, with account
i
's token balance fort
being stored at indexi*TOKENS + t
.I updated the unit tests and verified that state transitions are applied correctly when running the main snark with real data inside pepper (adding that functionality will come in a separate PR).