Custom field selection for wildcard - #419
Conversation
| type selection = | ||
| | Wildcard({}) | ||
| | Normal({}) |
There was a problem hiding this comment.
What is the point of payloads in these variant constructors?
There was a problem hiding this comment.
So, they are objects and can be used as WeakMap keys.
There was a problem hiding this comment.
In the next versions, they will also contain a list of specific events. You can see how it's done for wildcard in the next PR.
| preRegWildcardLogSelection | ||
| } else { | ||
| wildcardLogSelection |
There was a problem hiding this comment.
What is the difference between these two?
There was a problem hiding this comment.
preRegWildcardLogSelection filters out wildcard events which don't have preRegistration enabled
| contractAddressMapping: ContractAddressingMap.mapping, | ||
| //Used to prune dynamic contract registrations in the event | ||
| //of a rollback. | ||
| dynamicContracts: array<TablesStatic.DynamicContractRegistry.t>, |
There was a problem hiding this comment.
Can you describe why you moved these items from what was "kind"? Do these values exist for wildcard partitions?
It's not a problem I just want to understand reasoning.
There was a problem hiding this comment.
So it's not recreated and can be used as a cache key
| | ({selection: Wildcard(_)}, _) | ||
| | (_, {selection: Wildcard(_)}) => (p, Some(target)) |
There was a problem hiding this comment.
So basically merge always fails with a wildcard partition?
Is there any problematic cases where it could - say - continuously try and merge partitions that can't be merged?
There was a problem hiding this comment.
No, there's no case when it creates a merge query for a partition.
JonoPrest
left a comment
There was a problem hiding this comment.
Awesome Dmitry, it looks good to me and nothing blocking, just a couple of comments.
If we can chat about the data structure of FetchState.selection before merging that would be great.
This is the first step to having partitions for specific events. I've started with wildcard and the ability to include only needed fields in the query filed selection.