Copycat L3 indexer with parallel processing and parent lookups#837
Closed
nikooo777 wants to merge 28 commits into
Closed
Copycat L3 indexer with parallel processing and parent lookups#837nikooo777 wants to merge 28 commits into
nikooo777 wants to merge 28 commits into
Conversation
9392f30 to
ff6f8d4
Compare
dbd6d82 to
6ef9669
Compare
speeddragon
reviewed
Apr 30, 2026
Collaborator
speeddragon
left a comment
There was a problem hiding this comment.
Review the PR, I will fix this later.
Comment on lines
+776
to
+782
| case is_block_indexed(H, TargetDepth, Opts) of | ||
| true -> ok; | ||
| false -> | ||
| observe_event(<<"block_indexed">>, fun() -> | ||
| fetch_and_process_block(H, To, TargetDepth, Opts) | ||
| end) | ||
| end |
Collaborator
There was a problem hiding this comment.
If we're indexing most up to date block, we should keep indexing and ignore this is_block_indexed.
| %% requested safe depth (defaults to full recursion till the set | ||
| %% copycat_depth_recursion_cap). | ||
| process_l1_request(TXID, Request, Opts) -> | ||
| Depth = request_depth(Request, <<"safe_max">>, Opts), |
Collaborator
There was a problem hiding this comment.
Add force to force requests to be re-indexed in some edge cases.
0f5341d to
40f1de9
Compare
- Return tagged tuples from latest_height and normalize_height
- Propagate errors through parse_range using maybe block
- Return {error, unavailable} (HTTP 503) on upstream failures
- Validate resolved heights are non-negative in parse_range
- Log original upstream error reason before collapsing to unavailable
- Add regression tests with mock server for both failure paths
…ritting faster than OS is writting in disk
…ave, tests fixed on hb_store_arweave
f463c86 to
629a0dd
Compare
Collaborator
|
Closed in favor of #903, which contain this and other work merged in a new branch. |
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.
Summary
~arweave@2.9/parent=<id>endpoint for parent lookupsHow to use
Index blocks
Index a range of blocks at depth 3 (L1 TXs → L2 bundle items → L3 nested items):
curl "http://localhost:8005/~copycat@1.0/arweave?from=1890000&to=1889000&depth=3"For long-running indexing, use the cron wrapper to avoid HTTP timeout killing the job:
curl "http://localhost:8005/~cron@1.0/once?cron-path=~copycat@1.0/arweave&from=-1&to=1862995&depth=3"Query the inventory
See what was indexed per block, grouped by depth level:
curl "http://localhost:8005/~copycat@1.0/arweave?from=1890000&to=1889990&mode=inventory"Example response:
{ "1890000": { "depth": 3, "items": { "1": ["txid1", "txid2"], "2": ["bundleitem1", "bundleitem2"], "3": ["nesteditem1"] } } }Look up an item's parent
Find which block or bundle contains a given item:
curl "http://localhost:8005/~arweave@2.9/parent=CwxY--7bsqjtw2lneMUjkmYT9CWAYZvsmsO06dY232g"Response:
{"parents": [{"type": "bundle", "id": "Rve4-grgOw8jXLVw3f6nUhQvlVn6AYm7wA4I5HeKW74"}]}What gets indexed
The copycat indexer writes these entries to the index store:
<item-id>→ codec + offset + length): maps each item to its location in the Arweave weaveblock/<height>/depth→ integer): records that a block was indexed and to what depthblock/<height>/items/<depth>→ item IDs): lists items found at each depth levelparent/<item-id>→ type + parent ref): maps each item to its containing block (height) or bundle (ID)Configuration
arweave_block_workersarweave_index_workerscopycat_memory_budgetcopycat_memory_cap