Always re-index latest Cadence block - #776
Conversation
WalkthroughRemoved the emulator-specific adjustment and the computation of nextCadenceHeight; StartEventIngestion now initializes the RPC event subscriber using latestCadenceHeight directly. No exported/public API declarations were changed. Changes
Sequence Diagram(s)sequenceDiagram
participant B as Bootstrap
participant ES as RPCEventSubscriber
rect rgba(76,175,80,0.06)
B->>ES: StartEventIngestion(latestCadenceHeight)
ES-->>B: Subscription started / events streamed
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used🧠 Learnings (1)📚 Learning: 2025-10-06T10:14:49.676ZApplied to files:
🧬 Code graph analysis (1)bootstrap/bootstrap.go (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
🔇 Additional comments (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| chainID, | ||
| b.keystore, | ||
| nextCadenceHeight, | ||
| latestCadenceHeight, |
There was a problem hiding this comment.
The latestCadenceHeight is read from storage, which is updated along with all the block data in an atomic batch updates, which means if latestCadenceHeight should always be the latest height that has its data indexed in the storage.
I think we should find the root cause for why nextCadenceHeight doesn't work. It would mean there is some non atomic updates committed after the height is updated, which probably got lost during restarts.
janezpodhostnik
left a comment
There was a problem hiding this comment.
I agree with Leo that we should check where the problem originated, but I'm ok with this being the temporary fix.
Just maybe add a comment somewhere describing what is happening and why.
16b6e99 to
93f4e75
Compare
93f4e75 to
d50ef9e
Compare
d50ef9e to
0933b2a
Compare
Closes: #766
Description
Now that we have merged:
ViewProviderto return blockViewat its end state flow-go#7050I believe that we can always subscribe to EVM events by using the latest Cadence block. There's been reports of missing EVM blocks, and it seems this behavior manifests after restarts of the EVM GW node.
For contributor use:
masterbranchFiles changedin the Github PR explorerSummary by CodeRabbit