Fix fetch state with endBlock and pending dynamic contracts#393
Conversation
| let isPastEndblock = baseRegister.latestFetchedBlock.blockNumber >= endBlock | ||
| switch (baseRegister.registerType, endBlock) { | ||
| | (RootRegister, Some(endBlock)) => | ||
| let isPastEndblock = getLatestFullyFetchedBlock(fetchState).blockNumber >= endBlock |
There was a problem hiding this comment.
This getLatestFullyFetchedBlock usage is the only change related to the fix. Since we want to consider pending dynamic contracts as well.
Other changes are either renaming of fetchState to partitionedFetchState which is more correct, since these are two different entities. And removing endBlock from fetchState since it's not needed there.
There was a problem hiding this comment.
I'm not 100% following the intricacies to be honest. Are you saying that before this fix, there could be pending requests to fetch more events for dynamic contracts that weren't accounted for - and 'getLatestFullyFetchedBlock' will include that?
JasoonS
left a comment
There was a problem hiding this comment.
I'm not completely following - but happy to get this in so it doesn't block you and we can test it more (don't promote to 'latest' release etc until we're confident)
We can chat it through on a call too
| let isPastEndblock = baseRegister.latestFetchedBlock.blockNumber >= endBlock | ||
| switch (baseRegister.registerType, endBlock) { | ||
| | (RootRegister, Some(endBlock)) => | ||
| let isPastEndblock = getLatestFullyFetchedBlock(fetchState).blockNumber >= endBlock |
There was a problem hiding this comment.
I'm not 100% following the intricacies to be honest. Are you saying that before this fix, there could be pending requests to fetch more events for dynamic contracts that weren't accounted for - and 'getLatestFullyFetchedBlock' will include that?
No description provided.