First — thanks for the v0.9 work. Field report from a production HyperBEAM node serving a custom (non-aos) Lua AO process — our Aeternum Registrar at PID Dwnuy4MbuQkgwxw4-P08wxeny2KcwCh8Kd22mehacTc, behind Golden Codex's Aeternum Asset class (fine-art provenance on AO + Arweave). After v0.9-FINAL rolled through, every /compute request crashes deterministically. Diagnosis + a small defensive patch below; PR companion linked.
Symptom
100% of GET /<PID>/compute?slot=N requests crash the worker with function_clause. OTP restarts the worker, the next request crashes the same way, ad infinitum. Schedule writes still succeed; reads are dead.
Stacktrace (from journalctl -u hyperbeam)
returning_500_error, method: GET, path: Dwnuy..hacTc/compute,
Termination type: 'error'
Stacktrace:
hb_util:int/[#{<<"ao-result">> => <<"body">>,<<"body">> => <<"14040">>}]
at src/core/util/hb_util.erl:39
dev_process_worker:compute_cached/3
at src/preloaded/process/dev_process_worker.erl:51
dev_process_worker:compute_group/3
at src/preloaded/process/dev_process_worker.erl:30
hb_persistent:await/4
at src/preloaded/persistent/hb_persistent.erl:186
hb_ao:resolve_stage/4
hb_ao:do_resolve_many/2
hb_ao:resolve_many/2
dev_meta:handle_resolve/3
hb_http_server:handle_request/3
cowboy_handler:execute/2
cowboy_stream_h:execute/3
Error details:
function_clause
(Stacktrace captured against our local pre-reorganization tree where dev_process_worker.erl lived directly under src/; on current main the paths are src/preloaded/process/dev_process_worker.erl and src/core/util/hb_util.erl. Function signatures unchanged.)
Root cause
compute_cached/3 (around line 50 of src/preloaded/process/dev_process_worker.erl) expects RawSlot as a bare binary like <<"14040">>. The v0.9 HTTP resolve path is delivering it as the AO-Core envelope:
#{<<"ao-result">> => <<"body">>, <<"body">> => <<"14040">>}
hb_util:int/1 in src/core/util/hb_util.erl has three clauses — is_binary, is_list, is_integer. No map clause. BEAM raises function_clause. The data is fine — the slot id is at the body key; the consumer just isn't unwrapping it.
Proposed patch
Add a defensive unwrap as the first clause of compute_cached/3:
compute_cached(ProcID, RawSlot, Opts) when is_map(RawSlot) ->
%% Defensively unwrap the AO-Core message envelope when the v0.9 HTTP
%% resolve path delivers RawSlot wrapped instead of as a bare binary.
%% The slot id lives at the `body' key; everything else is unchanged.
case maps:find(<<"body">>, RawSlot) of
{ok, Body} -> compute_cached(ProcID, Body, Opts);
error -> false
end;
Locally validated against production traffic: the function_clause crash stops entirely. Companion PR: codex-curator/HyperBEAM @ fix/compute-cached-envelope-unwrap.
The unwrap might belong upstream in dev_process:target_slot/2 (the caller that constructs RawSlot) — happy to follow whichever seam you prefer.
Environment
|
|
| HyperBEAM |
v0.9 banner (VERSION: v0.9.), at HEAD of permaweb/HyperBEAM/main at the moment of clone |
| Erlang/OTP |
erts-15.2.7.8 |
| Build profile |
rocksdb+genesis_wasm |
| Store |
configured hb_store_fs at /opt/gcx/node/data/cache; on-disk cache observed at _build/rocksdb+genesis_wasm/rel/hb/cache-mainnet/, per-PID checkpoints under genesis-wasm/checkpoints/state-<PID>.dat |
| Process |
custom (non-aos) Lua, PID Dwnuy4MbuQkgwxw4-P08wxeny2KcwCh8Kd22mehacTc |
| OS |
Ubuntu 22.04, GCE e2-standard-4, us-west1-a |
Related v0.9 bugs we also hit (out of scope for the companion PR)
In recovery we also exposed:
- LMDB
mdb_page_dirty assertion against the existing cache after applying the unwrap patch. Next /compute exits with Assertion 'rc == 0' failed in mdb_page_dirty() at lmdb-sys-0.8.0/.../mdb:2121, status=6/ABRT. Possibly a v0.9 upgrade-migration gap on cached entries written under the old envelope.
loadMessages "Body is not valid" 500s after a full cache wipe — body "Body is not valid: would attempt to fetch from scheduler in loadMessages" from the genesis-wasm Node helper. Looks like the same envelope mismatch one layer up.
We're not proposing patches for these here — flagging only. The picture: nodes that ran pre-v0.9 long enough to accumulate cache hit (1); nodes that wipe to recover hit (2). The unwrap fixes neither alone.
Offer
Happy to follow up with full traces, reproduce against a freshly-provisioned node, pair on the right seam for the unwrap, or test patches against our Registrar before they ship. Reach us at curator@golden-codex.com · @codex-curator.
— Tad MacPherson, Metavolve Labs / Golden Codex
curator@golden-codex.com · @codex-curator · golden-codex.com
- Claude (Anthropic) — Jedi Code Master, paired on diagnosis + patch
Aeternum Registrar PID: Dwnuy4MbuQkgwxw4-P08wxeny2KcwCh8Kd22mehacTc
Operator: jFJbKYmhZVnmGk-ZTain8B3rV4S0aalTx6AEIKItNTM
First — thanks for the v0.9 work. Field report from a production HyperBEAM node serving a custom (non-aos) Lua AO process — our Aeternum Registrar at PID
Dwnuy4MbuQkgwxw4-P08wxeny2KcwCh8Kd22mehacTc, behind Golden Codex's Aeternum Asset class (fine-art provenance on AO + Arweave). After v0.9-FINAL rolled through, every/computerequest crashes deterministically. Diagnosis + a small defensive patch below; PR companion linked.Symptom
100% of
GET /<PID>/compute?slot=Nrequests crash the worker withfunction_clause. OTP restarts the worker, the next request crashes the same way, ad infinitum. Schedule writes still succeed; reads are dead.Stacktrace (from
journalctl -u hyperbeam)(Stacktrace captured against our local pre-reorganization tree where
dev_process_worker.erllived directly undersrc/; on currentmainthe paths aresrc/preloaded/process/dev_process_worker.erlandsrc/core/util/hb_util.erl. Function signatures unchanged.)Root cause
compute_cached/3(around line 50 ofsrc/preloaded/process/dev_process_worker.erl) expectsRawSlotas a bare binary like<<"14040">>. The v0.9 HTTP resolve path is delivering it as the AO-Core envelope:#{<<"ao-result">> => <<"body">>, <<"body">> => <<"14040">>}hb_util:int/1insrc/core/util/hb_util.erlhas three clauses —is_binary,is_list,is_integer. No map clause. BEAM raisesfunction_clause. The data is fine — the slot id is at thebodykey; the consumer just isn't unwrapping it.Proposed patch
Add a defensive unwrap as the first clause of
compute_cached/3:Locally validated against production traffic: the
function_clausecrash stops entirely. Companion PR: codex-curator/HyperBEAM @fix/compute-cached-envelope-unwrap.The unwrap might belong upstream in
dev_process:target_slot/2(the caller that constructsRawSlot) — happy to follow whichever seam you prefer.Environment
VERSION: v0.9.), at HEAD ofpermaweb/HyperBEAM/mainat the moment of cloneerts-15.2.7.8rocksdb+genesis_wasmhb_store_fsat/opt/gcx/node/data/cache; on-disk cache observed at_build/rocksdb+genesis_wasm/rel/hb/cache-mainnet/, per-PID checkpoints undergenesis-wasm/checkpoints/state-<PID>.datDwnuy4MbuQkgwxw4-P08wxeny2KcwCh8Kd22mehacTce2-standard-4,us-west1-aRelated v0.9 bugs we also hit (out of scope for the companion PR)
In recovery we also exposed:
mdb_page_dirtyassertion against the existing cache after applying the unwrap patch. Next/computeexits withAssertion 'rc == 0' failed in mdb_page_dirty()atlmdb-sys-0.8.0/.../mdb:2121,status=6/ABRT. Possibly a v0.9 upgrade-migration gap on cached entries written under the old envelope.loadMessages"Body is not valid" 500s after a full cache wipe — body"Body is not valid: would attempt to fetch from scheduler in loadMessages"from the genesis-wasm Node helper. Looks like the same envelope mismatch one layer up.We're not proposing patches for these here — flagging only. The picture: nodes that ran pre-v0.9 long enough to accumulate cache hit (1); nodes that wipe to recover hit (2). The unwrap fixes neither alone.
Offer
Happy to follow up with full traces, reproduce against a freshly-provisioned node, pair on the right seam for the unwrap, or test patches against our Registrar before they ship. Reach us at
curator@golden-codex.com·@codex-curator.— Tad MacPherson, Metavolve Labs / Golden Codex
curator@golden-codex.com·@codex-curator·golden-codex.comAeternum Registrar PID:
Dwnuy4MbuQkgwxw4-P08wxeny2KcwCh8Kd22mehacTcOperator:
jFJbKYmhZVnmGk-ZTain8B3rV4S0aalTx6AEIKItNTM