solution: ability to archive as plain JSON (or HEX) files with dir pe…#24
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a new JSON-per-field archival format (plus .hex raw-tx files) and introduces a new storage capability split so commands can target backends that can scan for missing heights without requiring full file read/merge support.
Changes:
- Add JSON-per-field format encoder (
formats::json) plus new filesystem and S3 (object_store) storage backends for that layout. - Refactor storage capabilities by introducing
ScanTarget(resume/missing detection) separate fromReadTarget(list/open/delete), and updatestream/fixto depend on scanning only. - Add
--format {avro,json}CLI switch and rejectverify/compactfor JSON format at startup.
Reviewed changes
Copilot reviewed 16 out of 17 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/storage/mod.rs | Adds JSON storage constructors, introduces ScanTarget, and factors out find_incomplete_by_listing |
| src/storage/fs.rs | Implements ScanTarget for filesystem Avro backend via shared listing-based scanner |
| src/storage/objects.rs | Implements ScanTarget for S3 Avro backend via shared listing-based scanner |
| src/storage/json_fs.rs | New filesystem JSON-per-field backend + tests |
| src/storage/json_objects.rs | New object_store JSON-per-field backend + tests |
| src/formats/mod.rs | Exposes formats::json |
| src/formats/json.rs | Implements JSON-per-field encoding + missing-height heuristics + tests |
| src/args.rs | Adds --format option and Format enum |
| src/main.rs | Dispatches commands based on backend capabilities and selected format |
| src/command/stream.rs | Relaxes target bound from ReadTarget to ScanTarget |
| src/command/fix.rs | Relaxes target bound from ReadTarget to ScanTarget |
| src/archiver/filenames.rs | Adds height_dir() helper for per-height directory layouts |
| src/record.rs | Clarifies TxRaw semantics (decoded bytes; re-encode per chain on output) |
| src/blockchain/ethereum.rs | Adjusts raw-tx handling to decode hex payload into bytes |
| README.adoc | Documents new --format flag in CLI help output |
| Cargo.toml / Cargo.lock | Adds tempfile for new filesystem JSON storage tests |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Coverage Report for CI Build 26260196243Coverage increased (+6.9%) to 49.769%Details
Uncovered Changes
Coverage Regressions10 previously-covered lines in 5 files lost coverage.
Coverage Stats
💛 - Coveralls |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…r height