You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current function selector computation is not ideal.
It is weird that it is using field while the noir code is using Field and if using a struct, the function signature which is used for the selector just inserts struct meaning that two functions with the same name that have structs as input will have same selector even if different structs.
Function Signature: transfer(struct,struct,field)
Function Selector: 0x6f9c917c
Similar if using arrays. In the function below, every param is different types, but you don't know from the signature or selector
The function signature should be unambiguous and look closer to the noir code that is represents.
Proposed solution
I propose that we add struct as tuples, that integers also have their width, and that arrays are inserted similarly to their definitions with sizes. An example is seen below:
structAsset{interest_accumulator:u120,last_updated_ts:u120,loan_to_value:u120,oracle_address:Field,}structPosition{collateral:Field,static_debt:Field,debt:Field,}structWrapped{asset:Asset,position:Position,array:[Field;2],}#[aztec(private)]fnabi_tester(asset:Asset,wrapped:Wrapped,owner:Field,small:u8,array:[Field;2],u8array:[u8;2],u120array:[u120;2],){}// Current// Function Signature: abi_tester(struct,struct,field,integer,array,array,array)// Function Selector: 0xd1b771b8// My proposal// Function Signature: abi_tester((u120,u120,u120,Field),((u120,u120,u120,Field),(Field,Field,Field),[Field;2]),Field,u8,[Field;2],[u8;2],[u120;2])// Function Selector: 0xaec244be
The text was updated successfully, but these errors were encountered:
LHerskind
added this to the
📢 Initial Public Sandbox Release milestone
Sep 4, 2023
The current function selector computation is not ideal.
It is weird that it is using
field
while the noir code is usingField
and if using a struct, the function signature which is used for the selector just insertsstruct
meaning that two functions with the same name that have structs as input will have same selector even if different structs.Similar if using arrays. In the function below, every param is different types, but you don't know from the signature or selector
The function signature should be unambiguous and look closer to the noir code that is represents.
Proposed solution
I propose that we add struct as tuples, that integers also have their width, and that arrays are inserted similarly to their definitions with sizes. An example is seen below:
The text was updated successfully, but these errors were encountered: