From d078ae3d2c2c692289037200656592a040da3123 Mon Sep 17 00:00:00 2001
From: zzz <zzz@i2pmail.org>
Date: Sun, 19 Jan 2025 09:14:27 -0500
Subject: [PATCH] prop. 167 notes on caching, sorting options

---
 i2p2www/spec/common-structures.rst             | 4 +++-
 i2p2www/spec/proposals/167-service-records.rst | 9 ++++++---
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/i2p2www/spec/common-structures.rst b/i2p2www/spec/common-structures.rst
index 078e38fd..ed6a6896 100644
--- a/i2p2www/spec/common-structures.rst
+++ b/i2p2www/spec/common-structures.rst
@@ -551,7 +551,7 @@ Notes
 * The encoding allows duplicate keys, however in any usage where the mapping is
   signed, duplicates may cause a signature failure.
 
-* Mappings contained in I2NP messages (i.e. in a RouterAddress or RouterInfo)
+* Mappings contained in I2NP messages (e.g. in a RouterAddress or RouterInfo)
   must be sorted by key so that the signature will be invariant. Duplicate keys
   are not allowed.
 
@@ -1278,6 +1278,8 @@ Notes
 
 * See note on the 'published' field in LeaseSet2Header_
 
+* The options mapping, if the size is greater than one, must be sorted by key, so the signature is invariant.
+
 
 JavaDoc: http://{{ i2pconv('idk.i2p/javadoc-i2p') }}/net/i2p/data/LeaseSet2.html
 
diff --git a/i2p2www/spec/proposals/167-service-records.rst b/i2p2www/spec/proposals/167-service-records.rst
index 328d7f80..a62d5a59 100644
--- a/i2p2www/spec/proposals/167-service-records.rst
+++ b/i2p2www/spec/proposals/167-service-records.rst
@@ -5,7 +5,7 @@ Service Records in LS2
     :author: zzz
     :created: 2024-06-22
     :thread: http://zzz.i2p/topics/3641
-    :lastupdated: 2025-01-18
+    :lastupdated: 2025-01-19
     :status: Open
     :target: 0.9.66
 
@@ -108,6 +108,8 @@ Specification
 LS2 Option Specification
 ---------------------------
 
+LS2 options MUST be sorted by key.
+
 Defined as follows:
 
 - serviceoption := optionkey optionvalue
@@ -209,8 +211,9 @@ Extend HostReplyMessage with additional error codes.
 Configuration is implementation-dependent. We may define standard I2CP options
 for i2ptunnel and SAM, to be documented in [I2CP-OPTIONS]_.
 
-Options mappings may be cached for a short time on either the client or router side,
-implementation-dependent. Recommended maximum time is one hour.
+Options mappings may be cached or negative cached for a short time on either the client or router side,
+implementation-dependent. Recommended maximum time is one hour, unless the service record TTL is shorter.
+Service records may be cached up to the TTL specified by the application, client, or router.
 
 
 Extend the specification as follows:
-- 
GitLab