-
Notifications
You must be signed in to change notification settings - Fork 14
Fix issue #548 and improve version validation for issue #597 #617
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
base: main
Are you sure you want to change the base?
Fix issue #548 and improve version validation for issue #597 #617
Conversation
…or issue midnightntwrk#597 - Fix midnightntwrk#548: Always fetch authorities from specific block for consistency * Modified chain-indexer/src/infra/subxt_node.rs to fetch authorities for each block instead of caching them across sessions * This ensures consistent author values regardless of indexer start point * Prevents discrepancies when indexers start from different block heights - Improve midnightntwrk#597: Add version validation and documentation * Created indexer-api/src/version_validator.rs module * Added version compatibility logging at API startup * Created VERSION_COMPATIBILITY.md with comprehensive documentation * Warns users about version mismatches to prevent 404 errors on v3 endpoints Both changes are backward compatible and improve reliability.
|
Hi @hseeberger! 👋 Thank you for the feedback! I've split the PR as suggested: ✅ PR #618 - Fix for issue #548 only (block author consistency)
Thanks again for the review! 🙏 |
|
@roman98Z , thanks for splitting! Very much appreciated. |
|
@hseeberger Also, if there are any other issues or bugs in the Midnight ecosystem that need attention, I'd be happy to help! Feel free to point me to: Other open issues that need fixing |
|
The ultimate authority when it comes to version compatibility is the I believe the new validations/log outputs are doomed to quickly outdate, because the only source of truth is |
Fix issue #548 and improve version validation for issue #597
Summary
This PR addresses two important issues in the midnight-indexer:
Both changes improve reliability and user experience without breaking backward compatibility.
Issue #548: Different Author Values in Blocks Table
Problem
When running two indexers with identical configurations but starting from different block heights, the
authorfield in theblockstable would differ for the same blocks. This was caused by the indexer fetching authorities only when they wereNone, which meant indexers starting from different points would use different authority sets.Root Cause
The indexer was caching authorities and only fetching them:
NewSessioneventIf Indexer A started from genesis and Indexer B started from block 250, they would fetch different initial authority sets, leading to different author calculations for the same blocks.
Solution
Modified
chain-indexer/src/infra/subxt_node.rsto always fetch authorities from the specific block being indexed, ensuring that:Changes
File:
chain-indexer/src/infra/subxt_node.rs(lines 231-249)Testing
To verify the fix:
authorvalues in theblockstableIssue #597: API v3 Endpoint 404
Problem
Users were getting 404 errors on
/api/v3/graphqlendpoint due to version incompatibilities when using thelatesttag for Docker images. This led to confusion and difficult-to-debug configuration issues.Root Cause
Using
latesttags resulted in:Solution
Added comprehensive version validation and documentation:
New Module:
indexer-api/src/version_validator.rsDocumentation:
VERSION_COMPATIBILITY.mdStartup Logging: Modified
indexer-api/src/main.rsChanges
New Files:
indexer-api/src/version_validator.rs(252 lines)VERSION_COMPATIBILITY.md(208 lines)Modified Files:
indexer-api/src/lib.rs- Added version_validator moduleindexer-api/src/main.rs- Integrated version validationStartup Output
When the API starts, users now see:
Impact
Performance
Backward Compatibility
User Experience
Testing Checklist
Related Issues
Additional Notes
For Reviewers
Issue Different author values in blocks table when running Indexer on two identical servers #548: The key change is in
make_block()function. Please verify the logic ensures authorities are always fetched from the correct block.Issue Is /api/v3/graphql available? Getting 404 on all v3 endpoints, unable to query dustGenerationStatus. #597: The version validator module includes unit tests. Consider extending it in the future to query actual component versions.
Documentation: The
VERSION_COMPATIBILITY.mdfile should be linked from the main README for better visibility.Future Enhancements
Commit Message