fix: derive bundle proofs from cached numbered children#917
Closed
nikooo777 wants to merge 2 commits into
Closed
Conversation
- rebuild parent bytes from cached items, not reconversion - this matches the byte stream tip nodes mined and accepted - heals already-posted bundles whose chunks were missing - add listing fallback so legacy bundler keys are findable - add test asserting signed and proof bytes agree end to end
Collaborator
Author
|
closing as per slack discussion, we'll do #918 first and then do the healing part on the side without merging that code into edge |
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
Two fixes that let the bundler recover already-posted bundle transactions whose chunks were being rejected by tip nodes with
data_root_not_found.build_proofsderives chunk-proof bytes from cached numbered ANS-104 children instead of reconverting the parent throughtx@1.0. The reconversion path is kept as a fallback for cache entries that don't have numbered children. This makes the proof byte stream match the byte stream originally signed and posted, so tip-node chunk acceptance lines up with the mined parent root.~bundler@1.0/tx/*/statusare discoverable again.hb_cache:list/3now delegates tohb_store:list/3, andhb_store_lmdb:list/3lists child keys when no group marker exists at the parent path. Without these, startup bundle recovery returns zero on databases that don't carry explicit group markers.This PR is intentionally a recovery/proof-byte fix. It does not attempt the broader follow-up cleanup for how newly generated bundles should be constructed from signed children.
Operator notes
On startup with this branch, bundle recovery discovers existing
postedbundle TX states and runs the normal proof-build + chunk-post + status-flip loop. Eligible transactions whosePOST /chunkpreviously failed should heal automatically, assuming the cached numbered children are present. The bundle-recovery path does not post new L1 transactions; it only issues/chunkrequests for parents already on-chain.Startup may still run other recovery paths, such as unbundled queued item recovery, according to the existing bundler behavior.
Test plan
rebar3 eunit --module=dev_bundler_task— includes the newpost_tx_and_build_proofs_bytes_match_for_nested_body_test, which signs a parent bundle through the same path used bypost_tx, writes/reads throughdev_bundler_cache, and asserts the proof-build bytes equal the signed parent bytes and child commitments are preserved across the round trip.rebar3 eunit --module=hb_cache— includes the newlist_lmdb_children_without_group_marker_test, which exercises the legacy listing fallback.rebar3 eunit --module=hb_store_lmdbrebar3 eunit --module=dev_bundlerrebar3 eunit --module=dev_bundler_cacherebar3 eunit --module=dev_bundler_recoveryrebar3 eunit --module=dev_codec_ans104rebar3 eunit --module=dev_codec_txrebar3 eunit— 3076 passed, 3 failed in the full run. The failures were outside the changed modules: one transienthb_gateway_clientgateway viability failure and two timing-sensitivehb_http_multiassertions.rebar3 eunit --module=hb_gateway_client— passedrebar3 eunit --module=hb_http_multi— passedpostedbundle TX states and confirmed recovery can transition them tocompletewithout manual chunk intervention.