-
Notifications
You must be signed in to change notification settings - Fork 21
validate blocks before committing #241
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
Conversation
WalkthroughA validator component was integrated into the committer's workflow. The committer struct now accepts a validator via a new option function and uses it to filter valid and invalid blocks before further processing. The orchestrator was updated to create and inject the validator when initializing the committer. Changes
Sequence Diagram(s)sequenceDiagram
participant Orchestrator
participant Validator
participant Committer
Orchestrator->>Validator: Create Validator(rpcClient, storage)
Orchestrator->>Committer: Create Committer(..., WithValidator(validator))
Committer->>Committer: getSequentialBlockDataToCommit()
Committer->>Validator: Validate blocks (if validator is set)
Validator-->>Committer: Return valid and invalid blocks
Committer->>Committer: Process only valid blocks
Estimated code review effort2 (~15 minutes) 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
🧬 Code Graph Analysis (2)internal/orchestrator/orchestrator.go (2)
internal/orchestrator/committer.go (1)
🧰 Additional context used🧬 Code Graph Analysis (2)internal/orchestrator/orchestrator.go (2)
internal/orchestrator/committer.go (1)
🔇 Additional comments (5)
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
This stack of pull requests is managed by Graphite. Learn more about stacking. |
22a2d81
to
fd74f7c
Compare
0b45721
to
7f6a1dc
Compare
fd74f7c
to
550fae7
Compare
550fae7
to
c7e63de
Compare
c7e63de
to
df00900
Compare
TL;DR
Added block validation before committing blocks to storage.
What changed?
validator
field to theCommitter
structNewCommitter
functiongetSequentialBlockDataToCommit
method that:How to test?
Why make this change?
This change adds a validation step to ensure data integrity before blocks are committed to storage. By filtering out invalid blocks, the system can continue processing valid blocks without being blocked by corrupted or malformed data, improving resilience and data quality.
Summary by CodeRabbit
New Features
Bug Fixes