* 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>
* add REST API to resolve SNRC
* fix unset fields
* support multi-TLD deployments
* update for mainnet tests
* haskell-friendly fieldnames
* add subname hint
* resolver: dockerize
* support multiple fallback links for splx contact and channels
* add test
* change url separator to semicolon
---------
Co-authored-by: sh <github.shum@liber.li>
* docker entrypoint: DRY store log backup
Don't Repeat Yourself
Set a variable for the full path to the source file.
Create the backup path by appending an extension from `date` output.
Also fixed quoting and switched to an `if` block.
Clean up block level variables.
* docker entrypoint: use ISO 8601 format
The previous format discards information about the local time zone.
* docker entrypoint: always use UTC
Now the format always ends in +00:00, and we can ignore that part again.
* docker entrypoint: provide the date format again
* docker entrypoint: remove time zone from the date format
* docker entrypoint: use an unambiguous date format
Present a leading zero before the month:
YYYY-0MM-DD
Both YYYY-MM-DD and YYYY-DD-MM are used by people and can be confusing in the beginning of the month.
* docker entrypoint: use appropriate quoting
Without avoiding field splitting a password containing a space changes the number of arguments being set.
* docker entrypoint: use explicit braces for custom variables
Make the intentions clear and don't assume the user knows the special cases for when variables won't be extended.
Example:
word=animal
words=mistake
echo "$words vs $word vs ${word}s"
* docker entrypoint-xftp-server: braces and quoting
* docker entrypoint-xftp-server: backup block
* docker entrypoints: explain date format in a comment
* switched from long to short option to date for POSIX
* docker entrypoint-smp-server: explain date format
* docker entrypoint-xftp-server: explain date format
* docker entrypoints: further explain format
I fixed the case to match the date format letters.
Also, use words to explain since I don't want everyone to need to read about date formats to understand.
* docker entrypoints: only quote letters
I was either going to quote the dashes too or stop quoting the colons.
Having less quotes was more readable.
* Revert "docker entrypoint: use an unambiguous date format"
This reverts commit ba2a93bad9.
* docker entrypoints: remove %F
* docker entrypoint-smp-server: remove %F
Used part of the explicit ISO 8601 format,
provided by the coreutils date invocation guide.
* docker entrypoint-xftp-server: remove %F
Used part of the explicit ISO 8601 format,
provided by the coreutils date invocation guide.
* save and restore messages when server is restarted
* read file line by line
* add import
* optmize restoring messages by reading the whole file
* update version to 2.3.0
* update scripts
* add script
* update readme