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
Currently Starknet uses an entire felt to store the variant of an enum. This is true even if you have an enum with only a couple variants such as
enumColor{
blue,
yellow,
red
}
As such, it's highly inefficient to store enums directly. I see two good options:
If Cairo/Starknet allows it, implement StorePacking on the Enumerator to provide more specific instructions on packing.
Otherwise, use u8 for storage and convert to Enum after taking out of storage.
Note, for models which is infrequently written to, this is a non-issue. Focus instead on models which are written to most frequently, with the goal of getting those to one or two felts.
The text was updated successfully, but these errors were encountered:
Currently Starknet uses an entire felt to store the variant of an enum. This is true even if you have an enum with only a couple variants such as
As such, it's highly inefficient to store enums directly. I see two good options:
Note, for models which is infrequently written to, this is a non-issue. Focus instead on models which are written to most frequently, with the goal of getting those to one or two felts.
The text was updated successfully, but these errors were encountered: