aboutsummaryrefslogtreecommitdiffstats
path: root/papers
diff options
context:
space:
mode:
authorMax Ogden <max@maxogden.com>2017-04-29 21:45:36 -0700
committerMax Ogden <max@maxogden.com>2017-04-29 21:45:36 -0700
commitcb5ceb18071d31caf76255f1a026a7d6817038eb (patch)
tree1b250b78ff0835a0cfce45cb5c2d0fb4f4a53e93 /papers
parent9bf2a15139c1d0c34bf5039a5fb81e2a0f67f357 (diff)
downloaddat-docs-cb5ceb18071d31caf76255f1a026a7d6817038eb.tar.gz
dat-docs-cb5ceb18071d31caf76255f1a026a7d6817038eb.zip
typesetting
Diffstat (limited to 'papers')
-rw-r--r--papers/dat-paper.md23
-rw-r--r--papers/dat-paper.pdfbin253750 -> 274419 bytes
2 files changed, 14 insertions, 9 deletions
diff --git a/papers/dat-paper.md b/papers/dat-paper.md
index 33bef3e..132218a 100644
--- a/papers/dat-paper.md
+++ b/papers/dat-paper.md
@@ -518,7 +518,7 @@ The Index itself is an in-order binary tree, not a traditional bitfield. To gene
```
// for e.g. 16 bytes (8 tuples) of
-// sparsely replicated data (some 1's, some 0's)
+// sparsely replicated data
0 - [00 00 00 00]
1 - [10 10 10 10]
2 - [11 11 11 11]
@@ -748,7 +748,7 @@ Type 3. How you tell the other peer what blocks of data you have or don't have.
```
message Have {
required uint64 start = 1;
- optional uint64 length = 2 [default = 1]; // defaults to 1
+ optional uint64 length = 2 [default = 1];
optional bytes bitfield = 3;
}
```
@@ -758,13 +758,18 @@ When sending bitfields you must run length encode them. The encoded bitfield is
If the last bit is set in the varint (it is an odd number) then a header represents a compressed bit sequence.
```
-compressed-sequence = varint(byte-length-of-sequence << 2 | bit << 1 | 1)
+compressed-sequence = varint(
+ byte-length-of-sequence
+ << 2 | bit << 1 | 1
+)
```
If the last bit is *not* set then a header represents an non compressed sequence
```
-uncompressed-sequence = varint(byte-length-of-bitfield << 1 | 0) + (bitfield)
+uncompressed-sequence = varint(
+ byte-length-of-bitfield << 1 | 0
+) + (bitfield)
```
##### Unhave
@@ -775,29 +780,29 @@ Type 4. How you communicate that you deleted or removed a block you used to have
```
message Unhave {
required uint64 start = 1;
- optional uint64 length = 2 [default = 1]; // defaults to 1
+ optional uint64 length = 2 [default = 1];
}
```
##### Want
-Type 5. How you ask the other peer to subscribe you to Have messages for a region of blocks
+Type 5. How you ask the other peer to subscribe you to Have messages for a region of blocks. The `length` value defaults to Infinity or feed.length (if not live).
```
message Want {
required uint64 start = 1;
- optional uint64 length = 2; // defaults to Infinity or feed.length (if not live)
+ optional uint64 length = 2;
}
```
##### Unwant
-Type 6. How you ask to unsubscribe from Have messages for a region of blocks from the other peer. You should only Unwant previously Wanted regions, but if you do Unwant something that hasn't been Wanted it won't have any effect.
+Type 6. How you ask to unsubscribe from Have messages for a region of blocks from the other peer. You should only Unwant previously Wanted regions, but if you do Unwant something that hasn't been Wanted it won't have any effect. The `length` value defaults to Infinity or feed.length (if not live).
```
message Unwant {
required uint64 start = 1;
- optional uint64 length = 2; // defaults to Infinity or feed.length (if not live)
+ optional uint64 length = 2;
}
```
diff --git a/papers/dat-paper.pdf b/papers/dat-paper.pdf
index e5276b0..002e301 100644
--- a/papers/dat-paper.pdf
+++ b/papers/dat-paper.pdf
Binary files differ