mirror of
https://github.com/simplex-chat/simplexmq.git
synced 2026-11-04 12:58:02 +00:00
9c4a814fdab9f7350b5f259bb5afe5145b5bd383
5
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
9c4a814fda | resolver: answer a subname only while its name's holder holds it (#2013) | ||
|
|
89c8ba9c98 |
resolver: read .simplex reservations from the name policy (#1993)
* resolver: read .simplex reservations from the name policy simplex-network/ens-contracts#42 moved reservedNames from SimplexController to SimplexNamePolicy. SNRC_NAME_POLICY_<TLD> names it; where it is unset the controller is read as before, as on .testing. Claude-Session: https://claude.ai/code/session_01BxsKd45qytTbangMqJs93F * resolver: address review: keep the reserved read's shape, explicit policy in tests, describe contracts by behavior Claude-Session: https://claude.ai/code/session_01BxsKd45qytTbangMqJs93F * resolver: address review: pin the name policy in every test that reads reservations, one policy test that fails without the read, note setNamePolicy Claude-Session: https://claude.ai/code/session_01BxsKd45qytTbangMqJs93F * resolver: address review: no env pins the suite does not keep elsewhere, no comment repeating the docstring Claude-Session: https://claude.ai/code/session_01BxsKd45qytTbangMqJs93F * resolver: address review: name what the .testing controller keeps Claude-Session: https://claude.ai/code/session_01BxsKd45qytTbangMqJs93F * resolver: address review: an empty name policy reply is refused too Claude-Session: https://claude.ai/code/session_01BxsKd45qytTbangMqJs93F * resolver: read each controller's name policy at startup in place of SNRC_NAME_POLICY_<TLD> Claude-Session: https://claude.ai/code/session_01BxsKd45qytTbangMqJs93F * resolver: address review: workers open their own RPC connections, docs of the startup read, test names and docstrings that say what holds Claude-Session: https://claude.ai/code/session_01BxsKd45qytTbangMqJs93F * resolver: a controller with no contract behind it stops the startup read, so the container restarts until the node reaches it Claude-Session: https://claude.ai/code/session_01BxsKd45qytTbangMqJs93F * resolver: address review: an empty name policy reply falls back again, so a chain without .testing's controller still starts; new functions after the ones they join, compose lines added only Claude-Session: https://claude.ai/code/session_01BxsKd45qytTbangMqJs93F * resolver: address review: tests of the workers' own connections, an address without a contract and an unconfigured controller; docs of which TLDs answer 502 Claude-Session: https://claude.ai/code/session_01BxsKd45qytTbangMqJs93F * resolver: address review: a controller naming no policy is logged as the other fallbacks are, a test of the startup exit, no redundant default Claude-Session: https://claude.ai/code/session_01BxsKd45qytTbangMqJs93F * resolver: address review: the startup test above the worker tests' Linux guard, without a controller it does not need Claude-Session: https://claude.ai/code/session_01BxsKd45qytTbangMqJs93F * resolver: address review: the startup test runs one worker, a test of an unconfigured controller, the fallbacks described once Claude-Session: https://claude.ai/code/session_01BxsKd45qytTbangMqJs93F * resolver: address review: compose names the 502 of a policy the node has not reached, the worker test sets its own reservation, no repeated README clauses Claude-Session: https://claude.ai/code/session_01BxsKd45qytTbangMqJs93F * resolver: every worker test reads the name's reservation from the policy, so its answer stays in setUp Claude-Session: https://claude.ai/code/session_01BxsKd45qytTbangMqJs93F * resolver: address review: docstrings that say where reservations are read from, no comment that does not hold Claude-Session: https://claude.ai/code/session_01BxsKd45qytTbangMqJs93F * resolver: address review: each reservation read picks the policy over the controller itself, no helper for two sites Claude-Session: https://claude.ai/code/session_01BxsKd45qytTbangMqJs93F * resolver: address review: the quick start's restart for a TLD with a name policy, the startup read's docstring Claude-Session: https://claude.ai/code/session_01BxsKd45qytTbangMqJs93F --------- Co-authored-by: brenzi-agent <346870783+brenzi-agent@users.noreply.github.com> |
||
|
|
053e83b704 |
resolver: multicall reads, keep-alive, workers and structured logs (#1883)
* resolver: queue up to 128 pending connections * resolver: reuse connections to the node * resolver: read each round in one multicall * resolver: run worker processes, log durations * resolver: keep smp-server connections alive * resolver: test with pytest, lock dependencies * resolver: structured logs and real client addresses * resolver: refuse requests with a body * resolver: harden pool, health and odd answers * resolver: pin images, rotate logs * resolver: stricter body check, redact RPC URL * resolver: ship .env as .env.example * resolver: pass settings from .env * resolver: name the image snrc-resolve:local |
||
|
|
ea43df2349 |
extend SMP protocol to support name availability queries by labelhash (#1863)
* implement resolving 2LD names by labelhash * tiny test addition * simplify language * report expiry and availability correctly * compare block instead of wall clock * simplify language * simplify language * map resolver 410 to NAME NOT_FOUND (a lapsed name is an answer, not a failure) * split error into a machine-readable code and a human message * resolver: reduce comments * resolver: reduce comments, remove REVIEW.html * extend SMP protocol to support name availability queries with accurate and meaningful replies * review fixes * more review fixes * docs shortening and other review fixes * add catch all for furture variants * adversarial review (against simplex-chat) fix * next iteration fixes * adapt house style * eth_call guard and cache constants * revert NAVL command and wrap it all into RSLV * doc fixes * Update src/Simplex/Messaging/Server/Names.hs Co-authored-by: Evgeny <evgeny@poberezkin.com> * Update src/Simplex/Messaging/Protocol.hs Co-authored-by: Evgeny <evgeny@poberezkin.com> * Update src/Simplex/Messaging/Protocol.hs Co-authored-by: Evgeny <evgeny@poberezkin.com> * Update src/Simplex/Messaging/Protocol.hs Co-authored-by: Evgeny <evgeny@poberezkin.com> * Update src/Simplex/Messaging/Protocol.hs Co-authored-by: Evgeny <evgeny@poberezkin.com> * protocol types refactoring * next iteration on types only * rentPrices map * claude answering ep review. to be continued... * separate labelhash and plaintext names cleanly * align implementation with latest type changes to test against client * fix adversarial review findings * trim diff * align resolver with contract changes for names v2 * fix reverse compatibility with .testing mainnet * fix more robustly * NameQuery simplification * revert drive-by refactoring * implement full type change and introduce resolver endpoint versioning * fix stale docs * derive NameRegistration JSON the same way on every build sumTypeJSON switches to the _owsf form on swift builds, but this JSON is the RNAME payload and the resolver's HTTP contract, so a swift client and a Linux relay would disagree on every field. taggedObjectJSON is what it already resolves to everywhere else. The label modifier keeps the reservedReason_ collision escape out of the API, as AgentWorkersDetails does: both arms now say reservedReason. * fix resolver boundary: status before body, cover /v2, drop dead field httpGet read the response body before checking the status, so an oversized error page surfaced as a transient "response too large" instead of the authoritative status. Reverting it to its previous shape restores that and removes the status test both callers had been re-deriving. registration() had no tests at all, though it is the endpoint SMP v22 consumes. RegistrationV2Tests covers the three answer shapes, the error paths and the exact key set of each, which is the wire contract. auctionUntil was always None with no consumer. The spec claimed a reason word travels unchanged; a resolver can only send a word it has, and SNRC's registry records a number. * fix review findings * resolver errors say what went wrong, not "no such name" /v2/resolve answers 200, 400 or 502, and an unregistered name is NRAvailable, so no status means "not registered". Mapping 400/404/410 to NOT_FOUND made a misconfigured relay deny every name, and hid a relay upgraded ahead of its resolver. All three now surface as RESOLVER. rslvNotFound would have gone dead, so it counts what its name says: an availability answer the encoder downgrades for a session below v22. The wire is unchanged. A hashed query the registrar cannot name is refused with 502 rather than answered with a record named "unknown", which the client rejects anyway. NRRUnknown is capped to 32 printable characters again, as the spec says. A registered name that is also reserved no longer offers a date it will never free up on. rentPrices is registrationPrices throughout, and yearPriceUSD is USDCents rather than a bare Int64. * fix regressions found reviewing the last two commits resolveNameMsg read the version off thParams', which on the PFWD path is the proxy's session, not the client's. It takes the version as an argument now, so each call site passes its own — the forwarded one uses fwdVersion. reservedReasonOf matched the reason words before capping, so "internal review" became NRRUnknown "internal", which encodes back as NRRInternal. Capping precedes the match, so what is kept encodes to what it decoded. Four agent tests still pinned NAME NOT_FOUND from a 404 stub, and two spec statements still described the old mapping. A registrar that does not record labels cannot answer a hashed query, which the resolver README now says. * docs sweep * simplify encoding * drop resolver caching (#1866) * rename * remove trailing_ filter * fix resolver v2 for subnames (#1867) * fix resolver v2 for subnames * simplify doc * resolver should report response truth freshness (#1868) * first shot at reporting freshness * fix review findings * renaming --------- Co-authored-by: sh <github.shum@liber.li> Co-authored-by: Evgeny <evgeny@poberezkin.com> |
||
|
|
2dff11a808 |
resolver: cleanup (#1817)
* resolver: cleanup * resolver: update .testing registry address |