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
consider including field index (and field bytes offset) in Store events #2222
Comments
Unclear how to handle the set event - I think we'd have to send down the whole field layout? |
I think "one splice event = one field update" is fine, I can't see why we'd splice many fields but not the whole record. How do we feel then about removing I guess it would prevent us from building "schemaless" indexers, but table schemas are a |
The idea here is that we currently support creating schemaless indexers, but with the constraint that data is stored in two fields: static data and dynamic data. However, that's not how it's actually stored onchain and I want to explore what additional args we could provide in events to offer indexer developers to have the option to store in a single blob for all like data vs. blob per field without a schema lookup. You could still build this with the events we have now, but would require an additional schema lookup. |
For more schemalessness the indexer devs could use FieldLayout's total static length it's still a lookup, but not strictly a schema lookup
Some thoughts on making
We can replace |
|
|
Store's splice operations on static and dynamic fields use a field index to map to contract storage slots. Without this data expressed in events, offchain clients/indexers are ~forced to model the data as a single bytes blob for static field data and another for dynamic field data.
Since we already have access to the field index in these methods (and the field-specific bytes offset for dynamic fields), we could expose these as part of the event to allow for more flexible ways of modeling data offchain.
We should probably measure the gas of this to make sure it's worth the trade-off. Adding this also means we'd cement the "one splice event = one field update", which seems fine.
The text was updated successfully, but these errors were encountered: