Support route to multiple nodes - #1106
Conversation
| Device -> WithPrivIP#{<<"device">> => Device} | ||
| end, | ||
| Host = cowboy_req:host(Req), | ||
| Host = cowboy_req:header(<<"host">>, Req, cowboy_req:host(Req)), |
| {ok, #{<<"ao-result">> := Key} = Res} -> | ||
| ?event(debug_multi, {admissible_result, {result, Res}}), | ||
| hb_util:atom(maps:get(Key, Res, false)) == true; |
There was a problem hiding this comment.
For HyperBEAM-to-HyperBEAM node communication, we need to know where the message is.
| [ID | Rest] when length(Rest) >= 2 -> | ||
| {KeyParts, [Value]} = | ||
| lists:split(length(Rest) - 1, Rest), | ||
| Key = | ||
| iolist_to_binary( | ||
| lists:join(<<":">>, KeyParts) | ||
| ), |
There was a problem hiding this comment.
This supports keys that contain :. Eg: qScPIDiicX8dyvkeXlyLcfNknLiNnJLqbjhdcg--a5w.
@Lucifer0x17, this isn't mandatory for this PR, right? I'm not sure why it was originally added.
There was a problem hiding this comment.
it's a correctness fix from the router port for colon-containing committed field names, independent of the multi-node feature but load-bearing for the NASA flow that produced those names, and safe to keep.
some manifest were failing to load like sam.weave.space and stuff
| hb_private:set( | ||
| Response#{ <<"path">> => Path }, | ||
| <<"admissibility/node">>, | ||
| Node, | ||
| Opts | ||
| ), |
There was a problem hiding this comment.
Previously, we set http-reference in the Base. I don't see a clear advantage/disadvantage (maybe readability), but this avoids modifying the body.
| apply_decorator(Base, Req, Decorator, Opts) -> | ||
| DecoratorBase = | ||
| hb_message:without_unless_signed([<<"path">>], Decorator, Opts), | ||
| {ok, Decorated} = | ||
| hb_ao:resolve( | ||
| DecoratorBase, | ||
| Req#{ <<"path">> => <<"decorator">>, <<"body">> => Base }, | ||
| Opts | ||
| ), | ||
| Decorated. |
There was a problem hiding this comment.
The goal here is to modify add to Base the http-reference configuration via dev_stamp_decorator.
3703273 to
2b2714c
Compare
Ports the feat/chance_and_router_conf router work onto post-#915 edge. Edge already carries the shared neo/edge Arweave and bundler layer, so the net delta is the router-specific work: dev_chance@1.0, the multi-node verifying read in hb_store_remote_node (parallel fan-out + cache@1.0 expected-response gate, no local store), the dev_cache trust gate, the dev_manifest b32 redirect, and host/port plumbing in hb_http. Source: feat/chance_and_router_conf. Carries four non-router fixes that auto-merged from that branch: 333a94b uncommit test_process/1 base before merging the execution stack f973947 bail from ensure_started/1 cleanly when sidecar dir is absent bb7521e symmetrical handling of `status` encoding (dev_httpsig) f70c3b8 relay-path dropped when matched at root path (dev_relay) Co-Authored-By: Sam Williams <sam@arweave.org>
…ification dev_meta: log the raw request singleton instead of wrapping it in hb_cache:ensure_all_loaded, which forced store reads on every request even when the http topic is off
Fire + sign on admitted reads; thread the hook config via the admissibility spec, not the runtime opts.
Thread the responding store node through the multi-read fan-out so the
admissible-response push carries that node's http-reference, not empty.
- hb_store_remote_node: wrap nodes as {prefix, opts}
- hb_http_multi: pass the responding node into the admissibility check,
stamp its http-reference onto the base
- hb_http: route a {prefix} node by prefix, preserving the path
The edge port flattened the hook lookup (deep_get -> maps:get), so device-scoped hooks like on.~cache@1.0.admissible-response stopped resolving. Restore nested resolution for path-form hook names while keeping flat names on the fast direct lookup. - hb_hook: list HookName -> deep_get (walk nested); binary -> maps:get - dev_cache: fire the device-scoped path [~cache@1.0, admissible-response]; drop a redundant debug event in the async hook
The hook fires inside the multi_read fan-out, so it inherits the remote-node store. Once chance@1.0 loads as a remote device, the hook's archive read re-enters the fan-out and the relay never fires. Drop the store from the hook opts so device reads hit the node default store (local + gateway); the admissibility verify keeps the store, only the hook drops it.
75865e8 to
771aefb
Compare
Based on #988, rebased on current
edge.This includes #1097, since it needs it for the gateway-shim@1.0 redirect to work.
Uses permaweb/gateway-shim-1.0#1
Config
Config example:
TODO:
When deployed
is-admissibleis received properly by lua process.