-
Couldn't load subscription status.
- Fork 28
On block interval #734
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
On block interval #734
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughAdds a new item model (Internal.item) and onBlock registration lifecycle. Refactors batching, fetch state, processing, logging, and chain management to use items (Event|Block). Introduces registration start/finish, per-chain onBlock configs, and updated source sync/options. Updates templates, tests, and dependencies accordingly. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User
participant Gen as Codegen Handlers
participant ER as EventRegister
participant Cfg as Config Builder
participant CM as ChainManager
participant CF as ChainFetcher
participant FS as FetchState
participant EP as EventProcessing
rect rgb(245,248,255)
note over Cfg,ER: Registration lifecycle (new)
Cfg->>ER: startRegistration(~ecosystem, ~multichain, ~preloadHandlers)
Gen->>ER: onBlock(options, handler)
ER-->>ER: validate & store per-chain onBlock
Cfg->>ER: finishRegistration()
ER-->>Cfg: registrations
Cfg-->>CM: config { registrations, multichain, ... }
end
rect rgb(245,255,245)
note over CM,EP: Processing with items (Event|Block)
CM->>CF: fetch next ranges
CF->>FS: handleQueryResult(...)
FS-->>CF: queue items [Event|Block]
CF-->>CM: batch of items
CM->>EP: processEventBatch(items, ...)
alt item is Block
EP-->>EP: build onBlock args {block, context}
EP-->>Gen: invoke registered onBlock handler
else item is Event
EP-->>Gen: invoke event handler (if any)
end
end
Estimated code review effort🎯 5 (Critical) | ⏱️ ~120–180 minutes Possibly related PRs
Suggested reviewers
Pre-merge checks (2 passed, 1 warning)❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
Poem
✨ Finishing touches🧪 Generate unit tests
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 |
| let rangeEnd = switch onBlockConfig.endBlock { | ||
| | Some(endBlock) => Pervasives.min(endBlock, nextLatestFullyFetchedBlockNumber) | ||
| | None => nextLatestFullyFetchedBlockNumber | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clamp this to the max queue size
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💪🏼
Summary by CodeRabbit