Skip to content

fix: derive bundle proofs from cached numbered children#917

Closed
nikooo777 wants to merge 2 commits into
edgefrom
fix/bundler-proof-recovery
Closed

fix: derive bundle proofs from cached numbered children#917
nikooo777 wants to merge 2 commits into
edgefrom
fix/bundler-proof-recovery

Conversation

@nikooo777
Copy link
Copy Markdown
Collaborator

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_proofs derives chunk-proof bytes from cached numbered ANS-104 children instead of reconverting the parent through tx@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.
  • Legacy bundler status paths under ~bundler@1.0/tx/*/status are discoverable again. hb_cache:list/3 now delegates to hb_store:list/3, and hb_store_lmdb:list/3 lists 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 posted bundle TX states and runs the normal proof-build + chunk-post + status-flip loop. Eligible transactions whose POST /chunk previously failed should heal automatically, assuming the cached numbered children are present. The bundle-recovery path does not post new L1 transactions; it only issues /chunk requests 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 new post_tx_and_build_proofs_bytes_match_for_nested_body_test, which signs a parent bundle through the same path used by post_tx, writes/reads through dev_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 new list_lmdb_children_without_group_marker_test, which exercises the legacy listing fallback.
  • rebar3 eunit --module=hb_store_lmdb
  • Focused bundler/cache/codec modules:
    • rebar3 eunit --module=dev_bundler
    • rebar3 eunit --module=dev_bundler_cache
    • rebar3 eunit --module=dev_bundler_recovery
    • rebar3 eunit --module=dev_codec_ans104
    • rebar3 eunit --module=dev_codec_tx
  • rebar3 eunit — 3076 passed, 3 failed in the full run. The failures were outside the changed modules: one transient hb_gateway_client gateway viability failure and two timing-sensitive hb_http_multi assertions.
  • Reran failed modules individually:
    • rebar3 eunit --module=hb_gateway_client — passed
    • rebar3 eunit --module=hb_http_multi — passed
  • Restarted local nodes against copied legacy LMDBs with posted bundle TX states and confirmed recovery can transition them to complete without manual chunk intervention.

nikooo777 added 2 commits May 19, 2026 19:06
- 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
@nikooo777
Copy link
Copy Markdown
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

@nikooo777 nikooo777 closed this May 19, 2026
@nikooo777 nikooo777 deleted the fix/bundler-proof-recovery branch May 19, 2026 20:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant