You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is an attempt to build upon #1169 with the key differences being:
1. SnapshotMetadata contains a version rather than F3SnapshotHeader.
2. F3Data is a cbor-encoded structure.
Copy file name to clipboardExpand all lines: FRCs/frc-f3-augmented-snapshot.md
+24-19Lines changed: 24 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,42 +33,45 @@ The time cost and the network bandwidth usage for a new Filecoin node to catch u
33
33
We propose the blow changes to the Filecoin CAR snapshot format.
34
34
35
35
- Change CAR roots to be a CID that points to a CBOR-encoded [`SnapshotMetadata`](#snapshotmetadata) struct that is stored as the first data block in the CAR.
36
-
- Store the raw [`F3Snapshot`](#f3snapshot) bytes as the second data block in the CAR when `F3Data != nil` in the metadata.
36
+
- Store the [`F3Data`](#f3data) structure as the second data block in the CAR when `F3Data != nil` in the metadata.
37
37
38
38
### SnapshotMetadata
39
39
40
40
```go
41
41
typeSnapshotMetadata {
42
-
HeadTipsetKey []Cid// required
43
-
F3Data *Cid // optional
42
+
Versionuint64// required, format version for SnapshotMetadata
43
+
// Only "2" is supported since "v1" was implied in the original format that predates `SnapshotMetadata`.
44
+
HeadTipsetKey []Cid// required
45
+
F3Data *Cid // optional, points to F3Data structure.
46
+
// The only supported codec is "CBOR" (0x51).
44
47
}
45
48
```
46
49
47
-
### F3Snapshot
50
+
### F3Data
48
51
49
-
An F3 snapshot contains one header block and N(N>0) data blocks in the below format:
52
+
F3Data is a CBOR-encoded structure that contains the complete F3 snapshot data:
@@ -92,9 +95,11 @@ type FinalityCertificate struct {
92
95
}
93
96
```
94
97
95
-
Notes:
96
-
-`FinalityCertificate`s should be ordered by `GPBFTInstance` in ascending order, thus they can be validated and intermediate power tables can be generated while data blocks are being read in a stream.
97
-
- The first and last `FinalityCertificate` instances should match those in the header, respectively.
98
+
### Ability to upgrade
99
+
100
+
1.**SnapshotMetadata.Version**: Controls the overall snapshot format and structure. Any changes/additions to the underlying structures (e.g., F3Data) (including encoding changes) should include an accompanying version bump.
101
+
2.**CID codec**: This will also change in encoding changes.
102
+
98
103
99
104
## Backwards Compatibility
100
105
<!--All FIPs that introduce backwards incompatibilities must include a section describing these incompatibilities and their severity. The FIP must explain how the author proposes to deal with these incompatibilities. FIP submissions without a sufficient backwards compatibility treatise may be rejected outright.-->
@@ -112,7 +117,7 @@ Notes:
112
117
This change has minimal security implications as the additional F3 data are also stored in the node database, unencrypted. Key considerations:
113
118
114
119
-**Integrity**: The F3 snapshot can be validated.
115
-
-**Performance** The F3 snapshot data blocks can be read, validated and imported in a stream.
120
+
-**Performance**: The F3Data structure can be validated efficiently as a single CBOR block.
116
121
117
122
The change does not introduce new attack vectors or modify existing security properties of the protocol.
0 commit comments