Skip to content

Commit 4145d0d

Browse files
authored
publish 1GiB and 16MiB sector sizes (#880)
* feat(sectorsizes): add 1GiB sector size * feat(sectorsizes): add 16MiB sector size * feat(publish): update parameter set
1 parent f73147f commit 4145d0d

File tree

5 files changed

+71
-20
lines changed

5 files changed

+71
-20
lines changed

filecoin-proofs/parameters.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,24 @@
11
{
2+
"v12-proof-of-spacetime-rational-535d1050e3adca2a0dfe6c3c0c4fa12097c9a7835fb969042f82a507b13310e0.params": {
3+
"cid": "QmZ6Y88jRbRjjYQzhh8o85bcUeChj7NGyo9yK6VbywhJ9F",
4+
"digest": "3d245479d9b5fc668d58c493da5f3ee1",
5+
"sector_size": 16777216
6+
},
7+
"v12-proof-of-spacetime-rational-535d1050e3adca2a0dfe6c3c0c4fa12097c9a7835fb969042f82a507b13310e0.vk": {
8+
"cid": "QmbGgBLMTCnRc1E1fsUCPyZE4SYzrtAYEWCqCtL55AgxE2",
9+
"digest": "29bd4c152096f878f41257b433159d81",
10+
"sector_size": 16777216
11+
},
12+
"v12-proof-of-spacetime-rational-b99f15d0bdaaf4ffb68b2ca72b69ea8d915f66a2a56f667430ad69d87aa5febd.params": {
13+
"cid": "Qmdm8vhWeRsZUUaHdysDr91gv6u6RFeC18hHxGnnzPrwcW",
14+
"digest": "c67fd415a65e6d1caf4278597cf3462e",
15+
"sector_size": 1073741824
16+
},
17+
"v12-proof-of-spacetime-rational-b99f15d0bdaaf4ffb68b2ca72b69ea8d915f66a2a56f667430ad69d87aa5febd.vk": {
18+
"cid": "Qmc3xssw1syaZDZKmiM7TbCRnoDPfmD6V8ec1eTESidJQS",
19+
"digest": "870355c10000010b9a4ece80892acca2",
20+
"sector_size": 1073741824
21+
},
222
"v12-proof-of-spacetime-rational-ba14a058a9dea194f68596f8ecf6537074f038a15c8d1a8550e10e31d4728912.params": {
323
"cid": "QmZBvF2F9wTYKLBxWSCQKe34D3M7vkNNc7ou8mxnNhZkZc",
424
"digest": "5d854e0ecfbd12cb7fa1247a6e6a0315",
@@ -19,6 +39,16 @@
1939
"digest": "c83eca165ba94233861227578d658a22",
2040
"sector_size": 268435456
2141
},
42+
"v12-zigzag-proof-of-replication-0ed875801b4a99e4a6b46e58703e6857277ce020510fc9080041f6cfd5e0d286.params": {
43+
"cid": "QmTkeyz3mfec4MqCbbiwuVWAQicY231zpdxSjdxN5U84PD",
44+
"digest": "cf7118ac2273e2ccb6b451a5acd5f6e0",
45+
"sector_size": 1073741824
46+
},
47+
"v12-zigzag-proof-of-replication-0ed875801b4a99e4a6b46e58703e6857277ce020510fc9080041f6cfd5e0d286.vk": {
48+
"cid": "QmaGzJCwJNpQAD63QAKb8y4MKS1AMHeKyYzg3C5WyRSRRM",
49+
"digest": "288c792f4fe09c85f8f35673fb9d5ed0",
50+
"sector_size": 1073741824
51+
},
2252
"v12-zigzag-proof-of-replication-5efcf852a15bd74808bc65d6f2df146de817baea96c96e3b752e6a3349957644.params": {
2353
"cid": "QmNSuxq15JPFCTehxVpgJydNZ79rpLoNwnLzQMGA9EziXg",
2454
"digest": "818cd9cc2e0e47210a05bd073847ab5a",
@@ -29,6 +59,16 @@
2959
"digest": "a6636e2ee1a176161e022296bc045e79",
3060
"sector_size": 268435456
3161
},
62+
"v12-zigzag-proof-of-replication-6496c180c2eab89ee0638bc73879ced01daf512486eb38b9e1c9402ba578e010.params": {
63+
"cid": "QmUBpwbVwu5uzjTS8n1yesJ2QUaVbWJ8D9p2VaSsfjgAUr",
64+
"digest": "e7aa73a1b06290d30f567bfac8324bf1",
65+
"sector_size": 16777216
66+
},
67+
"v12-zigzag-proof-of-replication-6496c180c2eab89ee0638bc73879ced01daf512486eb38b9e1c9402ba578e010.vk": {
68+
"cid": "Qme2uK8sQJUT3DzF291p2b91eFQzn7cKSJFiKVBsvrjTgt",
69+
"digest": "d318cd116803c8ccbd3ac4cded9400ad",
70+
"sector_size": 16777216
71+
},
3272
"v12-zigzag-proof-of-replication-a09b5cf44f640589b1b02cf823fa28269850342bcefa4878189b9b5c9ec4d2bb.params": {
3373
"cid": "QmTfhTnkFvbpFfw8UydFdnPCDfxgAxEcw4fRdGsELpcFnh",
3474
"digest": "906b6c0c9dc5bb581d9641c11b54e197",

filecoin-proofs/src/api/mod.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ fn pad_safe_fr(unpadded: &FrSafe) -> Fr32Ary {
456456
mod tests {
457457
use std::collections::BTreeMap;
458458

459-
use crate::constants::TEST_SECTOR_SIZE;
459+
use crate::constants::SECTOR_SIZE_ONE_KIB;
460460
use crate::error::ExpectWithBacktrace;
461461
use crate::types::{PoStConfig, SectorSize};
462462

@@ -588,7 +588,7 @@ mod tests {
588588

589589
{
590590
let result = verify_seal(
591-
PoRepConfig(SectorSize(TEST_SECTOR_SIZE), PoRepProofPartitions(2)),
591+
PoRepConfig(SectorSize(SECTOR_SIZE_ONE_KIB), PoRepProofPartitions(2)),
592592
not_convertible_to_fr_bytes,
593593
convertible_to_fr_bytes,
594594
convertible_to_fr_bytes,
@@ -612,7 +612,7 @@ mod tests {
612612

613613
{
614614
let result = verify_seal(
615-
PoRepConfig(SectorSize(TEST_SECTOR_SIZE), PoRepProofPartitions(2)),
615+
PoRepConfig(SectorSize(SECTOR_SIZE_ONE_KIB), PoRepProofPartitions(2)),
616616
convertible_to_fr_bytes,
617617
not_convertible_to_fr_bytes,
618618
convertible_to_fr_bytes,
@@ -636,7 +636,7 @@ mod tests {
636636

637637
{
638638
let result = verify_seal(
639-
PoRepConfig(SectorSize(TEST_SECTOR_SIZE), PoRepProofPartitions(2)),
639+
PoRepConfig(SectorSize(SECTOR_SIZE_ONE_KIB), PoRepProofPartitions(2)),
640640
convertible_to_fr_bytes,
641641
convertible_to_fr_bytes,
642642
not_convertible_to_fr_bytes,
@@ -671,7 +671,7 @@ mod tests {
671671
);
672672

673673
let result = verify_post(
674-
PoStConfig(SectorSize(TEST_SECTOR_SIZE)),
674+
PoStConfig(SectorSize(SECTOR_SIZE_ONE_KIB)),
675675
&[0; 32],
676676
&vec![0; SINGLE_PARTITION_PROOF_LEN],
677677
&replicas,
@@ -693,7 +693,7 @@ mod tests {
693693
#[test]
694694
#[ignore]
695695
fn test_pip_lifecycle() -> Result<(), failure::Error> {
696-
let sector_size = TEST_SECTOR_SIZE;
696+
let sector_size = SECTOR_SIZE_ONE_KIB;
697697

698698
let number_of_bytes_in_piece =
699699
UnpaddedBytesAmount::from(PaddedBytesAmount(sector_size.clone()));

filecoin-proofs/src/bin/paramcache.rs

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,13 @@ use storage_proofs::rational_post::RationalPoSt;
1717

1818
const POREP_PROOF_PARTITION_CHOICES: [PoRepProofPartitions; 1] = [PoRepProofPartitions(2)];
1919

20+
const PUBLISHED_SECTOR_SIZES: [u64; 4] = [
21+
SECTOR_SIZE_ONE_KIB,
22+
SECTOR_SIZE_16_MIB,
23+
SECTOR_SIZE_256_MIB,
24+
SECTOR_SIZE_1_GIB,
25+
];
26+
2027
fn cache_porep_params(porep_config: PoRepConfig) {
2128
let n = u64::from(PaddedBytesAmount::from(porep_config));
2229
info!(
@@ -111,17 +118,19 @@ pub fn main() {
111118

112119
let test_only: bool = matches.is_present("test-only");
113120

114-
cache_porep_params(PoRepConfig(
115-
SectorSize(TEST_SECTOR_SIZE),
116-
PoRepProofPartitions(2),
117-
));
118-
cache_post_params(PoStConfig(SectorSize(TEST_SECTOR_SIZE)));
121+
let smallest = vec![SECTOR_SIZE_ONE_KIB];
122+
123+
let sizes: &[u64] = if test_only {
124+
&smallest
125+
} else {
126+
&PUBLISHED_SECTOR_SIZES
127+
};
128+
129+
for size in sizes {
130+
cache_post_params(PoStConfig(SectorSize(*size)));
119131

120-
if !test_only {
121132
for p in &POREP_PROOF_PARTITION_CHOICES {
122-
cache_porep_params(PoRepConfig(SectorSize(LIVE_SECTOR_SIZE), *p));
133+
cache_porep_params(PoRepConfig(SectorSize(*size), *p));
123134
}
124-
125-
cache_post_params(PoStConfig(SectorSize(LIVE_SECTOR_SIZE)));
126135
}
127136
}

filecoin-proofs/src/bin/paramgen.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ pub fn main() {
1818
let out_file = &args[1];
1919

2020
let public_params = public_params(
21-
PaddedBytesAmount::from(SectorSize(TEST_SECTOR_SIZE)),
21+
PaddedBytesAmount::from(SectorSize(SECTOR_SIZE_ONE_KIB)),
2222
usize::from(PoRepProofPartitions(2)),
2323
);
2424

filecoin-proofs/src/constants.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@ use storage_proofs::util::NODE_SIZE;
33
pub const POREP_MINIMUM_CHALLENGES: usize = 12; // FIXME: 8,000
44
pub const SINGLE_PARTITION_PROOF_LEN: usize = 192;
55

6-
// Sector size, in bytes, for tests.
7-
pub const TEST_SECTOR_SIZE: u64 = 1024;
6+
pub const SECTOR_SIZE_ONE_KIB: u64 = 1024;
87

9-
// Sector size, in bytes, during live operation.
10-
pub const LIVE_SECTOR_SIZE: u64 = 1 << 28; // 256MiB
8+
pub const SECTOR_SIZE_16_MIB: u64 = 1 << 24;
9+
10+
pub const SECTOR_SIZE_256_MIB: u64 = 1 << 28;
11+
12+
pub const SECTOR_SIZE_1_GIB: u64 = 1 << 30;
1113

1214
pub const MINIMUM_RESERVED_LEAVES_FOR_PIECE_IN_SECTOR: usize = 4;
1315

0 commit comments

Comments
 (0)