fix(model): correct BlockHeaderMeta serialization and add ProcessedAt support#6
fix(model): correct BlockHeaderMeta serialization and add ProcessedAt support#6ordishs wants to merge 10 commits into
Conversation
… support - Fix capacity calculation in BlockHeaderMeta.Bytes() to include all fields - Add ProcessedAt field to BlockHeaderMeta struct for tracking block processing time - Update serialization/deserialization to handle ProcessedAt timestamp (8 bytes) - Add ProcessedAt to protobuf GetBlockHeaderResponse with proper timestamp type conversion - Update HTTP API responses to include Invalid and ProcessedAt fields - Fix frontend date parsing to handle RFC 3339 timestamp format from JSON API
- Add hasCoinbaseColumn parameter to processBlockHeadersRows - Fix GetBlockHeadersFromOldest to include processed_at column - Remove dynamic column detection to improve performance - Fix variable shadowing with err declaration
|
/claude-review |
|
Claude finished @oskarszoon's task —— View job Code Review Complete ✓I've reviewed this PR which fixes BlockHeaderMeta serialization and adds ProcessedAt support. The changes are well-implemented and address the "Invalid Date" error in the UI. Here's my analysis: SummaryVerdict: LGTM - The implementation is correct and solves the stated problem. The capacity calculation fix and ProcessedAt field handling are properly implemented across all layers. What Works Well1. Serialization Fix (model/BlockHeaderMeta.go:28)
2. ProcessedAt Implementation
3. Type Conversions
4. Frontend Handling (ui/dashboard)
Minor Observations (Non-blocking)1. Redundant Variable Declaration // Line 58: b64 declared
b64 := make([]byte, 8)
// Line 90: Redeclared unnecessarily
if m.ProcessedAt != nil {
b64 := make([]byte, 8) // Could reuse the b64 from line 58
...
}This works but is slightly inefficient. Not a bug, just a minor style issue. 2. Consistency in Timestamp Handling
This is intentional (ProcessedAt is nullable), but worth noting for consistency. The implementation correctly handles this. Security & CorrectnessNo issues found:
No malicious code detected - all changes are legitimate feature additions for tracking block processing timestamps. Testing NotesSince this is a fork PR, I cannot execute tests, but I recommend:
RecommendationApprove - This PR correctly implements the ProcessedAt field with proper serialization, gRPC support, and frontend handling. The capacity calculation fix ensures serialization correctness. No blocking issues identified. The minor redundant variable declaration is a style issue that doesn't affect functionality. Job run • Branch: |
|
Closing this PR in favor of a new PR from the pr-6-work branch with an additional optimization. |
Summary
Changes Made
Backend
Frontend
Problem Solved
This PR fixes the "Invalid Date" error in the UI when displaying the ProcessedAt field for blocks. The issue was caused by:
Test Plan