-
Notifications
You must be signed in to change notification settings - Fork 166
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
[Core] Support Arrays #1417
Comments
Hello @ponderingdemocritus I would like to take this up, could you please assign this to me. Thanks |
Great! Could you please share the approach you are thinking before starting on the work? |
So
Hello @tarrencev, So I was thinking of two approaches :
|
@Akashneelesh I think 1. is probably a good solution for now. I wonder if we should do something similar to https://github.com/starkware-libs/cairo/blob/4821865770ac9e57442aef6f0ce82edc7020a4d6/corelib/src/starknet/storage_access.cairo#L665 We will have to serialize array members to a Span first then write them to storage in order to support structs. Perhaps we can start with supporting primitives first though |
Hey @Akashneelesh happy to see you around! To complement the Tarrence's statement about serializing the array member, Dojo database system does not actually use the Therefore, the approach to take here should be a bit different than regular storage. Dojo database uses the storage syscalls directly. Let me break down the process and let me know if you want to clarify some part of it:
The objective to support array, would be to add the same logic as As Tarrence mentioned, you can make a first version that only supports array of primitives, you've an example here in the introspect module where primitives are handled. I would break down the path to achieve this as follow:
I hope this gives you more context, don't hesitate if you have any question or an alternative approach. Note aside: In the case of the |
Thanks alot @glihm for enlightening me with the whole process, Based on what you have mentioned I'll take this approach and try implementing it. And if I face a better approach or have any stops , I'll surely shoot a question here. |
I will close this one as the first phase was done in #1533. Need to check on the Torii side how this will be indexed. |
Currently Dojo does not natively support storing arrays in models.
This would be an extremely helpful feature.
I am unsure of the best implementation.
The text was updated successfully, but these errors were encountered: