Skip to content

fix: manifest loading on 52 char domain without TX ID#751

Open
speeddragon wants to merge 5 commits intoimpr/gunfrom
impr/manifest_52char
Open

fix: manifest loading on 52 char domain without TX ID#751
speeddragon wants to merge 5 commits intoimpr/gunfrom
impr/manifest_52char

Conversation

@speeddragon
Copy link
Collaborator

@speeddragon speeddragon commented Mar 12, 2026

Allow loading manifests and assets from a URL that doesn't have a TXID, or when it doesn't end with /, making the browser request assets to the domain root.

These will work now:

  • https://4nuojs5tw6xtfjbq47dqk6ak7n6tqyr3uxgemkq5z5vmunhxphya.arweave.net/42jky7O3rzKkMOfHBXgK-304YjulzEYqHc9qyjT3efA
  • https://4nuojs5tw6xtfjbq47dqk6ak7n6tqyr3uxgemkq5z5vmunhxphya.arweave.net/

This also returns 404 instead of HyperBuddy dashboard on a subdomain that doesn't belong to a valid ARNS or 52-character domains.

@speeddragon speeddragon changed the title Impr/manifest 52char Fix manifest loading on 52 char domain without TX ID Mar 12, 2026
@speeddragon speeddragon changed the title Fix manifest loading on 52 char domain without TX ID fix: manifest loading on 52 char domain without TX ID Mar 12, 2026
@speeddragon speeddragon marked this pull request as ready for review March 13, 2026 00:14
@speeddragon speeddragon force-pushed the impr/manifest_52char branch from d1ad7ca to 2611098 Compare March 13, 2026 17:55
@speeddragon
Copy link
Collaborator Author

Failed: 3. Skipped: 0. Passed: 3008.

Flaky tests:

  • hb_gateway_client: l2_dataitem_test...failed
  • hb_gateway_client: ao_dataitem_test...failed
  • hb_store_gateway: remote_hyperbeam_node_ans104_test...failed

src/dev_name.erl Outdated

%% @doc Try to resolve 52char subdomain back to its original TX ID
resolve_52char(Key, HookMsg, Opts) when byte_size(Key) == 52 ->
TXID = subdomain_to_tx_id(Key),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Convention is TXID not tx_id

src/dev_name.erl Outdated
Resolvers = hb_opts:get(name_resolvers, [], Opts),
?event({resolvers, Resolvers}),
case match_resolver(Key, Resolvers, Opts) of
ArnsResolver = case match_resolver(Key, Resolvers, Opts) of
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It isn't just Arns! ~name@1.0 is built to be agnostic

resolve_52char(Key, HookMsg, Opts) when byte_size(Key) == 52 ->
TXID = subdomain_to_tx_id(Key),
%% Clean up entries that doesn't have <<"path">> as key or aren't IDs.
Body = lists:filter(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please no waterfall.

src/dev_name.erl Outdated
hb_maps:merge(Base, Resolved, Opts).

subdomain_to_tx_id(Subdomain) when byte_size(Subdomain) == 52 ->
b64fast:encode(base32:decode(Subdomain)).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hb_util:human_id on the outer one

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should keep the conversion consistent. Isn't this, for example b64 not b64u? Either way, better in a single codepath

hb_util:human_int(Time * 1000) ++ "ms".

%% @doc Load ans104 binary files to a store.
load_and_store(Store, File) ->
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about just calling this preload? As it gets the data from our test directory, which is kind of preloaded?

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.

2 participants