diff options
author | Martin Schanzenbach <schanzen@gnunet.org> | 2022-12-28 12:18:30 +0900 |
---|---|---|
committer | Martin Schanzenbach <schanzen@gnunet.org> | 2022-12-28 12:18:30 +0900 |
commit | 553fd21c5ca5cc437555580de2281698d348cfe9 (patch) | |
tree | 3760c861d678e80ee497e89d3b69046bc536d6f9 | |
parent | de76f481524227f6c81af0428d10b6b866085378 (diff) | |
download | lsd0004-553fd21c5ca5cc437555580de2281698d348cfe9.tar.gz lsd0004-553fd21c5ca5cc437555580de2281698d348cfe9.zip |
More wording on result message caches and processing.
-rw-r--r-- | draft-schanzen-r5n.xml | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/draft-schanzen-r5n.xml b/draft-schanzen-r5n.xml index 54212c4..e7a11a8 100644 --- a/draft-schanzen-r5n.xml +++ b/draft-schanzen-r5n.xml | |||
@@ -1682,14 +1682,13 @@ BEGIN | |||
1682 | </t> | 1682 | </t> |
1683 | <ol> | 1683 | <ol> |
1684 | <li> | 1684 | <li> |
1685 | The <tt>QUERY_HASH</tt> and <tt>XQUERY</tt> fields are validated | 1685 | If the <tt>BTYPE</tt> is supported, the <tt>QUERY_HASH</tt> and <tt>XQUERY</tt> fields are validated |
1686 | against the requested <tt>BTYPE</tt> as defined by its respective | 1686 | as defined by the respective <tt>ValidateBlockQuery</tt> procedure for this type. |
1687 | <tt>ValidateBlockQuery</tt> procedure. | 1687 | If the result yields <tt>REQUEST_INVALID</tt>, the message <bcp14>MUST</bcp14> be discarded and |
1688 | If validation | 1688 | processing ends. |
1689 | function yields <tt>REQUEST_INVALID</tt>, the message <bcp14>MUST</bcp14> be discarded. | ||
1690 | If the <tt>BTYPE</tt> is not supported, the message <bcp14>MUST</bcp14> | 1689 | If the <tt>BTYPE</tt> is not supported, the message <bcp14>MUST</bcp14> |
1691 | be forwarded (Skip to step 4). | 1690 | be forwarded (Skip to step 4). |
1692 | If the <tt>BTYPE</tt> is <tt>ANY</tt>, the message is processed | 1691 | If the <tt>BTYPE</tt> is <tt>ANY</tt>, the message is processed further |
1693 | without validation. | 1692 | without validation. |
1694 | </li> | 1693 | </li> |
1695 | <li> | 1694 | <li> |
@@ -1699,12 +1698,12 @@ BEGIN | |||
1699 | </li> | 1698 | </li> |
1700 | <li> | 1699 | <li> |
1701 | <t> | 1700 | <t> |
1702 | The local peer <bcp14>MUST</bcp14> try to produce a reply in any of the following cases: | 1701 | The local peer <bcp14>SHOULD</bcp14> try to produce a reply in any of the following cases: |
1703 | (1) If the local peer is the closest peer | 1702 | (1) If the local peer is the closest peer |
1704 | (cf. <tt>IsClosestPeer (SELF, QueryHash, PeerFilter)</tt>, or (2) | 1703 | (cf. <tt>IsClosestPeer (SELF, QueryHash, PeerFilter)</tt>, or (2) |
1705 | if the <tt>DemultiplexEverywhere</tt> flag is set, or (3) | 1704 | if the <tt>DemultiplexEverywhere</tt> flag is set, or (3) |
1706 | if the local peer is not the closest and a similar <tt>GetRequest</tt> was answered previously | 1705 | if the local peer is not the closest and a previously |
1707 | with a cached result message this request also matches (<xref target="p2p_result_processing"/>). | 1706 | cached <tt>ResultMessage</tt> also matches this request (<xref target="p2p_result_processing"/>). |
1708 | </t> | 1707 | </t> |
1709 | <t> | 1708 | <t> |
1710 | The reply is produced (if one is available) using the following | 1709 | The reply is produced (if one is available) using the following |
@@ -1712,31 +1711,32 @@ BEGIN | |||
1712 | </t> | 1711 | </t> |
1713 | <ol type="%c)"> | 1712 | <ol type="%c)"> |
1714 | <li> | 1713 | <li> |
1715 | If the <tt>BTYPE</tt> does not indicate a request for a <tt>HELLO</tt> block or | 1714 | If the <tt>BTYPE</tt> is <tt>HELLO</tt>, the implementation <bcp14>MUST</bcp14> only consider |
1715 | synthesizing its own addresses and the addresses it has cached for the peers in its routing table | ||
1716 | as <tt>HELLO</tt> block replies. | ||
1717 | Otherwise, if the <tt>BTYPE</tt> does not indicate a request for a <tt>HELLO</tt> block or | ||
1716 | <tt>ANY</tt>, | 1718 | <tt>ANY</tt>, |
1717 | the implementation <bcp14>MUST</bcp14> only consider blocks in the local block storage | 1719 | the implementation <bcp14>MUST</bcp14> only consider blocks in the local block storage |
1718 | and previously cached <tt>ResultMessage</tt>s. | 1720 | and previously cached <tt>ResultMessage</tt>s. |
1719 | Otherwise, the implementation <bcp14>MUST</bcp14> only consider its own addresses and | ||
1720 | the addresses it has cached for the peers in its routing table. | ||
1721 | </li> | 1721 | </li> |
1722 | <li> | 1722 | <li> |
1723 | If <tt>FLAGS</tt> indicate a <tt>FindApproximate</tt> request, | 1723 | If the <tt>FLAGS</tt> field includes the flag <tt>FindApproximate</tt>, |
1724 | the peer <bcp14>SHOULD</bcp14> try to respond with the closest block (smallest value | 1724 | the peer <bcp14>SHOULD</bcp14> respond with the closest block (smallest value |
1725 | of <tt>GetDistance(QUERY_HASH, BLOCK_KEY)</tt>) it | 1725 | of <tt>GetDistance(QUERY_HASH, BLOCK_KEY)</tt>) it |
1726 | can find that is not filtered by the <tt>RESULT_BF</tt>. | 1726 | can find that is not filtered by the <tt>RESULT_BF</tt>. |
1727 | Otherwise, the peer <bcp14>MUST</bcp14> respond if it has a valid block | 1727 | Otherwise, the peer <bcp14>MUST</bcp14> respond with the block |
1728 | with a <tt>BLOCK_KEY</tt> that matches the <tt>QUERY_HASH</tt> exactly and that is | 1728 | with a <tt>BLOCK_KEY</tt> that matches the <tt>QUERY_HASH</tt> exactly and that is |
1729 | not filtered by the <tt>RESULT_BF</tt>. | 1729 | not filtered by the <tt>RESULT_BF</tt>. |
1730 | </li> | 1730 | </li> |
1731 | <li> | 1731 | <li> |
1732 | Any resulting (synthesized) block <bcp14>MUST</bcp14> be encapsulated in a | 1732 | Any resulting (synthesized) block is encapsulated in a |
1733 | <tt>ResultMessage</tt>. | 1733 | <tt>ResultMessage</tt>. |
1734 | The cached or created <tt>ResultMessage</tt> <bcp14>SHOULD</bcp14> be transmitted to the | 1734 | The <tt>ResultMessage</tt> <bcp14>SHOULD</bcp14> be transmitted to the |
1735 | neighbor from which the request was received. | 1735 | neighbor from which the request was received. |
1736 | </li> | 1736 | </li> |
1737 | </ol> | 1737 | </ol> |
1738 | <t> | 1738 | <t> |
1739 | Implementations <bcp14>MAY</bcp14> not to reply if they are resource-constrained. | 1739 | Implementations <bcp14>MAY</bcp14> not reply if they are resource-constrained. |
1740 | However, <tt>ResultMessage</tt>s <bcp14>MUST</bcp14> be given the | 1740 | However, <tt>ResultMessage</tt>s <bcp14>MUST</bcp14> be given the |
1741 | highest priority among competing transmissions. | 1741 | highest priority among competing transmissions. |
1742 | </t> | 1742 | </t> |