Remove hackiness around struct field ordering in IR generation in noirc_evaluator
#1398
Labels
enhancement
New feature or request
noirc_evaluator
#1398
Problem
We replaced the underlying datastructure for structs from
BTreeMap<String, FieldElement>
withVec<(String, FieldElement)>
in #1166 to give better guarantees around struct field ordering. However we still perform manipulation ofBTreeMaps
in theEvaluator
which requires a hack to flatten this into a single vector properly.See:
noir/crates/noirc_evaluator/src/lib.rs
Lines 231 to 240 in 05443d8
The difficulty lies in that
IrGenerator::abi_struct
requires access to the fields of structs so we can't flatten the entire struct into a vector of witness indices from the beginning.Happy Case
Ideally we wouldn't have
get_field_ordering
and would be able to flatten thisBTreeMap
in a cleaner way. Alternatively we'd be able to pass the struct field witnesses intoIrGenerator::abi_struct
while simultaneously maintaining this ordering.Alternatives Considered
No response
Additional Context
No response
Would you like to submit a PR for this Issue?
No
Support Needs
No response
The text was updated successfully, but these errors were encountered: