7a05eeeb60
This deprecates the Metadata protobuf map and starts serializing metadata as an array that is always sorted by the metadata key. This should resolve the issue that an state export file can be imported resulting in two different CRDT dags because the binary representation of the pin can arbitrarily change depending on how the keys in the map are listed, and thus the CID of a delta is impacted. So with this, a state export should result in exactly the same DAG regardless of where it is imported.
40 lines
805 B
Protocol Buffer
40 lines
805 B
Protocol Buffer
syntax = "proto3";
|
|
package api.pb;
|
|
|
|
option go_package=".;pb";
|
|
|
|
message Pin {
|
|
enum PinType {
|
|
BadType = 0; // 1 << iota
|
|
DataType = 1; // 2 << iota
|
|
MetaType = 2;
|
|
ClusterDAGType = 3;
|
|
ShardType = 4;
|
|
}
|
|
|
|
bytes Cid = 1;
|
|
PinType Type = 2;
|
|
repeated bytes Allocations = 3;
|
|
sint32 MaxDepth = 4;
|
|
bytes Reference = 5;
|
|
PinOptions Options = 6;
|
|
uint64 Timestamp = 7;
|
|
}
|
|
|
|
message PinOptions {
|
|
sint32 ReplicationFactorMin = 1;
|
|
sint32 ReplicationFactorMax = 2;
|
|
string Name = 3;
|
|
uint64 ShardSize = 4;
|
|
reserved 5; // reserved for UserAllocations
|
|
map<string, string> Metadata = 6 [deprecated = true];
|
|
bytes PinUpdate = 7;
|
|
uint64 ExpireAt = 8;
|
|
repeated bytes Origins = 9;
|
|
repeated Metadata SortedMetadata = 10;
|
|
}
|
|
|
|
message Metadata {
|
|
string Key = 1;
|
|
string Value = 2;
|
|
} |