Repository navigation
resolver: read .simplex reservations from the name policy - #1993
Conversation
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
…licy in tests, describe contracts by behavior Claude-Session: https://claude.ai/code/session_01BxsKd45qytTbangMqJs93F
…s reservations, one policy test that fails without the read, note setNamePolicy Claude-Session: https://claude.ai/code/session_01BxsKd45qytTbangMqJs93F
…re, no comment repeating the docstring Claude-Session: https://claude.ai/code/session_01BxsKd45qytTbangMqJs93F
…NRC_NAME_POLICY_<TLD> Claude-Session: https://claude.ai/code/session_01BxsKd45qytTbangMqJs93F
…s of the startup read, test names and docstrings that say what holds Claude-Session: https://claude.ai/code/session_01BxsKd45qytTbangMqJs93F
…ead, so the container restarts until the node reaches it Claude-Session: https://claude.ai/code/session_01BxsKd45qytTbangMqJs93F
…, 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
…ddress without a contract and an unconfigured controller; docs of which TLDs answer 502 Claude-Session: https://claude.ai/code/session_01BxsKd45qytTbangMqJs93F
…the other fallbacks are, a test of the startup exit, no redundant default Claude-Session: https://claude.ai/code/session_01BxsKd45qytTbangMqJs93F
…nux guard, without a controller it does not need Claude-Session: https://claude.ai/code/session_01BxsKd45qytTbangMqJs93F
… an unconfigured controller, the fallbacks described once Claude-Session: https://claude.ai/code/session_01BxsKd45qytTbangMqJs93F
…has not reached, the worker test sets its own reservation, no repeated README clauses Claude-Session: https://claude.ai/code/session_01BxsKd45qytTbangMqJs93F
…icy, so its answer stays in setUp Claude-Session: https://claude.ai/code/session_01BxsKd45qytTbangMqJs93F
…read from, no comment that does not hold Claude-Session: https://claude.ai/code/session_01BxsKd45qytTbangMqJs93F
… the controller itself, no helper for two sites Claude-Session: https://claude.ai/code/session_01BxsKd45qytTbangMqJs93F
…name policy, the startup read's docstring Claude-Session: https://claude.ai/code/session_01BxsKd45qytTbangMqJs93F
|
test instance results:
|
simplex-network/ens-contracts#42 moved reservations out of
SimplexControllerinto a newSimplexNamePolicy. ItsreservedNames(bytes32)returns the sameReason, and the controller no longer has it. The resolver asks the controller, so on a.simplexdeployment of the currentsimplexcontracts that read reverts and every lookup answers 502upstreamError.At startup, before its workers start, the resolver now reads each configured controller's
namePolicy(), and then readsreservedNamesfrom the policy it names, in the same round as before..testing's controller is from before name policies: the read reverts, and the controller keeps the reservations. A read that reverts, answers nothing, names no policy or fails with an RPC error is logged asno_name_policy, and reservations are read from the controller, so for a controller that has a name policy every lookup under its TLD answers 502 until a restart (for example, when the node had not yet synced to itssetNamePolicy). A node that does not answer stops the resolver (startup_failed), and the container restarts.listeninglogs each TLD's name policy. After the controller's owner callssetNamePolicy, the resolver must be restarted. No new setting.Everything else the resolver reads is unchanged:
nameExpires,GRACE_PERIODandlabelOfon the registrar,pricesandminCharLengthon the controller, the oracle'sprices, the registry, and the name's resolver.Tested
python -m unittest test_snrc_resolve(153 passed) andruff check. New tests cover the startup read (a policy, an old controller, no policy, no contract, an unconfigured controller, a node that does not answer), the exit at startup, workers that open their own RPC connections after the read, and reservations read from a policy in the same rounds as before..simplexdeployment on anvil of ens-contractssimplexwith SimplexNamePolicy: keep the community terms' text on chain simplex-network/ens-contracts#45, made by webapp: read reservations from the name policy and accept every name's terms on chain simplex.domains#7'sdev/deploy.ts.listeningnames the policy for.simplex.support.simplexanswersreserved(internal), and so does its hashed query.bakery.simplexanswersregisteredwith its record, and a free name answersavailablewith its price..testingthrough a public RPC:namePolicy()reverts and is logged asno_name_policy.foobar.testinganswersregistered, andsimplex.testinganswersreserved(internal).Not covered: bona fide community names (simplex-network/ens-contracts#40) need the buyer to accept terms before registering. The name response has no field for that, so they answer
availableas before.https://claude.ai/code/session_01BxsKd45qytTbangMqJs93F