Compare commits
1798
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fce453a2d1 | ||
|
|
9d813d8385 | ||
|
|
e4f04f198d | ||
|
|
7401fa234e | ||
|
|
7a009abcdd | ||
|
|
b305244405 | ||
|
|
02a0770436 | ||
|
|
196030bee2 | ||
|
|
d49297f898 | ||
|
|
b5ce847579 | ||
|
|
7dc19bb26e | ||
|
|
82343a06e7 | ||
|
|
5f9753933a | ||
|
|
fcaad20ecc | ||
|
|
f1ddb55252 | ||
|
|
69e8516d1f | ||
|
|
d437f19aae | ||
|
|
977e302e0c | ||
|
|
0bfbcfb5e9 | ||
|
|
7c4d3a457c | ||
|
|
25b2e144b8 | ||
|
|
11db419735 | ||
|
|
4e2d7fe1db | ||
|
|
910d3caacf | ||
|
|
a449937682 | ||
|
|
0b3144f566 | ||
|
|
13701c7ce2 | ||
|
|
3f152ae2bf | ||
|
|
a53dc5a7c7 | ||
|
|
da64f241eb | ||
|
|
caeeb6a7d9 | ||
|
|
694c45cd65 | ||
|
|
dbc6b32a4c | ||
|
|
5ba4a78657 | ||
|
|
1609317ac8 | ||
|
|
3a121f99c7 | ||
|
|
56b97e1386 | ||
|
|
3a62c8b4a2 | ||
|
|
1a0fc75325 | ||
|
|
945b93590d | ||
|
|
701d0a111e | ||
|
|
3c1edca902 | ||
|
|
92e4caa151 | ||
|
|
e767981aaf | ||
|
|
0536eb898d | ||
|
|
433e9c351d | ||
|
|
49a6d7ebcc | ||
|
|
4c25358a08 | ||
|
|
ecd1ab4b42 | ||
|
|
97a73f1c29 | ||
|
|
d118ef9202 | ||
|
|
3cd17f0ee4 | ||
|
|
fc34d9ba1c | ||
|
|
1eb101d70e | ||
|
|
7fea2e4d6c | ||
|
|
cca69a6c16 | ||
|
|
0ed8647b6f | ||
|
|
58843857e5 | ||
|
|
efdcd00da4 | ||
|
|
fee69a889b | ||
|
|
4af8b8ecf3 | ||
|
|
9a31b65cd0 | ||
|
|
5365ccfdb1 | ||
|
|
36f1dd7bb3 | ||
|
|
7b81369c8c | ||
|
|
7a1beacd00 | ||
|
|
32818c528f | ||
|
|
0d6493ec3f | ||
|
|
8715745feb | ||
|
|
aa124cf414 | ||
|
|
a94e47c6be | ||
|
|
6ddbe41376 | ||
|
|
42b2adddee | ||
|
|
18987f92ee | ||
|
|
b26405226e | ||
|
|
e1c7f30e60 | ||
|
|
b366e2c91f | ||
|
|
eb4bda2302 | ||
|
|
d9a1ecd387 | ||
|
|
9debd14b6c | ||
|
|
ff14cd3f9d | ||
|
|
e0481bbeca | ||
|
|
73ab064137 | ||
|
|
2cf0e4cb32 | ||
|
|
7123b29f06 | ||
|
|
037e80c70c | ||
|
|
1c055fe83b | ||
|
|
858538284f | ||
|
|
97c95a4e82 | ||
|
|
a3bdd29615 | ||
|
|
a431fdbdde | ||
|
|
60ba133fc8 | ||
|
|
90d78f924f | ||
|
|
3b2a1ea41d | ||
|
|
2961f3b864 | ||
|
|
3f23cf0c1e | ||
|
|
aac1f5abef | ||
|
|
724d80cf02 | ||
|
|
e7ee5b5932 | ||
|
|
4d4739497d | ||
|
|
4ded059a1c | ||
|
|
799d3ebe5e | ||
|
|
628102ab6c | ||
|
|
f2c0ba1df5 | ||
|
|
79453663b3 | ||
|
|
8600ae2ac4 | ||
|
|
193c84811a | ||
|
|
aef2ec513f | ||
|
|
37539ccb84 | ||
|
|
16128a0212 | ||
|
|
159da73fcd | ||
|
|
9f6f94bd02 | ||
|
|
c4259cb594 | ||
|
|
5ed5744cb6 | ||
|
|
a88edeb79d | ||
|
|
4d65e0101d | ||
|
|
45b07674e5 | ||
|
|
4906962da0 | ||
|
|
3ad1ea386c | ||
|
|
9ea623e125 | ||
|
|
e6117c49ef | ||
|
|
673f558ba5 | ||
|
|
56b80c41b6 | ||
|
|
c98ef0aaf8 | ||
|
|
2170b4deb5 | ||
|
|
913cab2785 | ||
|
|
6c51adc334 | ||
|
|
c6bda0e5d4 | ||
|
|
c3cadcba0e | ||
|
|
9fcafff847 | ||
|
|
53c525f0ed | ||
|
|
8a2a2d065d | ||
|
|
c229842f57 | ||
|
|
9a1a89d98c | ||
|
|
1bf40ad9df | ||
|
|
67889b473c | ||
|
|
05fa9c81de | ||
|
|
6d4fb8866e | ||
|
|
d2054e8653 | ||
|
|
6401363ef1 | ||
|
|
ce99aad438 | ||
|
|
135aef78d7 | ||
|
|
362c73bfbd | ||
|
|
ad66ad4f7d | ||
|
|
9fc6242e5b | ||
|
|
0ac1bbc7ae | ||
|
|
61a1a172fa | ||
|
|
3c96dcaec7 | ||
|
|
98642ec4b5 | ||
|
|
81f0cfdd1e | ||
|
|
b248097b42 | ||
|
|
9ce6a15edc | ||
|
|
55189fbe53 | ||
|
|
0d9e34d651 | ||
|
|
e1ac3f641b | ||
|
|
231893a794 | ||
|
|
65e599fb8e | ||
|
|
4421bf2fa1 | ||
|
|
91ccb7fbda | ||
|
|
9c4f8254ee | ||
|
|
326a9b673e | ||
|
|
b6278d2a6c | ||
|
|
1daaba9224 | ||
|
|
3ecc58d036 | ||
|
|
a715fb3063 | ||
|
|
49742f8fdc | ||
|
|
046a9f8af0 | ||
|
|
ffabb015ef | ||
|
|
84dbb229b6 | ||
|
|
c192637741 | ||
|
|
61f453fcd3 | ||
|
|
7cdf6dc680 | ||
|
|
b9fe61f9da | ||
|
|
4525395cc5 | ||
|
|
9b838f515b | ||
|
|
5b33555fda | ||
|
|
8d737a1428 | ||
|
|
e51b10e6a5 | ||
|
|
93e22da539 | ||
|
|
8ec7da0dee | ||
|
|
5416ce5443 | ||
|
|
4c8015c0a1 | ||
|
|
5734a39e8e | ||
|
|
62e352ef88 | ||
|
|
e1c2cf446e | ||
|
|
c5dc898ed0 | ||
|
|
acbfc879aa | ||
|
|
066d0edf51 | ||
|
|
949ec65118 | ||
|
|
f1f878a000 | ||
|
|
e3edab66e3 | ||
|
|
28d751b2e0 | ||
|
|
7dcfeee0ea | ||
|
|
1bb65189af | ||
|
|
6b06c1b5d3 | ||
|
|
8cf6f24f4d | ||
|
|
b7e1548041 | ||
|
|
2e1bb7e8cc | ||
|
|
1c21690dfe | ||
|
|
7073f31f84 | ||
|
|
5ac1c59527 | ||
|
|
c9799e1369 | ||
|
|
91d773451b | ||
|
|
ebe1ca7c77 | ||
|
|
1bc1cd3366 | ||
|
|
898f523162 | ||
|
|
08bbfed825 | ||
|
|
04f2d3543b | ||
|
|
85886287b4 | ||
|
|
b5912d1543 | ||
|
|
e9e28f75e2 | ||
|
|
b8747e3afc | ||
|
|
bac17061d4 | ||
|
|
99e1b9e2aa | ||
|
|
11fc068cfe | ||
|
|
f9f6f35b93 | ||
|
|
f281027a1c | ||
|
|
e49d499bb5 | ||
|
|
581cb34b11 | ||
|
|
4968babb32 | ||
|
|
ce040b7d33 | ||
|
|
a7e02f7207 | ||
|
|
bf0470ad09 | ||
|
|
7dbf0ced82 | ||
|
|
48e28898a6 | ||
|
|
17ac583508 | ||
|
|
6dc696b745 | ||
|
|
2aab4d4f05 | ||
|
|
94678bacea | ||
|
|
7207740af4 | ||
|
|
5329f18938 | ||
|
|
b81d189ec1 | ||
|
|
a52b4b72e9 | ||
|
|
14b76743c6 | ||
|
|
874124c4e7 | ||
|
|
0a67b6e222 | ||
|
|
6d464c478e | ||
|
|
eb83001bbc | ||
|
|
aacc246ba3 | ||
|
|
444a2bf355 | ||
|
|
b8473aeedd | ||
|
|
91ae72d47a | ||
|
|
74e6260fbd | ||
|
|
a6892f956e | ||
|
|
c018dac13a | ||
|
|
e9a6f5f287 | ||
|
|
a74c466b50 | ||
|
|
97cda51fcf | ||
|
|
963caf2e9d | ||
|
|
769b0f30ef | ||
|
|
e0922a7dd2 | ||
|
|
9c22065459 | ||
|
|
8091e7086e | ||
|
|
00e52296ce | ||
|
|
59ef2fe1b8 | ||
|
|
714ce54135 | ||
|
|
a463c90057 | ||
|
|
f138ae8882 | ||
|
|
bc5be0c30e | ||
|
|
30ae1dd8e8 | ||
|
|
dd91857bf6 | ||
|
|
4a5b0b87ea | ||
|
|
0708268c75 | ||
|
|
77a954c7c3 | ||
|
|
992a01617a | ||
|
|
c9e2c1b1d7 | ||
|
|
686ada0582 | ||
|
|
6291c0c581 | ||
|
|
f9900ba426 | ||
|
|
296ae4305f | ||
|
|
8a9ea66bdf | ||
|
|
92c07f877b | ||
|
|
6d0066eafa | ||
|
|
a49ec594ca | ||
|
|
40ed266617 | ||
|
|
b8eb4ddb0b | ||
|
|
d495c3cc16 | ||
|
|
a92981c967 | ||
|
|
254f821564 | ||
|
|
c6361b391c | ||
|
|
6347daf847 | ||
|
|
f21ddf0c50 | ||
|
|
865c7e587c | ||
|
|
949a046432 | ||
|
|
69470db596 | ||
|
|
52756128da | ||
|
|
433f9f8a13 | ||
|
|
79562a7175 | ||
|
|
dac5518005 | ||
|
|
a65386b491 | ||
|
|
37b857a0b2 | ||
|
|
5cfe8f315f | ||
|
|
a567a745b2 | ||
|
|
51fc965beb | ||
|
|
ec6b786fbf | ||
|
|
64b13afee5 | ||
|
|
3c366160bb | ||
|
|
be3462eb76 | ||
|
|
6862015929 | ||
|
|
e5de237990 | ||
|
|
d054340f13 | ||
|
|
77bf46d018 | ||
|
|
3621d8675f | ||
|
|
367146f032 | ||
|
|
f9641d70af | ||
|
|
755ce8cb91 | ||
|
|
b8cd154516 | ||
|
|
d711775cdf | ||
|
|
e0382c546d | ||
|
|
4293023731 | ||
|
|
83bf0c5a11 | ||
|
|
2ba34add2a | ||
|
|
d58babe32c | ||
|
|
b6682f4bbe | ||
|
|
9bb936b75c | ||
|
|
c940727cb4 | ||
|
|
fd8cb44e67 | ||
|
|
7c2f653323 | ||
|
|
420c5fb568 | ||
|
|
aad376296e | ||
|
|
ef68fdb261 | ||
|
|
25912e72a1 | ||
|
|
22760f0922 | ||
|
|
abe04c33c1 | ||
|
|
ba65d1e1e3 | ||
|
|
5ece3d4c10 | ||
|
|
b802ddb848 | ||
|
|
c3b406c5c2 | ||
|
|
e9715cae3b | ||
|
|
5a5d1bf9aa | ||
|
|
23147378a3 | ||
|
|
375d9fdfc9 | ||
|
|
e2cbad6ff4 | ||
|
|
a54d2fd19d | ||
|
|
a575947294 | ||
|
|
79ba74ce71 | ||
|
|
0a03ec569a | ||
|
|
cd64eba76c | ||
|
|
de68f1e5fe | ||
|
|
fce9ff237a | ||
|
|
10c939bc36 | ||
|
|
e753e7a66e | ||
|
|
5d416de32e | ||
|
|
f0f2b3e1f4 | ||
|
|
012cf96d60 | ||
|
|
a0cb6094c6 | ||
|
|
a05a462c8c | ||
|
|
8e62fec1d3 | ||
|
|
6123aa2ed4 | ||
|
|
1234fcfd4f | ||
|
|
04bc4405c7 | ||
|
|
7b203eae1b | ||
|
|
76157c5e03 | ||
|
|
ad4acf3baa | ||
|
|
580fa86ea3 | ||
|
|
675012fe1c | ||
|
|
56926b349a | ||
|
|
87c63e2cb7 | ||
|
|
c8cd8bb591 | ||
|
|
c3817652dc | ||
|
|
3fd83e9345 | ||
|
|
c2522e8ca9 | ||
|
|
1245871004 | ||
|
|
26707a5e03 | ||
|
|
214c32d2ef | ||
|
|
051ff5d205 | ||
|
|
31ad8e647a | ||
|
|
7351939053 | ||
|
|
2d1ebee139 | ||
|
|
9bb9bb5682 | ||
|
|
cdd2d5cc6a | ||
|
|
6ec82b7446 | ||
|
|
e2a93a3feb | ||
|
|
942922960e | ||
|
|
9ba7bcea23 | ||
|
|
d35216434f | ||
|
|
d2dca7b217 | ||
|
|
0ce666aaa0 | ||
|
|
f3db3da153 | ||
|
|
6e1d5c5733 | ||
|
|
562c59b6c1 | ||
|
|
5be125ad1a | ||
|
|
393479ea69 | ||
|
|
623272aa96 | ||
|
|
1c39730531 | ||
|
|
94bfd5cf66 | ||
|
|
c5bd019a7c | ||
|
|
c8edd5bd52 | ||
|
|
a7b1d86533 | ||
|
|
2795995989 | ||
|
|
cbd23c2b1b | ||
|
|
e3f5b7c59f | ||
|
|
3bb6efe0db | ||
|
|
e05b9ce039 | ||
|
|
94e3088f56 | ||
|
|
b311c26e21 | ||
|
|
0521d793db | ||
|
|
cf7a0415c1 | ||
|
|
ab2cea6b46 | ||
|
|
b708fbcd20 | ||
|
|
bf36363109 | ||
|
|
3399f72113 | ||
|
|
8c0b4a5132 | ||
|
|
f6e545bce5 | ||
|
|
c6c5cdd1dc | ||
|
|
ae7e5f4b2c | ||
|
|
33134e617f | ||
|
|
81d2fd615d | ||
|
|
899a65ae87 | ||
|
|
6ce9321094 | ||
|
|
a20c6cb04b | ||
|
|
ddd369e731 | ||
|
|
78817bd001 | ||
|
|
6d32a2f299 | ||
|
|
72021b3221 | ||
|
|
5e4e7c6d34 | ||
|
|
c974872494 | ||
|
|
7823363bba | ||
|
|
6feae1993d | ||
|
|
93bc3af7c6 | ||
|
|
74556edcff | ||
|
|
36224838dd | ||
|
|
bc88a02fe2 | ||
|
|
ba72eff3e6 | ||
|
|
d835cade15 | ||
|
|
355b73843c | ||
|
|
43c0344fb2 | ||
|
|
4767f3d87e | ||
|
|
36aa243c56 | ||
|
|
9df5ce1fb7 | ||
|
|
71f0f4c335 | ||
|
|
7a0f88cc7c | ||
|
|
3b3b0725ed | ||
|
|
f17bbc9eac | ||
|
|
ca9bcc90a5 | ||
|
|
384999556c | ||
|
|
afc29ed445 | ||
|
|
a09f386537 | ||
|
|
2ebc111b70 | ||
|
|
e961766e4b | ||
|
|
681b90768a | ||
|
|
cdca1a46b1 | ||
|
|
f677995603 | ||
|
|
e1a36058b4 | ||
|
|
439b424261 | ||
|
|
c217ccf540 | ||
|
|
6f21a10a56 | ||
|
|
fd66c0dcf6 | ||
|
|
9c00af1b86 | ||
|
|
a3e785cb4a | ||
|
|
6926d63655 | ||
|
|
48dea93c7e | ||
|
|
0b7addc031 | ||
|
|
031bfaf120 | ||
|
|
f15a1edbf2 | ||
|
|
75b8e4c981 | ||
|
|
56df886b55 | ||
|
|
bcaeb83fef | ||
|
|
60b9acc09d | ||
|
|
deb9882520 | ||
|
|
da5ae1efe1 | ||
|
|
eebe784191 | ||
|
|
f9485eb9c2 | ||
|
|
36a1934845 | ||
|
|
df5bd147fa | ||
|
|
977351f419 | ||
|
|
f61eb23f8f | ||
|
|
10af768c60 | ||
|
|
7efed6617c | ||
|
|
a9ec408844 | ||
|
|
b260c849f7 | ||
|
|
2c06eb76d6 | ||
|
|
6bcade5e6d | ||
|
|
4524fbe936 | ||
|
|
6c7ababd3f | ||
|
|
a428f44793 | ||
|
|
b576785aac | ||
|
|
3b5b55de19 | ||
|
|
ee6989970f | ||
|
|
bac708fa34 | ||
|
|
93d9bfb682 | ||
|
|
e6c8c9a6ab | ||
|
|
34387326d1 | ||
|
|
aca2a0fd1b | ||
|
|
0e8a709f92 | ||
|
|
d50a26f4ae | ||
|
|
baee4a1576 | ||
|
|
1bf7e6a408 | ||
|
|
59351c8cb8 | ||
|
|
230b8554f6 | ||
|
|
b47cde70fa | ||
|
|
e89f7d9023 | ||
|
|
94374aa93d | ||
|
|
05c8635749 | ||
|
|
0f79a0024c | ||
|
|
7fc2f9dc29 | ||
|
|
ec0607900d | ||
|
|
8a2d27309d | ||
|
|
d77e59309d | ||
|
|
2a1f18b6ab | ||
|
|
34bfd13548 | ||
|
|
7e7844f169 | ||
|
|
2e22781f8f | ||
|
|
99d5ad097c | ||
|
|
1b2bbd3888 | ||
|
|
095d5d2e31 | ||
|
|
7fd4c9617d | ||
|
|
1916561e60 | ||
|
|
ad0f44f0c5 | ||
|
|
ae66f57fa0 | ||
|
|
107eb76b20 | ||
|
|
cb2518716c | ||
|
|
a1098f6dc2 | ||
|
|
407c6cf120 | ||
|
|
9e76a788e2 | ||
|
|
02c0fb7b65 | ||
|
|
a5bddbcdc6 | ||
|
|
9f54c4d002 | ||
|
|
4289ce10e4 | ||
|
|
263de5b0c1 | ||
|
|
ecc1f4b8f1 | ||
|
|
ea32b415f0 | ||
|
|
229cfafa8d | ||
|
|
53e1f75c2c | ||
|
|
9a01964f5f | ||
|
|
f2a6c9458c | ||
|
|
9a117fa39a | ||
|
|
212f5ddb4f | ||
|
|
296eab3045 | ||
|
|
e5ac8662c8 | ||
|
|
c1b2080f4e | ||
|
|
eedcf910eb | ||
|
|
b72cd90c19 | ||
|
|
c0f89e5b2d | ||
|
|
1e37185d74 | ||
|
|
3f3d61b043 | ||
|
|
7ef1513f9b | ||
|
|
b536dfa552 | ||
|
|
f0accce286 | ||
|
|
6bc2ee2735 | ||
|
|
3c82ee49c0 | ||
|
|
e435b42426 | ||
|
|
9481fa0a4b | ||
|
|
1d67b7ffb6 | ||
|
|
de1f4792cd | ||
|
|
681ce94a34 | ||
|
|
cd3772bf4f | ||
|
|
b3f7db7a15 | ||
|
|
4e37131602 | ||
|
|
0d6eb7fefc | ||
|
|
7b7733077a | ||
|
|
3b5f367822 | ||
|
|
ae49729afb | ||
|
|
3ff209d95d | ||
|
|
7d2810abbc | ||
|
|
8b68d37e84 | ||
|
|
a62e027002 | ||
|
|
e7038d286d | ||
|
|
44fd0e3349 | ||
|
|
84d70caa87 | ||
|
|
e129ae3706 | ||
|
|
e797ec138d | ||
|
|
a923d7c884 | ||
|
|
cce77196cd | ||
|
|
c0f47e5eed | ||
|
|
1cd590ace9 | ||
|
|
f33cf74d0f | ||
|
|
6cb411e5bb | ||
|
|
b1a74d71f1 | ||
|
|
026c51033c | ||
|
|
eff73c9728 | ||
|
|
947000c94f | ||
|
|
67e3f182f5 | ||
|
|
6ed97f0d04 | ||
|
|
743862857e | ||
|
|
e8bdf8171b | ||
|
|
eecb0831a8 | ||
|
|
7319420c8f | ||
|
|
e8d771fcac | ||
|
|
32b3618c74 | ||
|
|
22e72e19b3 | ||
|
|
485568d460 | ||
|
|
8d5be1c012 | ||
|
|
e32704e7f6 | ||
|
|
03bc45a26a | ||
|
|
1e524b7210 | ||
|
|
5a09b6496d | ||
|
|
2aa5911fb9 | ||
|
|
a19c0a8255 | ||
|
|
4d8b912acc | ||
|
|
1af8987c79 | ||
|
|
6fdf76b5d2 | ||
|
|
78649d45b9 | ||
|
|
899ae8aa8e | ||
|
|
b6c141c059 | ||
|
|
316836f43b | ||
|
|
9df19ae436 | ||
|
|
6123339baf | ||
|
|
35918cbd7e | ||
|
|
c8e0341248 | ||
|
|
4ad97f6a36 | ||
|
|
09cfad9d71 | ||
|
|
7fa84518c8 | ||
|
|
6675aec686 | ||
|
|
e271bae5ec | ||
|
|
142ba6660a | ||
|
|
b27196b770 | ||
|
|
811bc62d65 | ||
|
|
f476aa937e | ||
|
|
932110fb93 | ||
|
|
1865e8f088 | ||
|
|
fdae1face5 | ||
|
|
ad39d8707d | ||
|
|
cc61650f86 | ||
|
|
b2805823ce | ||
|
|
1dc6a2fea6 | ||
|
|
b38adaa736 | ||
|
|
80e9f76261 | ||
|
|
399a1afd94 | ||
|
|
8ddf4766ea | ||
|
|
171a0461b2 | ||
|
|
73208b8081 | ||
|
|
d6d2c2fc39 | ||
|
|
b8f3d936c4 | ||
|
|
da31b61ba1 | ||
|
|
a3c9f5ed79 | ||
|
|
8d4876d1ee | ||
|
|
8bd848c8d7 | ||
|
|
966071d437 | ||
|
|
279cdd0760 | ||
|
|
1ab2744c84 | ||
|
|
47ffceef0d | ||
|
|
0ad1f0e233 | ||
|
|
1221c0ba3f | ||
|
|
d45e2074a6 | ||
|
|
03352ea863 | ||
|
|
713edd565c | ||
|
|
a32b7a32f3 | ||
|
|
f51d8323c0 | ||
|
|
9b68174231 | ||
|
|
04092f3e6b | ||
|
|
fc74a6c8ca | ||
|
|
2a669b95fb | ||
|
|
9117b89b83 | ||
|
|
9d92b6eb92 | ||
|
|
73c741f20c | ||
|
|
929a05e898 | ||
|
|
268366e446 | ||
|
|
4cddfd1074 | ||
|
|
eb8296120b | ||
|
|
daac7f2988 | ||
|
|
ca46a79144 | ||
|
|
e155eb9fa3 | ||
|
|
4691b2b809 | ||
|
|
3ecf478ff0 | ||
|
|
c084130d3e | ||
|
|
f4af6b670c | ||
|
|
d2d8c06f52 | ||
|
|
c65142782f | ||
|
|
266b3750c9 | ||
|
|
3233755282 | ||
|
|
b1d9fd3b70 | ||
|
|
e23768fa58 | ||
|
|
533e76ff2e | ||
|
|
a30493446e | ||
|
|
d9c763437e | ||
|
|
e78c4ab9b3 | ||
|
|
7247f8e41f | ||
|
|
33b53c4a0d | ||
|
|
ac5cbe5a82 | ||
|
|
b6b5046cce | ||
|
|
dde2ab59ae | ||
|
|
bb6235733d | ||
|
|
595ad44ee7 | ||
|
|
20fc5ffa38 | ||
|
|
6ef0c382c3 | ||
|
|
575e6add43 | ||
|
|
235377585d | ||
|
|
b74e085272 | ||
|
|
008fbbd652 | ||
|
|
c3d41d4e17 | ||
|
|
faa3a79a5f | ||
|
|
03dd33dbbe | ||
|
|
049b48928f | ||
|
|
75ad0c3c2d | ||
|
|
79403f169e | ||
|
|
2790cf35af | ||
|
|
f9b63c5f8c | ||
|
|
db5e4da268 | ||
|
|
c1d8368fdc | ||
|
|
4b4104e400 | ||
|
|
ad348c8e2f | ||
|
|
b13aa8f172 | ||
|
|
9c92d77b64 | ||
|
|
cd95892bf0 | ||
|
|
7b4ab2077b | ||
|
|
578b5691bc | ||
|
|
6353fa72d8 | ||
|
|
fd07ca87ce | ||
|
|
11ae85645b | ||
|
|
3aabb0314a | ||
|
|
13ccb8cbfe | ||
|
|
efdb854a7c | ||
|
|
98f4d37f1a | ||
|
|
37673c6de6 | ||
|
|
7896af731f | ||
|
|
877dfbe992 | ||
|
|
5b9ea1b4e0 | ||
|
|
710fda49f0 | ||
|
|
2b14bda6b8 | ||
|
|
1abfc5b1cf | ||
|
|
c9bd5ec452 | ||
|
|
51643caf60 | ||
|
|
ee63be26a1 | ||
|
|
1900c907fd | ||
|
|
a9d4495d83 | ||
|
|
7b8447a95a | ||
|
|
7931f1f8f9 | ||
|
|
20b75022aa | ||
|
|
dbc8903bac | ||
|
|
a4f720d866 | ||
|
|
4b8369c071 | ||
|
|
72333147d3 | ||
|
|
64cda4aeda | ||
|
|
6ede77b254 | ||
|
|
c94eee5fc3 | ||
|
|
322b85898f | ||
|
|
cf09dd044a | ||
|
|
a4c1a34163 | ||
|
|
d140909562 | ||
|
|
f9fd47e7d0 | ||
|
|
67fbf9eb00 | ||
|
|
730aceac6d | ||
|
|
1bf396f9af | ||
|
|
45c2f34295 | ||
|
|
ff10e0eaf1 | ||
|
|
40485eb88a | ||
|
|
37a345b39d | ||
|
|
6b8f526df3 | ||
|
|
e51ce5c508 | ||
|
|
8c41e17c93 | ||
|
|
5d72ebe0cc | ||
|
|
f07ce297f6 | ||
|
|
a87239e802 | ||
|
|
3e6c482229 | ||
|
|
176ecd4c3b | ||
|
|
211ad166af | ||
|
|
fe47d6a1a4 | ||
|
|
4dd93e5bbb | ||
|
|
10f2445a99 | ||
|
|
6cc9eecc85 | ||
|
|
817c155287 | ||
|
|
6e44de1e10 | ||
|
|
a6460be37b | ||
|
|
6b7b488e00 | ||
|
|
e7123d1a8e | ||
|
|
50aba9a8e6 | ||
|
|
1b18236f91 | ||
|
|
e17ae2eaf4 | ||
|
|
6d567b36e3 | ||
|
|
7b7ab016db | ||
|
|
0c9c94bad1 | ||
|
|
a3c5fadcc0 | ||
|
|
f1b24598f5 | ||
|
|
2d0929e305 | ||
|
|
8e01e73de4 | ||
|
|
7c8edf5632 | ||
|
|
25284b5325 | ||
|
|
06d2ac65b5 | ||
|
|
e3888b38bb | ||
|
|
5da2995bcd | ||
|
|
92e6f29cc8 | ||
|
|
a2468656e4 | ||
|
|
0358ad83cb | ||
|
|
3aab77af8d | ||
|
|
85447abe7f | ||
|
|
71c6d05902 | ||
|
|
8d062bc880 | ||
|
|
9e2d46b33f | ||
|
|
6080431383 | ||
|
|
5cafdc2f29 | ||
|
|
ff845aa793 | ||
|
|
55c9271695 | ||
|
|
f148397e1b | ||
|
|
82c9e72aab | ||
|
|
cdeac2bca0 | ||
|
|
4682e72cf4 | ||
|
|
1e5e69ec9d | ||
|
|
6e5f521463 | ||
|
|
abdad1f6d3 | ||
|
|
752f4a3d67 | ||
|
|
550e2743d7 | ||
|
|
8f9e730ad6 | ||
|
|
4235a97cf4 | ||
|
|
8b19b84140 | ||
|
|
5b585c0285 | ||
|
|
b0e7bc15c2 | ||
|
|
533349cc0d | ||
|
|
eab8fecd26 | ||
|
|
1f2621b574 | ||
|
|
ff8b95df93 | ||
|
|
8f6f21c94c | ||
|
|
7a938b2dea | ||
|
|
2e76375e8a | ||
|
|
9715113898 | ||
|
|
8e46b9ea5d | ||
|
|
33dfcf2663 | ||
|
|
7508d96327 | ||
|
|
b8bf2af3e3 | ||
|
|
9ee940098d | ||
|
|
e476cf7968 | ||
|
|
c315111bc7 | ||
|
|
8a47a71772 | ||
|
|
b115e2879a | ||
|
|
73ec10a49e | ||
|
|
325a4c0e5b | ||
|
|
b360c9403f | ||
|
|
ca4ee1e8cf | ||
|
|
2e5474e864 | ||
|
|
19c8ea3288 | ||
|
|
6260271b78 | ||
|
|
83427c478f | ||
|
|
0870f48b5c | ||
|
|
c3fb68545a | ||
|
|
aa599bfaf9 | ||
|
|
62c0f35b5a | ||
|
|
0de1566eaf | ||
|
|
39bf59d372 | ||
|
|
554848fe6b | ||
|
|
d05d5bcb70 | ||
|
|
8d3f98fe38 | ||
|
|
826cdb2186 | ||
|
|
c394fbdfc3 | ||
|
|
2fb5837a55 | ||
|
|
8cbf1a3e1b | ||
|
|
04ce49130a | ||
|
|
3ff23ecbfa | ||
|
|
ab8bf393c2 | ||
|
|
d0390181ec | ||
|
|
2f5c036faa | ||
|
|
c41ccb6c37 | ||
|
|
9e40e246ec | ||
|
|
afac38e492 | ||
|
|
1cd93e63fd | ||
|
|
a3458213f4 | ||
|
|
c0f29ea9c6 | ||
|
|
fa09b9afb1 | ||
|
|
7dba12fc81 | ||
|
|
95442094df | ||
|
|
1ce1dbbc50 | ||
|
|
8ac20305df | ||
|
|
98fed009d7 | ||
|
|
c79f2b9d38 | ||
|
|
b38141601c | ||
|
|
03fa955e9e | ||
|
|
f41dd4feb6 | ||
|
|
f2496d87c9 | ||
|
|
0c062f9c08 | ||
|
|
d677826312 | ||
|
|
9ec1abf880 | ||
|
|
92d56d82f4 | ||
|
|
ca444bb71d | ||
|
|
5f1ae545e3 | ||
|
|
99d0d5019b | ||
|
|
be09474615 | ||
|
|
a67f97e8a2 | ||
|
|
9453734434 | ||
|
|
2fde9e63cd | ||
|
|
f628e121df | ||
|
|
2b29ceab83 | ||
|
|
51b4458d32 | ||
|
|
9872ca7f12 | ||
|
|
2871ed74d0 | ||
|
|
07e68aa064 | ||
|
|
1b264d5a53 | ||
|
|
03cb555d1d | ||
|
|
e097578e85 | ||
|
|
b3ab3ce170 | ||
|
|
84e6ba5dff | ||
|
|
b7ba08476c | ||
|
|
aad8aa0893 | ||
|
|
30013c1f06 | ||
|
|
6901e998e6 | ||
|
|
8939d5982f | ||
|
|
a20916f9af | ||
|
|
107f80274c | ||
|
|
4ec8fbf1ff | ||
|
|
5b38419c5f | ||
|
|
dafd1f77fa | ||
|
|
ce6e328d52 | ||
|
|
2bc4b35f51 | ||
|
|
031b06be77 | ||
|
|
b9474cf0a2 | ||
|
|
074a4cc3e4 | ||
|
|
790ba155b8 | ||
|
|
0ca95a5ea0 | ||
|
|
7e43bfc109 | ||
|
|
6cfee12f31 | ||
|
|
6ac3d529ef | ||
|
|
e4cb68e05d | ||
|
|
0626330d44 | ||
|
|
60cf2a71cf | ||
|
|
87babdf3e7 | ||
|
|
ac3bea489b | ||
|
|
ca57546ef5 | ||
|
|
7bd9af7856 | ||
|
|
5b0a0baa9a | ||
|
|
a9a523d8c0 | ||
|
|
c6277922ac | ||
|
|
a82ac00d9a | ||
|
|
d6aa17e21f | ||
|
|
ba816a1c13 | ||
|
|
ceb11bfe77 | ||
|
|
c99f8a17ac | ||
|
|
1e03fac105 | ||
|
|
0b105dad97 | ||
|
|
832e204ec4 | ||
|
|
bfbd01ab15 | ||
|
|
58f63ca8a2 | ||
|
|
012efed117 | ||
|
|
1f1e341c36 | ||
|
|
80c9c26560 | ||
|
|
011ea43496 | ||
|
|
3a8ac6dffa | ||
|
|
d1480c36c0 | ||
|
|
5c9a10617b | ||
|
|
a93d7499d9 | ||
|
|
e24b454a1f | ||
|
|
4936b4ea44 | ||
|
|
c4069824f7 | ||
|
|
7efaa708a6 | ||
|
|
93656e65f8 | ||
|
|
3a7c364562 | ||
|
|
c0bb554d8d | ||
|
|
073b7b4ff5 | ||
|
|
393d8541e2 | ||
|
|
1ef780d96f | ||
|
|
a8cb027c08 | ||
|
|
4a874eff70 | ||
|
|
e3c250f240 | ||
|
|
899db1f7c3 | ||
|
|
d9562e2aee | ||
|
|
d568d6fabc | ||
|
|
da6752eccb | ||
|
|
9a5b13b7c8 | ||
|
|
8459d75597 | ||
|
|
b780a64ed9 | ||
|
|
60fae3a59d | ||
|
|
c1d04a9d13 | ||
|
|
424c27bada | ||
|
|
3c57b980e5 | ||
|
|
52411b12e3 | ||
|
|
6f8d00310b | ||
|
|
f955084572 | ||
|
|
d923620d5a | ||
|
|
2a862d497f | ||
|
|
bda4e5be95 | ||
|
|
ae12c70afe | ||
|
|
efe9ec4906 | ||
|
|
b161f56bd2 | ||
|
|
3464dc2fdf | ||
|
|
893998cb70 | ||
|
|
083c5b003c | ||
|
|
8c8652e7bb | ||
|
|
051d993d62 | ||
|
|
07c842d6e0 | ||
|
|
b9d3585f4c | ||
|
|
05afaf6094 | ||
|
|
3a52f05692 | ||
|
|
64bf3fccd2 | ||
|
|
dec79c70a1 | ||
|
|
21a8f71859 | ||
|
|
edfc2c215c | ||
|
|
16d491a134 | ||
|
|
7559e4311e | ||
|
|
a41b4acec3 | ||
|
|
fd50cd128a | ||
|
|
e99b98873c | ||
|
|
6b953a03d0 | ||
|
|
37a3e610b7 | ||
|
|
f87d8d0b7f | ||
|
|
a95b77a940 | ||
|
|
5ff6148444 | ||
|
|
0130b28879 | ||
|
|
4cdd830003 | ||
|
|
f1425dcb26 | ||
|
|
cd8d3a0c88 | ||
|
|
8729ee4fa2 | ||
|
|
544cfa63ab | ||
|
|
0b9a2cc11c | ||
|
|
25768a291e | ||
|
|
19bd9cf945 | ||
|
|
8aabe1b488 | ||
|
|
3a0f80da74 | ||
|
|
edd3486d2c | ||
|
|
5911780735 | ||
|
|
1e24ef4d0d | ||
|
|
207d33eaba | ||
|
|
d645c5fbab | ||
|
|
960759d22b | ||
|
|
5b7da270c9 | ||
|
|
58edb1b15d | ||
|
|
655051ef98 | ||
|
|
93653d9a58 | ||
|
|
492fb9d054 | ||
|
|
4e16d600b0 | ||
|
|
fa8372a83b | ||
|
|
9614f6db8d | ||
|
|
e216aefd23 | ||
|
|
cf7dd36829 | ||
|
|
3fb71cdfea | ||
|
|
a01f5d4495 | ||
|
|
d16c5d0e93 | ||
|
|
825e2c9527 | ||
|
|
c309686679 | ||
|
|
3dc3f55ecb | ||
|
|
f59bfd65da | ||
|
|
33f2d24f54 | ||
|
|
03a4316dcd | ||
|
|
f9db71ee12 | ||
|
|
62a85e60a7 | ||
|
|
4cb5622d18 | ||
|
|
4abcdd80bf | ||
|
|
6ce9f232dc | ||
|
|
20d1a5db70 | ||
|
|
d46ee7c89b | ||
|
|
d2abc409f9 | ||
|
|
5f9e7c4ff4 | ||
|
|
4963fe7809 | ||
|
|
a64cf77e84 | ||
|
|
57fa377730 | ||
|
|
d4f46122f7 | ||
|
|
bf23e59900 | ||
|
|
c578efaabd | ||
|
|
a98ca86a45 | ||
|
|
b26d952d09 | ||
|
|
736fb5c5b0 | ||
|
|
a777cf7166 | ||
|
|
6ff889c8d6 | ||
|
|
3f9849a63b | ||
|
|
09cd258780 | ||
|
|
7d65a2664d | ||
|
|
d29e3afc28 | ||
|
|
5ec5ebac31 | ||
|
|
793b5c7cc3 | ||
|
|
237d0bb1b0 | ||
|
|
61e173215b | ||
|
|
ff949d84ad | ||
|
|
6b0868089b | ||
|
|
6f316cddbb | ||
|
|
2474c0b633 | ||
|
|
75d8c52004 | ||
|
|
6867f017ec | ||
|
|
3fd55fa56b | ||
|
|
572114b8ba | ||
|
|
1215f26a84 | ||
|
|
d4fa5a0f1d | ||
|
|
2c3d0d826d | ||
|
|
100e198eb3 | ||
|
|
63d7ca328f | ||
|
|
b72b12a960 | ||
|
|
0523c946f9 | ||
|
|
4172a3c8b7 | ||
|
|
9b11c4b319 | ||
|
|
135186e33d | ||
|
|
f82a262ffe | ||
|
|
4b685c5e26 | ||
|
|
921fda94c7 | ||
|
|
1078dff3a9 | ||
|
|
8a923fb420 | ||
|
|
ced22687eb | ||
|
|
177282d9f9 | ||
|
|
cddf63efe9 | ||
|
|
1bc987772c | ||
|
|
c755ceeffa | ||
|
|
6db8a862bb | ||
|
|
6311e53a76 | ||
|
|
ef65ddf351 | ||
|
|
a54ac2ef79 | ||
|
|
86cf17c1f4 | ||
|
|
daa2d89ef5 | ||
|
|
0e53275d40 | ||
|
|
dda1a42a2a | ||
|
|
a259c7bd75 | ||
|
|
d10d0a20b1 | ||
|
|
70b8557b63 | ||
|
|
0e7e252951 | ||
|
|
d53a9e877a | ||
|
|
a03e9e34ab | ||
|
|
d874c633d7 | ||
|
|
dedf46ed1f | ||
|
|
d42f7e4a1c | ||
|
|
dd20829dbe | ||
|
|
670bd993f3 | ||
|
|
6f6f5d79fb | ||
|
|
3f4eaa99d5 | ||
|
|
94e1a833d6 | ||
|
|
eabb9639a3 | ||
|
|
27e48d73dd | ||
|
|
aa1b770974 | ||
|
|
bb56e97177 | ||
|
|
0f22d51309 | ||
|
|
b1734f84b3 | ||
|
|
839fc8df7d | ||
|
|
a4728d3c72 | ||
|
|
6806bff57b | ||
|
|
66f8f8aff2 | ||
|
|
bc384c01e3 | ||
|
|
976a3a5e7b | ||
|
|
122b319520 | ||
|
|
29d5976c01 | ||
|
|
cd266a05d2 | ||
|
|
6ba2533e2b | ||
|
|
dd327f0b22 | ||
|
|
927448601c | ||
|
|
1f04cc1f23 | ||
|
|
cfb6aca9a4 | ||
|
|
c37271422b | ||
|
|
975090256d | ||
|
|
cbf308a01d | ||
|
|
ec6580d840 | ||
|
|
9e7d9affbe | ||
|
|
52fbee6749 | ||
|
|
0f0a70e251 | ||
|
|
fac769ff17 | ||
|
|
690be5bf7f | ||
|
|
1d8de2791a | ||
|
|
3e32aa896c | ||
|
|
65ecca2904 | ||
|
|
62de84d5b6 | ||
|
|
2f30322a4e | ||
|
|
145c862ee0 | ||
|
|
bd1bec5c93 | ||
|
|
2f1f35cc71 | ||
|
|
be1123b5df | ||
|
|
5ccb4586b5 | ||
|
|
d8d708704d | ||
|
|
063eefe896 | ||
|
|
65819140dd | ||
|
|
0e2278cc76 | ||
|
|
bdd56d2516 | ||
|
|
7fb590208c | ||
|
|
02b00c025a | ||
|
|
8935c4386c | ||
|
|
bcd2c71031 | ||
|
|
69495f5b59 | ||
|
|
3f703ff8a4 | ||
|
|
46d8ae47dc | ||
|
|
5bc4ee257f | ||
|
|
aac6d88f72 | ||
|
|
f00698aafd | ||
|
|
e1634128c1 | ||
|
|
a3ea3ad911 | ||
|
|
0eec00055f | ||
|
|
e8df325796 | ||
|
|
ec8baf23d8 | ||
|
|
63487e1d69 | ||
|
|
a0353c8627 | ||
|
|
6ecbcebd44 | ||
|
|
0f83a0a634 | ||
|
|
e6a8c278f5 | ||
|
|
780dfa0c7c | ||
|
|
5e692f9071 | ||
|
|
40c61a310f | ||
|
|
22ce395130 | ||
|
|
716b4a3b09 | ||
|
|
eb48dc9b68 | ||
|
|
fc7d4a13b0 | ||
|
|
73ca65a6ff | ||
|
|
f157ac9b68 | ||
|
|
773f896bcd | ||
|
|
0001a6bad0 | ||
|
|
a64f2421d2 | ||
|
|
8a42462271 | ||
|
|
b08bf32040 | ||
|
|
a45803d8a0 | ||
|
|
ec00e73c9d | ||
|
|
dd20cb7301 | ||
|
|
ac3cdf75fa | ||
|
|
3e288f1066 | ||
|
|
80d5e52923 | ||
|
|
a51b08e386 | ||
|
|
6b7b9793ab | ||
|
|
e4233e45be | ||
|
|
47bac4a0c9 | ||
|
|
b31480232b | ||
|
|
73c7e9edf1 | ||
|
|
5eb5fcd0f4 | ||
|
|
fbcb05388e | ||
|
|
0addca1070 | ||
|
|
a8fcaeb141 | ||
|
|
2e057b8f52 | ||
|
|
84710cf27e | ||
|
|
7ed40c1ec7 | ||
|
|
97a91f23f1 | ||
|
|
5065626984 | ||
|
|
15263bc0d7 | ||
|
|
8c4c2eeffc | ||
|
|
d7528557df | ||
|
|
dc26f3bd74 | ||
|
|
8652f80ab3 | ||
|
|
e5895af4a2 | ||
|
|
dfb65ed89f | ||
|
|
6c31cecc7d | ||
|
|
e05fdf8923 | ||
|
|
2343778559 | ||
|
|
095361bead | ||
|
|
9108828aeb | ||
|
|
1ffc3ed3a6 | ||
|
|
8e376c84cf | ||
|
|
ba3c96f8c6 | ||
|
|
b7912cbe0b | ||
|
|
dafdb7689c | ||
|
|
46ba2b6b4f | ||
|
|
b4c1e340ea | ||
|
|
a438e6fa73 | ||
|
|
b21d3ded2f | ||
|
|
0169d0dafd | ||
|
|
a0d76bda99 | ||
|
|
36f1a8f3ca | ||
|
|
f04bae3f0b | ||
|
|
95f86f9de0 | ||
|
|
e8ef39e734 | ||
|
|
702a7815b9 | ||
|
|
276eabd4e5 | ||
|
|
09a5c2e025 | ||
|
|
509aea5d04 | ||
|
|
3f9f9eb667 | ||
|
|
29cdee761b | ||
|
|
f7a49e7be7 | ||
|
|
21e6c963ab | ||
|
|
74d3ba6b5e | ||
|
|
43cde484f4 | ||
|
|
c31f4de7d5 | ||
|
|
6fd1609410 | ||
|
|
9c75a3aaa8 | ||
|
|
a3d8494a04 | ||
|
|
a9e22df765 | ||
|
|
b9b4a2659d | ||
|
|
072297e661 | ||
|
|
13b260e7f7 | ||
|
|
ac31651a42 | ||
|
|
67bedc4ace | ||
|
|
55ae9e8414 | ||
|
|
4768c425d1 | ||
|
|
b4bdb89f65 | ||
|
|
ea9130256c | ||
|
|
cde687bbe1 | ||
|
|
9725d72a80 | ||
|
|
fbd3c90b80 | ||
|
|
49c619d65d | ||
|
|
b0a9a27288 | ||
|
|
c9a557e0d9 | ||
|
|
fcb7cd0eb0 | ||
|
|
9ccd4ee240 | ||
|
|
84c48de5d9 | ||
|
|
9f6265e0b4 | ||
|
|
a5be80828a | ||
|
|
3969d6b767 | ||
|
|
dad9190142 | ||
|
|
9d143426ee | ||
|
|
727765b248 | ||
|
|
780c40329e | ||
|
|
489782e21b | ||
|
|
5d6398f20e | ||
|
|
6ce5879071 | ||
|
|
05c1325885 | ||
|
|
9331714089 | ||
|
|
d5e1cc095c | ||
|
|
c2437b7bf2 | ||
|
|
bfd1099ef3 | ||
|
|
f3b691d618 | ||
|
|
66c8c66f40 | ||
|
|
52c7fa2427 | ||
|
|
0cfc344f82 | ||
|
|
02fa0df81c | ||
|
|
027017d0d2 | ||
|
|
c3ecf8355d | ||
|
|
a09aa0aa72 | ||
|
|
26c9120d22 | ||
|
|
71329f6c41 | ||
|
|
91f6d4b013 | ||
|
|
40d16a8f88 | ||
|
|
73f16f08e3 | ||
|
|
f88fcdbcfc | ||
|
|
330cfc33ee | ||
|
|
cf20b0b2b8 | ||
|
|
001ecbb561 | ||
|
|
a597b072b8 | ||
|
|
f25efecb74 | ||
|
|
6d52d8552b | ||
|
|
c9a2ff4007 | ||
|
|
b961e1aab5 | ||
|
|
36868a8749 | ||
|
|
4ef8543128 | ||
|
|
93e4656a27 | ||
|
|
c4f46171ae | ||
|
|
e2a1ca7caa | ||
|
|
19e808fffb | ||
|
|
d21c44e266 | ||
|
|
01215b7d2c | ||
|
|
da9b0c6735 | ||
|
|
4d2f3375e8 | ||
|
|
e16e9ad343 | ||
|
|
27efbc3485 | ||
|
|
d4074e45cf | ||
|
|
f39942283b | ||
|
|
468b90a4a4 | ||
|
|
092e12d1be | ||
|
|
320b36495d | ||
|
|
e4f47de6ef | ||
|
|
410ecb4bbc | ||
|
|
d019853687 | ||
|
|
4d51980cb5 | ||
|
|
5b5e6b9e44 | ||
|
|
58a084049d | ||
|
|
9538fc9723 | ||
|
|
227188e908 | ||
|
|
61791b90ea | ||
|
|
797147097c | ||
|
|
f8b132890c | ||
|
|
134aee4582 | ||
|
|
77d75b7739 | ||
|
|
7d2b3f05db | ||
|
|
26c3752f48 | ||
|
|
4bcde2f0ff | ||
|
|
160bb0b050 | ||
|
|
05aa860459 | ||
|
|
a4c2a20851 | ||
|
|
4df9179d34 | ||
|
|
8943de27e4 | ||
|
|
fc728d9e11 | ||
|
|
f6131ce3b5 | ||
|
|
9110e6f632 | ||
|
|
331702cd95 | ||
|
|
743ce5a40f | ||
|
|
abec7dd3bc | ||
|
|
f6de16e95a | ||
|
|
a9ee263682 | ||
|
|
8d955d5f30 | ||
|
|
4d8be81a8f | ||
|
|
e3c7b8d006 | ||
|
|
3b1d86b750 | ||
|
|
cf0faf58dc | ||
|
|
af113f867d | ||
|
|
ca230bba09 | ||
|
|
a26a2160ae | ||
|
|
aafdf3d093 | ||
|
|
12dc3baff9 | ||
|
|
d5b4d93575 | ||
|
|
ab55a6fbbe | ||
|
|
0c884734a3 | ||
|
|
58dd814765 | ||
|
|
bd4927b494 | ||
|
|
8454abcf45 | ||
|
|
407bf4961c | ||
|
|
46937a1b9f | ||
|
|
210485d800 | ||
|
|
135796d4fa | ||
|
|
78949d6c05 | ||
|
|
83f65a673b | ||
|
|
407c2ed114 | ||
|
|
37141779ac | ||
|
|
b522901845 | ||
|
|
e362d47903 | ||
|
|
b1781c33ce | ||
|
|
2a1505b364 | ||
|
|
8b548ac02f | ||
|
|
5c77c25747 | ||
|
|
6c0374cd3c | ||
|
|
51753a1e25 | ||
|
|
dc744a8dd9 | ||
|
|
d1a63e4173 | ||
|
|
90d57f0243 | ||
|
|
3a81411d28 | ||
|
|
b12bb32ece | ||
|
|
0992e56fee | ||
|
|
5fe1726484 | ||
|
|
189b27f36e | ||
|
|
a0d6daa180 | ||
|
|
699d2c7b24 | ||
|
|
0262f1cd6e | ||
|
|
bdac11ade7 | ||
|
|
25e89d3a7a | ||
|
|
c6ac582c99 | ||
|
|
9ea229ed5a | ||
|
|
f88c514be9 | ||
|
|
3e70b8420e | ||
|
|
2c583b03ff | ||
|
|
dd78e75dd6 | ||
|
|
c6101aa02f | ||
|
|
46ee3a0c46 | ||
|
|
763659b8a3 | ||
|
|
74f645a098 | ||
|
|
53a48df77e | ||
|
|
597b72e286 | ||
|
|
ec2bfb99bb | ||
|
|
8ea5162ad9 | ||
|
|
9c119bfdad | ||
|
|
a1d5b2a293 | ||
|
|
450d0687da | ||
|
|
b83a9b902a | ||
|
|
b26906963b | ||
|
|
b0c043cc2f | ||
|
|
d0503d409f | ||
|
|
b9bd061bdd | ||
|
|
b868769ec8 | ||
|
|
89138bab4d | ||
|
|
60ea33b1c7 | ||
|
|
08e297a217 | ||
|
|
19732d3bd7 | ||
|
|
e3c9430e7e | ||
|
|
a189906b9b | ||
|
|
205f54d80d | ||
|
|
d9d54a918f | ||
|
|
81a2f2f06d | ||
|
|
3e41844e6c | ||
|
|
2620eab45e | ||
|
|
5b7bf6ca9f | ||
|
|
77dd022243 | ||
|
|
17cb5117f4 | ||
|
|
7a9824f00e | ||
|
|
9d4489360b | ||
|
|
5f1783c9a5 | ||
|
|
32fc03886d | ||
|
|
73182cff3a | ||
|
|
ef0771ee48 | ||
|
|
943c40a233 | ||
|
|
7655e660f3 | ||
|
|
a5847fd06f | ||
|
|
91fb111462 | ||
|
|
9adaa9b967 | ||
|
|
8665e32221 | ||
|
|
07f1be0ff6 | ||
|
|
1449644c34 | ||
|
|
5454aebf13 | ||
|
|
a4fd3de0b0 | ||
|
|
599a6bfb24 | ||
|
|
60fe55cdc0 | ||
|
|
501308239f | ||
|
|
21e27b8034 | ||
|
|
8d3017febb | ||
|
|
d196c236b8 | ||
|
|
f8c675bc5e | ||
|
|
caf3cfa7d8 | ||
|
|
bfee6699d2 | ||
|
|
627d4fbf74 | ||
|
|
2894567165 | ||
|
|
a633f93707 | ||
|
|
588d6ec828 | ||
|
|
025d8ebc59 | ||
|
|
189f5f8aae | ||
|
|
3c37078a85 | ||
|
|
e309293a47 | ||
|
|
4d87f16e95 | ||
|
|
053317e334 | ||
|
|
662c51605f | ||
|
|
e196a81e99 | ||
|
|
eaac4b6de4 | ||
|
|
a3c806a7a8 | ||
|
|
495f08473d | ||
|
|
40d5c6f0dc | ||
|
|
6056858bf8 | ||
|
|
f01015bac5 | ||
|
|
ad16bafa66 | ||
|
|
3be0c068b9 | ||
|
|
cd95b40d61 | ||
|
|
60b3ae2ac2 | ||
|
|
e94e26f529 | ||
|
|
6958b6fc2b | ||
|
|
34df787be6 | ||
|
|
b3eb9edc34 | ||
|
|
2767cdba9c | ||
|
|
8cb9c6e21f | ||
|
|
b45924a234 | ||
|
|
2d4f5958e2 | ||
|
|
fb911a4542 | ||
|
|
9297e1b90d | ||
|
|
735f6fec1a | ||
|
|
e0a9cae386 | ||
|
|
e7a7d4c75a | ||
|
|
758b54f36d | ||
|
|
6455b0edcc | ||
|
|
6fbaba1323 | ||
|
|
d9fd1d9a46 | ||
|
|
5a5a6f9cd2 | ||
|
|
14c26567b2 | ||
|
|
8efc8051d1 | ||
|
|
bcfe7a76e8 | ||
|
|
7d17ee5960 | ||
|
|
dc6bd2b015 | ||
|
|
724dfc6a4d | ||
|
|
47b82bdaea | ||
|
|
0fc1239445 | ||
|
|
18834de7d0 | ||
|
|
6607019788 | ||
|
|
1f339f623e | ||
|
|
95d294db63 | ||
|
|
4eaf89666f | ||
|
|
a94a48f70b | ||
|
|
3bfaf5af16 | ||
|
|
3123400759 | ||
|
|
e1deed3b1a | ||
|
|
9369c54f54 | ||
|
|
67c732a100 | ||
|
|
3f7b15b598 | ||
|
|
f7884c4f45 | ||
|
|
a60ccbf106 | ||
|
|
97e4921a4a | ||
|
|
8182ffcf9f | ||
|
|
9ba7f372cd | ||
|
|
b7fe165b8f | ||
|
|
d2e9d21031 | ||
|
|
32a855b984 | ||
|
|
9a993d25d0 | ||
|
|
b1c06ece85 | ||
|
|
32ce12acfc | ||
|
|
726d9b86ea | ||
|
|
852ac4c178 | ||
|
|
d9100981ad | ||
|
|
e508055dc1 | ||
|
|
ba171954b4 | ||
|
|
1d8a9c75d4 | ||
|
|
c2d4dcae19 | ||
|
|
116ed01197 | ||
|
|
7b8d1cc54c | ||
|
|
7a55e8e892 | ||
|
|
3ab8ec57f1 | ||
|
|
0e17b6c066 | ||
|
|
44e092c07c | ||
|
|
c8a187e779 | ||
|
|
76d009e409 | ||
|
|
080aa3356a | ||
|
|
3b2e8c439a | ||
|
|
70589e4406 | ||
|
|
261238e157 | ||
|
|
11d738eee0 | ||
|
|
3943c3ae6f | ||
|
|
463f55ba13 | ||
|
|
e493d9e2e3 | ||
|
|
19f52b4541 | ||
|
|
9606dce425 | ||
|
|
98ff1c4d20 | ||
|
|
e5d73f2923 | ||
|
|
03806f7063 | ||
|
|
63c8b8edd1 | ||
|
|
a0795165af | ||
|
|
c23cff45f6 | ||
|
|
02cef1353e | ||
|
|
008120747e | ||
|
|
9964f80bb7 | ||
|
|
afe54ab5f3 | ||
|
|
6cd6732225 | ||
|
|
429b9a1bc5 | ||
|
|
d063a32def | ||
|
|
1ebd908fe3 | ||
|
|
e1a08b1c89 | ||
|
|
dd998037cf | ||
|
|
6d8a6c480f | ||
|
|
b1b558ed07 | ||
|
|
593c7e78b1 | ||
|
|
9a3c8a2134 | ||
|
|
c54ecd2802 | ||
|
|
d5e22e0fee | ||
|
|
1a3a4d23c0 | ||
|
|
0eb2152012 | ||
|
|
57f1cd71ad | ||
|
|
fa64cacfa7 | ||
|
|
9dbeb3028d | ||
|
|
8e168cb657 | ||
|
|
5616dfb1bc | ||
|
|
ddef708178 | ||
|
|
67bdc266af | ||
|
|
f352c18290 | ||
|
|
d1e15e61d0 | ||
|
|
9fcc27edd5 | ||
|
|
e47cbae885 | ||
|
|
1a6c9b9c0e | ||
|
|
f1b4d2b1b3 | ||
|
|
1bd7f5b7ec | ||
|
|
8319323329 | ||
|
|
20544b6b7b | ||
|
|
1242e4a292 | ||
|
|
42a233c083 | ||
|
|
047f7e5015 | ||
|
|
d1e1f8bdce | ||
|
|
6e61431759 | ||
|
|
16743a25c2 | ||
|
|
3a3edbbb16 | ||
|
|
8957213c56 | ||
|
|
f9433811c7 | ||
|
|
a5ee1c69fe | ||
|
|
61e1297cc7 | ||
|
|
bb74308ac9 | ||
|
|
8eeecb431b | ||
|
|
df2a852e6c | ||
|
|
e40c7b7a86 | ||
|
|
177033d0f2 | ||
|
|
cab724841a | ||
|
|
2241f02621 | ||
|
|
c6b28b4d8b | ||
|
|
c92d73384b | ||
|
|
5abba9ca9f | ||
|
|
35291983a1 | ||
|
|
a19dbb8c91 | ||
|
|
6a3bb184b7 | ||
|
|
1acb6b4328 | ||
|
|
6e5ccc87cf | ||
|
|
4853762763 | ||
|
|
8533ae0032 | ||
|
|
90ff1d3ccf | ||
|
|
23c6597836 | ||
|
|
b4302df892 | ||
|
|
1723793c35 | ||
|
|
be774f55ce | ||
|
|
e158b1d1e4 | ||
|
|
28e94bf9db | ||
|
|
6184e8a943 | ||
|
|
fb4ef413f4 | ||
|
|
b0687ecb09 | ||
|
|
46688e501b | ||
|
|
e62aaa3d3d | ||
|
|
c776811ea9 | ||
|
|
c8042540d5 | ||
|
|
bfcfb199a0 | ||
|
|
8b01725129 | ||
|
|
cb39dd8ed0 | ||
|
|
734a03cf82 | ||
|
|
aed6e8d0be | ||
|
|
ec0f7795d3 | ||
|
|
c95940acac | ||
|
|
3215eba0eb | ||
|
|
4e98f0abdc | ||
|
|
0ba88ac53a | ||
|
|
2c10dc6c57 | ||
|
|
778483166f | ||
|
|
a40aa9f90b | ||
|
|
c4a7de9d37 | ||
|
|
9e76aba3d1 | ||
|
|
1993efe201 | ||
|
|
e74f70346e | ||
|
|
530011fd09 | ||
|
|
1cdb414bf8 | ||
|
|
a572787013 | ||
|
|
3f92940a19 | ||
|
|
177aa3cffd | ||
|
|
6e44755b55 | ||
|
|
7e6c3a330a | ||
|
|
89db4235ce | ||
|
|
001fc7dd53 | ||
|
|
46ae2556c7 | ||
|
|
9b69b10fea | ||
|
|
a460ab84fa | ||
|
|
bac783774d | ||
|
|
4221461ede | ||
|
|
a324b3fce0 | ||
|
|
bd2176c398 | ||
|
|
441bcdc4af | ||
|
|
26ae8bb3a7 | ||
|
|
f8ac98bf46 | ||
|
|
5e6aceeb0e | ||
|
|
cbb147de23 | ||
|
|
f60692c7ef | ||
|
|
97c2cdb8d6 | ||
|
|
43f7fd5e10 | ||
|
|
a4e2fce9ca | ||
|
|
bff3af81d5 | ||
|
|
1d2f84322d | ||
|
|
368d72ebfe | ||
|
|
8d9f3719ce | ||
|
|
af0d9b650d | ||
|
|
2a1094fc17 | ||
|
|
cadbd00ac4 | ||
|
|
f70ec02a6c | ||
|
|
16973bc2e8 | ||
|
|
38e01cba83 | ||
|
|
9af82f2d68 | ||
|
|
b87142ec8e | ||
|
|
41be8fc9e5 | ||
|
|
ec14259b5a | ||
|
|
172bbed962 | ||
|
|
faece90316 | ||
|
|
2e1d463933 | ||
|
|
5f8c44125b | ||
|
|
5b9104f68e | ||
|
|
2931be5fc5 | ||
|
|
50ce475701 | ||
|
|
77de45f684 | ||
|
|
9b80ea4cf1 | ||
|
|
c104cb446b | ||
|
|
207746f8c4 | ||
|
|
fc10281d96 | ||
|
|
a335cb3767 | ||
|
|
367112fd4b | ||
|
|
54695c6f8c | ||
|
|
f004d036dc | ||
|
|
f8a89cafd8 | ||
|
|
d6dd86b419 | ||
|
|
6fd9d5f28b | ||
|
|
28e720fef2 | ||
|
|
d7fbd8b67d | ||
|
|
809289f5ef | ||
|
|
c2fa54ca9c | ||
|
|
edcb28737c | ||
|
|
a8a9818043 | ||
|
|
95e8b59367 | ||
|
|
1b1879342c | ||
|
|
b3432b512e | ||
|
|
7c84e22c3e | ||
|
|
89d61ca238 | ||
|
|
2f8a2fc907 | ||
|
|
4192e40a9a | ||
|
|
0fd5dbee11 | ||
|
|
8756df2447 | ||
|
|
84b6734063 | ||
|
|
2bafdf7271 | ||
|
|
dc8de20b9a | ||
|
|
c3c46e9097 | ||
|
|
d7690aa719 | ||
|
|
89d7a72a4b | ||
|
|
98c99b4fea | ||
|
|
cd66afb05c | ||
|
|
c3faadf749 | ||
|
|
d9e711eac5 | ||
|
|
83c8e981b4 | ||
|
|
44405bd1a0 | ||
|
|
dbcb662f9c | ||
|
|
53a9dd5da4 | ||
|
|
0e7e665e6d | ||
|
|
8e0314b3a3 | ||
|
|
7759f13a13 | ||
|
|
fa7a5789aa | ||
|
|
7694f895c2 | ||
|
|
92190c7e0b | ||
|
|
f57d4b4126 | ||
|
|
381638abea | ||
|
|
31666b9617 | ||
|
|
7e933f7045 | ||
|
|
574b5c03dc | ||
|
|
e68c8cb1ee | ||
|
|
b3816bc2dc | ||
|
|
9a07c2fd38 | ||
|
|
44ed3dc46b | ||
|
|
6064d2f2f1 | ||
|
|
ac2194b0eb | ||
|
|
7b4c657e90 | ||
|
|
b9bfcc4b69 | ||
|
|
fe56995244 | ||
|
|
714d7a146e | ||
|
|
c7e4217693 | ||
|
|
7863a269ad | ||
|
|
e70cefaa28 | ||
|
|
a80bc34d59 | ||
|
|
89ac8b09b5 | ||
|
|
2437a4182d | ||
|
|
ee7b6f2470 | ||
|
|
926858aeec | ||
|
|
38f7cbc6c7 | ||
|
|
b4a129068a | ||
|
|
ccf24b9952 | ||
|
|
3508a5b664 | ||
|
|
f79d34be5c | ||
|
|
605953565b | ||
|
|
34e3dc2b37 | ||
|
|
595b51ecdd | ||
|
|
6df17bceb1 | ||
|
|
ef03314c6d | ||
|
|
4fc78bf720 | ||
|
|
1d6db306ec | ||
|
|
b681078b06 | ||
|
|
aab42dd96f | ||
|
|
888b2040de | ||
|
|
aae9bf3f46 | ||
|
|
4d9b852875 | ||
|
|
3e10f2e250 | ||
|
|
67dc7523d5 | ||
|
|
caaff9b7af | ||
|
|
fe602ab3bb | ||
|
|
20a7193b06 | ||
|
|
65befc281e | ||
|
|
b4a3eb55e1 | ||
|
|
027c1b5ab8 | ||
|
|
b0b016b58c | ||
|
|
0444435589 | ||
|
|
0a04302fb2 | ||
|
|
8612d1e824 | ||
|
|
1ce7c250d7 | ||
|
|
2c5f4386ba | ||
|
|
92c12f9bde | ||
|
|
3b25934649 | ||
|
|
aef741ae19 | ||
|
|
16c60914eb | ||
|
|
d1d8845ab2 | ||
|
|
612befc962 | ||
|
|
cf94aed32e | ||
|
|
a5bcf8b5b2 | ||
|
|
ab71bc0e78 | ||
|
|
26da526379 |
+96
-41
@@ -44,13 +44,13 @@ commands:
|
|||||||
- restore_cache:
|
- restore_cache:
|
||||||
name: Restore parameters cache
|
name: Restore parameters cache
|
||||||
keys:
|
keys:
|
||||||
- 'v25-2k-lotus-params'
|
- 'v26-2k-lotus-params'
|
||||||
paths:
|
paths:
|
||||||
- /var/tmp/filecoin-proof-parameters/
|
- /var/tmp/filecoin-proof-parameters/
|
||||||
- run: ./lotus fetch-params 2048
|
- run: ./lotus fetch-params 2048
|
||||||
- save_cache:
|
- save_cache:
|
||||||
name: Save parameters cache
|
name: Save parameters cache
|
||||||
key: 'v25-2k-lotus-params'
|
key: 'v26-2k-lotus-params'
|
||||||
paths:
|
paths:
|
||||||
- /var/tmp/filecoin-proof-parameters/
|
- /var/tmp/filecoin-proof-parameters/
|
||||||
install_ipfs:
|
install_ipfs:
|
||||||
@@ -285,21 +285,6 @@ jobs:
|
|||||||
root: "."
|
root: "."
|
||||||
paths:
|
paths:
|
||||||
- linux-butterflynet
|
- linux-butterflynet
|
||||||
build-ntwk-nerpa:
|
|
||||||
description: |
|
|
||||||
Compile lotus binaries for the nerpa network
|
|
||||||
parameters:
|
|
||||||
<<: *test-params
|
|
||||||
executor: << parameters.executor >>
|
|
||||||
steps:
|
|
||||||
- install-deps
|
|
||||||
- prepare
|
|
||||||
- run: make nerpanet
|
|
||||||
- run: mkdir linux-nerpanet && mv lotus lotus-miner lotus-worker linux-nerpanet
|
|
||||||
- persist_to_workspace:
|
|
||||||
root: "."
|
|
||||||
paths:
|
|
||||||
- linux-nerpanet
|
|
||||||
build-lotus-soup:
|
build-lotus-soup:
|
||||||
description: |
|
description: |
|
||||||
Compile `lotus-soup` Testground test plan
|
Compile `lotus-soup` Testground test plan
|
||||||
@@ -333,7 +318,7 @@ jobs:
|
|||||||
command: pushd testplans/lotus-soup && mkdir -p $HOME/testground && cp env-ci.toml $HOME/testground/.env.toml && echo 'endpoint="https://ci.testground.ipfs.team"' >> $HOME/testground/.env.toml && echo 'user="circleci"' >> $HOME/testground/.env.toml
|
command: pushd testplans/lotus-soup && mkdir -p $HOME/testground && cp env-ci.toml $HOME/testground/.env.toml && echo 'endpoint="https://ci.testground.ipfs.team"' >> $HOME/testground/.env.toml && echo 'user="circleci"' >> $HOME/testground/.env.toml
|
||||||
- run:
|
- run:
|
||||||
name: "prepare testground home dir and link test plans"
|
name: "prepare testground home dir and link test plans"
|
||||||
command: mkdir -p $HOME/testground/plans && ln -s $(pwd)/testplans/lotus-soup $HOME/testground/plans/lotus-soup && ln -s $(pwd)/testplans/graphsync $HOME/testground/plans/graphsync
|
command: mkdir -p $HOME/testground/plans && ln -s $(pwd)/testplans/lotus-soup $HOME/testground/plans/lotus-soup
|
||||||
- run:
|
- run:
|
||||||
name: "go get lotus@master"
|
name: "go get lotus@master"
|
||||||
command: cd testplans/lotus-soup && go get github.com/filecoin-project/lotus@master
|
command: cd testplans/lotus-soup && go get github.com/filecoin-project/lotus@master
|
||||||
@@ -343,10 +328,6 @@ jobs:
|
|||||||
- run:
|
- run:
|
||||||
name: "trigger payment channel stress testplan on taas"
|
name: "trigger payment channel stress testplan on taas"
|
||||||
command: ~/testground-cli run composition -f $HOME/testground/plans/lotus-soup/_compositions/paych-stress-k8s.toml --metadata-commit=$CIRCLE_SHA1 --metadata-repo=filecoin-project/lotus --metadata-branch=$CIRCLE_BRANCH
|
command: ~/testground-cli run composition -f $HOME/testground/plans/lotus-soup/_compositions/paych-stress-k8s.toml --metadata-commit=$CIRCLE_SHA1 --metadata-repo=filecoin-project/lotus --metadata-branch=$CIRCLE_BRANCH
|
||||||
- run:
|
|
||||||
name: "trigger graphsync testplan on taas"
|
|
||||||
command: ~/testground-cli run composition -f $HOME/testground/plans/graphsync/_compositions/stress-k8s.toml --metadata-commit=$CIRCLE_SHA1 --metadata-repo=filecoin-project/lotus --metadata-branch=$CIRCLE_BRANCH
|
|
||||||
|
|
||||||
|
|
||||||
build-macos:
|
build-macos:
|
||||||
description: build darwin lotus binary
|
description: build darwin lotus binary
|
||||||
@@ -409,7 +390,7 @@ jobs:
|
|||||||
|
|
||||||
build-appimage:
|
build-appimage:
|
||||||
machine:
|
machine:
|
||||||
image: ubuntu-2004:202104-01
|
image: ubuntu-2004:202111-02
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
- attach_workspace:
|
- attach_workspace:
|
||||||
@@ -417,6 +398,16 @@ jobs:
|
|||||||
- run:
|
- run:
|
||||||
name: install appimage-builder
|
name: install appimage-builder
|
||||||
command: |
|
command: |
|
||||||
|
# appimage-builder requires /dev/snd to exist. It creates containers during the testing phase
|
||||||
|
# that pass sound devices from the host to the testing container. (hard coded!)
|
||||||
|
# https://github.com/AppImageCrafters/appimage-builder/blob/master/appimagebuilder/modules/test/execution_test.py#L54
|
||||||
|
# Circleci doesn't provide a working sound device; this is enough to fake it.
|
||||||
|
if [ ! -e /dev/snd ]
|
||||||
|
then
|
||||||
|
sudo mkdir /dev/snd
|
||||||
|
sudo mknod /dev/snd/ControlC0 c 1 2
|
||||||
|
fi
|
||||||
|
|
||||||
# docs: https://appimage-builder.readthedocs.io/en/latest/intro/install.html
|
# docs: https://appimage-builder.readthedocs.io/en/latest/intro/install.html
|
||||||
sudo apt update
|
sudo apt update
|
||||||
sudo apt install -y python3-pip python3-setuptools patchelf desktop-file-utils libgdk-pixbuf2.0-dev fakeroot strace
|
sudo apt install -y python3-pip python3-setuptools patchelf desktop-file-utils libgdk-pixbuf2.0-dev fakeroot strace
|
||||||
@@ -637,6 +628,11 @@ jobs:
|
|||||||
default: "latest"
|
default: "latest"
|
||||||
description: A comma-separated string containing docker image tags to build and push (default = latest)
|
description: A comma-separated string containing docker image tags to build and push (default = latest)
|
||||||
|
|
||||||
|
target:
|
||||||
|
type: string
|
||||||
|
default: "lotus-all-in-one"
|
||||||
|
description: Docker target to build
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- run:
|
- run:
|
||||||
name: Confirm that environment variables are set
|
name: Confirm that environment variables are set
|
||||||
@@ -676,6 +672,7 @@ jobs:
|
|||||||
|
|
||||||
docker build \
|
docker build \
|
||||||
<<#parameters.extra-build-args>><<parameters.extra-build-args>><</parameters.extra-build-args>> \
|
<<#parameters.extra-build-args>><<parameters.extra-build-args>><</parameters.extra-build-args>> \
|
||||||
|
--target <<parameters.target>> \
|
||||||
-f <<parameters.path>>/<<parameters.dockerfile>> \
|
-f <<parameters.path>>/<<parameters.dockerfile>> \
|
||||||
$docker_tag_args \
|
$docker_tag_args \
|
||||||
<<parameters.path>>
|
<<parameters.path>>
|
||||||
@@ -724,8 +721,8 @@ jobs:
|
|||||||
- packer/build:
|
- packer/build:
|
||||||
template: tools/packer/lotus.pkr.hcl
|
template: tools/packer/lotus.pkr.hcl
|
||||||
args: "-var ci_workspace_bins=./linux-butterflynet -var lotus_network=butterflynet -var git_tag=$CIRCLE_TAG"
|
args: "-var ci_workspace_bins=./linux-butterflynet -var lotus_network=butterflynet -var git_tag=$CIRCLE_TAG"
|
||||||
publish-packer-nerpanet:
|
publish-packer-snap:
|
||||||
description: build and push AWS IAM and DigitalOcean droplet.
|
description: build packer image with snap. mainnet only.
|
||||||
executor:
|
executor:
|
||||||
name: packer/default
|
name: packer/default
|
||||||
packer-version: 1.6.6
|
packer-version: 1.6.6
|
||||||
@@ -734,8 +731,7 @@ jobs:
|
|||||||
- attach_workspace:
|
- attach_workspace:
|
||||||
at: "."
|
at: "."
|
||||||
- packer/build:
|
- packer/build:
|
||||||
template: tools/packer/lotus.pkr.hcl
|
template: tools/packer/lotus-snap.pkr.hcl
|
||||||
args: "-var ci_workspace_bins=./linux-nerpanet -var lotus_network=nerpanet -var git_tag=$CIRCLE_TAG"
|
|
||||||
publish-dockerhub:
|
publish-dockerhub:
|
||||||
description: publish to dockerhub
|
description: publish to dockerhub
|
||||||
machine:
|
machine:
|
||||||
@@ -816,6 +812,11 @@ workflows:
|
|||||||
suite: itest-deals_512mb
|
suite: itest-deals_512mb
|
||||||
target: "./itests/deals_512mb_test.go"
|
target: "./itests/deals_512mb_test.go"
|
||||||
|
|
||||||
|
- test:
|
||||||
|
name: test-itest-deals_anycid
|
||||||
|
suite: itest-deals_anycid
|
||||||
|
target: "./itests/deals_anycid_test.go"
|
||||||
|
|
||||||
- test:
|
- test:
|
||||||
name: test-itest-deals_concurrent
|
name: test-itest-deals_concurrent
|
||||||
suite: itest-deals_concurrent
|
suite: itest-deals_concurrent
|
||||||
@@ -836,6 +837,16 @@ workflows:
|
|||||||
suite: itest-deals_padding
|
suite: itest-deals_padding
|
||||||
target: "./itests/deals_padding_test.go"
|
target: "./itests/deals_padding_test.go"
|
||||||
|
|
||||||
|
- test:
|
||||||
|
name: test-itest-deals_partial_retrieval_dm-level
|
||||||
|
suite: itest-deals_partial_retrieval_dm-level
|
||||||
|
target: "./itests/deals_partial_retrieval_dm-level_test.go"
|
||||||
|
|
||||||
|
- test:
|
||||||
|
name: test-itest-deals_partial_retrieval
|
||||||
|
suite: itest-deals_partial_retrieval
|
||||||
|
target: "./itests/deals_partial_retrieval_test.go"
|
||||||
|
|
||||||
- test:
|
- test:
|
||||||
name: test-itest-deals_power
|
name: test-itest-deals_power
|
||||||
suite: itest-deals_power
|
suite: itest-deals_power
|
||||||
@@ -851,6 +862,11 @@ workflows:
|
|||||||
suite: itest-deals_publish
|
suite: itest-deals_publish
|
||||||
target: "./itests/deals_publish_test.go"
|
target: "./itests/deals_publish_test.go"
|
||||||
|
|
||||||
|
- test:
|
||||||
|
name: test-itest-deals_retry_deal_no_funds
|
||||||
|
suite: itest-deals_retry_deal_no_funds
|
||||||
|
target: "./itests/deals_retry_deal_no_funds_test.go"
|
||||||
|
|
||||||
- test:
|
- test:
|
||||||
name: test-itest-deals
|
name: test-itest-deals
|
||||||
suite: itest-deals
|
suite: itest-deals
|
||||||
@@ -866,6 +882,11 @@ workflows:
|
|||||||
suite: itest-get_messages_in_ts
|
suite: itest-get_messages_in_ts
|
||||||
target: "./itests/get_messages_in_ts_test.go"
|
target: "./itests/get_messages_in_ts_test.go"
|
||||||
|
|
||||||
|
- test:
|
||||||
|
name: test-itest-mempool
|
||||||
|
suite: itest-mempool
|
||||||
|
target: "./itests/mempool_test.go"
|
||||||
|
|
||||||
- test:
|
- test:
|
||||||
name: test-itest-multisig
|
name: test-itest-multisig
|
||||||
suite: itest-multisig
|
suite: itest-multisig
|
||||||
@@ -896,6 +917,11 @@ workflows:
|
|||||||
suite: itest-sector_finalize_early
|
suite: itest-sector_finalize_early
|
||||||
target: "./itests/sector_finalize_early_test.go"
|
target: "./itests/sector_finalize_early_test.go"
|
||||||
|
|
||||||
|
- test:
|
||||||
|
name: test-itest-sector_make_cc_avail
|
||||||
|
suite: itest-sector_make_cc_avail
|
||||||
|
target: "./itests/sector_make_cc_avail_test.go"
|
||||||
|
|
||||||
- test:
|
- test:
|
||||||
name: test-itest-sector_miner_collateral
|
name: test-itest-sector_miner_collateral
|
||||||
suite: itest-sector_miner_collateral
|
suite: itest-sector_miner_collateral
|
||||||
@@ -906,11 +932,26 @@ workflows:
|
|||||||
suite: itest-sector_pledge
|
suite: itest-sector_pledge
|
||||||
target: "./itests/sector_pledge_test.go"
|
target: "./itests/sector_pledge_test.go"
|
||||||
|
|
||||||
|
- test:
|
||||||
|
name: test-itest-sector_prefer_no_upgrade
|
||||||
|
suite: itest-sector_prefer_no_upgrade
|
||||||
|
target: "./itests/sector_prefer_no_upgrade_test.go"
|
||||||
|
|
||||||
|
- test:
|
||||||
|
name: test-itest-sector_revert_available
|
||||||
|
suite: itest-sector_revert_available
|
||||||
|
target: "./itests/sector_revert_available_test.go"
|
||||||
|
|
||||||
- test:
|
- test:
|
||||||
name: test-itest-sector_terminate
|
name: test-itest-sector_terminate
|
||||||
suite: itest-sector_terminate
|
suite: itest-sector_terminate
|
||||||
target: "./itests/sector_terminate_test.go"
|
target: "./itests/sector_terminate_test.go"
|
||||||
|
|
||||||
|
- test:
|
||||||
|
name: test-itest-self_sent_txn
|
||||||
|
suite: itest-self_sent_txn
|
||||||
|
target: "./itests/self_sent_txn_test.go"
|
||||||
|
|
||||||
- test:
|
- test:
|
||||||
name: test-itest-tape
|
name: test-itest-tape
|
||||||
suite: itest-tape
|
suite: itest-tape
|
||||||
@@ -931,6 +972,11 @@ workflows:
|
|||||||
suite: itest-wdpost
|
suite: itest-wdpost
|
||||||
target: "./itests/wdpost_test.go"
|
target: "./itests/wdpost_test.go"
|
||||||
|
|
||||||
|
- test:
|
||||||
|
name: test-itest-worker
|
||||||
|
suite: itest-worker
|
||||||
|
target: "./itests/worker_test.go"
|
||||||
|
|
||||||
- test:
|
- test:
|
||||||
name: test-unit-cli
|
name: test-unit-cli
|
||||||
suite: utest-unit-cli
|
suite: utest-unit-cli
|
||||||
@@ -961,7 +1007,7 @@ workflows:
|
|||||||
codecov-upload: false
|
codecov-upload: false
|
||||||
suite: conformance-bleeding-edge
|
suite: conformance-bleeding-edge
|
||||||
target: "./conformance"
|
target: "./conformance"
|
||||||
vectors-branch: master
|
vectors-branch: specs-actors-v7
|
||||||
- trigger-testplans:
|
- trigger-testplans:
|
||||||
filters:
|
filters:
|
||||||
branches:
|
branches:
|
||||||
@@ -983,13 +1029,15 @@ workflows:
|
|||||||
tags:
|
tags:
|
||||||
only:
|
only:
|
||||||
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
|
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
|
||||||
- build-ntwk-nerpa:
|
- build-lotus-soup
|
||||||
|
- build-macos:
|
||||||
filters:
|
filters:
|
||||||
|
branches:
|
||||||
|
ignore:
|
||||||
|
- /.*/
|
||||||
tags:
|
tags:
|
||||||
only:
|
only:
|
||||||
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
|
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
|
||||||
- build-lotus-soup
|
|
||||||
- build-macos
|
|
||||||
- build-appimage:
|
- build-appimage:
|
||||||
filters:
|
filters:
|
||||||
branches:
|
branches:
|
||||||
@@ -1015,6 +1063,13 @@ workflows:
|
|||||||
path: .
|
path: .
|
||||||
repo: lotus-dev
|
repo: lotus-dev
|
||||||
tag: '${CIRCLE_SHA1:0:8}'
|
tag: '${CIRCLE_SHA1:0:8}'
|
||||||
|
target: lotus-all-in-one
|
||||||
|
- build-and-push-image:
|
||||||
|
dockerfile: Dockerfile.lotus
|
||||||
|
path: .
|
||||||
|
repo: lotus-test
|
||||||
|
tag: '${CIRCLE_SHA1:0:8}'
|
||||||
|
target: lotus-test
|
||||||
- publish-packer-mainnet:
|
- publish-packer-mainnet:
|
||||||
requires:
|
requires:
|
||||||
- build-all
|
- build-all
|
||||||
@@ -1045,16 +1100,6 @@ workflows:
|
|||||||
tags:
|
tags:
|
||||||
only:
|
only:
|
||||||
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
|
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
|
||||||
- publish-packer-nerpanet:
|
|
||||||
requires:
|
|
||||||
- build-ntwk-nerpa
|
|
||||||
filters:
|
|
||||||
branches:
|
|
||||||
ignore:
|
|
||||||
- /.*/
|
|
||||||
tags:
|
|
||||||
only:
|
|
||||||
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
|
|
||||||
- publish-snapcraft:
|
- publish-snapcraft:
|
||||||
name: publish-snapcraft-stable
|
name: publish-snapcraft-stable
|
||||||
channel: stable
|
channel: stable
|
||||||
@@ -1091,3 +1136,13 @@ workflows:
|
|||||||
- publish-dockerhub:
|
- publish-dockerhub:
|
||||||
name: publish-dockerhub-nightly
|
name: publish-dockerhub-nightly
|
||||||
tag: nightly
|
tag: nightly
|
||||||
|
monthly:
|
||||||
|
triggers:
|
||||||
|
- schedule:
|
||||||
|
cron: "0 0 1 * *"
|
||||||
|
filters:
|
||||||
|
branches:
|
||||||
|
only:
|
||||||
|
- master
|
||||||
|
jobs:
|
||||||
|
- publish-packer-snap
|
||||||
|
|||||||
+46
-41
@@ -44,13 +44,13 @@ commands:
|
|||||||
- restore_cache:
|
- restore_cache:
|
||||||
name: Restore parameters cache
|
name: Restore parameters cache
|
||||||
keys:
|
keys:
|
||||||
- 'v25-2k-lotus-params'
|
- 'v26-2k-lotus-params'
|
||||||
paths:
|
paths:
|
||||||
- /var/tmp/filecoin-proof-parameters/
|
- /var/tmp/filecoin-proof-parameters/
|
||||||
- run: ./lotus fetch-params 2048
|
- run: ./lotus fetch-params 2048
|
||||||
- save_cache:
|
- save_cache:
|
||||||
name: Save parameters cache
|
name: Save parameters cache
|
||||||
key: 'v25-2k-lotus-params'
|
key: 'v26-2k-lotus-params'
|
||||||
paths:
|
paths:
|
||||||
- /var/tmp/filecoin-proof-parameters/
|
- /var/tmp/filecoin-proof-parameters/
|
||||||
install_ipfs:
|
install_ipfs:
|
||||||
@@ -285,21 +285,6 @@ jobs:
|
|||||||
root: "."
|
root: "."
|
||||||
paths:
|
paths:
|
||||||
- linux-butterflynet
|
- linux-butterflynet
|
||||||
build-ntwk-nerpa:
|
|
||||||
description: |
|
|
||||||
Compile lotus binaries for the nerpa network
|
|
||||||
parameters:
|
|
||||||
<<: *test-params
|
|
||||||
executor: << parameters.executor >>
|
|
||||||
steps:
|
|
||||||
- install-deps
|
|
||||||
- prepare
|
|
||||||
- run: make nerpanet
|
|
||||||
- run: mkdir linux-nerpanet && mv lotus lotus-miner lotus-worker linux-nerpanet
|
|
||||||
- persist_to_workspace:
|
|
||||||
root: "."
|
|
||||||
paths:
|
|
||||||
- linux-nerpanet
|
|
||||||
build-lotus-soup:
|
build-lotus-soup:
|
||||||
description: |
|
description: |
|
||||||
Compile `lotus-soup` Testground test plan
|
Compile `lotus-soup` Testground test plan
|
||||||
@@ -333,7 +318,7 @@ jobs:
|
|||||||
command: pushd testplans/lotus-soup && mkdir -p $HOME/testground && cp env-ci.toml $HOME/testground/.env.toml && echo 'endpoint="https://ci.testground.ipfs.team"' >> $HOME/testground/.env.toml && echo 'user="circleci"' >> $HOME/testground/.env.toml
|
command: pushd testplans/lotus-soup && mkdir -p $HOME/testground && cp env-ci.toml $HOME/testground/.env.toml && echo 'endpoint="https://ci.testground.ipfs.team"' >> $HOME/testground/.env.toml && echo 'user="circleci"' >> $HOME/testground/.env.toml
|
||||||
- run:
|
- run:
|
||||||
name: "prepare testground home dir and link test plans"
|
name: "prepare testground home dir and link test plans"
|
||||||
command: mkdir -p $HOME/testground/plans && ln -s $(pwd)/testplans/lotus-soup $HOME/testground/plans/lotus-soup && ln -s $(pwd)/testplans/graphsync $HOME/testground/plans/graphsync
|
command: mkdir -p $HOME/testground/plans && ln -s $(pwd)/testplans/lotus-soup $HOME/testground/plans/lotus-soup
|
||||||
- run:
|
- run:
|
||||||
name: "go get lotus@master"
|
name: "go get lotus@master"
|
||||||
command: cd testplans/lotus-soup && go get github.com/filecoin-project/lotus@master
|
command: cd testplans/lotus-soup && go get github.com/filecoin-project/lotus@master
|
||||||
@@ -343,10 +328,6 @@ jobs:
|
|||||||
- run:
|
- run:
|
||||||
name: "trigger payment channel stress testplan on taas"
|
name: "trigger payment channel stress testplan on taas"
|
||||||
command: ~/testground-cli run composition -f $HOME/testground/plans/lotus-soup/_compositions/paych-stress-k8s.toml --metadata-commit=$CIRCLE_SHA1 --metadata-repo=filecoin-project/lotus --metadata-branch=$CIRCLE_BRANCH
|
command: ~/testground-cli run composition -f $HOME/testground/plans/lotus-soup/_compositions/paych-stress-k8s.toml --metadata-commit=$CIRCLE_SHA1 --metadata-repo=filecoin-project/lotus --metadata-branch=$CIRCLE_BRANCH
|
||||||
- run:
|
|
||||||
name: "trigger graphsync testplan on taas"
|
|
||||||
command: ~/testground-cli run composition -f $HOME/testground/plans/graphsync/_compositions/stress-k8s.toml --metadata-commit=$CIRCLE_SHA1 --metadata-repo=filecoin-project/lotus --metadata-branch=$CIRCLE_BRANCH
|
|
||||||
|
|
||||||
|
|
||||||
build-macos:
|
build-macos:
|
||||||
description: build darwin lotus binary
|
description: build darwin lotus binary
|
||||||
@@ -409,7 +390,7 @@ jobs:
|
|||||||
|
|
||||||
build-appimage:
|
build-appimage:
|
||||||
machine:
|
machine:
|
||||||
image: ubuntu-2004:202104-01
|
image: ubuntu-2004:202111-02
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
- attach_workspace:
|
- attach_workspace:
|
||||||
@@ -417,6 +398,16 @@ jobs:
|
|||||||
- run:
|
- run:
|
||||||
name: install appimage-builder
|
name: install appimage-builder
|
||||||
command: |
|
command: |
|
||||||
|
# appimage-builder requires /dev/snd to exist. It creates containers during the testing phase
|
||||||
|
# that pass sound devices from the host to the testing container. (hard coded!)
|
||||||
|
# https://github.com/AppImageCrafters/appimage-builder/blob/master/appimagebuilder/modules/test/execution_test.py#L54
|
||||||
|
# Circleci doesn't provide a working sound device; this is enough to fake it.
|
||||||
|
if [ ! -e /dev/snd ]
|
||||||
|
then
|
||||||
|
sudo mkdir /dev/snd
|
||||||
|
sudo mknod /dev/snd/ControlC0 c 1 2
|
||||||
|
fi
|
||||||
|
|
||||||
# docs: https://appimage-builder.readthedocs.io/en/latest/intro/install.html
|
# docs: https://appimage-builder.readthedocs.io/en/latest/intro/install.html
|
||||||
sudo apt update
|
sudo apt update
|
||||||
sudo apt install -y python3-pip python3-setuptools patchelf desktop-file-utils libgdk-pixbuf2.0-dev fakeroot strace
|
sudo apt install -y python3-pip python3-setuptools patchelf desktop-file-utils libgdk-pixbuf2.0-dev fakeroot strace
|
||||||
@@ -637,6 +628,11 @@ jobs:
|
|||||||
default: "latest"
|
default: "latest"
|
||||||
description: A comma-separated string containing docker image tags to build and push (default = latest)
|
description: A comma-separated string containing docker image tags to build and push (default = latest)
|
||||||
|
|
||||||
|
target:
|
||||||
|
type: string
|
||||||
|
default: "lotus-all-in-one"
|
||||||
|
description: Docker target to build
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- run:
|
- run:
|
||||||
name: Confirm that environment variables are set
|
name: Confirm that environment variables are set
|
||||||
@@ -676,6 +672,7 @@ jobs:
|
|||||||
|
|
||||||
docker build \
|
docker build \
|
||||||
<<#parameters.extra-build-args>><<parameters.extra-build-args>><</parameters.extra-build-args>> \
|
<<#parameters.extra-build-args>><<parameters.extra-build-args>><</parameters.extra-build-args>> \
|
||||||
|
--target <<parameters.target>> \
|
||||||
-f <<parameters.path>>/<<parameters.dockerfile>> \
|
-f <<parameters.path>>/<<parameters.dockerfile>> \
|
||||||
$docker_tag_args \
|
$docker_tag_args \
|
||||||
<<parameters.path>>
|
<<parameters.path>>
|
||||||
@@ -724,8 +721,8 @@ jobs:
|
|||||||
- packer/build:
|
- packer/build:
|
||||||
template: tools/packer/lotus.pkr.hcl
|
template: tools/packer/lotus.pkr.hcl
|
||||||
args: "-var ci_workspace_bins=./linux-butterflynet -var lotus_network=butterflynet -var git_tag=$CIRCLE_TAG"
|
args: "-var ci_workspace_bins=./linux-butterflynet -var lotus_network=butterflynet -var git_tag=$CIRCLE_TAG"
|
||||||
publish-packer-nerpanet:
|
publish-packer-snap:
|
||||||
description: build and push AWS IAM and DigitalOcean droplet.
|
description: build packer image with snap. mainnet only.
|
||||||
executor:
|
executor:
|
||||||
name: packer/default
|
name: packer/default
|
||||||
packer-version: 1.6.6
|
packer-version: 1.6.6
|
||||||
@@ -734,8 +731,7 @@ jobs:
|
|||||||
- attach_workspace:
|
- attach_workspace:
|
||||||
at: "."
|
at: "."
|
||||||
- packer/build:
|
- packer/build:
|
||||||
template: tools/packer/lotus.pkr.hcl
|
template: tools/packer/lotus-snap.pkr.hcl
|
||||||
args: "-var ci_workspace_bins=./linux-nerpanet -var lotus_network=nerpanet -var git_tag=$CIRCLE_TAG"
|
|
||||||
publish-dockerhub:
|
publish-dockerhub:
|
||||||
description: publish to dockerhub
|
description: publish to dockerhub
|
||||||
machine:
|
machine:
|
||||||
@@ -816,7 +812,7 @@ workflows:
|
|||||||
codecov-upload: false
|
codecov-upload: false
|
||||||
suite: conformance-bleeding-edge
|
suite: conformance-bleeding-edge
|
||||||
target: "./conformance"
|
target: "./conformance"
|
||||||
vectors-branch: master
|
vectors-branch: specs-actors-v7
|
||||||
- trigger-testplans:
|
- trigger-testplans:
|
||||||
filters:
|
filters:
|
||||||
branches:
|
branches:
|
||||||
@@ -838,13 +834,15 @@ workflows:
|
|||||||
tags:
|
tags:
|
||||||
only:
|
only:
|
||||||
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
|
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
|
||||||
- build-ntwk-nerpa:
|
- build-lotus-soup
|
||||||
|
- build-macos:
|
||||||
filters:
|
filters:
|
||||||
|
branches:
|
||||||
|
ignore:
|
||||||
|
- /.*/
|
||||||
tags:
|
tags:
|
||||||
only:
|
only:
|
||||||
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
|
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
|
||||||
- build-lotus-soup
|
|
||||||
- build-macos
|
|
||||||
- build-appimage:
|
- build-appimage:
|
||||||
filters:
|
filters:
|
||||||
branches:
|
branches:
|
||||||
@@ -870,6 +868,13 @@ workflows:
|
|||||||
path: .
|
path: .
|
||||||
repo: lotus-dev
|
repo: lotus-dev
|
||||||
tag: '${CIRCLE_SHA1:0:8}'
|
tag: '${CIRCLE_SHA1:0:8}'
|
||||||
|
target: lotus-all-in-one
|
||||||
|
- build-and-push-image:
|
||||||
|
dockerfile: Dockerfile.lotus
|
||||||
|
path: .
|
||||||
|
repo: lotus-test
|
||||||
|
tag: '${CIRCLE_SHA1:0:8}'
|
||||||
|
target: lotus-test
|
||||||
- publish-packer-mainnet:
|
- publish-packer-mainnet:
|
||||||
requires:
|
requires:
|
||||||
- build-all
|
- build-all
|
||||||
@@ -900,16 +905,6 @@ workflows:
|
|||||||
tags:
|
tags:
|
||||||
only:
|
only:
|
||||||
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
|
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
|
||||||
- publish-packer-nerpanet:
|
|
||||||
requires:
|
|
||||||
- build-ntwk-nerpa
|
|
||||||
filters:
|
|
||||||
branches:
|
|
||||||
ignore:
|
|
||||||
- /.*/
|
|
||||||
tags:
|
|
||||||
only:
|
|
||||||
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
|
|
||||||
- publish-snapcraft:
|
- publish-snapcraft:
|
||||||
name: publish-snapcraft-stable
|
name: publish-snapcraft-stable
|
||||||
channel: stable
|
channel: stable
|
||||||
@@ -946,3 +941,13 @@ workflows:
|
|||||||
- publish-dockerhub:
|
- publish-dockerhub:
|
||||||
name: publish-dockerhub-nightly
|
name: publish-dockerhub-nightly
|
||||||
tag: nightly
|
tag: nightly
|
||||||
|
monthly:
|
||||||
|
triggers:
|
||||||
|
- schedule:
|
||||||
|
cron: "0 0 1 * *"
|
||||||
|
filters:
|
||||||
|
branches:
|
||||||
|
only:
|
||||||
|
- master
|
||||||
|
jobs:
|
||||||
|
- publish-packer-snap
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
## Related Issues
|
||||||
|
<!-- link all issues that this PR might resolve/fix. If an issue doesn't exist, include a brief motivation for the change being made.-->
|
||||||
|
|
||||||
|
## Proposed Changes
|
||||||
|
<!-- provide a clear list of the changes being made-->
|
||||||
|
|
||||||
|
|
||||||
|
## Additional Info
|
||||||
|
<!-- callouts, links to documentation, and etc-->
|
||||||
|
|
||||||
|
## Checklist
|
||||||
|
|
||||||
|
Before you mark the PR ready for review, please make sure that:
|
||||||
|
- [ ] All commits have a clear commit message.
|
||||||
|
- [ ] The PR title is in the form of of `<PR type>: <area>: <change being made>`
|
||||||
|
- example: ` fix: mempool: Introduce a cache for valid signatures`
|
||||||
|
- `PR type`: _fix_, _feat_, _INTERFACE BREAKING CHANGE_, _CONSENSUS BREAKING_, _build_, _chore_, _ci_, _docs_,_perf_, _refactor_, _revert_, _style_, _test_
|
||||||
|
- `area`: _api_, _chain_, _state_, _vm_, _data transfer_, _market_, _mempool_, _message_, _block production_, _multisig_, _networking_, _paychan_, _proving_, _sealing_, _wallet_, _deps_
|
||||||
|
- [ ] This PR has tests for new functionality or change in behaviour
|
||||||
|
- [ ] If new user-facing features are introduced, clear usage guidelines and / or documentation updates should be included in https://lotus.filecoin.io or [Discussion Tutorials.](https://github.com/filecoin-project/lotus/discussions/categories/tutorials)
|
||||||
|
- [ ] CI is green
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
name: sync-master-main
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
jobs:
|
||||||
|
sync:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: update remote branch main
|
||||||
|
run: |
|
||||||
|
# overrides the remote branch (origin:github) `main`
|
||||||
|
git push origin --force master:main
|
||||||
@@ -40,6 +40,7 @@ build/paramfetch.sh
|
|||||||
/bundle
|
/bundle
|
||||||
/darwin
|
/darwin
|
||||||
/linux
|
/linux
|
||||||
|
*.snap
|
||||||
|
|
||||||
*-fuzz.zip
|
*-fuzz.zip
|
||||||
/chain/types/work_msg/
|
/chain/types/work_msg/
|
||||||
|
|||||||
+5
-5
@@ -49,23 +49,23 @@ AppDir:
|
|||||||
fedora:
|
fedora:
|
||||||
image: appimagecrafters/tests-env:fedora-30
|
image: appimagecrafters/tests-env:fedora-30
|
||||||
command: ./AppRun
|
command: ./AppRun
|
||||||
use_host_x: true
|
use_host_x: false
|
||||||
debian:
|
debian:
|
||||||
image: appimagecrafters/tests-env:debian-stable
|
image: appimagecrafters/tests-env:debian-stable
|
||||||
command: ./AppRun
|
command: ./AppRun
|
||||||
use_host_x: true
|
use_host_x: false
|
||||||
arch:
|
arch:
|
||||||
image: appimagecrafters/tests-env:archlinux-latest
|
image: appimagecrafters/tests-env:archlinux-latest
|
||||||
command: ./AppRun
|
command: ./AppRun
|
||||||
use_host_x: true
|
use_host_x: false
|
||||||
centos:
|
centos:
|
||||||
image: appimagecrafters/tests-env:centos-7
|
image: appimagecrafters/tests-env:centos-7
|
||||||
command: ./AppRun
|
command: ./AppRun
|
||||||
use_host_x: true
|
use_host_x: false
|
||||||
ubuntu:
|
ubuntu:
|
||||||
image: appimagecrafters/tests-env:ubuntu-xenial
|
image: appimagecrafters/tests-env:ubuntu-xenial
|
||||||
command: ./AppRun
|
command: ./AppRun
|
||||||
use_host_x: true
|
use_host_x: false
|
||||||
AppImage:
|
AppImage:
|
||||||
arch: x86_64
|
arch: x86_64
|
||||||
update-information: guess
|
update-information: guess
|
||||||
|
|||||||
+692
-117
@@ -1,5 +1,579 @@
|
|||||||
# Lotus changelog
|
# Lotus changelog
|
||||||
|
|
||||||
|
# 1.15.0 / 2022-03-09
|
||||||
|
|
||||||
|
This is an optional release with retrieval improvements(client side), SP ux with unsealing, snap deals and regular deal making and many other new features, improvements and bug fixes.
|
||||||
|
|
||||||
|
## Highlights
|
||||||
|
- feat:sealing: StartEpochSealingBuffer triggers packing on time([filecoin-project/lotus#7905](https://github.com/filecoin-project/lotus/pull/7905))
|
||||||
|
- use the `StartEpochSealingBuffer` configuration variable as a way to enforce that sectors are packed for sealing / updating no matter how many deals they have if the nearest deal start date is close enough to the present.
|
||||||
|
- feat: #6017 market: retrieval ask CLI command ([filecoin-project/lotus#7814](https://github.com/filecoin-project/lotus/pull/7814))
|
||||||
|
- feat(graphsync): allow setting of per-peer incoming requests for miners ([filecoin-project/lotus#7578](https://github.com/filecoin-project/lotus/pull/7578))
|
||||||
|
- by setting `SimultaneousTransfersForStoragePerClient` in deal making configuration.
|
||||||
|
- Make retrieval even faster ([filecoin-project/lotus#7746](https://github.com/filecoin-project/lotus/pull/7746))
|
||||||
|
- feat: #7747 sealing: Adding conf variable for capping number of concurrent unsealing jobs (#7884) ([filecoin-project/lotus#7884](https://github.com/filecoin-project/lotus/pull/7884))
|
||||||
|
- by setting `MaxConcurrentUnseals` in `DAGStoreConfig`
|
||||||
|
|
||||||
|
## New Features
|
||||||
|
- feat: mpool: Cache state nonces ([filecoin-project/lotus#8005](https://github.com/filecoin-project/lotus/pull/8005))
|
||||||
|
- chore: build: make the OhSnap epoch configurable by an envvar for devnets ([filecoin-project/lotus#7995](https://github.com/filecoin-project/lotus/pull/7995))
|
||||||
|
- Shed: Add a util to send a batch of messages ([filecoin-project/lotus#7667](https://github.com/filecoin-project/lotus/pull/7667))
|
||||||
|
- Add api for transfer diagnostics ([filecoin-project/lotus#7759](https://github.com/filecoin-project/lotus/pull/7759))
|
||||||
|
- Shed: Add a util to list terminated deals ([filecoin-project/lotus#7774](https://github.com/filecoin-project/lotus/pull/7774))
|
||||||
|
- Expose EnableGasTracing as an env_var ([filecoin-project/lotus#7750](https://github.com/filecoin-project/lotus/pull/7750))
|
||||||
|
- Command to list active sector locks ([filecoin-project/lotus#7735](https://github.com/filecoin-project/lotus/pull/7735))
|
||||||
|
- Initial switch to OpenTelemetry ([filecoin-project/lotus#7725](https://github.com/filecoin-project/lotus/pull/7725))
|
||||||
|
|
||||||
|
## Improvements
|
||||||
|
- splitstore sortless compaction ([filecoin-project/lotus#8008](https://github.com/filecoin-project/lotus/pull/8008))
|
||||||
|
- perf: chain: Make drand logs in daemon less noisy (#7955) ([filecoin-project/lotus#7955](https://github.com/filecoin-project/lotus/pull/7955))
|
||||||
|
- chore: shed: storage stats 2.0 ([filecoin-project/lotus#7941](https://github.com/filecoin-project/lotus/pull/7941))
|
||||||
|
- misc: api: Annotate lotus tests according to listed behaviors ([filecoin-project/lotus#7835](https://github.com/filecoin-project/lotus/pull/7835))
|
||||||
|
- some basic splitstore refactors ([filecoin-project/lotus#7999](https://github.com/filecoin-project/lotus/pull/7999))
|
||||||
|
- chore: sealer: quieten a log ([filecoin-project/lotus#7998](https://github.com/filecoin-project/lotus/pull/7998))
|
||||||
|
- tvx: supply network version when extracting messages. ([filecoin-project/lotus#7996](https://github.com/filecoin-project/lotus/pull/7996))
|
||||||
|
- chore: remove inaccurate comment in sealtasks ([filecoin-project/lotus#7977](https://github.com/filecoin-project/lotus/pull/7977))
|
||||||
|
- Refactor: VM: Remove the NetworkVersionGetter ([filecoin-project/lotus#7818](https://github.com/filecoin-project/lotus/pull/7818))
|
||||||
|
- refactor: state: Move randomness versioning out of the VM ([filecoin-project/lotus#7816](https://github.com/filecoin-project/lotus/pull/7816))
|
||||||
|
- updating to new datastore/blockstore code with contexts ([filecoin-project/lotus#7646](https://github.com/filecoin-project/lotus/pull/7646))
|
||||||
|
- Mempool msg selection should respect block message limits ([filecoin-project/lotus#7321](https://github.com/filecoin-project/lotus/pull/7321))
|
||||||
|
- Minor improvement for OpenTelemetry ([filecoin-project/lotus#7760](https://github.com/filecoin-project/lotus/pull/7760))
|
||||||
|
- Sort lotus-miner retrieval-deals by dealId ([filecoin-project/lotus#7749](https://github.com/filecoin-project/lotus/pull/7749))
|
||||||
|
- dagstore pieceReader: Always read full in ReadAt ([filecoin-project/lotus#7737](https://github.com/filecoin-project/lotus/pull/7737))
|
||||||
|
|
||||||
|
## Bug Fixes
|
||||||
|
- fix: sealing: Stop recovery attempts after fault ([filecoin-project/lotus#8014](https://github.com/filecoin-project/lotus/pull/8014))
|
||||||
|
- fix:snap: pay for the collateral difference needed if the miner available balance is insufficient ([filecoin-project/lotus#8234](https://github.com/filecoin-project/lotus/pull/8234))
|
||||||
|
- sealer: fix error message ([filecoin-project/lotus#8136](https://github.com/filecoin-project/lotus/pull/8136))
|
||||||
|
- typo in variable name ([filecoin-project/lotus#8134](https://github.com/filecoin-project/lotus/pull/8134))
|
||||||
|
- fix: sealer: allow enable/disabling ReplicaUpdate tasks ([filecoin-project/lotus#8093](https://github.com/filecoin-project/lotus/pull/8093))
|
||||||
|
- chore: chain: fix log ([filecoin-project/lotus#7993](https://github.com/filecoin-project/lotus/pull/7993))
|
||||||
|
- Fix: chain: create a new VM for each epoch ([filecoin-project/lotus#7966](https://github.com/filecoin-project/lotus/pull/7966))
|
||||||
|
- fix: doc generation struct slice example value ([filecoin-project/lotus#7851](https://github.com/filecoin-project/lotus/pull/7851))
|
||||||
|
- fix: returned error not be accept correctly ([filecoin-project/lotus#7852](https://github.com/filecoin-project/lotus/pull/7852))
|
||||||
|
- fix: #7577 markets: When retrying Add Piece, first seek to start of reader ([filecoin-project/lotus#7812](https://github.com/filecoin-project/lotus/pull/7812))
|
||||||
|
- misc: n/a sealing: Fix grammatical error in a log warning message ([filecoin-project/lotus#7831](https://github.com/filecoin-project/lotus/pull/7831))
|
||||||
|
- sectors update-state checks if sector exists before changing its state ([filecoin-project/lotus#7762](https://github.com/filecoin-project/lotus/pull/7762))
|
||||||
|
- SplitStore: supress compaction near upgrades ([filecoin-project/lotus#7734](https://github.com/filecoin-project/lotus/pull/7734))
|
||||||
|
|
||||||
|
## Dependency Updates
|
||||||
|
- github.com/filecoin-project/go-commp-utils (v0.1.2 -> v0.1.3):
|
||||||
|
- github.com/filecoin-project/dagstore (v0.4.3 -> v0.4.4):
|
||||||
|
- github.com/filecoin-project/go-fil-markets (v1.13.4 -> v1.19.2):
|
||||||
|
- github.com/filecoin-project/go-statestore (v0.1.1 -> v0.2.0):
|
||||||
|
- github.com/filecoin-project/go-storedcounter (v0.0.0-20200421200003-1c99c62e8a5b -> v0.1.0):
|
||||||
|
- github.com/filecoin-project/specs-actors/v2 (v2.3.5 -> v2.3.6):
|
||||||
|
- feat(deps): update markets stack ([filecoin-project/lotus#7959](https://github.com/filecoin-project/lotus/pull/7959))
|
||||||
|
- Use go-libp2p-connmgr v0.3.1 ([filecoin-project/lotus#7957](https://github.com/filecoin-project/lotus/pull/7957))
|
||||||
|
- dep/fix 7701 Dependency: update to ipld-legacy to v0.1.1 ([filecoin-project/lotus#7751](https://github.com/filecoin-project/lotus/pull/7751))
|
||||||
|
|
||||||
|
## Others
|
||||||
|
- chore: backport: release ([filecoin-project/lotus#8245](https://github.com/filecoin-project/lotus/pull/8245))
|
||||||
|
- Lotus release v1.15.0-rc3 ([filecoin-project/lotus#8236](https://github.com/filecoin-project/lotus/pull/8236))
|
||||||
|
- Lotus release v1.15.0-rc2 ([filecoin-project/lotus#8211](https://github.com/filecoin-project/lotus/pull/8211))
|
||||||
|
- Merge branch 'releases' into release/v1.15.0
|
||||||
|
- chore: build: backport releases ([filecoin-project/lotus#8193](https://github.com/filecoin-project/lotus/pull/8193))
|
||||||
|
- Merge branch 'releases' into release/v1.15.0
|
||||||
|
- bump the version to v1.15.0-rc1
|
||||||
|
- chore: build: v1.14.0 -> master ([filecoin-project/lotus#8053](https://github.com/filecoin-project/lotus/pull/8053))
|
||||||
|
- chore: merge release/v1.14.0 PRs into master ([filecoin-project/lotus#7979](https://github.com/filecoin-project/lotus/pull/7979))
|
||||||
|
- chore: update PR template ([filecoin-project/lotus#7918](https://github.com/filecoin-project/lotus/pull/7918))
|
||||||
|
- build: release: bump master version to v1.15.0-dev ([filecoin-project/lotus#7922](https://github.com/filecoin-project/lotus/pull/7922))
|
||||||
|
- misc: docs: remove issue number from the pr title ([filecoin-project/lotus#7902](https://github.com/filecoin-project/lotus/pull/7902))
|
||||||
|
- Snapcraft grade no develgrade ([filecoin-project/lotus#7802](https://github.com/filecoin-project/lotus/pull/7802))
|
||||||
|
- chore: create pull_request_template.md ([filecoin-project/lotus#7726](https://github.com/filecoin-project/lotus/pull/7726))
|
||||||
|
- Disable appimage ([filecoin-project/lotus#7707](https://github.com/filecoin-project/lotus/pull/7707))
|
||||||
|
|
||||||
|
## Contributors
|
||||||
|
| Contributor | Commits | Lines ± | Files Changed |
|
||||||
|
|-------------|---------|---------|---------------|
|
||||||
|
| @arajasek | 73 | +7232/-2778 | 386 |
|
||||||
|
| @zenground0 | 27 | +5604/-1049 | 219 |
|
||||||
|
| @vyzo | 118 | +4356/-1470 | 253 |
|
||||||
|
| @zl | 1 | +3725/-309 | 8 |
|
||||||
|
| @dirkmc | 7 | +1392/-1110 | 61 |
|
||||||
|
| arajasek | 37 | +221/-1329 | 90 |
|
||||||
|
| @magik6k | 33 | +1138/-336 | 101 |
|
||||||
|
| @whyrusleeping | 2 | +483/-585 | 28 |
|
||||||
|
| Darko Brdareski | 14 | +725/-276 | 154 |
|
||||||
|
| @rvagg | 2 | +43/-947 | 10 |
|
||||||
|
| @hannahhoward | 5 | +436/-335 | 31 |
|
||||||
|
| @hannahhoward | 12 | +507/-133 | 37 |
|
||||||
|
| @jennijuju | 27 | +333/-178 | 54 |
|
||||||
|
| @TheMenko | 8 | +237/-179 | 17 |
|
||||||
|
| c r | 2 | +227/-45 | 12 |
|
||||||
|
| @dirkmck | 12 | +188/-40 | 27 |
|
||||||
|
| @ribasushi | 3 | +128/-62 | 3 |
|
||||||
|
| @raulk | 6 | +128/-49 | 9 |
|
||||||
|
| @Whyrusleeping | 1 | +76/-70 | 8 |
|
||||||
|
| @Stebalien | 1 | +55/-37 | 1 |
|
||||||
|
| @jennijuju | 11 | +29/-16 | 11 |
|
||||||
|
| @aarshkshah1992 | 1 | +23/-19 | 5 |
|
||||||
|
| @travisperson | 1 | +0/-18 | 2 |
|
||||||
|
| @gstuart | 3 | +12/-1 | 3 |
|
||||||
|
| @coryschwartz | 4 | +5/-6 | 4 |
|
||||||
|
| @pefish | 1 | +4/-3 | 1 |
|
||||||
|
| @Kubuxu | 1 | +5/-2 | 2 |
|
||||||
|
| Colin Kennedy | 1 | +4/-2 | 1 |
|
||||||
|
| Rob Quist | 1 | +2/-2 | 1 |
|
||||||
|
| @shotcollin | 1 | +1/-1 | 1 |
|
||||||
|
|
||||||
|
|
||||||
|
# 1.14.4 / 2022-03-03
|
||||||
|
|
||||||
|
This is a *highly recommended* optional release for storage providers that are doing snap deals. This fix the bug
|
||||||
|
that causes some snap deal sectors are stuck in `FinalizeReplicaUpdate`. In addition, SPs should be able to force
|
||||||
|
update sectors status without getting blocked by `normal shutdown of state machine`.
|
||||||
|
|
||||||
|
# v1.14.3 / 2022-02-28
|
||||||
|
|
||||||
|
This is an **optional** release, that includes a fix to properly register the `--really-do-it` flag for abort-upgrade.
|
||||||
|
|
||||||
|
# 1.14.2 / 2022-02-24
|
||||||
|
|
||||||
|
This is an **optional** release of lotus, that's had a couple more improvements w.r.t Snap experience for storage providers in preparation of the[upcoming OhSnap upgrade](https://github.com/filecoin-project/community/discussions/74?sort=new#discussioncomment-1922550).
|
||||||
|
|
||||||
|
Note that the network is STILL scheduled to upgrade to v15 on March 1st at 2022-03-01T15:00:00Z. All node operators, including storage providers, must upgrade to at least Lotus v1.14.0 before that time. Storage providers must update their daemons, miners, and worker(s).
|
||||||
|
|
||||||
|
Wanna know how to Snap your deal? Check [this](https://github.com/filecoin-project/lotus/discussions/8141) out!
|
||||||
|
|
||||||
|
## Bug Fixes
|
||||||
|
- fix lotus-bench for sealing jobs (#8173)
|
||||||
|
- fix:sealing:really-do-it flag for abort upgrade (#8181)
|
||||||
|
- fix:proving:post check sector handles snap deals replica faults (#8177)
|
||||||
|
- fix: sealing: missing file type (#8180)
|
||||||
|
|
||||||
|
## Others
|
||||||
|
- Retract force-pushed v1.14.0 to work around stale gomod caches (#8159): We originally tagged v1.14.0 off the wrong
|
||||||
|
commit and fixed that by a force push, in which is a really bad practise since it messes up the go mod. Therefore,
|
||||||
|
we want to retract it and users may use v1.14.1&^.
|
||||||
|
|
||||||
|
## Contributors
|
||||||
|
|
||||||
|
| Contributor | Commits | Lines ± | Files Changed |
|
||||||
|
|-------------|---------|---------|---------------|
|
||||||
|
| @zenground0 | 2 | +73/-58 | 12 |
|
||||||
|
| @eben.xie | 1 | +7/-0 | 1 |
|
||||||
|
| @jennijuju | 1 | +4/-0 | 1 |
|
||||||
|
| @jennijuju | 1 | +2/-1 | 1 |
|
||||||
|
| @ribasushi | 1 | +2/-0 | 1 |
|
||||||
|
|
||||||
|
# 1.14.1 / 2022-02-18
|
||||||
|
|
||||||
|
This is an **optional** release of lotus, that fixes the incorrect *comment* of network v15 OhSnap upgrade **date**. Note the actual upgrade epoch in [v1.14.0](https://github.com/filecoin-project/lotus/releases/tag/v1.14.0) was correct.
|
||||||
|
|
||||||
|
# 1.14.0 / 2022-02-17
|
||||||
|
|
||||||
|
This is a MANDATORY release of Lotus that introduces [Filecoin network v15,
|
||||||
|
codenamed the OhSnap upgrade](https://github.com/filecoin-project/community/discussions/74?sort=new#discussioncomment-1922550).
|
||||||
|
|
||||||
|
The network is scheduled to upgrade to v15 on March 1st at 2022-03-01T15:00:00Z. All node operators, including storage providers, must upgrade to this release (or a later release) before that time. Storage providers must update their daemons, miners, and worker(s).
|
||||||
|
|
||||||
|
The OhSnap upgrade introduces the following FIPs, delivered in [actors v7](https://github.com/filecoin-project/specs-actors/releases/tag/v7.0.0):
|
||||||
|
- [FIP-0019 Snap Deals](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0019.md)
|
||||||
|
- [FIP-0028 Remove Datacap from Verified clients](https://github.com/filecoin-project/FIPs/pull/226)
|
||||||
|
|
||||||
|
It is recommended that storage providers download the new params before updating their node, miner, and workers. To do so:
|
||||||
|
|
||||||
|
- Download Lotus v1.14.0 or later
|
||||||
|
- run `make lotus-shed`
|
||||||
|
- run `./lotus-shed fetch-params` with the appropriate `proving-params` flag
|
||||||
|
- Upgrade the Lotus daemon and miner **when the previous step is complete**
|
||||||
|
|
||||||
|
All node operators, including storage providers, should be aware that a pre-migration will begin at 2022-03-01T13:30:00Z (90 minutes before the real upgrade). The pre-migration will take between 20 and 50 minutes, depending on hardware specs. During this time, expect slower block validation times, increased CPU and memory usage, and longer delays for API queries.
|
||||||
|
|
||||||
|
## New Features and Changes
|
||||||
|
- Integrate actor v7-rc1:
|
||||||
|
- Integrate v7 actors ([#7617](https://github.com/filecoin-project/lotus/pull/7617))
|
||||||
|
- feat: state: Fast migration for v15 ([#7933](https://github.com/filecoin-project/lotus/pull/7933))
|
||||||
|
- fix: blockstore: Add missing locks to autobatch::Get() [#7939](https://github.com/filecoin-project/lotus/pull/7939))
|
||||||
|
- correctness fixes for the autobatch blockstore ([#7940](https://github.com/filecoin-project/lotus/pull/7940))
|
||||||
|
- Implement and support [FIP-0019 Snap Deals](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0019.md)
|
||||||
|
- chore: deps: Integrate proof v11.0.0 ([#7923](https://github.com/filecoin-project/lotus/pull/7923))
|
||||||
|
- Snap Deals Lotus Integration: FSM Posting and integration test ([#7810](https://github.com/filecoin-project/lotus/pull/7810))
|
||||||
|
- Feat/sector storage unseal ([#7730](https://github.com/filecoin-project/lotus/pull/7730))
|
||||||
|
- Feat/snap deals storage ([#7615](https://github.com/filecoin-project/lotus/pull/7615))
|
||||||
|
- fix: sealing: Add more deal expiration checks during PRU pipeline ([#7871](https://github.com/filecoin-project/lotus/pull/7871))
|
||||||
|
- chore: deps: Update go-paramfetch ([#7917](https://github.com/filecoin-project/lotus/pull/7917))
|
||||||
|
- feat: #7880 gas: add gas charge for VerifyReplicaUpdate ([#7897](https://github.com/filecoin-project/lotus/pull/7897))
|
||||||
|
- enhancement: sectors: disable existing cc upgrade path 2 days before the upgrade epoch ([#7900](https://github.com/filecoin-project/lotus/pull/7900))
|
||||||
|
|
||||||
|
## Improvements
|
||||||
|
- updating to new datastore/blockstore code with contexts ([#7646](https://github.com/filecoin-project/lotus/pull/7646))
|
||||||
|
- reorder transfer checks so as to ensure sending 2B FIL to yourself fails if you don't have that amount ([#7637](https://github.com/filecoin-project/lotus/pull/7637))
|
||||||
|
- VM: Circ supply should be constant per epoch ([#7811](https://github.com/filecoin-project/lotus/pull/7811))
|
||||||
|
|
||||||
|
## Bug Fixes
|
||||||
|
- Fix: state: circsuypply calc around null blocks ([#7890](https://github.com/filecoin-project/lotus/pull/7890))
|
||||||
|
- Mempool msg selection should respect block message limits ([#7321](https://github.com/filecoin-project/lotus/pull/7321))
|
||||||
|
SplitStore: supress compaction near upgrades ([#7734](https://github.com/filecoin-project/lotus/pull/7734))
|
||||||
|
|
||||||
|
## Others
|
||||||
|
- chore: create pull_request_template.md ([#7726](https://github.com/filecoin-project/lotus/pull/7726))
|
||||||
|
|
||||||
|
## Contributors
|
||||||
|
|
||||||
|
| Contributor | Commits | Lines ± | Files Changed |
|
||||||
|
|-------------|---------|---------|---------------|
|
||||||
|
| Aayush Rajasekaran | 41 | +5538/-1205 | 189 |
|
||||||
|
| zenground0 | 11 | +3316/-524 | 124 |
|
||||||
|
| Jennifer Wang | 29 | +714/-599 | 68 |
|
||||||
|
| ZenGround0 | 3 | +263/-25 | 11 |
|
||||||
|
| c r | 2 | +198/-30 | 6 |
|
||||||
|
| vyzo | 4 | +189/-7 | 7 |
|
||||||
|
| Aayush | 11 | +146/-48 | 49 |
|
||||||
|
| web3-bot | 10 | +99/-17 | 10 |
|
||||||
|
| Steven Allen | 1 | +55/-37 | 1 |
|
||||||
|
| Jiaying Wang | 5 | +30/-8 | 5 |
|
||||||
|
| Jakub Sztandera | 2 | +8/-3 | 3 |
|
||||||
|
| Łukasz Magiera | 1 | +3/-3 | 2 |
|
||||||
|
| Travis Person | 1 | +2/-2 | 2 |
|
||||||
|
| Rod Vagg | 1 | +2/-2 | 2 |
|
||||||
|
|
||||||
|
# v1.13.2 / 2022-01-09
|
||||||
|
|
||||||
|
Lotus v1.13.2 is a *highly recommended* feature release with remarkable retrieval improvements, new features like
|
||||||
|
worker management, schedule enhancements and so on.
|
||||||
|
|
||||||
|
## Highlights
|
||||||
|
- 🚀🚀🚀Improve retrieval deal experience
|
||||||
|
- Testing result with MinerX.3 shows the retrieval deal success rate has increased dramatically with faster transfer
|
||||||
|
speed, you can join or follow along furthur performance testings [here](https://github.com/filecoin-project/lotus/discussions/7874). We recommend application developers to integrate with the new
|
||||||
|
retrieval APIs to provide a better client experience.
|
||||||
|
- 🌟🌟🌟 Reduce retrieval Time-To-First-Byte over 100x ([#7693](https://github.com/filecoin-project/lotus/pull/7693))
|
||||||
|
- This change makes most free, small retrievals sub-second
|
||||||
|
- 🌟🌟🌟 Partial retrieval ux improvements ([#7610](https://github.com/filecoin-project/lotus/pull/7610))
|
||||||
|
- New retrieval commands for clients:
|
||||||
|
- `lotus client ls`: retrieve and list desired object links
|
||||||
|
- `lotus client cat`: retrieve and print the data from the network
|
||||||
|
- 🌟🌟 The monolith `ClientRetrieve` method was broken into:
|
||||||
|
- `ClientRetrieve` which retrieves data into the local repo (or into an IPFS node if ipfs integration is enabled)
|
||||||
|
- `ClientRetrieveWait` which will wait for the retrieval to complete
|
||||||
|
- `ClientExport` which will export data from the local node
|
||||||
|
- Note: this change only applies to v1 API. v0 API remains unchanged.
|
||||||
|
- 🌟 Support for full ipld selectors was added (for example making it possible to only retrieve list of directories in a deal, without fetching any file data)
|
||||||
|
- To learn more, see [here](https://github.com/filecoin-project/lotus/blob/0523c946f984b22b3f5de8cc3003cc791389527e/api/types.go#L230-L264)
|
||||||
|
- 🚀🚀 Sealing scheduler enhancements ([#7703](https://github.com/filecoin-project/lotus/pull/7703),
|
||||||
|
[#7269](https://github.com/filecoin-project/lotus/pull/7269)), [#7714](https://github.com/filecoin-project/lotus/pull/7714)
|
||||||
|
- Workers are now aware of cgroup memory limits
|
||||||
|
- Multiple tasks which use a GPU can be scheduled on a single worker
|
||||||
|
- Workers can override default resource table through env vars
|
||||||
|
- Default value list: https://gist.github.com/magik6k/c0e1c7cd73c1241a9acabc30bf469a43
|
||||||
|
- 🚀🚀 Sector storage groups ([#7453](https://github.com/filecoin-project/lotus/pull/7453))
|
||||||
|
- Storage groups allow for better control of data flow between workers, for example, it makes it possible to define that data from PC1 on a given worker has to have it's PC2 step executed on the same worker
|
||||||
|
- To set it up, follow the instructions under the `Sector Storage Group` section [here](https://lotus.filecoin.io/docs/storage-providers/seal-workers/#lotus-worker-co-location)
|
||||||
|
|
||||||
|
## New Features
|
||||||
|
- Add RLE dump code ([#7691](https://github.com/filecoin-project/lotus/pull/7691))
|
||||||
|
- Shed: Add a util to list miner faults ([#7605](https://github.com/filecoin-project/lotus/pull/7605))
|
||||||
|
- lotus-shed msg: Decode submessages/msig proposals ([#7639](https://github.com/filecoin-project/lotus/pull/7639))
|
||||||
|
- CLI: Add a lotus multisig cancel command ([#7645](https://github.com/filecoin-project/lotus/pull/7645))
|
||||||
|
- shed: simple wallet balancer util ([#7414](https://github.com/filecoin-project/lotus/pull/7414))
|
||||||
|
- balancing token balance between multiple accounts
|
||||||
|
|
||||||
|
## Improvements
|
||||||
|
- Add verbose mode to `lotus-miner pieces list-cids` ([#7699](https://github.com/filecoin-project/lotus/pull/7699))
|
||||||
|
- retrieval: Only output matching nodes, MatchPath dagspec ([#7706](https://github.com/filecoin-project/lotus/pull/7706))
|
||||||
|
- Cleanup partial retrieval codepaths ( zero functional changes ) ([#7688](https://github.com/filecoin-project/lotus/pull/7688))
|
||||||
|
- storage: Use 1M buffers for Tar transfers ([#7681](https://github.com/filecoin-project/lotus/pull/7681))
|
||||||
|
- Chore/dm level tests plus merkle proof cars ([#7673](https://github.com/filecoin-project/lotus/pull/7673))
|
||||||
|
- Shed: Add a util to create miners more easily ([#7595](https://github.com/filecoin-project/lotus/pull/7595))
|
||||||
|
- add timeout flag to wait-api command ([#7592](https://github.com/filecoin-project/lotus/pull/7592))
|
||||||
|
- add log for restart windows post scheduler ([#7613](https://github.com/filecoin-project/lotus/pull/7613))
|
||||||
|
- remove jaeger envvars ([#7631](https://github.com/filecoin-project/lotus/pull/7631))
|
||||||
|
- remove api and jaeger env from docker file ([#7624](https://github.com/filecoin-project/lotus/pull/7624))
|
||||||
|
- Wdpost worker: Reduce challenge confidence to 1 epoch ([#7572](https://github.com/filecoin-project/lotus/pull/7572))
|
||||||
|
- add additional methods to lotus gateway ([#7644](https://github.com/filecoin-project/lotus/pull/7644))
|
||||||
|
- Add caches to lotus-stats and splitcode ([#7329](https://github.com/filecoin-project/lotus/pull/7329))
|
||||||
|
- remote store: Remove debug printf ([#7664](https://github.com/filecoin-project/lotus/pull/7664))
|
||||||
|
- docsgen-cli: Handle commands with no description correctly ([#7659](https://github.com/filecoin-project/lotus/pull/7659))
|
||||||
|
|
||||||
|
## Bug Fixes
|
||||||
|
- fix docker logic error ([#7709](https://github.com/filecoin-project/lotus/pull/7709))
|
||||||
|
- add missing NodeType tag ([#7559](https://github.com/filecoin-project/lotus/pull/7559))
|
||||||
|
- checkCommit should return SectorCommitFailed ([#7555](https://github.com/filecoin-project/lotus/pull/7555))
|
||||||
|
- ffiwrapper: Validate PC2 by calling C1 with random seeds ([#7710](https://github.com/filecoin-project/lotus/pull/7710))
|
||||||
|
|
||||||
|
## Dependency Updates
|
||||||
|
- Update go-graphsync v0.10.6 ([#7708](https://github.com/filecoin-project/lotus/pull/7708))
|
||||||
|
- update go-libp2p-pubsub to v0.5.6 ([#7581](https://github.com/filecoin-project/lotus/pull/7581))
|
||||||
|
- Update go-state-types ([#7591](https://github.com/filecoin-project/lotus/pull/7591))
|
||||||
|
- disable mplex stream muxer ([#7689](https://github.com/filecoin-project/lotus/pull/7689))
|
||||||
|
- Bump ws from 5.2.2 to 5.2.3 in /lotuspond/front ([#7660](https://github.com/filecoin-project/lotus/pull/7660))
|
||||||
|
- Bump color-string from 1.5.3 to 1.6.0 in /lotuspond/front ([#7658](https://github.com/filecoin-project/lotus/pull/7658))
|
||||||
|
- Bump postcss from 7.0.17 to 7.0.39 in /lotuspond/front ([#7657](https://github.com/filecoin-project/lotus/pull/7657))
|
||||||
|
- Bump path-parse from 1.0.6 to 1.0.7 in /lotuspond/front ([#7656](https://github.com/filecoin-project/lotus/pull/7656))
|
||||||
|
- Bump tmpl from 1.0.4 to 1.0.5 in /lotuspond/front ([#7655](https://github.com/filecoin-project/lotus/pull/7655))
|
||||||
|
- Bump url-parse from 1.4.7 to 1.5.3 in /lotuspond/front ([#7654](https://github.com/filecoin-project/lotus/pull/7654))
|
||||||
|
- github.com/filecoin-project/go-state-types (v0.1.1-0.20210915140513-d354ccf10379 -> v0.1.1):
|
||||||
|
|
||||||
|
## Others
|
||||||
|
- Update archive script ([#7690](https://github.com/filecoin-project/lotus/pull/7690))
|
||||||
|
|
||||||
|
## Contributors
|
||||||
|
|
||||||
|
| Contributor | Commits | Lines ± | Files Changed |
|
||||||
|
|-------------|---------|---------|---------------|
|
||||||
|
| @magik6k | 89 | +5200/-1818 | 232 |
|
||||||
|
| Travis Person | 5 | +1473/-953 | 38 |
|
||||||
|
| @arajasek | 6 | +550/-38 | 19 |
|
||||||
|
| @clinta | 4 | +393/-123 | 26 |
|
||||||
|
| @ribasushi | 3 | +334/-68 | 7 |
|
||||||
|
| @jennijuju| 13 | +197/-120 | 67 |
|
||||||
|
| @Kubuxu | 10 | +153/-30 | 10 |
|
||||||
|
| @coryschwartz | 6 | +18/-26 | 6 |
|
||||||
|
| Marten Seemann | 2 | +6/-34 | 5 |
|
||||||
|
| @vyzo | 1 | +3/-3 | 2 |
|
||||||
|
| @hannahhoward | 1 | +3/-3 | 2 |
|
||||||
|
| @zenground0 | 2 | +2/-2 | 2 |
|
||||||
|
| @yaohcn | 2 | +2/-2 | 2 |
|
||||||
|
| @jennijuju | 1 | +1/-1 | 1 |
|
||||||
|
| @hunjixin | 1 | +1/-0 | 1 |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# v1.13.1 / 2021-11-26
|
||||||
|
|
||||||
|
This is an optional Lotus v1.13.1 release.
|
||||||
|
|
||||||
|
## New Features
|
||||||
|
- Shed: Add a util to find miner based on peerid ([filecoin-project/lotus#7544](https://github.com/filecoin-project/lotus/pull/7544))
|
||||||
|
- Collect and expose graphsync metrics ([filecoin-project/lotus#7542](https://github.com/filecoin-project/lotus/pull/7542))
|
||||||
|
- Shed: Add a util to find the most recent null tipset ([filecoin-project/lotus#7456](https://github.com/filecoin-project/lotus/pull/7456))
|
||||||
|
|
||||||
|
## Improvements
|
||||||
|
- Show prepared tasks in sealing jobs ([filecoin-project/lotus#7527](https://github.com/filecoin-project/lotus/pull/7527))
|
||||||
|
- To make Deep happy ([filecoin-project/lotus#7546](https://github.com/filecoin-project/lotus/pull/7546))
|
||||||
|
- Expose per-state sector counts on the prometheus endpoint ([filecoin-project/lotus#7541](https://github.com/filecoin-project/lotus/pull/7541))
|
||||||
|
- Add storage-id flag to proving check ([filecoin-project/lotus#7479](https://github.com/filecoin-project/lotus/pull/7479))
|
||||||
|
- FilecoinEC: Improve a log message ([filecoin-project/lotus#7499](https://github.com/filecoin-project/lotus/pull/7499))
|
||||||
|
- itests: retry deal when control addr is out of funds ([filecoin-project/lotus#7454](https://github.com/filecoin-project/lotus/pull/7454))
|
||||||
|
- Normlize selector use within lotus ([filecoin-project/lotus#7467](https://github.com/filecoin-project/lotus/pull/7467))
|
||||||
|
- sealing: Improve scheduling of ready work ([filecoin-project/lotus#7335](https://github.com/filecoin-project/lotus/pull/7335))
|
||||||
|
- Remove dead example code + dep ([filecoin-project/lotus#7466](https://github.com/filecoin-project/lotus/pull/7466))
|
||||||
|
|
||||||
|
## Bug Fixes
|
||||||
|
- fix the withdrawn amount unit ([filecoin-project/lotus#7563](https://github.com/filecoin-project/lotus/pull/7563))
|
||||||
|
- rename vm#make{=>Account}Actor(). ([filecoin-project/lotus#7562](https://github.com/filecoin-project/lotus/pull/7562))
|
||||||
|
- Fix used sector space accounting after AddPieceFailed ([filecoin-project/lotus#7530](https://github.com/filecoin-project/lotus/pull/7530))
|
||||||
|
- Don't remove sector data when moving data into a shared path ([filecoin-project/lotus#7494](https://github.com/filecoin-project/lotus/pull/7494))
|
||||||
|
- fix: support node instantiation in external packages ([filecoin-project/lotus#7511](https://github.com/filecoin-project/lotus/pull/7511))
|
||||||
|
- Stop adding Jennifer's $HOME to lotus docs ([filecoin-project/lotus#7477](https://github.com/filecoin-project/lotus/pull/7477))
|
||||||
|
- Bugfix: Use correct startup network versions ([filecoin-project/lotus#7486](https://github.com/filecoin-project/lotus/pull/7486))
|
||||||
|
- Dep upgrade pass ([filecoin-project/lotus#7478](https://github.com/filecoin-project/lotus/pull/7478))
|
||||||
|
- Remove obsolete GS testplan - it now lives in go-graphsync ([filecoin-project/lotus#7469](https://github.com/filecoin-project/lotus/pull/7469))
|
||||||
|
- sealing: Recover sectors after failed AddPiece ([filecoin-project/lotus#7444](https://github.com/filecoin-project/lotus/pull/7444))
|
||||||
|
|
||||||
|
## Dependency Updates
|
||||||
|
- Update go-graphsync v0.10.1 ([filecoin-project/lotus#7457](https://github.com/filecoin-project/lotus/pull/7457))
|
||||||
|
- update to proof v10.1.0 ([filecoin-project/lotus#7564](https://github.com/filecoin-project/lotus/pull/7564))
|
||||||
|
- github.com/filecoin-project/specs-actors/v6 (v6.0.0 -> v6.0.1):
|
||||||
|
- github.com/filecoin-project/go-jsonrpc (v0.1.4-0.20210217175800-45ea43ac2bec -> v0.1.5):
|
||||||
|
- github.com/filecoin-project/go-fil-markets (v1.13.1 -> v1.13.3):
|
||||||
|
- github.com/filecoin-project/go-data-transfer (v1.11.1 -> v1.11.4):
|
||||||
|
- github.com/filecoin-project/go-crypto (v0.0.0-20191218222705-effae4ea9f03 -> v0.0.1):
|
||||||
|
- github.com/filecoin-project/go-commp-utils (v0.1.1-0.20210427191551-70bf140d31c7 -> v0.1.2):
|
||||||
|
- github.com/filecoin-project/go-cbor-util (v0.0.0-20191219014500-08c40a1e63a2 -> v0.0.1):
|
||||||
|
- github.com/filecoin-project/go-address (v0.0.5 -> v0.0.6):
|
||||||
|
- unpin the yamux dependency ([filecoin-project/lotus#7532](https://github.com/filecoin-project/lotus/pull/7532)
|
||||||
|
- peerstore@v0.2.9 was withdrawn, let's not depend on it directly ([filecoin-project/lotus#7481](https://github.com/filecoin-project/lotus/pull/7481))
|
||||||
|
- chore(deps): use tagged github.com/ipld/go-ipld-selector-text-lite ([filecoin-project/lotus#7464](https://github.com/filecoin-project/lotus/pull/7464))
|
||||||
|
- Stop indirectly depending on deprecated github.com/prometheus/common ([filecoin-project/lotus#7473](https://github.com/filecoin-project/lotus/pull/7473))
|
||||||
|
|
||||||
|
## Others
|
||||||
|
- fix the changelog ([filecoin-project/lotus#7594](https://github.com/filecoin-project/lotus/pull/7594))
|
||||||
|
- v1.13.1-rc2 prep ([filecoin-project/lotus#7593](https://github.com/filecoin-project/lotus/pull/7593))
|
||||||
|
- lotus v1.13.1-rc1 ([filecoin-project/lotus#7569](https://github.com/filecoin-project/lotus/pull/7569))
|
||||||
|
- misc: back-port v1.13.0 back to master ([filecoin-project/lotus#7537](https://github.com/filecoin-project/lotus/pull/7537))
|
||||||
|
- Inline codegen ([filecoin-project/lotus#7495](https://github.com/filecoin-project/lotus/pull/7495))
|
||||||
|
- releases -> master ([filecoin-project/lotus#7507](https://github.com/filecoin-project/lotus/pull/7507))
|
||||||
|
- Make chocolate back to master ([filecoin-project/lotus#7493](https://github.com/filecoin-project/lotus/pull/7493))
|
||||||
|
- restore filters for the build-macos job ([filecoin-project/lotus#7455](https://github.com/filecoin-project/lotus/pull/7455))
|
||||||
|
- bump master to v1.13.1-dev ([filecoin-project/lotus#7451](https://github.com/filecoin-project/lotus/pull/7451))
|
||||||
|
|
||||||
|
Contributors
|
||||||
|
|
||||||
|
| Contributor | Commits | Lines ± | Files Changed |
|
||||||
|
|-------------|---------|---------|---------------|
|
||||||
|
| @magik6k | 27 | +1285/-531 | 76 |
|
||||||
|
| @ribasushi | 7 | +265/-1635 | 21 |
|
||||||
|
| @raulk | 2 | +2/-737 | 13 |
|
||||||
|
| @nonsens | 4 | +391/-21 | 19 |
|
||||||
|
| @arajasek | 6 | +216/-23 | 14 |
|
||||||
|
| @jennijuju| 8 | +102/-37 | 29 |
|
||||||
|
| Steven Allen | 2 | +77/-29 | 6 |
|
||||||
|
| @jennijuju | 4 | +19/-18 | 11 |
|
||||||
|
| @dirkmc | 2 | +9/-9 | 4 |
|
||||||
|
| @@coryschwartz | 1 | +16/-2 | 2 |
|
||||||
|
| @frrist | 1 | +12/-0 | 2 |
|
||||||
|
| @Kubuxu | 5 | +5/-5 | 5 |
|
||||||
|
| @hunjixin | 2 | +6/-3 | 2 |
|
||||||
|
| @vyzo | 1 | +3/-3 | 2 |
|
||||||
|
| @@rvagg | 1 | +3/-3 | 2 |
|
||||||
|
| @hannahhoward | 1 | +3/-2 | 2 |
|
||||||
|
| Marten Seemann | 1 | +3/-0 | 1 |
|
||||||
|
| @ZenGround0 | 1 | +1/-1 | 1 |
|
||||||
|
|
||||||
|
|
||||||
|
# v1.13.0 / 2021-10-18
|
||||||
|
|
||||||
|
Lotus v1.13.0 is a *highly recommended* feature release for all lotus users(i.e: storage providers, data brokers, application developers and so on) that supports the upcoming
|
||||||
|
[Network v14 Chocolate upgrade](https://github.com/filecoin-project/lotus/discussions/7431).
|
||||||
|
This feature release includes the latest functionalities and improvements, like data transfer rate-limiting for both storage and retrieval deals, proof v10 with CUDA support, etc. You can find more details in the Changelog below.
|
||||||
|
|
||||||
|
## Highlights
|
||||||
|
- Enable separate storage and retrieval transfer limits ([filecoin-project/lotus#7405](https://github.com/filecoin-project/lotus/pull/7405))
|
||||||
|
- `SimultaneousTransfer` is now replaced by `SimultaneousTransfersForStorage` and `SimultaneousTransfersForRetrieval`, where users may set the amount of ongoing data transfer for storage and retrieval deals in parallel separately. The default value for both is set to 20.
|
||||||
|
- If you are using the lotus client, these two configuration variables are under the `Client` section in `./lotus/config.toml`.
|
||||||
|
- If you are a service provider, these two configuration variables should be set under the `Dealmaking` section in `/.lotusminer/config.toml`.
|
||||||
|
- Update proofs to v10.0.0 ([filecoin-project/lotus#7420](https://github.com/filecoin-project/lotus/pull/7420))
|
||||||
|
- This version supports CUDA. To enable CUDA instead of openCL, build lotus with `FFI_USE_CUDA=1 FFI_BUILD_FROM_SOURCE=1 ...`.
|
||||||
|
- You can find additional Nvidia driver installation instructions written by MinerX fellows [here](https://github.com/filecoin-project/lotus/discussions/7443#discussioncomment-1425274) and perf improvements result on PC2/C2/WindowPoSt computation on different profiles [here](https://github.com/filecoin-project/lotus/discussions/7443), most people observe a 30-50% decrease in computation time.
|
||||||
|
|
||||||
|
## New Features
|
||||||
|
- Feat/datamodel selector retrieval ([filecoin-project/lotus#6393](https://github.com/filecoin-project/lotus/pull/66393393))
|
||||||
|
- This introduces a new RetrievalOrder-struct field and a CLI option that takes a string representation as understood by [https://pkg.go.dev/github.com/ipld/go-ipld-selector-text-lite#SelectorSpecFromPath](https://pkg.go.dev/github.com/ipld/go-ipld-selector-text-lite#SelectorSpecFromPath). This allows for partial retrieval of any sub-DAG of a deal provided the user knows the exact low-level shape of the deal contents.
|
||||||
|
- For example, to retrieve the first entry of a UnixFS directory by executing, run `lotus client retrieve --miner f0XXXXX --datamodel-path-selector 'Links/0/Hash' bafyROOTCID ~/output`
|
||||||
|
- Expose storage stats on the metrics endpoint ([filecoin-project/lotus#7418](https://github.com/filecoin-project/lotus/pull/7418))
|
||||||
|
- feat: Catch panic to generate report and reraise ([filecoin-project/lotus#7341](https://github.com/filecoin-project/lotus/pull/7341))
|
||||||
|
- Set `LOTUS_PANIC_REPORT_PATH` and `LOTUS_PANIC_JOURNAL_LOOKBACK` to get reports generated when a panic occurs on your daemon miner or workers.
|
||||||
|
- Add envconfig docs to the config ([filecoin-project/lotus#7412](https://github.com/filecoin-project/lotus/pull/7412))
|
||||||
|
- You can now find supported env vars in [default-lotus-miner-config.toml](https://github.com/filecoin-project/lotus/blob/master/documentation/en/default-lotus-miner-config.toml).
|
||||||
|
- lotus shed: fr32 utils ([filecoin-project/lotus#7355](https://github.com/filecoin-project/lotus/pull/7355))
|
||||||
|
- Miner CLI: Allow trying to change owners of any miner actor ([filecoin-project/lotus#7328](https://github.com/filecoin-project/lotus/pull/7328))
|
||||||
|
- Add --unproven flag to the sectors list command ([filecoin-project/lotus#7308](https://github.com/filecoin-project/lotus/pull/7308))
|
||||||
|
|
||||||
|
## Improvements
|
||||||
|
- check for deal start epoch on SectorAddPieceToAny ([filecoin-project/lotus#7407](https://github.com/filecoin-project/lotus/pull/7407))
|
||||||
|
- Verify Voucher locks in VoucherValidUnlocked ([filecoin-project/lotus#5609](https://github.com/filecoin-project/lotus/pull/5609))
|
||||||
|
- Add more info to miner allinfo command ([filecoin-project/lotus#7384](https://github.com/filecoin-project/lotus/pull/7384))
|
||||||
|
- add `lotus-miner storage-deals list --format=json` with transfers ([filecoin-project/lotus#7312](https://github.com/filecoin-project/lotus/pull/7312))
|
||||||
|
- Fix formatting ([filecoin-project/lotus#7383](https://github.com/filecoin-project/lotus/pull/7383))
|
||||||
|
- GetCurrentDealInfo err: handle correctly err case ([filecoin-project/lotus#7346](https://github.com/filecoin-project/lotus/pull/7346))
|
||||||
|
- fix: Enforce verification key integrity check regardless of TRUST_PARAMS=1 ([filecoin-project/lotus#7327](https://github.com/filecoin-project/lotus/pull/7327))
|
||||||
|
- Show more deal states in miner info ([filecoin-project/lotus#7311](https://github.com/filecoin-project/lotus/pull/7311))
|
||||||
|
- Prep retrieval for selectors: no functional changes ([filecoin-project/lotus#7306](https://github.com/filecoin-project/lotus/pull/7306))
|
||||||
|
- Seed: improve helptext ([filecoin-project/lotus#7304](https://github.com/filecoin-project/lotus/pull/7304))
|
||||||
|
- Mempool: reduce size of sigValCache ([filecoin-project/lotus#7305](https://github.com/filecoin-project/lotus/pull/7305))
|
||||||
|
- Stop indirectly depending on deprecated github.com/prometheus/common ([filecoin-project/lotus#7474](https://github.com/filecoin-project/lotus/pull/7474))
|
||||||
|
|
||||||
|
## Bug Fixes
|
||||||
|
- StateSearchMsg: Correct usage of the allowReplaced flag ([filecoin-project/lotus#7450](https://github.com/filecoin-project/lotus/pull/7450))
|
||||||
|
- fix staging area path buildup ([filecoin-project/lotus#7363](https://github.com/filecoin-project/lotus/pull/7363))
|
||||||
|
- storagemgr: Cleanup workerLk around worker resources ([filecoin-project/lotus#7334](https://github.com/filecoin-project/lotus/pull/7334))
|
||||||
|
- fix: check padSector Cid ([filecoin-project/lotus#7310](https://github.com/filecoin-project/lotus/pull/7310))
|
||||||
|
- sealing: Recover sectors after failed AddPiece ([filecoin-project/lotus#7492](https://github.com/filecoin-project/lotus/pull/7492))
|
||||||
|
- fix: support node instantiation in external packages ([filecoin-project/lotus#7511](https://github.com/filecoin-project/lotus/pull/7511))
|
||||||
|
- Chore/backport cleanup withdrawn dependency ([filecoin-project/lotus#7482](https://github.com/filecoin-project/lotus/pull/7482))
|
||||||
|
|
||||||
|
## Dependency Updates
|
||||||
|
- github.com/filecoin-project/go-data-transfer (v1.10.1 -> v1.11.1):
|
||||||
|
- github.com/filecoin-project/go-fil-markets (v1.12.0 -> v1.13.1):
|
||||||
|
- github.com/filecoin-project/go-paramfetch (v0.0.2-0.20210614165157-25a6c7769498 -> v0.0.2):
|
||||||
|
- update go-libp2p to v0.15.0 ([filecoin-project/lotus#7362](https://github.com/filecoin-project/lotus/pull/7362))
|
||||||
|
- update to go-graphsync v0.10.1 ([filecoin-project/lotus#7359](https://github.com/filecoin-project/lotus/pull/7359))
|
||||||
|
|
||||||
|
## Others
|
||||||
|
- Chocolate to master ([filecoin-project/lotus#7440](https://github.com/filecoin-project/lotus/pull/7440))
|
||||||
|
- releases -> master ([filecoin-project/lotus#7403](https://github.com/filecoin-project/lotus/pull/7403))
|
||||||
|
- remove nerpanet related code ([filecoin-project/lotus#7373](https://github.com/filecoin-project/lotus/pull/7373))
|
||||||
|
- sync branch main with master on updates ([filecoin-project/lotus#7366](https://github.com/filecoin-project/lotus/pull/7366))
|
||||||
|
- remove job to install jq ([filecoin-project/lotus#7309](https://github.com/filecoin-project/lotus/pull/7309))
|
||||||
|
- restore filters for the build-macos job ([filecoin-project/lotus#7455](https://github.com/filecoin-project/lotus/pull/7455))
|
||||||
|
- v1.13.0-rc2 ([filecoin-project/lotus#7458](https://github.com/filecoin-project/lotus/pull/7458))
|
||||||
|
- v1.13.0-rc1 ([filecoin-project/lotus#7452](https://github.com/filecoin-project/lotus/pull/7452))
|
||||||
|
|
||||||
|
## Contributors
|
||||||
|
|
||||||
|
| Contributor | Commits | Lines ± | Files Changed |
|
||||||
|
|-------------|---------|---------|---------------|
|
||||||
|
| @dirkmc | 8 | +845/-375 | 55 |
|
||||||
|
| @magik6k | 10 | +1056/-60 | 26 |
|
||||||
|
| @aarshkshah1992 | 6 | +813/-259 | 16 |
|
||||||
|
| @arajasek | 10 | +552/-251 | 43 |
|
||||||
|
| @ribasushi | 6 | +505/-78 | 22 |
|
||||||
|
| @jennijuju | 7 | +212/-323 | 34 |
|
||||||
|
| @nonsense | 10 | +335/-139 | 19 |
|
||||||
|
| @dirkmc | 8 | +149/-55 | 16 |
|
||||||
|
| @hannahhoward | 4 | +56/-32 | 17 |
|
||||||
|
| @rvagg | 4 | +61/-13 | 9 |
|
||||||
|
| @jennijuju | 2 | +0/-57 | 2 |
|
||||||
|
| @hannahhoward | 1 | +33/-18 | 7 |
|
||||||
|
| @Kubuxu | 8 | +27/-16 | 9 |
|
||||||
|
| @coryschwartz | 1 | +16/-2 | 2 |
|
||||||
|
| @travisperson | 1 | +14/-0 | 1 |
|
||||||
|
| @frrist | 1 | +12/-0 | 2 |
|
||||||
|
| @ognots | 1 | +0/-10 | 2 |
|
||||||
|
| @lanzafame | 1 | +3/-3 | 1 |
|
||||||
|
| @jennijuju | 1 | +2/-2 | 1 |
|
||||||
|
| @swift-mx | 1 | +1/-1 | 1 |
|
||||||
|
|
||||||
|
# v1.12.0 / 2021-10-12
|
||||||
|
|
||||||
|
This is a mandatory release of Lotus that introduces [Filecoin Network v14](https://github.com/filecoin-project/community/discussions/74#discussioncomment-1398542), codenamed the Chocolate upgrade. The Filecoin mainnet will upgrade at epoch 1231620, on 2021-10-26T13:30:00Z.
|
||||||
|
|
||||||
|
The Chocolate upgrade introduces the following FIPs, delivered in [v6 actors](https://github.com/filecoin-project/specs-actors/releases/tag/v6.0.0)
|
||||||
|
|
||||||
|
- [FIP-0020](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0020.md): Add return value to `WithdrawBalance`
|
||||||
|
- [FIP-0021](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0021.md): Correct quality calculation on expiration
|
||||||
|
- [FIP-0022](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0022.md): Bad deals don't fail PublishStorageDeals
|
||||||
|
- [FIP-0023](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0023.md): Break ties between tipsets of equal weight
|
||||||
|
- [FIP-0024](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0024.md): BatchBalancer & BatchDiscount Post-HyperDrive Adjustment
|
||||||
|
- [FIP-0026](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0026.md): Extend sector faulty period from 2 weeks to 6 weeks
|
||||||
|
|
||||||
|
Note that this release is built on top of lotus v1.11.3. Enterprising users like storage providers, data brokers and others are recommended to use lotus v1.13.0 for latest new features, improvements and bug fixes.
|
||||||
|
|
||||||
|
## New Features and Changes
|
||||||
|
- Implement and support [FIP-0024](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0024.md) BatchBalancer & BatchDiscount Post-HyperDrive Adjustment:
|
||||||
|
- Precommit batch balancer support/config ([filecoin-project/lotus#7410](https://github.com/filecoin-project/lotus/pull/7410))
|
||||||
|
- Set `BatchPreCommitAboveBaseFee` to decide whether sending out a PreCommits in individual messages or in a batch.
|
||||||
|
- The default value of `BatchPreCommitAboveBaseFee` and `AggregateAboveBaseFee` are now updated to 0.32nanoFIL.
|
||||||
|
- The amount of FIL withdrawn from `WithdrawBalance` from miner or market via lotus CLI is now printed out upon message landing on the chain.
|
||||||
|
|
||||||
|
## Improvements
|
||||||
|
- Implement [FIP-0023](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0023.md) (Break ties between tipsets of equal weight)
|
||||||
|
- ChainStore: Add a tiebreaker rule for tipsets of equal weight ([filecoin-project/lotus#7378](https://github.com/filecoin-project/lotus/pull/7378))
|
||||||
|
- Randomness: Move getters from ChainAPI to StateAPI ([filecoin-project/lotus#7322](https://github.com/filecoin-project/lotus/pull/7322))
|
||||||
|
|
||||||
|
## Bug Fixes
|
||||||
|
- Fix Drand fetching around null tipsets ([filecoin-project/lotus#7376](https://github.com/filecoin-project/lotus/pull/7376))
|
||||||
|
|
||||||
|
## Dependency Updates
|
||||||
|
- Add [v6 actors](https://github.com/filecoin-project/specs-actors/releases/tag/v6.0.0)
|
||||||
|
- **Protocol changes**
|
||||||
|
- Multisig Approve only hashes when hash in params
|
||||||
|
- FIP 0020 WithdrawBalance methods return withdrawn value
|
||||||
|
- FIP 0021 Fix bug in power calculation when extending verified deals sectors
|
||||||
|
- FIP 0022 PublishStorageDeals drops errors in batch
|
||||||
|
- FIP 0024 BatchBalancer update and burn added to PreCommitBatch
|
||||||
|
- FIP 0026 Add FaultMaxAge extension
|
||||||
|
- Reduce calls to power and reward actors by passing values from power cron
|
||||||
|
- Defensive programming hardening power cron against programmer error
|
||||||
|
- **Implementation changes**
|
||||||
|
- Move to xerrors
|
||||||
|
- Improved logging: burn events are not logged with reasons and burned value.
|
||||||
|
- github.com/filecoin-project/go-state-types (v0.1.1-0.20210810190654-139e0e79e69e -> v0.1.1-0.20210915140513-d354ccf10379):
|
||||||
|
|
||||||
|
## Others
|
||||||
|
- v1.12.0-rc1 prep ([filecoin-project/lotus#7426](https://github.com/filecoin-project/lotus/pull/7426)
|
||||||
|
- Extend FaultMaxAge to 6 weeks for actors v6 on test networks only ([filecoin-project/lotus#7421](https://github.com/filecoin-project/lotus/pull/7421))
|
||||||
|
|
||||||
|
## Contributors
|
||||||
|
|
||||||
|
| Contributor | Commits | Lines ± | Files Changed |
|
||||||
|
|-------------|---------|---------|---------------|
|
||||||
|
| @ZenGround0 | 12 | +4202/-2752 | 187 |
|
||||||
|
| @arajasek | 25 | +4567/-854 | 190 |
|
||||||
|
| @laudiacay | 4 | +1276/-435 | 37 |
|
||||||
|
| @laudiacay | 12 | +1350/-209 | 43 |
|
||||||
|
| @magik6k | 1 | +171/-13 | 8 |
|
||||||
|
| @Stebalien | 2 | +115/-12 | 6 |
|
||||||
|
| @jennijuju | 7 | +73/-34 | 26 |
|
||||||
|
| @travisperson | 2 | +19/-19 | 7 |
|
||||||
|
| @coryschwartz | 1 | +16/-2 | 2 |
|
||||||
|
| @Kubuxu | 5 | +5/-5 | 5 |
|
||||||
|
| @ribasushi | 1 | +5/-3 | 1 |
|
||||||
|
|
||||||
# v1.11.3 / 2021-09-29
|
# v1.11.3 / 2021-09-29
|
||||||
|
|
||||||
lotus v1.11.3 is a feature release that's **highly recommended to ALL lotus users to upgrade**, including node
|
lotus v1.11.3 is a feature release that's **highly recommended to ALL lotus users to upgrade**, including node
|
||||||
@@ -9,13 +583,13 @@ improvements in different area, like deal making, sealing and so on.
|
|||||||
## Highlights
|
## Highlights
|
||||||
|
|
||||||
- 🌟🌟Introduce `MaxStagingDealsBytes - reject new deals if our staging deals area is full ([filecoin-project/lotus#7276](https://github.com/filecoin-project/lotus/pull/7276))
|
- 🌟🌟Introduce `MaxStagingDealsBytes - reject new deals if our staging deals area is full ([filecoin-project/lotus#7276](https://github.com/filecoin-project/lotus/pull/7276))
|
||||||
- Set `MaxStagingDealsBytes` under the [Dealmaking] section of the markets' subsystem's `config.toml` to reject new incoming deals when the `deal-staging` directory of market subsystem's repo gets too large.
|
- Set `MaxStagingDealsBytes` under the [Dealmaking] section of the markets' subsystem's `config.toml` to reject new incoming deals when the `deal-staging` directory of market subsystem's repo gets too large.
|
||||||
- 🌟🌟miner: Command to list/remove expired sectors locally ([filecoin-project/lotus#7140](https://github.com/filecoin-project/lotus/pull/7140))
|
- 🌟🌟miner: Command to list/remove expired sectors locally ([filecoin-project/lotus#7140](https://github.com/filecoin-project/lotus/pull/7140))
|
||||||
- run `./lotus-miner sectors expired -h` for more details.
|
- run `./lotus-miner sectors expired -h` for more details.
|
||||||
- 🚀update to ffi to update-bellperson-proofs-v9-0-2 ([filecoin-project/lotus#7369](https://github.com/filecoin-project/lotus/pull/7369))
|
- 🚀update to ffi to update-bellperson-proofs-v9-0-2 ([filecoin-project/lotus#7369](https://github.com/filecoin-project/lotus/pull/7369))
|
||||||
- MinerX fellows(early testers of lotus releases) have reported faster WindowPoSt computation!
|
- MinerX fellows(early testers of lotus releases) have reported faster WindowPoSt computation!
|
||||||
- 🌟dealpublisher: Fully validate deals before publishing ([filecoin-project/lotus#7234](https://github.com/filecoin-project/lotus/pull/7234))
|
- 🌟dealpublisher: Fully validate deals before publishing ([filecoin-project/lotus#7234](https://github.com/filecoin-project/lotus/pull/7234))
|
||||||
- This excludes the expired deals before sending out a PSD message which reduces the chances of PSD message failure due to invalid deals.
|
- This excludes the expired deals before sending out a PSD message which reduces the chances of PSD message failure due to invalid deals.
|
||||||
- 🌟Simple alert system; FD limit alerts ([filecoin-project/lotus#7108](https://github.com/filecoin-project/lotus/pull/7108))
|
- 🌟Simple alert system; FD limit alerts ([filecoin-project/lotus#7108](https://github.com/filecoin-project/lotus/pull/7108))
|
||||||
|
|
||||||
## New Features
|
## New Features
|
||||||
@@ -140,24 +714,24 @@ storage providers and clients.
|
|||||||
- It is highly recommended to **wait all ongoing data transfer to finish or cancel inbound storage deals that
|
- It is highly recommended to **wait all ongoing data transfer to finish or cancel inbound storage deals that
|
||||||
are still transferring**, using the `lotus-miner data-transfers cancel` command before upgrade your market nodes. Reason being that the new dagstore changes attributes in the internal deal state objects, and the paths to the staging CARs where the deal data was being placed will be lost.
|
are still transferring**, using the `lotus-miner data-transfers cancel` command before upgrade your market nodes. Reason being that the new dagstore changes attributes in the internal deal state objects, and the paths to the staging CARs where the deal data was being placed will be lost.
|
||||||
- ‼️Having your dags initialized will become important in the near feature for you to provide a better storage
|
- ‼️Having your dags initialized will become important in the near feature for you to provide a better storage
|
||||||
and retrieval service. We'd suggest you to start [forced bulk initialization] soon if possible as this process
|
and retrieval service. We'd suggest you to start [forced bulk initialization] soon if possible as this process
|
||||||
places relatively high IP workload on your storage system and is better to be carried out gradually and over a
|
places relatively high IP workload on your storage system and is better to be carried out gradually and over a
|
||||||
longer timeframe. Read how to do properly perform a force bulk initialization [here](https://docs.filecoin.io/mine/lotus/dagstore/#forcing-bulk-initialization).
|
longer timeframe. Read how to do properly perform a force bulk initialization [here](https://docs.filecoin.io/mine/lotus/dagstore/#forcing-bulk-initialization).
|
||||||
- ⏮ Rollback Alert(from v1.11.2-rcX to any version lower): If a storages deal is initiated with M1/v1.11.2(-rcX)
|
- ⏮ Rollback Alert(from v1.11.2-rcX to any version lower): If a storages deal is initiated with M1/v1.11.2(-rcX)
|
||||||
release, it needs to get to the `StorageDealAwaitingPrecommit` state before you can do a version rollback or the markets process may panic.
|
release, it needs to get to the `StorageDealAwaitingPrecommit` state before you can do a version rollback or the markets process may panic.
|
||||||
- 💙 **Special thanks to [MinerX fellows for testing and providing valuable feedbacks](https://github.com/filecoin-project/lotus/discussions/6852) for Dagstore in the past month!**
|
- 💙 **Special thanks to [MinerX fellows for testing and providing valuable feedbacks](https://github.com/filecoin-project/lotus/discussions/6852) for Dagstore in the past month!**
|
||||||
- 🌟🌟 rpcenc: Support reader redirect ([filecoin-project/lotus#6952](https://github.com/filecoin-project/lotus/pull/6952))
|
- 🌟🌟 rpcenc: Support reader redirect ([filecoin-project/lotus#6952](https://github.com/filecoin-project/lotus/pull/6952))
|
||||||
- This allows market processes to send piece bytes directly to workers involved on `AddPiece`.
|
- This allows market processes to send piece bytes directly to workers involved on `AddPiece`.
|
||||||
- Extending sectors: more practical and flexible tools ([filecoin-project/lotus#6097](https://github.com/filecoin-project/lotus/pull/6097))
|
- Extending sectors: more practical and flexible tools ([filecoin-project/lotus#6097](https://github.com/filecoin-project/lotus/pull/6097))
|
||||||
- `lotus-miner sectors check-expire` to inspect expiring sectors.
|
- `lotus-miner sectors check-expire` to inspect expiring sectors.
|
||||||
- `lotus-miner sectors renew` for renewing expiring sectors, see the command help menu for customizable option
|
- `lotus-miner sectors renew` for renewing expiring sectors, see the command help menu for customizable option
|
||||||
like `extension`, `new-expiration` and so on.
|
like `extension`, `new-expiration` and so on.
|
||||||
- ‼️ MpoolReplaceCmd ( lotus mpool replace`) now takes FIL for fee-limit ([filecoin-project/lotus#6927](https://github.com/filecoin-project/lotus/pull/6927))
|
- ‼️ MpoolReplaceCmd ( lotus mpool replace`) now takes FIL for fee-limit ([filecoin-project/lotus#6927](https://github.com/filecoin-project/lotus/pull/6927))
|
||||||
- Drop townhall/chainwatch ([filecoin-project/lotus#6912](https://github.com/filecoin-project/lotus/pull/6912))
|
- Drop townhall/chainwatch ([filecoin-project/lotus#6912](https://github.com/filecoin-project/lotus/pull/6912))
|
||||||
- ChainWatch is no longer supported by lotus.
|
- ChainWatch is no longer supported by lotus.
|
||||||
- Configurable CC Sector Expiration ([filecoin-project/lotus#6803](https://github.com/filecoin-project/lotus/pull/6803))
|
- Configurable CC Sector Expiration ([filecoin-project/lotus#6803](https://github.com/filecoin-project/lotus/pull/6803))
|
||||||
- Set `CommittedCapacitySectorLifetime` in lotus-miner/config.toml to specify the default expiration for a new CC
|
- Set `CommittedCapacitySectorLifetime` in lotus-miner/config.toml to specify the default expiration for a new CC
|
||||||
sector, value must be between 180-540 days inclusive.
|
sector, value must be between 180-540 days inclusive.
|
||||||
|
|
||||||
## New Features
|
## New Features
|
||||||
- api/command for encoding actor params ([filecoin-project/lotus#7150](https://github.com/filecoin-project/lotus/pull/7150))
|
- api/command for encoding actor params ([filecoin-project/lotus#7150](https://github.com/filecoin-project/lotus/pull/7150))
|
||||||
@@ -288,110 +862,110 @@ This is a **highly recommended** but optional Lotus v1.11.1 release that introd
|
|||||||
- You can now preview the the default and updated node config by running `lotus/lotus-miner config default/updated`
|
- You can now preview the the default and updated node config by running `lotus/lotus-miner config default/updated`
|
||||||
|
|
||||||
## New Features
|
## New Features
|
||||||
- ⭐️⭐️⭐️ Support standalone miner-market process ([filecoin-project/lotus#6356](https://github.com/filecoin-project/lotus/pull/6356))
|
- ⭐️⭐️⭐️ Support standalone miner-market process ([filecoin-project/lotus#6356](https://github.com/filecoin-project/lotus/pull/6356))
|
||||||
- **⭐️⭐️ Experimental** [Splitstore]((https://github.com/filecoin-project/lotus/blob/master/blockstore/splitstore/README.md)) (more details coming in v1.11.2! Stay tuned! Join the discussion [here](https://github.com/filecoin-project/lotus/discussions/5788) if you have questions!) :
|
- **⭐️⭐️ Experimental** [Splitstore]((https://github.com/filecoin-project/lotus/blob/master/blockstore/splitstore/README.md)) (more details coming in v1.11.2! Stay tuned! Join the discussion [here](https://github.com/filecoin-project/lotus/discussions/5788) if you have questions!) :
|
||||||
- Improve splitstore warmup ([filecoin-project/lotus#6867](https://github.com/filecoin-project/lotus/pull/6867))
|
- Improve splitstore warmup ([filecoin-project/lotus#6867](https://github.com/filecoin-project/lotus/pull/6867))
|
||||||
- Moving GC for badger ([filecoin-project/lotus#6854](https://github.com/filecoin-project/lotus/pull/6854))
|
- Moving GC for badger ([filecoin-project/lotus#6854](https://github.com/filecoin-project/lotus/pull/6854))
|
||||||
- splitstore shed utils ([filecoin-project/lotus#6811](https://github.com/filecoin-project/lotus/pull/6811))
|
- splitstore shed utils ([filecoin-project/lotus#6811](https://github.com/filecoin-project/lotus/pull/6811))
|
||||||
- fix warmup by decoupling state from message receipt walk ([filecoin-project/lotus#6841](https://github.com/filecoin-project/lotus/pull/6841))
|
- fix warmup by decoupling state from message receipt walk ([filecoin-project/lotus#6841](https://github.com/filecoin-project/lotus/pull/6841))
|
||||||
- Splitstore: support on-disk marksets using badger ([filecoin-project/lotus#6833](https://github.com/filecoin-project/lotus/pull/6833))
|
- Splitstore: support on-disk marksets using badger ([filecoin-project/lotus#6833](https://github.com/filecoin-project/lotus/pull/6833))
|
||||||
- cache loaded block messages ([filecoin-project/lotus#6760](https://github.com/filecoin-project/lotus/pull/6760))
|
- cache loaded block messages ([filecoin-project/lotus#6760](https://github.com/filecoin-project/lotus/pull/6760))
|
||||||
- Splitstore: add retention policy option for keeping messages in the hotstore ([filecoin-project/lotus#6775](https://github.com/filecoin-project/lotus/pull/6775))
|
- Splitstore: add retention policy option for keeping messages in the hotstore ([filecoin-project/lotus#6775](https://github.com/filecoin-project/lotus/pull/6775))
|
||||||
- Introduce the LOTUS_CHAIN_BADGERSTORE_DISABLE_FSYNC envvar ([filecoin-project/lotus#6817](https://github.com/filecoin-project/lotus/pull/6817))
|
- Introduce the LOTUS_CHAIN_BADGERSTORE_DISABLE_FSYNC envvar ([filecoin-project/lotus#6817](https://github.com/filecoin-project/lotus/pull/6817))
|
||||||
- Splitstore: add support for protecting out of chain references in the blockstore ([filecoin-project/lotus#6777](https://github.com/filecoin-project/lotus/pull/6777))
|
- Splitstore: add support for protecting out of chain references in the blockstore ([filecoin-project/lotus#6777](https://github.com/filecoin-project/lotus/pull/6777))
|
||||||
- Implement exposed splitstore ([filecoin-project/lotus#6762](https://github.com/filecoin-project/lotus/pull/6762))
|
- Implement exposed splitstore ([filecoin-project/lotus#6762](https://github.com/filecoin-project/lotus/pull/6762))
|
||||||
- Splitstore code reorg ([filecoin-project/lotus#6756](https://github.com/filecoin-project/lotus/pull/6756))
|
- Splitstore code reorg ([filecoin-project/lotus#6756](https://github.com/filecoin-project/lotus/pull/6756))
|
||||||
- Splitstore: Some small fixes ([filecoin-project/lotus#6754](https://github.com/filecoin-project/lotus/pull/6754))
|
- Splitstore: Some small fixes ([filecoin-project/lotus#6754](https://github.com/filecoin-project/lotus/pull/6754))
|
||||||
- Splitstore Enhanchements ([filecoin-project/lotus#6474](https://github.com/filecoin-project/lotus/pull/6474))
|
- Splitstore Enhanchements ([filecoin-project/lotus#6474](https://github.com/filecoin-project/lotus/pull/6474))
|
||||||
- lotus-shed: initial export cmd for markets related metadata ([filecoin-project/lotus#6840](https://github.com/filecoin-project/lotus/pull/6840))
|
- lotus-shed: initial export cmd for markets related metadata ([filecoin-project/lotus#6840](https://github.com/filecoin-project/lotus/pull/6840))
|
||||||
- add a very verbose -vv flag to lotus and lotus-miner. ([filecoin-project/lotus#6888](https://github.com/filecoin-project/lotus/pull/6888))
|
- add a very verbose -vv flag to lotus and lotus-miner. ([filecoin-project/lotus#6888](https://github.com/filecoin-project/lotus/pull/6888))
|
||||||
- Add allocated sectorid vis ([filecoin-project/lotus#4638](https://github.com/filecoin-project/lotus/pull/4638))
|
- Add allocated sectorid vis ([filecoin-project/lotus#4638](https://github.com/filecoin-project/lotus/pull/4638))
|
||||||
- add a command for compacting sector numbers bitfield ([filecoin-project/lotus#4640](https://github.com/filecoin-project/lotus/pull/4640))
|
- add a command for compacting sector numbers bitfield ([filecoin-project/lotus#4640](https://github.com/filecoin-project/lotus/pull/4640))
|
||||||
- Run `lotus-miner actor compact-allocated` to compact sector number allocations to reduce the size of the allocated sector number bitfield.
|
- Run `lotus-miner actor compact-allocated` to compact sector number allocations to reduce the size of the allocated sector number bitfield.
|
||||||
- Add ChainGetMessagesInTipset API ([filecoin-project/lotus#6642](https://github.com/filecoin-project/lotus/pull/6642))
|
- Add ChainGetMessagesInTipset API ([filecoin-project/lotus#6642](https://github.com/filecoin-project/lotus/pull/6642))
|
||||||
- Handle the --color flag via proper global state ([filecoin-project/lotus#6743](https://github.com/filecoin-project/lotus/pull/6743))
|
- Handle the --color flag via proper global state ([filecoin-project/lotus#6743](https://github.com/filecoin-project/lotus/pull/6743))
|
||||||
- Enable color by default only if os.Stdout is a TTY ([filecoin-project/lotus#6696](https://github.com/filecoin-project/lotus/pull/6696))
|
- Enable color by default only if os.Stdout is a TTY ([filecoin-project/lotus#6696](https://github.com/filecoin-project/lotus/pull/6696))
|
||||||
- Stop outputing ANSI color on non-TTY ([filecoin-project/lotus#6694](https://github.com/filecoin-project/lotus/pull/6694))
|
- Stop outputing ANSI color on non-TTY ([filecoin-project/lotus#6694](https://github.com/filecoin-project/lotus/pull/6694))
|
||||||
- Envvar to disable slash filter ([filecoin-project/lotus#6620](https://github.com/filecoin-project/lotus/pull/6620))
|
- Envvar to disable slash filter ([filecoin-project/lotus#6620](https://github.com/filecoin-project/lotus/pull/6620))
|
||||||
- commit batch: AggregateAboveBaseFee config ([filecoin-project/lotus#6650](https://github.com/filecoin-project/lotus/pull/6650))
|
- commit batch: AggregateAboveBaseFee config ([filecoin-project/lotus#6650](https://github.com/filecoin-project/lotus/pull/6650))
|
||||||
- shed tool to estimate aggregate network fees ([filecoin-project/lotus#6631](https://github.com/filecoin-project/lotus/pull/6631))
|
- shed tool to estimate aggregate network fees ([filecoin-project/lotus#6631](https://github.com/filecoin-project/lotus/pull/6631))
|
||||||
|
|
||||||
## Bug Fixes
|
## Bug Fixes
|
||||||
- Fix padding of deals, which only partially shipped in #5988 ([filecoin-project/lotus#6683](https://github.com/filecoin-project/lotus/pull/6683))
|
- Fix padding of deals, which only partially shipped in #5988 ([filecoin-project/lotus#6683](https://github.com/filecoin-project/lotus/pull/6683))
|
||||||
- fix deal concurrency test failures by upgrading graphsync and others ([filecoin-project/lotus#6724](https://github.com/filecoin-project/lotus/pull/6724))
|
- fix deal concurrency test failures by upgrading graphsync and others ([filecoin-project/lotus#6724](https://github.com/filecoin-project/lotus/pull/6724))
|
||||||
- fix: on randomness change, use new rand ([filecoin-project/lotus#6805](https://github.com/filecoin-project/lotus/pull/6805)) - fix: always check if StateSearchMessage returns nil ([filecoin-project/lotus#6802](https://github.com/filecoin-project/lotus/pull/6802))
|
- fix: on randomness change, use new rand ([filecoin-project/lotus#6805](https://github.com/filecoin-project/lotus/pull/6805)) - fix: always check if StateSearchMessage returns nil ([filecoin-project/lotus#6802](https://github.com/filecoin-project/lotus/pull/6802))
|
||||||
- test: fix flaky window post tests ([filecoin-project/lotus#6804](https://github.com/filecoin-project/lotus/pull/6804))
|
- test: fix flaky window post tests ([filecoin-project/lotus#6804](https://github.com/filecoin-project/lotus/pull/6804))
|
||||||
- wrap close(wait) with sync.Once to avoid panic ([filecoin-project/lotus#6800](https://github.com/filecoin-project/lotus/pull/6800))
|
- wrap close(wait) with sync.Once to avoid panic ([filecoin-project/lotus#6800](https://github.com/filecoin-project/lotus/pull/6800))
|
||||||
- fixes #6786 segfault ([filecoin-project/lotus#6787](https://github.com/filecoin-project/lotus/pull/6787))
|
- fixes #6786 segfault ([filecoin-project/lotus#6787](https://github.com/filecoin-project/lotus/pull/6787))
|
||||||
- ClientRetrieve stops on cancel([filecoin-project/lotus#6739](https://github.com/filecoin-project/lotus/pull/6739))
|
- ClientRetrieve stops on cancel([filecoin-project/lotus#6739](https://github.com/filecoin-project/lotus/pull/6739))
|
||||||
- Fix bugs in sectors extend --v1-sectors ([filecoin-project/lotus#6066](https://github.com/filecoin-project/lotus/pull/6066))
|
- Fix bugs in sectors extend --v1-sectors ([filecoin-project/lotus#6066](https://github.com/filecoin-project/lotus/pull/6066))
|
||||||
- fix "lotus-seed genesis car" error "merkledag: not found" ([filecoin-project/lotus#6688](https://github.com/filecoin-project/lotus/pull/6688))
|
- fix "lotus-seed genesis car" error "merkledag: not found" ([filecoin-project/lotus#6688](https://github.com/filecoin-project/lotus/pull/6688))
|
||||||
- Get retrieval pricing input should not error out on a deal state fetch ([filecoin-project/lotus#6679](https://github.com/filecoin-project/lotus/pull/6679))
|
- Get retrieval pricing input should not error out on a deal state fetch ([filecoin-project/lotus#6679](https://github.com/filecoin-project/lotus/pull/6679))
|
||||||
- Fix more CID double-encoding as hex ([filecoin-project/lotus#6680](https://github.com/filecoin-project/lotus/pull/6680))
|
- Fix more CID double-encoding as hex ([filecoin-project/lotus#6680](https://github.com/filecoin-project/lotus/pull/6680))
|
||||||
- storage: Fix FinalizeSector with sectors in stoage paths ([filecoin-project/lotus#6653](https://github.com/filecoin-project/lotus/pull/6653))
|
- storage: Fix FinalizeSector with sectors in stoage paths ([filecoin-project/lotus#6653](https://github.com/filecoin-project/lotus/pull/6653))
|
||||||
- Fix tiny error in check-client-datacap ([filecoin-project/lotus#6664](https://github.com/filecoin-project/lotus/pull/6664))
|
- Fix tiny error in check-client-datacap ([filecoin-project/lotus#6664](https://github.com/filecoin-project/lotus/pull/6664))
|
||||||
- Fix: precommit_batch method used the wrong cfg.CommitBatchWait ([filecoin-project/lotus#6658](https://github.com/filecoin-project/lotus/pull/6658))
|
- Fix: precommit_batch method used the wrong cfg.CommitBatchWait ([filecoin-project/lotus#6658](https://github.com/filecoin-project/lotus/pull/6658))
|
||||||
- fix ticket expiration check ([filecoin-project/lotus#6635](https://github.com/filecoin-project/lotus/pull/6635))
|
- fix ticket expiration check ([filecoin-project/lotus#6635](https://github.com/filecoin-project/lotus/pull/6635))
|
||||||
- remove precommit check in handleCommitFailed ([filecoin-project/lotus#6634](https://github.com/filecoin-project/lotus/pull/6634))
|
- remove precommit check in handleCommitFailed ([filecoin-project/lotus#6634](https://github.com/filecoin-project/lotus/pull/6634))
|
||||||
- fix prove commit aggregate send token amount ([filecoin-project/lotus#6625](https://github.com/filecoin-project/lotus/pull/6625))
|
- fix prove commit aggregate send token amount ([filecoin-project/lotus#6625](https://github.com/filecoin-project/lotus/pull/6625))
|
||||||
|
|
||||||
## Improvements
|
## Improvements
|
||||||
- Eliminate inefficiency in markets logging ([filecoin-project/lotus#6895](https://github.com/filecoin-project/lotus/pull/6895))
|
- Eliminate inefficiency in markets logging ([filecoin-project/lotus#6895](https://github.com/filecoin-project/lotus/pull/6895))
|
||||||
- rename `cmd/lotus{-storage=>}-miner` to match binary. ([filecoin-project/lotus#6886](https://github.com/filecoin-project/lotus/pull/6886))
|
- rename `cmd/lotus{-storage=>}-miner` to match binary. ([filecoin-project/lotus#6886](https://github.com/filecoin-project/lotus/pull/6886))
|
||||||
- fix racy TestSimultanenousTransferLimit. ([filecoin-project/lotus#6862](https://github.com/filecoin-project/lotus/pull/6862))
|
- fix racy TestSimultanenousTransferLimit. ([filecoin-project/lotus#6862](https://github.com/filecoin-project/lotus/pull/6862))
|
||||||
- ValidateBlock: Assert that block header height's are greater than parents ([filecoin-project/lotus#6872](https://github.com/filecoin-project/lotus/pull/6872))
|
- ValidateBlock: Assert that block header height's are greater than parents ([filecoin-project/lotus#6872](https://github.com/filecoin-project/lotus/pull/6872))
|
||||||
- feat: Don't panic when api impl is nil ([filecoin-project/lotus#6857](https://github.com/filecoin-project/lotus/pull/6857))
|
- feat: Don't panic when api impl is nil ([filecoin-project/lotus#6857](https://github.com/filecoin-project/lotus/pull/6857))
|
||||||
- add docker-compose file ([filecoin-project/lotus#6544](https://github.com/filecoin-project/lotus/pull/6544))
|
- add docker-compose file ([filecoin-project/lotus#6544](https://github.com/filecoin-project/lotus/pull/6544))
|
||||||
- easy way to make install app ([filecoin-project/lotus#5183](https://github.com/filecoin-project/lotus/pull/5183))
|
- easy way to make install app ([filecoin-project/lotus#5183](https://github.com/filecoin-project/lotus/pull/5183))
|
||||||
- api: Separate the Net interface from Common ([filecoin-project/lotus#6627](https://github.com/filecoin-project/lotus/pull/6627)) - add StateReadState to gateway api ([filecoin-project/lotus#6818](https://github.com/filecoin-project/lotus/pull/6818))
|
- api: Separate the Net interface from Common ([filecoin-project/lotus#6627](https://github.com/filecoin-project/lotus/pull/6627)) - add StateReadState to gateway api ([filecoin-project/lotus#6818](https://github.com/filecoin-project/lotus/pull/6818))
|
||||||
- add SealProof in SectorBuilder ([filecoin-project/lotus#6815](https://github.com/filecoin-project/lotus/pull/6815))
|
- add SealProof in SectorBuilder ([filecoin-project/lotus#6815](https://github.com/filecoin-project/lotus/pull/6815))
|
||||||
- sealing: Handle preCommitParams errors more correctly ([filecoin-project/lotus#6763](https://github.com/filecoin-project/lotus/pull/6763))
|
- sealing: Handle preCommitParams errors more correctly ([filecoin-project/lotus#6763](https://github.com/filecoin-project/lotus/pull/6763))
|
||||||
- ClientFindData: always fetch peer id from chain ([filecoin-project/lotus#6807](https://github.com/filecoin-project/lotus/pull/6807))
|
- ClientFindData: always fetch peer id from chain ([filecoin-project/lotus#6807](https://github.com/filecoin-project/lotus/pull/6807))
|
||||||
- test: handle null blocks in TestForkRefuseCall ([filecoin-project/lotus#6758](https://github.com/filecoin-project/lotus/pull/6758))
|
- test: handle null blocks in TestForkRefuseCall ([filecoin-project/lotus#6758](https://github.com/filecoin-project/lotus/pull/6758))
|
||||||
- Add more deal details to lotus-miner info ([filecoin-project/lotus#6708](https://github.com/filecoin-project/lotus/pull/6708))
|
- Add more deal details to lotus-miner info ([filecoin-project/lotus#6708](https://github.com/filecoin-project/lotus/pull/6708))
|
||||||
- add election backtest ([filecoin-project/lotus#5950](https://github.com/filecoin-project/lotus/pull/5950))
|
- add election backtest ([filecoin-project/lotus#5950](https://github.com/filecoin-project/lotus/pull/5950))
|
||||||
- add dollar sign ([filecoin-project/lotus#6690](https://github.com/filecoin-project/lotus/pull/6690))
|
- add dollar sign ([filecoin-project/lotus#6690](https://github.com/filecoin-project/lotus/pull/6690))
|
||||||
- get-actor cli spelling fix ([filecoin-project/lotus#6681](https://github.com/filecoin-project/lotus/pull/6681))
|
- get-actor cli spelling fix ([filecoin-project/lotus#6681](https://github.com/filecoin-project/lotus/pull/6681))
|
||||||
- polish(statetree): accept a context in statetree diff for timeouts ([filecoin-project/lotus#6639](https://github.com/filecoin-project/lotus/pull/6639))
|
- polish(statetree): accept a context in statetree diff for timeouts ([filecoin-project/lotus#6639](https://github.com/filecoin-project/lotus/pull/6639))
|
||||||
- Add helptext to lotus chain export ([filecoin-project/lotus#6672](https://github.com/filecoin-project/lotus/pull/6672))
|
- Add helptext to lotus chain export ([filecoin-project/lotus#6672](https://github.com/filecoin-project/lotus/pull/6672))
|
||||||
- add an incremental nonce itest. ([filecoin-project/lotus#6663](https://github.com/filecoin-project/lotus/pull/6663))
|
- add an incremental nonce itest. ([filecoin-project/lotus#6663](https://github.com/filecoin-project/lotus/pull/6663))
|
||||||
- commit batch: Initialize the FailedSectors map ([filecoin-project/lotus#6647](https://github.com/filecoin-project/lotus/pull/6647))
|
- commit batch: Initialize the FailedSectors map ([filecoin-project/lotus#6647](https://github.com/filecoin-project/lotus/pull/6647))
|
||||||
- Fast-path retry submitting commit aggregate if commit is still valid ([filecoin-project/lotus#6638](https://github.com/filecoin-project/lotus/pull/6638))
|
- Fast-path retry submitting commit aggregate if commit is still valid ([filecoin-project/lotus#6638](https://github.com/filecoin-project/lotus/pull/6638))
|
||||||
- Reuse timers in sealing batch logic ([filecoin-project/lotus#6636](https://github.com/filecoin-project/lotus/pull/6636))
|
- Reuse timers in sealing batch logic ([filecoin-project/lotus#6636](https://github.com/filecoin-project/lotus/pull/6636))
|
||||||
|
|
||||||
## Dependency Updates
|
## Dependency Updates
|
||||||
- Update to proof v8.0.3 ([filecoin-project/lotus#6890](https://github.com/filecoin-project/lotus/pull/6890))
|
- Update to proof v8.0.3 ([filecoin-project/lotus#6890](https://github.com/filecoin-project/lotus/pull/6890))
|
||||||
- update to go-fil-market v1.6.0 ([filecoin-project/lotus#6885](https://github.com/filecoin-project/lotus/pull/6885))
|
- update to go-fil-market v1.6.0 ([filecoin-project/lotus#6885](https://github.com/filecoin-project/lotus/pull/6885))
|
||||||
- Bump go-multihash, adjust test for supported version ([filecoin-project/lotus#6674](https://github.com/filecoin-project/lotus/pull/6674))
|
- Bump go-multihash, adjust test for supported version ([filecoin-project/lotus#6674](https://github.com/filecoin-project/lotus/pull/6674))
|
||||||
- github.com/filecoin-project/go-data-transfer (v1.6.0 -> v1.7.2):
|
- github.com/filecoin-project/go-data-transfer (v1.6.0 -> v1.7.2):
|
||||||
- github.com/filecoin-project/go-fil-markets (v1.5.0 -> v1.6.2):
|
- github.com/filecoin-project/go-fil-markets (v1.5.0 -> v1.6.2):
|
||||||
- github.com/filecoin-project/go-padreader (v0.0.0-20200903213702-ed5fae088b20 -> v0.0.0-20210723183308-812a16dc01b1)
|
- github.com/filecoin-project/go-padreader (v0.0.0-20200903213702-ed5fae088b20 -> v0.0.0-20210723183308-812a16dc01b1)
|
||||||
- github.com/filecoin-project/go-state-types (v0.1.1-0.20210506134452-99b279731c48 -> v0.1.1-0.20210810190654-139e0e79e69e)
|
- github.com/filecoin-project/go-state-types (v0.1.1-0.20210506134452-99b279731c48 -> v0.1.1-0.20210810190654-139e0e79e69e)
|
||||||
- github.com/filecoin-project/go-statemachine (v0.0.0-20200925024713-05bd7c71fbfe -> v1.0.1)
|
- github.com/filecoin-project/go-statemachine (v0.0.0-20200925024713-05bd7c71fbfe -> v1.0.1)
|
||||||
- update go-libp2p-pubsub to v0.5.0 ([filecoin-project/lotus#6764](https://github.com/filecoin-project/lotus/pull/6764))
|
- update go-libp2p-pubsub to v0.5.0 ([filecoin-project/lotus#6764](https://github.com/filecoin-project/lotus/pull/6764))
|
||||||
|
|
||||||
## Others
|
## Others
|
||||||
- Master->v1.11.1 ([filecoin-project/lotus#7051](https://github.com/filecoin-project/lotus/pull/7051))
|
- Master->v1.11.1 ([filecoin-project/lotus#7051](https://github.com/filecoin-project/lotus/pull/7051))
|
||||||
- v1.11.1-rc2 ([filecoin-project/lotus#6966](https://github.com/filecoin-project/lotus/pull/6966))
|
- v1.11.1-rc2 ([filecoin-project/lotus#6966](https://github.com/filecoin-project/lotus/pull/6966))
|
||||||
- Backport master -> v1.11.1 ([filecoin-project/lotus#6965](https://github.com/filecoin-project/lotus/pull/6965))
|
- Backport master -> v1.11.1 ([filecoin-project/lotus#6965](https://github.com/filecoin-project/lotus/pull/6965))
|
||||||
- Fixes in master -> release ([filecoin-project/lotus#6933](https://github.com/filecoin-project/lotus/pull/6933))
|
- Fixes in master -> release ([filecoin-project/lotus#6933](https://github.com/filecoin-project/lotus/pull/6933))
|
||||||
- Add changelog for v1.11.1-rc1 and bump the version ([filecoin-project/lotus#6900](https://github.com/filecoin-project/lotus/pull/6900))
|
- Add changelog for v1.11.1-rc1 and bump the version ([filecoin-project/lotus#6900](https://github.com/filecoin-project/lotus/pull/6900))
|
||||||
- Fix merge release -> v1.11.1 ([filecoin-project/lotus#6897](https://github.com/filecoin-project/lotus/pull/6897))
|
- Fix merge release -> v1.11.1 ([filecoin-project/lotus#6897](https://github.com/filecoin-project/lotus/pull/6897))
|
||||||
- Update RELEASE_ISSUE_TEMPLATE.md ([filecoin-project/lotus#6880](https://github.com/filecoin-project/lotus/pull/6880))
|
- Update RELEASE_ISSUE_TEMPLATE.md ([filecoin-project/lotus#6880](https://github.com/filecoin-project/lotus/pull/6880))
|
||||||
- Add github actions for staled pr ([filecoin-project/lotus#6879](https://github.com/filecoin-project/lotus/pull/6879))
|
- Add github actions for staled pr ([filecoin-project/lotus#6879](https://github.com/filecoin-project/lotus/pull/6879))
|
||||||
- Update issue templates and add templates for M1 ([filecoin-project/lotus#6856](https://github.com/filecoin-project/lotus/pull/6856))
|
- Update issue templates and add templates for M1 ([filecoin-project/lotus#6856](https://github.com/filecoin-project/lotus/pull/6856))
|
||||||
- Fix links in issue templates
|
- Fix links in issue templates
|
||||||
- Update issue templates to forms ([filecoin-project/lotus#6798](https://github.com/filecoin-project/lotus/pull/6798)
|
- Update issue templates to forms ([filecoin-project/lotus#6798](https://github.com/filecoin-project/lotus/pull/6798)
|
||||||
- Nerpa v13 upgrade ([filecoin-project/lotus#6837](https://github.com/filecoin-project/lotus/pull/6837))
|
- Nerpa v13 upgrade ([filecoin-project/lotus#6837](https://github.com/filecoin-project/lotus/pull/6837))
|
||||||
- add docker-compose file ([filecoin-project/lotus#6544](https://github.com/filecoin-project/lotus/pull/6544))
|
- add docker-compose file ([filecoin-project/lotus#6544](https://github.com/filecoin-project/lotus/pull/6544))
|
||||||
- release -> master ([filecoin-project/lotus#6828](https://github.com/filecoin-project/lotus/pull/6828))
|
- release -> master ([filecoin-project/lotus#6828](https://github.com/filecoin-project/lotus/pull/6828))
|
||||||
- Resurrect CODEOWNERS, but for maintainers group ([filecoin-project/lotus#6773](https://github.com/filecoin-project/lotus/pull/6773))
|
- Resurrect CODEOWNERS, but for maintainers group ([filecoin-project/lotus#6773](https://github.com/filecoin-project/lotus/pull/6773))
|
||||||
- Master disclaimer ([filecoin-project/lotus#6757](https://github.com/filecoin-project/lotus/pull/6757))
|
- Master disclaimer ([filecoin-project/lotus#6757](https://github.com/filecoin-project/lotus/pull/6757))
|
||||||
- Create stale.yml ([filecoin-project/lotus#6747](https://github.com/filecoin-project/lotus/pull/6747))
|
- Create stale.yml ([filecoin-project/lotus#6747](https://github.com/filecoin-project/lotus/pull/6747))
|
||||||
- Release template: Update all testnet infra at once ([filecoin-project/lotus#6710](https://github.com/filecoin-project/lotus/pull/6710))
|
- Release template: Update all testnet infra at once ([filecoin-project/lotus#6710](https://github.com/filecoin-project/lotus/pull/6710))
|
||||||
- Release Template: remove binary validation step ([filecoin-project/lotus#6709](https://github.com/filecoin-project/lotus/pull/6709))
|
- Release Template: remove binary validation step ([filecoin-project/lotus#6709](https://github.com/filecoin-project/lotus/pull/6709))
|
||||||
- Reset of the interop network ([filecoin-project/lotus#6689](https://github.com/filecoin-project/lotus/pull/6689))
|
- Reset of the interop network ([filecoin-project/lotus#6689](https://github.com/filecoin-project/lotus/pull/6689))
|
||||||
- Update version.go to 1.11.1 ([filecoin-project/lotus#6621](https://github.com/filecoin-project/lotus/pull/6621))
|
- Update version.go to 1.11.1 ([filecoin-project/lotus#6621](https://github.com/filecoin-project/lotus/pull/6621))
|
||||||
|
|
||||||
## Contributors
|
## Contributors
|
||||||
|
|
||||||
@@ -433,7 +1007,7 @@ This is a **highly recommended** but optional Lotus v1.11.1 release that introd
|
|||||||
| dependabot[bot] | 1 | +3/-3 | 1 |
|
| dependabot[bot] | 1 | +3/-3 | 1 |
|
||||||
| zhoutian527 | 1 | +2/-2 | 1 |
|
| zhoutian527 | 1 | +2/-2 | 1 |
|
||||||
| xloem | 1 | +4/-0 | 1 |
|
| xloem | 1 | +4/-0 | 1 |
|
||||||
| @travisperson| 2 | +2/-2 | 3 |
|
| | 2 | +2/-2 | 3 |
|
||||||
| Liviu Damian | 2 | +2/-2 | 2 |
|
| Liviu Damian | 2 | +2/-2 | 2 |
|
||||||
| @jimpick | 2 | +2/-2 | 2 |
|
| @jimpick | 2 | +2/-2 | 2 |
|
||||||
| Frank | 1 | +3/-0 | 1 |
|
| Frank | 1 | +3/-0 | 1 |
|
||||||
@@ -445,6 +1019,7 @@ This is a **highly recommended** but optional Lotus v1.11.1 release that introd
|
|||||||
This is a **highly recommended** release of Lotus that have many bug fixes, improvements and new features.
|
This is a **highly recommended** release of Lotus that have many bug fixes, improvements and new features.
|
||||||
|
|
||||||
## Highlights
|
## Highlights
|
||||||
|
- Miner SimultaneousTransfers config ([filecoin-project/lotus#6612](https://github.com/filecoin-project/lotus/pull/6612))
|
||||||
- Miner SimultaneousTransfers config ([filecoin-project/lotus#6612](https://github.com/filecoin-project/lotus/pull/6612))
|
- Miner SimultaneousTransfers config ([filecoin-project/lotus#6612](https://github.com/filecoin-project/lotus/pull/6612))
|
||||||
- Set `SimultaneousTransfers` in lotus miner config to configure the maximum number of parallel online data transfers, including both storage and retrieval deals.
|
- Set `SimultaneousTransfers` in lotus miner config to configure the maximum number of parallel online data transfers, including both storage and retrieval deals.
|
||||||
- Dynamic Retrieval pricing ([filecoin-project/lotus#6175](https://github.com/filecoin-project/lotus/pull/6175))
|
- Dynamic Retrieval pricing ([filecoin-project/lotus#6175](https://github.com/filecoin-project/lotus/pull/6175))
|
||||||
@@ -599,7 +1174,7 @@ This is a **highly recommended** release of Lotus that have many bug fixes, impr
|
|||||||
| @Stebalien | 106 | +7653/-2718 | 273 |
|
| @Stebalien | 106 | +7653/-2718 | 273 |
|
||||||
| dirkmc | 11 | +2580/-1371 | 77 |
|
| dirkmc | 11 | +2580/-1371 | 77 |
|
||||||
| @dirkmc | 39 | +1865/-1194 | 79 |
|
| @dirkmc | 39 | +1865/-1194 | 79 |
|
||||||
| @Kubuxu | 19 | +1973/-485 | 81 |
|
| | 19 | +1973/-485 | 81 |
|
||||||
| @vyzo | 4 | +1748/-330 | 50 |
|
| @vyzo | 4 | +1748/-330 | 50 |
|
||||||
| @aarshkshah1992 | 5 | +1462/-213 | 27 |
|
| @aarshkshah1992 | 5 | +1462/-213 | 27 |
|
||||||
| @coryschwartz | 35 | +568/-206 | 59 |
|
| @coryschwartz | 35 | +568/-206 | 59 |
|
||||||
@@ -714,10 +1289,10 @@ FIPs [0008](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0008.m
|
|||||||
**Check out the documentation [here](https://docs.filecoin.io/mine/lotus/miner-configuration/#precommitsectorsbatch) for details on the new Lotus miner sealing config options, [here](https://docs.filecoin.io/mine/lotus/miner-configuration/#fees-section) for fee config options, and explanations of the new features.**
|
**Check out the documentation [here](https://docs.filecoin.io/mine/lotus/miner-configuration/#precommitsectorsbatch) for details on the new Lotus miner sealing config options, [here](https://docs.filecoin.io/mine/lotus/miner-configuration/#fees-section) for fee config options, and explanations of the new features.**
|
||||||
|
|
||||||
Note:
|
Note:
|
||||||
- We recommend to keep `PreCommitSectorsBatch` as 1.
|
- We recommend to keep `PreCommitSectorsBatch` as 1.
|
||||||
- We recommend miners to set `PreCommitBatchWait` lower than 30 hours.
|
- We recommend miners to set `PreCommitBatchWait` lower than 30 hours.
|
||||||
- We recommend miners to set a longer `CommitBatchSlack` and `PreCommitBatchSlack` to prevent message failures
|
- We recommend miners to set a longer `CommitBatchSlack` and `PreCommitBatchSlack` to prevent message failures
|
||||||
due to expirations.
|
due to expirations.
|
||||||
|
|
||||||
### Projected state tree growth
|
### Projected state tree growth
|
||||||
|
|
||||||
@@ -728,9 +1303,9 @@ Given these assumptions:
|
|||||||
- We'd expect a network storage growth rate of around 530PiB per day. 😳 🎉 🥳 😅
|
- We'd expect a network storage growth rate of around 530PiB per day. 😳 🎉 🥳 😅
|
||||||
- We'd expect network bandwidth dedicated to `SubmitWindowedPoSt` to grow by about 0.02% per day.
|
- We'd expect network bandwidth dedicated to `SubmitWindowedPoSt` to grow by about 0.02% per day.
|
||||||
- We'd expect the [state-tree](https://spec.filecoin.io/#section-systems.filecoin_vm.state_tree) (and therefore [snapshot](https://docs.filecoin.io/get-started/lotus/chain/#lightweight-snapshot)) size to grow by 1.16GiB per day.
|
- We'd expect the [state-tree](https://spec.filecoin.io/#section-systems.filecoin_vm.state_tree) (and therefore [snapshot](https://docs.filecoin.io/get-started/lotus/chain/#lightweight-snapshot)) size to grow by 1.16GiB per day.
|
||||||
- Nearly all of the state-tree growth is expected to come from new sector metadata.
|
- Nearly all of the state-tree growth is expected to come from new sector metadata.
|
||||||
- We'd expect the daily lotus datastore growth rate to increase by about 10-15% (from current ~21GiB/day).
|
- We'd expect the daily lotus datastore growth rate to increase by about 10-15% (from current ~21GiB/day).
|
||||||
- Most "growth" of the lotus datastore is due to "churn", historical data that's no longer referenced by the latest state-tree.
|
- Most "growth" of the lotus datastore is due to "churn", historical data that's no longer referenced by the latest state-tree.
|
||||||
|
|
||||||
### Future improvements
|
### Future improvements
|
||||||
|
|
||||||
|
|||||||
+50
-23
@@ -28,6 +28,14 @@ WORKDIR /opt/filecoin
|
|||||||
RUN make clean deps
|
RUN make clean deps
|
||||||
|
|
||||||
|
|
||||||
|
FROM builder-local AS builder-test
|
||||||
|
MAINTAINER Lotus Development Team
|
||||||
|
|
||||||
|
WORKDIR /opt/filecoin
|
||||||
|
|
||||||
|
RUN make debug
|
||||||
|
|
||||||
|
|
||||||
FROM builder-local AS builder
|
FROM builder-local AS builder
|
||||||
MAINTAINER Lotus Development Team
|
MAINTAINER Lotus Development Team
|
||||||
|
|
||||||
@@ -36,7 +44,7 @@ WORKDIR /opt/filecoin
|
|||||||
ARG RUSTFLAGS=""
|
ARG RUSTFLAGS=""
|
||||||
ARG GOFLAGS=""
|
ARG GOFLAGS=""
|
||||||
|
|
||||||
RUN make lotus lotus-miner lotus-worker lotus-shed lotus-wallet lotus-gateway
|
RUN make lotus lotus-miner lotus-worker lotus-shed lotus-wallet lotus-gateway lotus-stats
|
||||||
|
|
||||||
|
|
||||||
FROM ubuntu:20.04 AS base
|
FROM ubuntu:20.04 AS base
|
||||||
@@ -53,8 +61,9 @@ COPY --from=builder /usr/lib/x86_64-linux-gnu/libnuma.so.1 /lib/
|
|||||||
COPY --from=builder /usr/lib/x86_64-linux-gnu/libhwloc.so.5 /lib/
|
COPY --from=builder /usr/lib/x86_64-linux-gnu/libhwloc.so.5 /lib/
|
||||||
COPY --from=builder /usr/lib/x86_64-linux-gnu/libOpenCL.so.1 /lib/
|
COPY --from=builder /usr/lib/x86_64-linux-gnu/libOpenCL.so.1 /lib/
|
||||||
|
|
||||||
RUN useradd -r -u 532 -U fc
|
RUN useradd -r -u 532 -U fc \
|
||||||
|
&& mkdir -p /etc/OpenCL/vendors \
|
||||||
|
&& echo "libnvidia-opencl.so.1" > /etc/OpenCL/vendors/nvidia.icd
|
||||||
|
|
||||||
###
|
###
|
||||||
FROM base AS lotus
|
FROM base AS lotus
|
||||||
@@ -66,8 +75,6 @@ COPY scripts/docker-lotus-entrypoint.sh /
|
|||||||
|
|
||||||
ENV FILECOIN_PARAMETER_CACHE /var/tmp/filecoin-proof-parameters
|
ENV FILECOIN_PARAMETER_CACHE /var/tmp/filecoin-proof-parameters
|
||||||
ENV LOTUS_PATH /var/lib/lotus
|
ENV LOTUS_PATH /var/lib/lotus
|
||||||
ENV LOTUS_JAEGER_AGENT_HOST 127.0.0.1
|
|
||||||
ENV LOTUS_JAEGER_AGENT_PORT 6831
|
|
||||||
ENV DOCKER_LOTUS_IMPORT_SNAPSHOT https://fil-chain-snapshots-fallback.s3.amazonaws.com/mainnet/minimal_finality_stateroots_latest.car
|
ENV DOCKER_LOTUS_IMPORT_SNAPSHOT https://fil-chain-snapshots-fallback.s3.amazonaws.com/mainnet/minimal_finality_stateroots_latest.car
|
||||||
ENV DOCKER_LOTUS_IMPORT_WALLET ""
|
ENV DOCKER_LOTUS_IMPORT_WALLET ""
|
||||||
|
|
||||||
@@ -92,8 +99,6 @@ MAINTAINER Lotus Development Team
|
|||||||
COPY --from=builder /opt/filecoin/lotus-wallet /usr/local/bin/
|
COPY --from=builder /opt/filecoin/lotus-wallet /usr/local/bin/
|
||||||
|
|
||||||
ENV WALLET_PATH /var/lib/lotus-wallet
|
ENV WALLET_PATH /var/lib/lotus-wallet
|
||||||
ENV LOTUS_JAEGER_AGENT_HOST 127.0.0.1
|
|
||||||
ENV LOTUS_JAEGER_AGENT_PORT 6831
|
|
||||||
|
|
||||||
RUN mkdir /var/lib/lotus-wallet
|
RUN mkdir /var/lib/lotus-wallet
|
||||||
RUN chown fc: /var/lib/lotus-wallet
|
RUN chown fc: /var/lib/lotus-wallet
|
||||||
@@ -114,10 +119,6 @@ MAINTAINER Lotus Development Team
|
|||||||
|
|
||||||
COPY --from=builder /opt/filecoin/lotus-gateway /usr/local/bin/
|
COPY --from=builder /opt/filecoin/lotus-gateway /usr/local/bin/
|
||||||
|
|
||||||
ENV LOTUS_JAEGER_AGENT_HOST 127.0.0.1
|
|
||||||
ENV LOTUS_JAEGER_AGENT_PORT 6831
|
|
||||||
ENV FULLNODE_API_INFO /ip4/127.0.0.1/tcp/1234/http
|
|
||||||
|
|
||||||
USER fc
|
USER fc
|
||||||
|
|
||||||
EXPOSE 1234
|
EXPOSE 1234
|
||||||
@@ -135,11 +136,7 @@ COPY --from=builder /opt/filecoin/lotus-miner /usr/local/bin/
|
|||||||
COPY scripts/docker-lotus-miner-entrypoint.sh /
|
COPY scripts/docker-lotus-miner-entrypoint.sh /
|
||||||
|
|
||||||
ENV FILECOIN_PARAMETER_CACHE /var/tmp/filecoin-proof-parameters
|
ENV FILECOIN_PARAMETER_CACHE /var/tmp/filecoin-proof-parameters
|
||||||
ENV FULLNODE_API_INFO /ip4/127.0.0.1/tcp/1234/http
|
|
||||||
ENV LOTUS_MINER_PATH /var/lib/lotus-miner
|
ENV LOTUS_MINER_PATH /var/lib/lotus-miner
|
||||||
ENV LOTUS_JAEGER_AGENT_HOST 127.0.0.1
|
|
||||||
ENV LOTUS_JAEGER_AGENT_PORT 6831
|
|
||||||
ENV DOCKER_LOTUS_MINER_INIT true
|
|
||||||
|
|
||||||
RUN mkdir /var/lib/lotus-miner /var/tmp/filecoin-proof-parameters
|
RUN mkdir /var/lib/lotus-miner /var/tmp/filecoin-proof-parameters
|
||||||
RUN chown fc: /var/lib/lotus-miner /var/tmp/filecoin-proof-parameters
|
RUN chown fc: /var/lib/lotus-miner /var/tmp/filecoin-proof-parameters
|
||||||
@@ -163,10 +160,7 @@ MAINTAINER Lotus Development Team
|
|||||||
COPY --from=builder /opt/filecoin/lotus-worker /usr/local/bin/
|
COPY --from=builder /opt/filecoin/lotus-worker /usr/local/bin/
|
||||||
|
|
||||||
ENV FILECOIN_PARAMETER_CACHE /var/tmp/filecoin-proof-parameters
|
ENV FILECOIN_PARAMETER_CACHE /var/tmp/filecoin-proof-parameters
|
||||||
ENV MINER_API_INFO /ip4/127.0.0.1/tcp/2345/http
|
|
||||||
ENV LOTUS_WORKER_PATH /var/lib/lotus-worker
|
ENV LOTUS_WORKER_PATH /var/lib/lotus-worker
|
||||||
ENV LOTUS_JAEGER_AGENT_HOST 127.0.0.1
|
|
||||||
ENV LOTUS_JAEGER_AGENT_PORT 6831
|
|
||||||
|
|
||||||
RUN mkdir /var/lib/lotus-worker
|
RUN mkdir /var/lib/lotus-worker
|
||||||
RUN chown fc: /var/lib/lotus-worker
|
RUN chown fc: /var/lib/lotus-worker
|
||||||
@@ -186,16 +180,11 @@ CMD ["-help"]
|
|||||||
from base as lotus-all-in-one
|
from base as lotus-all-in-one
|
||||||
|
|
||||||
ENV FILECOIN_PARAMETER_CACHE /var/tmp/filecoin-proof-parameters
|
ENV FILECOIN_PARAMETER_CACHE /var/tmp/filecoin-proof-parameters
|
||||||
ENV FULLNODE_API_INFO /ip4/127.0.0.1/tcp/1234/http
|
|
||||||
ENV LOTUS_JAEGER_AGENT_HOST 127.0.0.1
|
|
||||||
ENV LOTUS_JAEGER_AGENT_PORT 6831
|
|
||||||
ENV LOTUS_MINER_PATH /var/lib/lotus-miner
|
ENV LOTUS_MINER_PATH /var/lib/lotus-miner
|
||||||
ENV LOTUS_PATH /var/lib/lotus
|
ENV LOTUS_PATH /var/lib/lotus
|
||||||
ENV LOTUS_WORKER_PATH /var/lib/lotus-worker
|
ENV LOTUS_WORKER_PATH /var/lib/lotus-worker
|
||||||
ENV MINER_API_INFO /ip4/127.0.0.1/tcp/2345/http
|
|
||||||
ENV WALLET_PATH /var/lib/lotus-wallet
|
ENV WALLET_PATH /var/lib/lotus-wallet
|
||||||
ENV DOCKER_LOTUS_IMPORT_SNAPSHOT https://fil-chain-snapshots-fallback.s3.amazonaws.com/mainnet/minimal_finality_stateroots_latest.car
|
ENV DOCKER_LOTUS_IMPORT_SNAPSHOT https://fil-chain-snapshots-fallback.s3.amazonaws.com/mainnet/minimal_finality_stateroots_latest.car
|
||||||
ENV DOCKER_LOTUS_MINER_INIT true
|
|
||||||
|
|
||||||
COPY --from=builder /opt/filecoin/lotus /usr/local/bin/
|
COPY --from=builder /opt/filecoin/lotus /usr/local/bin/
|
||||||
COPY --from=builder /opt/filecoin/lotus-shed /usr/local/bin/
|
COPY --from=builder /opt/filecoin/lotus-shed /usr/local/bin/
|
||||||
@@ -203,6 +192,44 @@ COPY --from=builder /opt/filecoin/lotus-wallet /usr/local/bin/
|
|||||||
COPY --from=builder /opt/filecoin/lotus-gateway /usr/local/bin/
|
COPY --from=builder /opt/filecoin/lotus-gateway /usr/local/bin/
|
||||||
COPY --from=builder /opt/filecoin/lotus-miner /usr/local/bin/
|
COPY --from=builder /opt/filecoin/lotus-miner /usr/local/bin/
|
||||||
COPY --from=builder /opt/filecoin/lotus-worker /usr/local/bin/
|
COPY --from=builder /opt/filecoin/lotus-worker /usr/local/bin/
|
||||||
|
COPY --from=builder /opt/filecoin/lotus-stats /usr/local/bin/
|
||||||
|
|
||||||
|
RUN mkdir /var/tmp/filecoin-proof-parameters
|
||||||
|
RUN mkdir /var/lib/lotus
|
||||||
|
RUN mkdir /var/lib/lotus-miner
|
||||||
|
RUN mkdir /var/lib/lotus-worker
|
||||||
|
RUN mkdir /var/lib/lotus-wallet
|
||||||
|
RUN chown fc: /var/tmp/filecoin-proof-parameters
|
||||||
|
RUN chown fc: /var/lib/lotus
|
||||||
|
RUN chown fc: /var/lib/lotus-miner
|
||||||
|
RUN chown fc: /var/lib/lotus-worker
|
||||||
|
RUN chown fc: /var/lib/lotus-wallet
|
||||||
|
|
||||||
|
|
||||||
|
VOLUME /var/tmp/filecoin-proof-parameters
|
||||||
|
VOLUME /var/lib/lotus
|
||||||
|
VOLUME /var/lib/lotus-miner
|
||||||
|
VOLUME /var/lib/lotus-worker
|
||||||
|
VOLUME /var/lib/lotus-wallet
|
||||||
|
|
||||||
|
EXPOSE 1234
|
||||||
|
EXPOSE 2345
|
||||||
|
EXPOSE 3456
|
||||||
|
EXPOSE 1777
|
||||||
|
|
||||||
|
###
|
||||||
|
from base as lotus-test
|
||||||
|
|
||||||
|
ENV FILECOIN_PARAMETER_CACHE /var/tmp/filecoin-proof-parameters
|
||||||
|
ENV LOTUS_MINER_PATH /var/lib/lotus-miner
|
||||||
|
ENV LOTUS_PATH /var/lib/lotus
|
||||||
|
ENV LOTUS_WORKER_PATH /var/lib/lotus-worker
|
||||||
|
ENV WALLET_PATH /var/lib/lotus-wallet
|
||||||
|
|
||||||
|
COPY --from=builder-test /opt/filecoin/lotus /usr/local/bin/
|
||||||
|
COPY --from=builder-test /opt/filecoin/lotus-miner /usr/local/bin/
|
||||||
|
COPY --from=builder-test /opt/filecoin/lotus-worker /usr/local/bin/
|
||||||
|
COPY --from=builder-test /opt/filecoin/lotus-seed /usr/local/bin/
|
||||||
|
|
||||||
RUN mkdir /var/tmp/filecoin-proof-parameters
|
RUN mkdir /var/tmp/filecoin-proof-parameters
|
||||||
RUN mkdir /var/lib/lotus
|
RUN mkdir /var/lib/lotus
|
||||||
|
|||||||
@@ -76,9 +76,6 @@ debug: build-devnets
|
|||||||
calibnet: GOFLAGS+=-tags=calibnet
|
calibnet: GOFLAGS+=-tags=calibnet
|
||||||
calibnet: build-devnets
|
calibnet: build-devnets
|
||||||
|
|
||||||
nerpanet: GOFLAGS+=-tags=nerpanet
|
|
||||||
nerpanet: build-devnets
|
|
||||||
|
|
||||||
butterflynet: GOFLAGS+=-tags=butterflynet
|
butterflynet: GOFLAGS+=-tags=butterflynet
|
||||||
butterflynet: build-devnets
|
butterflynet: build-devnets
|
||||||
|
|
||||||
@@ -100,7 +97,7 @@ BINS+=lotus-miner
|
|||||||
|
|
||||||
lotus-worker: $(BUILD_DEPS)
|
lotus-worker: $(BUILD_DEPS)
|
||||||
rm -f lotus-worker
|
rm -f lotus-worker
|
||||||
$(GOCC) build $(GOFLAGS) -o lotus-worker ./cmd/lotus-seal-worker
|
$(GOCC) build $(GOFLAGS) -o lotus-worker ./cmd/lotus-worker
|
||||||
.PHONY: lotus-worker
|
.PHONY: lotus-worker
|
||||||
BINS+=lotus-worker
|
BINS+=lotus-worker
|
||||||
|
|
||||||
@@ -294,6 +291,7 @@ method-gen: api-gen
|
|||||||
(cd ./lotuspond/front/src/chain && $(GOCC) run ./methodgen.go)
|
(cd ./lotuspond/front/src/chain && $(GOCC) run ./methodgen.go)
|
||||||
|
|
||||||
actors-gen:
|
actors-gen:
|
||||||
|
$(GOCC) run ./gen/inline-gen . gen/inlinegen-data.json
|
||||||
$(GOCC) run ./chain/actors/agen
|
$(GOCC) run ./chain/actors/agen
|
||||||
$(GOCC) fmt ./...
|
$(GOCC) fmt ./...
|
||||||
|
|
||||||
@@ -344,9 +342,11 @@ docsgen-openrpc-worker: docsgen-openrpc-bin
|
|||||||
.PHONY: docsgen docsgen-md-bin docsgen-openrpc-bin
|
.PHONY: docsgen docsgen-md-bin docsgen-openrpc-bin
|
||||||
|
|
||||||
gen: actors-gen type-gen method-gen cfgdoc-gen docsgen api-gen circleci
|
gen: actors-gen type-gen method-gen cfgdoc-gen docsgen api-gen circleci
|
||||||
@echo ">>> IF YOU'VE MODIFIED THE CLI, REMEMBER TO ALSO MAKE docsgen-cli"
|
@echo ">>> IF YOU'VE MODIFIED THE CLI OR CONFIG, REMEMBER TO ALSO MAKE docsgen-cli"
|
||||||
.PHONY: gen
|
.PHONY: gen
|
||||||
|
|
||||||
|
jen: gen
|
||||||
|
|
||||||
snap: lotus lotus-miner lotus-worker
|
snap: lotus lotus-miner lotus-worker
|
||||||
snapcraft
|
snapcraft
|
||||||
# snapcraft upload ./lotus_*.snap
|
# snapcraft upload ./lotus_*.snap
|
||||||
@@ -354,6 +354,8 @@ snap: lotus lotus-miner lotus-worker
|
|||||||
# separate from gen because it needs binaries
|
# separate from gen because it needs binaries
|
||||||
docsgen-cli: lotus lotus-miner lotus-worker
|
docsgen-cli: lotus lotus-miner lotus-worker
|
||||||
python ./scripts/generate-lotus-cli.py
|
python ./scripts/generate-lotus-cli.py
|
||||||
|
./lotus config default > documentation/en/default-lotus-config.toml
|
||||||
|
./lotus-miner config default > documentation/en/default-lotus-miner-config.toml
|
||||||
.PHONY: docsgen-cli
|
.PHONY: docsgen-cli
|
||||||
|
|
||||||
print-%:
|
print-%:
|
||||||
|
|||||||
@@ -123,7 +123,6 @@ Note: The default branch `master` is the dev branch where the latest new feature
|
|||||||
|
|
||||||
# Or to join a testnet or devnet:
|
# Or to join a testnet or devnet:
|
||||||
make clean calibnet # Calibration with min 32GiB sectors
|
make clean calibnet # Calibration with min 32GiB sectors
|
||||||
make clean nerpanet # Nerpa with min 512MiB sectors
|
|
||||||
|
|
||||||
sudo make install
|
sudo make install
|
||||||
```
|
```
|
||||||
|
|||||||
+48
-23
@@ -27,7 +27,6 @@ import (
|
|||||||
"github.com/filecoin-project/lotus/chain/actors/builtin/paych"
|
"github.com/filecoin-project/lotus/chain/actors/builtin/paych"
|
||||||
"github.com/filecoin-project/lotus/chain/actors/builtin/power"
|
"github.com/filecoin-project/lotus/chain/actors/builtin/power"
|
||||||
"github.com/filecoin-project/lotus/chain/types"
|
"github.com/filecoin-project/lotus/chain/types"
|
||||||
marketevents "github.com/filecoin-project/lotus/markets/loggers"
|
|
||||||
"github.com/filecoin-project/lotus/node/modules/dtypes"
|
"github.com/filecoin-project/lotus/node/modules/dtypes"
|
||||||
"github.com/filecoin-project/lotus/node/repo/imports"
|
"github.com/filecoin-project/lotus/node/repo/imports"
|
||||||
)
|
)
|
||||||
@@ -72,12 +71,6 @@ type FullNode interface {
|
|||||||
// ChainHead returns the current head of the chain.
|
// ChainHead returns the current head of the chain.
|
||||||
ChainHead(context.Context) (*types.TipSet, error) //perm:read
|
ChainHead(context.Context) (*types.TipSet, error) //perm:read
|
||||||
|
|
||||||
// ChainGetRandomnessFromTickets is used to sample the chain for randomness.
|
|
||||||
ChainGetRandomnessFromTickets(ctx context.Context, tsk types.TipSetKey, personalization crypto.DomainSeparationTag, randEpoch abi.ChainEpoch, entropy []byte) (abi.Randomness, error) //perm:read
|
|
||||||
|
|
||||||
// ChainGetRandomnessFromBeacon is used to sample the beacon for randomness.
|
|
||||||
ChainGetRandomnessFromBeacon(ctx context.Context, tsk types.TipSetKey, personalization crypto.DomainSeparationTag, randEpoch abi.ChainEpoch, entropy []byte) (abi.Randomness, error) //perm:read
|
|
||||||
|
|
||||||
// ChainGetBlock returns the block specified by the given CID.
|
// ChainGetBlock returns the block specified by the given CID.
|
||||||
ChainGetBlock(context.Context, cid.Cid) (*types.BlockHeader, error) //perm:read
|
ChainGetBlock(context.Context, cid.Cid) (*types.BlockHeader, error) //perm:read
|
||||||
// ChainGetTipSet returns the tipset specified by the given TipSetKey.
|
// ChainGetTipSet returns the tipset specified by the given TipSetKey.
|
||||||
@@ -296,7 +289,7 @@ type FullNode interface {
|
|||||||
|
|
||||||
// // UX ?
|
// // UX ?
|
||||||
|
|
||||||
// MethodGroup: Wallet
|
// MethodGroup: WalletF
|
||||||
|
|
||||||
// WalletNew creates a new address in the wallet with the given sigType.
|
// WalletNew creates a new address in the wallet with the given sigType.
|
||||||
// Available key types: bls, secp256k1, secp256k1-ledger
|
// Available key types: bls, secp256k1, secp256k1-ledger
|
||||||
@@ -357,10 +350,11 @@ type FullNode interface {
|
|||||||
// ClientMinerQueryOffer returns a QueryOffer for the specific miner and file.
|
// ClientMinerQueryOffer returns a QueryOffer for the specific miner and file.
|
||||||
ClientMinerQueryOffer(ctx context.Context, miner address.Address, root cid.Cid, piece *cid.Cid) (QueryOffer, error) //perm:read
|
ClientMinerQueryOffer(ctx context.Context, miner address.Address, root cid.Cid, piece *cid.Cid) (QueryOffer, error) //perm:read
|
||||||
// ClientRetrieve initiates the retrieval of a file, as specified in the order.
|
// ClientRetrieve initiates the retrieval of a file, as specified in the order.
|
||||||
ClientRetrieve(ctx context.Context, order RetrievalOrder, ref *FileRef) error //perm:admin
|
ClientRetrieve(ctx context.Context, params RetrievalOrder) (*RestrievalRes, error) //perm:admin
|
||||||
// ClientRetrieveWithEvents initiates the retrieval of a file, as specified in the order, and provides a channel
|
// ClientRetrieveWait waits for retrieval to be complete
|
||||||
// of status updates.
|
ClientRetrieveWait(ctx context.Context, deal retrievalmarket.DealID) error //perm:admin
|
||||||
ClientRetrieveWithEvents(ctx context.Context, order RetrievalOrder, ref *FileRef) (<-chan marketevents.RetrievalEvent, error) //perm:admin
|
// ClientExport exports a file stored in the local filestore to a system file
|
||||||
|
ClientExport(ctx context.Context, exportRef ExportRef, fileRef FileRef) error //perm:admin
|
||||||
// ClientListRetrievals returns information about retrievals made by the local client
|
// ClientListRetrievals returns information about retrievals made by the local client
|
||||||
ClientListRetrievals(ctx context.Context) ([]RetrievalInfo, error) //perm:write
|
ClientListRetrievals(ctx context.Context) ([]RetrievalInfo, error) //perm:write
|
||||||
// ClientGetRetrievalUpdates returns status of updated retrieval deals
|
// ClientGetRetrievalUpdates returns status of updated retrieval deals
|
||||||
@@ -591,6 +585,11 @@ type FullNode interface {
|
|||||||
// StateNetworkVersion returns the network version at the given tipset
|
// StateNetworkVersion returns the network version at the given tipset
|
||||||
StateNetworkVersion(context.Context, types.TipSetKey) (apitypes.NetworkVersion, error) //perm:read
|
StateNetworkVersion(context.Context, types.TipSetKey) (apitypes.NetworkVersion, error) //perm:read
|
||||||
|
|
||||||
|
// StateGetRandomnessFromTickets is used to sample the chain for randomness.
|
||||||
|
StateGetRandomnessFromTickets(ctx context.Context, personalization crypto.DomainSeparationTag, randEpoch abi.ChainEpoch, entropy []byte, tsk types.TipSetKey) (abi.Randomness, error) //perm:read
|
||||||
|
// StateGetRandomnessFromBeacon is used to sample the beacon for randomness.
|
||||||
|
StateGetRandomnessFromBeacon(ctx context.Context, personalization crypto.DomainSeparationTag, randEpoch abi.ChainEpoch, entropy []byte, tsk types.TipSetKey) (abi.Randomness, error) //perm:read
|
||||||
|
|
||||||
// MethodGroup: Msig
|
// MethodGroup: Msig
|
||||||
// The Msig methods are used to interact with multisig wallets on the
|
// The Msig methods are used to interact with multisig wallets on the
|
||||||
// filecoin network
|
// filecoin network
|
||||||
@@ -630,10 +629,14 @@ type FullNode interface {
|
|||||||
// <sender address of the approve msg>, <method to call in the proposed message>, <params to include in the proposed message>
|
// <sender address of the approve msg>, <method to call in the proposed message>, <params to include in the proposed message>
|
||||||
MsigApproveTxnHash(context.Context, address.Address, uint64, address.Address, address.Address, types.BigInt, address.Address, uint64, []byte) (*MessagePrototype, error) //perm:sign
|
MsigApproveTxnHash(context.Context, address.Address, uint64, address.Address, address.Address, types.BigInt, address.Address, uint64, []byte) (*MessagePrototype, error) //perm:sign
|
||||||
|
|
||||||
|
// MsigCancel cancels a previously-proposed multisig message
|
||||||
|
// It takes the following params: <multisig address>, <proposed transaction ID> <signer address>
|
||||||
|
MsigCancel(context.Context, address.Address, uint64, address.Address) (*MessagePrototype, error) //perm:sign
|
||||||
|
|
||||||
// MsigCancel cancels a previously-proposed multisig message
|
// MsigCancel cancels a previously-proposed multisig message
|
||||||
// It takes the following params: <multisig address>, <proposed transaction ID>, <recipient address>, <value to transfer>,
|
// It takes the following params: <multisig address>, <proposed transaction ID>, <recipient address>, <value to transfer>,
|
||||||
// <sender address of the cancel msg>, <method to call in the proposed message>, <params to include in the proposed message>
|
// <sender address of the cancel msg>, <method to call in the proposed message>, <params to include in the proposed message>
|
||||||
MsigCancel(context.Context, address.Address, uint64, address.Address, types.BigInt, address.Address, uint64, []byte) (*MessagePrototype, error) //perm:sign
|
MsigCancelTxnHash(context.Context, address.Address, uint64, address.Address, types.BigInt, address.Address, uint64, []byte) (*MessagePrototype, error) //perm:sign
|
||||||
|
|
||||||
// MsigAddPropose proposes adding a signer in the multisig
|
// MsigAddPropose proposes adding a signer in the multisig
|
||||||
// It takes the following params: <multisig address>, <sender address of the propose msg>,
|
// It takes the following params: <multisig address>, <sender address of the propose msg>,
|
||||||
@@ -686,7 +689,17 @@ type FullNode interface {
|
|||||||
// MethodGroup: Paych
|
// MethodGroup: Paych
|
||||||
// The Paych methods are for interacting with and managing payment channels
|
// The Paych methods are for interacting with and managing payment channels
|
||||||
|
|
||||||
PaychGet(ctx context.Context, from, to address.Address, amt types.BigInt) (*ChannelInfo, error) //perm:sign
|
// PaychGet gets or creates a payment channel between address pair
|
||||||
|
// The specified amount will be reserved for use. If there aren't enough non-reserved funds
|
||||||
|
// available, funds will be added through an on-chain message.
|
||||||
|
// - When opts.OffChain is true, this call will not cause any messages to be sent to the chain (no automatic
|
||||||
|
// channel creation/funds adding). If the operation can't be performed without sending a message an error will be
|
||||||
|
// returned. Note that even when this option is specified, this call can be blocked by previous operations on the
|
||||||
|
// channel waiting for on-chain operations.
|
||||||
|
PaychGet(ctx context.Context, from, to address.Address, amt types.BigInt, opts PaychGetOpts) (*ChannelInfo, error) //perm:sign
|
||||||
|
// PaychFund gets or creates a payment channel between address pair.
|
||||||
|
// The specified amount will be added to the channel through on-chain send for future use
|
||||||
|
PaychFund(ctx context.Context, from, to address.Address, amt types.BigInt) (*ChannelInfo, error) //perm:sign
|
||||||
PaychGetWaitReady(context.Context, cid.Cid) (address.Address, error) //perm:sign
|
PaychGetWaitReady(context.Context, cid.Cid) (address.Address, error) //perm:sign
|
||||||
PaychAvailableFunds(ctx context.Context, ch address.Address) (*ChannelAvailableFunds, error) //perm:sign
|
PaychAvailableFunds(ctx context.Context, ch address.Address) (*ChannelAvailableFunds, error) //perm:sign
|
||||||
PaychAvailableFundsByFromTo(ctx context.Context, from, to address.Address) (*ChannelAvailableFunds, error) //perm:sign
|
PaychAvailableFundsByFromTo(ctx context.Context, from, to address.Address) (*ChannelAvailableFunds, error) //perm:sign
|
||||||
@@ -825,6 +838,10 @@ const (
|
|||||||
PCHOutbound
|
PCHOutbound
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type PaychGetOpts struct {
|
||||||
|
OffChain bool
|
||||||
|
}
|
||||||
|
|
||||||
type PaychStatus struct {
|
type PaychStatus struct {
|
||||||
ControlAddr address.Address
|
ControlAddr address.Address
|
||||||
Direction PCHDir
|
Direction PCHDir
|
||||||
@@ -842,16 +859,23 @@ type ChannelAvailableFunds struct {
|
|||||||
From address.Address
|
From address.Address
|
||||||
// To is the to address of the channel
|
// To is the to address of the channel
|
||||||
To address.Address
|
To address.Address
|
||||||
// ConfirmedAmt is the amount of funds that have been confirmed on-chain
|
|
||||||
// for the channel
|
// ConfirmedAmt is the total amount of funds that have been confirmed on-chain for the channel
|
||||||
ConfirmedAmt types.BigInt
|
ConfirmedAmt types.BigInt
|
||||||
// PendingAmt is the amount of funds that are pending confirmation on-chain
|
// PendingAmt is the amount of funds that are pending confirmation on-chain
|
||||||
PendingAmt types.BigInt
|
PendingAmt types.BigInt
|
||||||
|
|
||||||
|
// NonReservedAmt is part of ConfirmedAmt that is available for use (e.g. when the payment channel was pre-funded)
|
||||||
|
NonReservedAmt types.BigInt
|
||||||
|
// PendingAvailableAmt is the amount of funds that are pending confirmation on-chain that will become available once confirmed
|
||||||
|
PendingAvailableAmt types.BigInt
|
||||||
|
|
||||||
// PendingWaitSentinel can be used with PaychGetWaitReady to wait for
|
// PendingWaitSentinel can be used with PaychGetWaitReady to wait for
|
||||||
// confirmation of pending funds
|
// confirmation of pending funds
|
||||||
PendingWaitSentinel *cid.Cid
|
PendingWaitSentinel *cid.Cid
|
||||||
// QueuedAmt is the amount that is queued up behind a pending request
|
// QueuedAmt is the amount that is queued up behind a pending request
|
||||||
QueuedAmt types.BigInt
|
QueuedAmt types.BigInt
|
||||||
|
|
||||||
// VoucherRedeemedAmt is the amount that is redeemed by vouchers on-chain
|
// VoucherRedeemedAmt is the amount that is redeemed by vouchers on-chain
|
||||||
// and in the local datastore
|
// and in the local datastore
|
||||||
VoucherReedeemedAmt types.BigInt
|
VoucherReedeemedAmt types.BigInt
|
||||||
@@ -897,6 +921,7 @@ type QueryOffer struct {
|
|||||||
Size uint64
|
Size uint64
|
||||||
MinPrice types.BigInt
|
MinPrice types.BigInt
|
||||||
UnsealPrice types.BigInt
|
UnsealPrice types.BigInt
|
||||||
|
PricePerByte abi.TokenAmount
|
||||||
PaymentInterval uint64
|
PaymentInterval uint64
|
||||||
PaymentIntervalIncrease uint64
|
PaymentIntervalIncrease uint64
|
||||||
Miner address.Address
|
Miner address.Address
|
||||||
@@ -930,14 +955,14 @@ type MarketDeal struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type RetrievalOrder struct {
|
type RetrievalOrder struct {
|
||||||
// TODO: make this less unixfs specific
|
Root cid.Cid
|
||||||
Root cid.Cid
|
Piece *cid.Cid
|
||||||
Piece *cid.Cid
|
DataSelector *Selector
|
||||||
|
|
||||||
|
// todo: Size/Total are only used for calculating price per byte; we should let users just pass that
|
||||||
Size uint64
|
Size uint64
|
||||||
|
Total types.BigInt
|
||||||
|
|
||||||
FromLocalCAR string // if specified, get data from a local CARv2 file.
|
|
||||||
// TODO: support offset
|
|
||||||
Total types.BigInt
|
|
||||||
UnsealPrice types.BigInt
|
UnsealPrice types.BigInt
|
||||||
PaymentInterval uint64
|
PaymentInterval uint64
|
||||||
PaymentIntervalIncrease uint64
|
PaymentIntervalIncrease uint64
|
||||||
@@ -1080,7 +1105,7 @@ type CirculatingSupply struct {
|
|||||||
type MiningBaseInfo struct {
|
type MiningBaseInfo struct {
|
||||||
MinerPower types.BigInt
|
MinerPower types.BigInt
|
||||||
NetworkPower types.BigInt
|
NetworkPower types.BigInt
|
||||||
Sectors []builtin.SectorInfo
|
Sectors []builtin.ExtendedSectorInfo
|
||||||
WorkerKey address.Address
|
WorkerKey address.Address
|
||||||
SectorSize abi.SectorSize
|
SectorSize abi.SectorSize
|
||||||
PrevBeaconEntry types.BeaconEntry
|
PrevBeaconEntry types.BeaconEntry
|
||||||
|
|||||||
+5
-1
@@ -31,6 +31,8 @@ import (
|
|||||||
type Gateway interface {
|
type Gateway interface {
|
||||||
ChainHasObj(context.Context, cid.Cid) (bool, error)
|
ChainHasObj(context.Context, cid.Cid) (bool, error)
|
||||||
ChainHead(ctx context.Context) (*types.TipSet, error)
|
ChainHead(ctx context.Context) (*types.TipSet, error)
|
||||||
|
ChainGetParentMessages(context.Context, cid.Cid) ([]Message, error)
|
||||||
|
ChainGetParentReceipts(context.Context, cid.Cid) ([]*types.MessageReceipt, error)
|
||||||
ChainGetBlockMessages(context.Context, cid.Cid) (*BlockMessages, error)
|
ChainGetBlockMessages(context.Context, cid.Cid) (*BlockMessages, error)
|
||||||
ChainGetMessage(ctx context.Context, mc cid.Cid) (*types.Message, error)
|
ChainGetMessage(ctx context.Context, mc cid.Cid) (*types.Message, error)
|
||||||
ChainGetPath(ctx context.Context, from, to types.TipSetKey) ([]*HeadChange, error)
|
ChainGetPath(ctx context.Context, from, to types.TipSetKey) ([]*HeadChange, error)
|
||||||
@@ -39,11 +41,13 @@ type Gateway interface {
|
|||||||
ChainGetTipSetAfterHeight(ctx context.Context, h abi.ChainEpoch, tsk types.TipSetKey) (*types.TipSet, error)
|
ChainGetTipSetAfterHeight(ctx context.Context, h abi.ChainEpoch, tsk types.TipSetKey) (*types.TipSet, error)
|
||||||
ChainNotify(context.Context) (<-chan []*HeadChange, error)
|
ChainNotify(context.Context) (<-chan []*HeadChange, error)
|
||||||
ChainReadObj(context.Context, cid.Cid) ([]byte, error)
|
ChainReadObj(context.Context, cid.Cid) ([]byte, error)
|
||||||
|
ChainGetGenesis(context.Context) (*types.TipSet, error)
|
||||||
GasEstimateMessageGas(ctx context.Context, msg *types.Message, spec *MessageSendSpec, tsk types.TipSetKey) (*types.Message, error)
|
GasEstimateMessageGas(ctx context.Context, msg *types.Message, spec *MessageSendSpec, tsk types.TipSetKey) (*types.Message, error)
|
||||||
MpoolPush(ctx context.Context, sm *types.SignedMessage) (cid.Cid, error)
|
MpoolPush(ctx context.Context, sm *types.SignedMessage) (cid.Cid, error)
|
||||||
MsigGetAvailableBalance(ctx context.Context, addr address.Address, tsk types.TipSetKey) (types.BigInt, error)
|
MsigGetAvailableBalance(ctx context.Context, addr address.Address, tsk types.TipSetKey) (types.BigInt, error)
|
||||||
MsigGetVested(ctx context.Context, addr address.Address, start types.TipSetKey, end types.TipSetKey) (types.BigInt, error)
|
|
||||||
MsigGetPending(context.Context, address.Address, types.TipSetKey) ([]*MsigTransaction, error)
|
MsigGetPending(context.Context, address.Address, types.TipSetKey) ([]*MsigTransaction, error)
|
||||||
|
MsigGetVested(ctx context.Context, addr address.Address, start types.TipSetKey, end types.TipSetKey) (types.BigInt, error)
|
||||||
|
MsigGetVestingSchedule(ctx context.Context, addr address.Address, tsk types.TipSetKey) (MsigVesting, error)
|
||||||
StateAccountKey(ctx context.Context, addr address.Address, tsk types.TipSetKey) (address.Address, error)
|
StateAccountKey(ctx context.Context, addr address.Address, tsk types.TipSetKey) (address.Address, error)
|
||||||
StateDealProviderCollateralBounds(ctx context.Context, size abi.PaddedPieceSize, verified bool, tsk types.TipSetKey) (DealCollateralBounds, error)
|
StateDealProviderCollateralBounds(ctx context.Context, size abi.PaddedPieceSize, verified bool, tsk types.TipSetKey) (DealCollateralBounds, error)
|
||||||
StateGetActor(ctx context.Context, actor address.Address, ts types.TipSetKey) (*types.Actor, error)
|
StateGetActor(ctx context.Context, actor address.Address, ts types.TipSetKey) (*types.Actor, error)
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package api
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"time"
|
||||||
|
|
||||||
metrics "github.com/libp2p/go-libp2p-core/metrics"
|
metrics "github.com/libp2p/go-libp2p-core/metrics"
|
||||||
"github.com/libp2p/go-libp2p-core/network"
|
"github.com/libp2p/go-libp2p-core/network"
|
||||||
@@ -25,6 +26,7 @@ type Net interface {
|
|||||||
|
|
||||||
NetConnectedness(context.Context, peer.ID) (network.Connectedness, error) //perm:read
|
NetConnectedness(context.Context, peer.ID) (network.Connectedness, error) //perm:read
|
||||||
NetPeers(context.Context) ([]peer.AddrInfo, error) //perm:read
|
NetPeers(context.Context) ([]peer.AddrInfo, error) //perm:read
|
||||||
|
NetPing(context.Context, peer.ID) (time.Duration, error) //perm:read
|
||||||
NetConnect(context.Context, peer.AddrInfo) error //perm:write
|
NetConnect(context.Context, peer.AddrInfo) error //perm:write
|
||||||
NetAddrsListen(context.Context) (peer.AddrInfo, error) //perm:read
|
NetAddrsListen(context.Context) (peer.AddrInfo, error) //perm:read
|
||||||
NetDisconnect(context.Context, peer.ID) error //perm:write
|
NetDisconnect(context.Context, peer.ID) error //perm:write
|
||||||
@@ -51,6 +53,15 @@ type Net interface {
|
|||||||
NetBlockRemove(ctx context.Context, acl NetBlockList) error //perm:admin
|
NetBlockRemove(ctx context.Context, acl NetBlockList) error //perm:admin
|
||||||
NetBlockList(ctx context.Context) (NetBlockList, error) //perm:read
|
NetBlockList(ctx context.Context) (NetBlockList, error) //perm:read
|
||||||
|
|
||||||
|
NetProtectAdd(ctx context.Context, acl []peer.ID) error //perm:admin
|
||||||
|
NetProtectRemove(ctx context.Context, acl []peer.ID) error //perm:admin
|
||||||
|
NetProtectList(ctx context.Context) ([]peer.ID, error) //perm:read
|
||||||
|
|
||||||
|
// ResourceManager API
|
||||||
|
NetStat(ctx context.Context, scope string) (NetStat, error) //perm:read
|
||||||
|
NetLimit(ctx context.Context, scope string) (NetLimit, error) //perm:read
|
||||||
|
NetSetLimit(ctx context.Context, scope string, limit NetLimit) error //perm:admin
|
||||||
|
|
||||||
// ID returns peerID of libp2p node backing this API
|
// ID returns peerID of libp2p node backing this API
|
||||||
ID(context.Context) (peer.ID, error) //perm:read
|
ID(context.Context) (peer.ID, error) //perm:read
|
||||||
}
|
}
|
||||||
|
|||||||
+65
-43
@@ -14,6 +14,7 @@ import (
|
|||||||
"github.com/filecoin-project/go-address"
|
"github.com/filecoin-project/go-address"
|
||||||
datatransfer "github.com/filecoin-project/go-data-transfer"
|
datatransfer "github.com/filecoin-project/go-data-transfer"
|
||||||
"github.com/filecoin-project/go-state-types/abi"
|
"github.com/filecoin-project/go-state-types/abi"
|
||||||
|
abinetwork "github.com/filecoin-project/go-state-types/network"
|
||||||
"github.com/filecoin-project/specs-actors/v2/actors/builtin/market"
|
"github.com/filecoin-project/specs-actors/v2/actors/builtin/market"
|
||||||
"github.com/filecoin-project/specs-storage/storage"
|
"github.com/filecoin-project/specs-storage/storage"
|
||||||
|
|
||||||
@@ -23,7 +24,6 @@ import (
|
|||||||
|
|
||||||
"github.com/filecoin-project/lotus/chain/types"
|
"github.com/filecoin-project/lotus/chain/types"
|
||||||
"github.com/filecoin-project/lotus/extern/sector-storage/fsutil"
|
"github.com/filecoin-project/lotus/extern/sector-storage/fsutil"
|
||||||
"github.com/filecoin-project/lotus/extern/sector-storage/stores"
|
|
||||||
"github.com/filecoin-project/lotus/extern/sector-storage/storiface"
|
"github.com/filecoin-project/lotus/extern/sector-storage/storiface"
|
||||||
"github.com/filecoin-project/lotus/extern/storage-sealing/sealiface"
|
"github.com/filecoin-project/lotus/extern/storage-sealing/sealiface"
|
||||||
)
|
)
|
||||||
@@ -91,7 +91,8 @@ type StorageMiner interface {
|
|||||||
SectorsUpdate(context.Context, abi.SectorNumber, SectorState) error //perm:admin
|
SectorsUpdate(context.Context, abi.SectorNumber, SectorState) error //perm:admin
|
||||||
// SectorRemove removes the sector from storage. It doesn't terminate it on-chain, which can
|
// SectorRemove removes the sector from storage. It doesn't terminate it on-chain, which can
|
||||||
// be done with SectorTerminate. Removing and not terminating live sectors will cause additional penalties.
|
// be done with SectorTerminate. Removing and not terminating live sectors will cause additional penalties.
|
||||||
SectorRemove(context.Context, abi.SectorNumber) error //perm:admin
|
SectorRemove(context.Context, abi.SectorNumber) error //perm:admin
|
||||||
|
SectorMarkForUpgrade(ctx context.Context, id abi.SectorNumber, snap bool) error //perm:admin
|
||||||
// SectorTerminate terminates the sector on-chain (adding it to a termination batch first), then
|
// SectorTerminate terminates the sector on-chain (adding it to a termination batch first), then
|
||||||
// automatically removes it from storage
|
// automatically removes it from storage
|
||||||
SectorTerminate(context.Context, abi.SectorNumber) error //perm:admin
|
SectorTerminate(context.Context, abi.SectorNumber) error //perm:admin
|
||||||
@@ -99,8 +100,7 @@ type StorageMiner interface {
|
|||||||
// Returns null if message wasn't sent
|
// Returns null if message wasn't sent
|
||||||
SectorTerminateFlush(ctx context.Context) (*cid.Cid, error) //perm:admin
|
SectorTerminateFlush(ctx context.Context) (*cid.Cid, error) //perm:admin
|
||||||
// SectorTerminatePending returns a list of pending sector terminations to be sent in the next batch message
|
// SectorTerminatePending returns a list of pending sector terminations to be sent in the next batch message
|
||||||
SectorTerminatePending(ctx context.Context) ([]abi.SectorID, error) //perm:admin
|
SectorTerminatePending(ctx context.Context) ([]abi.SectorID, error) //perm:admin
|
||||||
SectorMarkForUpgrade(ctx context.Context, id abi.SectorNumber) error //perm:admin
|
|
||||||
// SectorPreCommitFlush immediately sends a PreCommit message with sectors batched for PreCommit.
|
// SectorPreCommitFlush immediately sends a PreCommit message with sectors batched for PreCommit.
|
||||||
// Returns null if message wasn't sent
|
// Returns null if message wasn't sent
|
||||||
SectorPreCommitFlush(ctx context.Context) ([]sealiface.PreCommitBatchRes, error) //perm:admin
|
SectorPreCommitFlush(ctx context.Context) ([]sealiface.PreCommitBatchRes, error) //perm:admin
|
||||||
@@ -111,6 +111,9 @@ type StorageMiner interface {
|
|||||||
SectorCommitFlush(ctx context.Context) ([]sealiface.CommitBatchRes, error) //perm:admin
|
SectorCommitFlush(ctx context.Context) ([]sealiface.CommitBatchRes, error) //perm:admin
|
||||||
// SectorCommitPending returns a list of pending Commit sectors to be sent in the next aggregate message
|
// SectorCommitPending returns a list of pending Commit sectors to be sent in the next aggregate message
|
||||||
SectorCommitPending(ctx context.Context) ([]abi.SectorID, error) //perm:admin
|
SectorCommitPending(ctx context.Context) ([]abi.SectorID, error) //perm:admin
|
||||||
|
SectorMatchPendingPiecesToOpenSectors(ctx context.Context) error //perm:admin
|
||||||
|
// SectorAbortUpgrade can be called on sectors that are in the process of being upgraded to abort it
|
||||||
|
SectorAbortUpgrade(context.Context, abi.SectorNumber) error //perm:admin
|
||||||
|
|
||||||
// WorkerConnect tells the node to connect to workers RPC
|
// WorkerConnect tells the node to connect to workers RPC
|
||||||
WorkerConnect(context.Context, string) error //perm:admin retry:true
|
WorkerConnect(context.Context, string) error //perm:admin retry:true
|
||||||
@@ -118,36 +121,42 @@ type StorageMiner interface {
|
|||||||
WorkerJobs(context.Context) (map[uuid.UUID][]storiface.WorkerJob, error) //perm:admin
|
WorkerJobs(context.Context) (map[uuid.UUID][]storiface.WorkerJob, error) //perm:admin
|
||||||
|
|
||||||
//storiface.WorkerReturn
|
//storiface.WorkerReturn
|
||||||
ReturnAddPiece(ctx context.Context, callID storiface.CallID, pi abi.PieceInfo, err *storiface.CallError) error //perm:admin retry:true
|
ReturnAddPiece(ctx context.Context, callID storiface.CallID, pi abi.PieceInfo, err *storiface.CallError) error //perm:admin retry:true
|
||||||
ReturnSealPreCommit1(ctx context.Context, callID storiface.CallID, p1o storage.PreCommit1Out, err *storiface.CallError) error //perm:admin retry:true
|
ReturnSealPreCommit1(ctx context.Context, callID storiface.CallID, p1o storage.PreCommit1Out, err *storiface.CallError) error //perm:admin retry:true
|
||||||
ReturnSealPreCommit2(ctx context.Context, callID storiface.CallID, sealed storage.SectorCids, err *storiface.CallError) error //perm:admin retry:true
|
ReturnSealPreCommit2(ctx context.Context, callID storiface.CallID, sealed storage.SectorCids, err *storiface.CallError) error //perm:admin retry:true
|
||||||
ReturnSealCommit1(ctx context.Context, callID storiface.CallID, out storage.Commit1Out, err *storiface.CallError) error //perm:admin retry:true
|
ReturnSealCommit1(ctx context.Context, callID storiface.CallID, out storage.Commit1Out, err *storiface.CallError) error //perm:admin retry:true
|
||||||
ReturnSealCommit2(ctx context.Context, callID storiface.CallID, proof storage.Proof, err *storiface.CallError) error //perm:admin retry:true
|
ReturnSealCommit2(ctx context.Context, callID storiface.CallID, proof storage.Proof, err *storiface.CallError) error //perm:admin retry:true
|
||||||
ReturnFinalizeSector(ctx context.Context, callID storiface.CallID, err *storiface.CallError) error //perm:admin retry:true
|
ReturnFinalizeSector(ctx context.Context, callID storiface.CallID, err *storiface.CallError) error //perm:admin retry:true
|
||||||
ReturnReleaseUnsealed(ctx context.Context, callID storiface.CallID, err *storiface.CallError) error //perm:admin retry:true
|
ReturnReplicaUpdate(ctx context.Context, callID storiface.CallID, out storage.ReplicaUpdateOut, err *storiface.CallError) error //perm:admin retry:true
|
||||||
ReturnMoveStorage(ctx context.Context, callID storiface.CallID, err *storiface.CallError) error //perm:admin retry:true
|
ReturnProveReplicaUpdate1(ctx context.Context, callID storiface.CallID, vanillaProofs storage.ReplicaVanillaProofs, err *storiface.CallError) error //perm:admin retry:true
|
||||||
ReturnUnsealPiece(ctx context.Context, callID storiface.CallID, err *storiface.CallError) error //perm:admin retry:true
|
ReturnProveReplicaUpdate2(ctx context.Context, callID storiface.CallID, proof storage.ReplicaUpdateProof, err *storiface.CallError) error //perm:admin retry:true
|
||||||
ReturnReadPiece(ctx context.Context, callID storiface.CallID, ok bool, err *storiface.CallError) error //perm:admin retry:true
|
ReturnGenerateSectorKeyFromData(ctx context.Context, callID storiface.CallID, err *storiface.CallError) error //perm:admin retry:true
|
||||||
ReturnFetch(ctx context.Context, callID storiface.CallID, err *storiface.CallError) error //perm:admin retry:true
|
ReturnFinalizeReplicaUpdate(ctx context.Context, callID storiface.CallID, err *storiface.CallError) error //perm:admin retry:true
|
||||||
|
ReturnReleaseUnsealed(ctx context.Context, callID storiface.CallID, err *storiface.CallError) error //perm:admin retry:true
|
||||||
|
ReturnMoveStorage(ctx context.Context, callID storiface.CallID, err *storiface.CallError) error //perm:admin retry:true
|
||||||
|
ReturnUnsealPiece(ctx context.Context, callID storiface.CallID, err *storiface.CallError) error //perm:admin retry:true
|
||||||
|
ReturnReadPiece(ctx context.Context, callID storiface.CallID, ok bool, err *storiface.CallError) error //perm:admin retry:true
|
||||||
|
ReturnFetch(ctx context.Context, callID storiface.CallID, err *storiface.CallError) error //perm:admin retry:true
|
||||||
|
|
||||||
// SealingSchedDiag dumps internal sealing scheduler state
|
// SealingSchedDiag dumps internal sealing scheduler state
|
||||||
SealingSchedDiag(ctx context.Context, doSched bool) (interface{}, error) //perm:admin
|
SealingSchedDiag(ctx context.Context, doSched bool) (interface{}, error) //perm:admin
|
||||||
SealingAbort(ctx context.Context, call storiface.CallID) error //perm:admin
|
SealingAbort(ctx context.Context, call storiface.CallID) error //perm:admin
|
||||||
|
|
||||||
//stores.SectorIndex
|
// SectorIndex
|
||||||
StorageAttach(context.Context, stores.StorageInfo, fsutil.FsStat) error //perm:admin
|
StorageAttach(context.Context, storiface.StorageInfo, fsutil.FsStat) error //perm:admin
|
||||||
StorageInfo(context.Context, stores.ID) (stores.StorageInfo, error) //perm:admin
|
StorageInfo(context.Context, storiface.ID) (storiface.StorageInfo, error) //perm:admin
|
||||||
StorageReportHealth(context.Context, stores.ID, stores.HealthReport) error //perm:admin
|
StorageReportHealth(context.Context, storiface.ID, storiface.HealthReport) error //perm:admin
|
||||||
StorageDeclareSector(ctx context.Context, storageID stores.ID, s abi.SectorID, ft storiface.SectorFileType, primary bool) error //perm:admin
|
StorageDeclareSector(ctx context.Context, storageID storiface.ID, s abi.SectorID, ft storiface.SectorFileType, primary bool) error //perm:admin
|
||||||
StorageDropSector(ctx context.Context, storageID stores.ID, s abi.SectorID, ft storiface.SectorFileType) error //perm:admin
|
StorageDropSector(ctx context.Context, storageID storiface.ID, s abi.SectorID, ft storiface.SectorFileType) error //perm:admin
|
||||||
StorageFindSector(ctx context.Context, sector abi.SectorID, ft storiface.SectorFileType, ssize abi.SectorSize, allowFetch bool) ([]stores.SectorStorageInfo, error) //perm:admin
|
StorageFindSector(ctx context.Context, sector abi.SectorID, ft storiface.SectorFileType, ssize abi.SectorSize, allowFetch bool) ([]storiface.SectorStorageInfo, error) //perm:admin
|
||||||
StorageBestAlloc(ctx context.Context, allocate storiface.SectorFileType, ssize abi.SectorSize, pathType storiface.PathType) ([]stores.StorageInfo, error) //perm:admin
|
StorageBestAlloc(ctx context.Context, allocate storiface.SectorFileType, ssize abi.SectorSize, pathType storiface.PathType) ([]storiface.StorageInfo, error) //perm:admin
|
||||||
StorageLock(ctx context.Context, sector abi.SectorID, read storiface.SectorFileType, write storiface.SectorFileType) error //perm:admin
|
StorageLock(ctx context.Context, sector abi.SectorID, read storiface.SectorFileType, write storiface.SectorFileType) error //perm:admin
|
||||||
StorageTryLock(ctx context.Context, sector abi.SectorID, read storiface.SectorFileType, write storiface.SectorFileType) (bool, error) //perm:admin
|
StorageTryLock(ctx context.Context, sector abi.SectorID, read storiface.SectorFileType, write storiface.SectorFileType) (bool, error) //perm:admin
|
||||||
StorageList(ctx context.Context) (map[stores.ID][]stores.Decl, error) //perm:admin
|
StorageList(ctx context.Context) (map[storiface.ID][]storiface.Decl, error) //perm:admin
|
||||||
|
StorageGetLocks(ctx context.Context) (storiface.SectorLocks, error) //perm:admin
|
||||||
|
|
||||||
StorageLocal(ctx context.Context) (map[stores.ID]string, error) //perm:admin
|
StorageLocal(ctx context.Context) (map[storiface.ID]string, error) //perm:admin
|
||||||
StorageStat(ctx context.Context, id stores.ID) (fsutil.FsStat, error) //perm:admin
|
StorageStat(ctx context.Context, id storiface.ID) (fsutil.FsStat, error) //perm:admin
|
||||||
|
|
||||||
MarketImportDealData(ctx context.Context, propcid cid.Cid, path string) error //perm:write
|
MarketImportDealData(ctx context.Context, propcid cid.Cid, path string) error //perm:write
|
||||||
MarketListDeals(ctx context.Context) ([]MarketDeal, error) //perm:read
|
MarketListDeals(ctx context.Context) ([]MarketDeal, error) //perm:read
|
||||||
@@ -160,12 +169,15 @@ type StorageMiner interface {
|
|||||||
MarketGetRetrievalAsk(ctx context.Context) (*retrievalmarket.Ask, error) //perm:read
|
MarketGetRetrievalAsk(ctx context.Context) (*retrievalmarket.Ask, error) //perm:read
|
||||||
MarketListDataTransfers(ctx context.Context) ([]DataTransferChannel, error) //perm:write
|
MarketListDataTransfers(ctx context.Context) ([]DataTransferChannel, error) //perm:write
|
||||||
MarketDataTransferUpdates(ctx context.Context) (<-chan DataTransferChannel, error) //perm:write
|
MarketDataTransferUpdates(ctx context.Context) (<-chan DataTransferChannel, error) //perm:write
|
||||||
|
// MarketDataTransferDiagnostics generates debugging information about current data transfers over graphsync
|
||||||
|
MarketDataTransferDiagnostics(ctx context.Context, p peer.ID) (*TransferDiagnostics, error) //perm:write
|
||||||
// MarketRestartDataTransfer attempts to restart a data transfer with the given transfer ID and other peer
|
// MarketRestartDataTransfer attempts to restart a data transfer with the given transfer ID and other peer
|
||||||
MarketRestartDataTransfer(ctx context.Context, transferID datatransfer.TransferID, otherPeer peer.ID, isInitiator bool) error //perm:write
|
MarketRestartDataTransfer(ctx context.Context, transferID datatransfer.TransferID, otherPeer peer.ID, isInitiator bool) error //perm:write
|
||||||
// MarketCancelDataTransfer cancels a data transfer with the given transfer ID and other peer
|
// MarketCancelDataTransfer cancels a data transfer with the given transfer ID and other peer
|
||||||
MarketCancelDataTransfer(ctx context.Context, transferID datatransfer.TransferID, otherPeer peer.ID, isInitiator bool) error //perm:write
|
MarketCancelDataTransfer(ctx context.Context, transferID datatransfer.TransferID, otherPeer peer.ID, isInitiator bool) error //perm:write
|
||||||
MarketPendingDeals(ctx context.Context) (PendingDealInfo, error) //perm:write
|
MarketPendingDeals(ctx context.Context) (PendingDealInfo, error) //perm:write
|
||||||
MarketPublishPendingDeals(ctx context.Context) error //perm:admin
|
MarketPublishPendingDeals(ctx context.Context) error //perm:admin
|
||||||
|
MarketRetryPublishDeal(ctx context.Context, propcid cid.Cid) error //perm:admin
|
||||||
|
|
||||||
// DagstoreListShards returns information about all shards known to the
|
// DagstoreListShards returns information about all shards known to the
|
||||||
// DAG store. Only available on nodes running the markets subsystem.
|
// DAG store. Only available on nodes running the markets subsystem.
|
||||||
@@ -209,6 +221,16 @@ type StorageMiner interface {
|
|||||||
// DagstoreGC runs garbage collection on the DAG store.
|
// DagstoreGC runs garbage collection on the DAG store.
|
||||||
DagstoreGC(ctx context.Context) ([]DagstoreShardResult, error) //perm:admin
|
DagstoreGC(ctx context.Context) ([]DagstoreShardResult, error) //perm:admin
|
||||||
|
|
||||||
|
// IndexerAnnounceDeal informs indexer nodes that a new deal was received,
|
||||||
|
// so they can download its index
|
||||||
|
IndexerAnnounceDeal(ctx context.Context, proposalCid cid.Cid) error //perm:admin
|
||||||
|
|
||||||
|
// IndexerAnnounceAllDeals informs the indexer nodes aboutall active deals.
|
||||||
|
IndexerAnnounceAllDeals(ctx context.Context) error //perm:admin
|
||||||
|
|
||||||
|
// DagstoreLookupPieces returns information about shards that contain the given CID.
|
||||||
|
DagstoreLookupPieces(ctx context.Context, cid cid.Cid) ([]DagstoreShardInfo, error) //perm:admin
|
||||||
|
|
||||||
// RuntimeSubsystems returns the subsystems that are enabled
|
// RuntimeSubsystems returns the subsystems that are enabled
|
||||||
// in this instance.
|
// in this instance.
|
||||||
RuntimeSubsystems(ctx context.Context) (MinerSubsystems, error) //perm:read
|
RuntimeSubsystems(ctx context.Context) (MinerSubsystems, error) //perm:read
|
||||||
@@ -245,11 +267,10 @@ type StorageMiner interface {
|
|||||||
|
|
||||||
CheckProvable(ctx context.Context, pp abi.RegisteredPoStProof, sectors []storage.SectorRef, expensive bool) (map[abi.SectorNumber]string, error) //perm:admin
|
CheckProvable(ctx context.Context, pp abi.RegisteredPoStProof, sectors []storage.SectorRef, expensive bool) (map[abi.SectorNumber]string, error) //perm:admin
|
||||||
|
|
||||||
ComputeProof(ctx context.Context, ssi []builtin.SectorInfo, rand abi.PoStRandomness) ([]builtin.PoStProof, error) //perm:read
|
ComputeProof(ctx context.Context, ssi []builtin.ExtendedSectorInfo, rand abi.PoStRandomness, poStEpoch abi.ChainEpoch, nv abinetwork.Version) ([]builtin.PoStProof, error) //perm:read
|
||||||
}
|
}
|
||||||
|
|
||||||
var _ storiface.WorkerReturn = *new(StorageMiner)
|
var _ storiface.WorkerReturn = *new(StorageMiner)
|
||||||
var _ stores.SectorIndex = *new(StorageMiner)
|
|
||||||
|
|
||||||
type SealRes struct {
|
type SealRes struct {
|
||||||
Err string
|
Err string
|
||||||
@@ -273,19 +294,20 @@ type SectorPiece struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type SectorInfo struct {
|
type SectorInfo struct {
|
||||||
SectorID abi.SectorNumber
|
SectorID abi.SectorNumber
|
||||||
State SectorState
|
State SectorState
|
||||||
CommD *cid.Cid
|
CommD *cid.Cid
|
||||||
CommR *cid.Cid
|
CommR *cid.Cid
|
||||||
Proof []byte
|
Proof []byte
|
||||||
Deals []abi.DealID
|
Deals []abi.DealID
|
||||||
Pieces []SectorPiece
|
Pieces []SectorPiece
|
||||||
Ticket SealTicket
|
Ticket SealTicket
|
||||||
Seed SealSeed
|
Seed SealSeed
|
||||||
PreCommitMsg *cid.Cid
|
PreCommitMsg *cid.Cid
|
||||||
CommitMsg *cid.Cid
|
CommitMsg *cid.Cid
|
||||||
Retries uint64
|
Retries uint64
|
||||||
ToUpgrade bool
|
ToUpgrade bool
|
||||||
|
ReplicaUpdateMessage *cid.Cid
|
||||||
|
|
||||||
LastErr string
|
LastErr string
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
//stm: #unit
|
||||||
package api
|
package api
|
||||||
|
|
||||||
import (
|
import (
|
||||||
@@ -26,6 +27,7 @@ func goCmd() string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestDoesntDependOnFFI(t *testing.T) {
|
func TestDoesntDependOnFFI(t *testing.T) {
|
||||||
|
//stm: @OTHER_IMPLEMENTATION_FFI_DEPENDENCE_001
|
||||||
deps, err := exec.Command(goCmd(), "list", "-deps", "github.com/filecoin-project/lotus/api").Output()
|
deps, err := exec.Command(goCmd(), "list", "-deps", "github.com/filecoin-project/lotus/api").Output()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
@@ -38,6 +40,7 @@ func TestDoesntDependOnFFI(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestDoesntDependOnBuild(t *testing.T) {
|
func TestDoesntDependOnBuild(t *testing.T) {
|
||||||
|
//stm: @OTHER_IMPLEMENTATION_FFI_DEPENDENCE_002
|
||||||
deps, err := exec.Command(goCmd(), "list", "-deps", "github.com/filecoin-project/lotus/api").Output()
|
deps, err := exec.Command(goCmd(), "list", "-deps", "github.com/filecoin-project/lotus/api").Output()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
@@ -50,6 +53,7 @@ func TestDoesntDependOnBuild(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestReturnTypes(t *testing.T) {
|
func TestReturnTypes(t *testing.T) {
|
||||||
|
//stm: @OTHER_IMPLEMENTATION_001
|
||||||
errType := reflect.TypeOf(new(error)).Elem()
|
errType := reflect.TypeOf(new(error)).Elem()
|
||||||
bareIface := reflect.TypeOf(new(interface{})).Elem()
|
bareIface := reflect.TypeOf(new(interface{})).Elem()
|
||||||
jmarsh := reflect.TypeOf(new(json.Marshaler)).Elem()
|
jmarsh := reflect.TypeOf(new(json.Marshaler)).Elem()
|
||||||
@@ -115,6 +119,7 @@ func TestReturnTypes(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestPermTags(t *testing.T) {
|
func TestPermTags(t *testing.T) {
|
||||||
|
//stm: @OTHER_IMPLEMENTATION_PERM_TAGS_001
|
||||||
_ = PermissionedFullAPI(&FullNodeStruct{})
|
_ = PermissionedFullAPI(&FullNodeStruct{})
|
||||||
_ = PermissionedStorMinerAPI(&StorageMinerStruct{})
|
_ = PermissionedStorMinerAPI(&StorageMinerStruct{})
|
||||||
_ = PermissionedWorkerAPI(&WorkerStruct{})
|
_ = PermissionedWorkerAPI(&WorkerStruct{})
|
||||||
|
|||||||
+11
-2
@@ -7,8 +7,9 @@ import (
|
|||||||
"github.com/ipfs/go-cid"
|
"github.com/ipfs/go-cid"
|
||||||
|
|
||||||
"github.com/filecoin-project/go-state-types/abi"
|
"github.com/filecoin-project/go-state-types/abi"
|
||||||
|
"github.com/filecoin-project/specs-actors/v5/actors/runtime/proof"
|
||||||
|
|
||||||
"github.com/filecoin-project/lotus/extern/sector-storage/sealtasks"
|
"github.com/filecoin-project/lotus/extern/sector-storage/sealtasks"
|
||||||
"github.com/filecoin-project/lotus/extern/sector-storage/stores"
|
|
||||||
"github.com/filecoin-project/lotus/extern/sector-storage/storiface"
|
"github.com/filecoin-project/lotus/extern/sector-storage/storiface"
|
||||||
"github.com/filecoin-project/specs-storage/storage"
|
"github.com/filecoin-project/specs-storage/storage"
|
||||||
)
|
)
|
||||||
@@ -29,7 +30,7 @@ type Worker interface {
|
|||||||
|
|
||||||
// TaskType -> Weight
|
// TaskType -> Weight
|
||||||
TaskTypes(context.Context) (map[sealtasks.TaskType]struct{}, error) //perm:admin
|
TaskTypes(context.Context) (map[sealtasks.TaskType]struct{}, error) //perm:admin
|
||||||
Paths(context.Context) ([]stores.StoragePath, error) //perm:admin
|
Paths(context.Context) ([]storiface.StoragePath, error) //perm:admin
|
||||||
Info(context.Context) (storiface.WorkerInfo, error) //perm:admin
|
Info(context.Context) (storiface.WorkerInfo, error) //perm:admin
|
||||||
|
|
||||||
// storiface.WorkerCalls
|
// storiface.WorkerCalls
|
||||||
@@ -39,11 +40,19 @@ type Worker interface {
|
|||||||
SealCommit1(ctx context.Context, sector storage.SectorRef, ticket abi.SealRandomness, seed abi.InteractiveSealRandomness, pieces []abi.PieceInfo, cids storage.SectorCids) (storiface.CallID, error) //perm:admin
|
SealCommit1(ctx context.Context, sector storage.SectorRef, ticket abi.SealRandomness, seed abi.InteractiveSealRandomness, pieces []abi.PieceInfo, cids storage.SectorCids) (storiface.CallID, error) //perm:admin
|
||||||
SealCommit2(ctx context.Context, sector storage.SectorRef, c1o storage.Commit1Out) (storiface.CallID, error) //perm:admin
|
SealCommit2(ctx context.Context, sector storage.SectorRef, c1o storage.Commit1Out) (storiface.CallID, error) //perm:admin
|
||||||
FinalizeSector(ctx context.Context, sector storage.SectorRef, keepUnsealed []storage.Range) (storiface.CallID, error) //perm:admin
|
FinalizeSector(ctx context.Context, sector storage.SectorRef, keepUnsealed []storage.Range) (storiface.CallID, error) //perm:admin
|
||||||
|
FinalizeReplicaUpdate(ctx context.Context, sector storage.SectorRef, keepUnsealed []storage.Range) (storiface.CallID, error) //perm:admin
|
||||||
|
ReplicaUpdate(ctx context.Context, sector storage.SectorRef, pieces []abi.PieceInfo) (storiface.CallID, error) //perm:admin
|
||||||
|
ProveReplicaUpdate1(ctx context.Context, sector storage.SectorRef, sectorKey, newSealed, newUnsealed cid.Cid) (storiface.CallID, error) //perm:admin
|
||||||
|
ProveReplicaUpdate2(ctx context.Context, sector storage.SectorRef, sectorKey, newSealed, newUnsealed cid.Cid, vanillaProofs storage.ReplicaVanillaProofs) (storiface.CallID, error) //perm:admin
|
||||||
|
GenerateSectorKeyFromData(ctx context.Context, sector storage.SectorRef, commD cid.Cid) (storiface.CallID, error) //perm:admin
|
||||||
ReleaseUnsealed(ctx context.Context, sector storage.SectorRef, safeToFree []storage.Range) (storiface.CallID, error) //perm:admin
|
ReleaseUnsealed(ctx context.Context, sector storage.SectorRef, safeToFree []storage.Range) (storiface.CallID, error) //perm:admin
|
||||||
MoveStorage(ctx context.Context, sector storage.SectorRef, types storiface.SectorFileType) (storiface.CallID, error) //perm:admin
|
MoveStorage(ctx context.Context, sector storage.SectorRef, types storiface.SectorFileType) (storiface.CallID, error) //perm:admin
|
||||||
UnsealPiece(context.Context, storage.SectorRef, storiface.UnpaddedByteIndex, abi.UnpaddedPieceSize, abi.SealRandomness, cid.Cid) (storiface.CallID, error) //perm:admin
|
UnsealPiece(context.Context, storage.SectorRef, storiface.UnpaddedByteIndex, abi.UnpaddedPieceSize, abi.SealRandomness, cid.Cid) (storiface.CallID, error) //perm:admin
|
||||||
Fetch(context.Context, storage.SectorRef, storiface.SectorFileType, storiface.PathType, storiface.AcquireMode) (storiface.CallID, error) //perm:admin
|
Fetch(context.Context, storage.SectorRef, storiface.SectorFileType, storiface.PathType, storiface.AcquireMode) (storiface.CallID, error) //perm:admin
|
||||||
|
|
||||||
|
GenerateWinningPoSt(ctx context.Context, ppt abi.RegisteredPoStProof, mid abi.ActorID, sectors []storiface.PostSectorChallenge, randomness abi.PoStRandomness) ([]proof.PoStProof, error) //perm:admin
|
||||||
|
GenerateWindowPoSt(ctx context.Context, ppt abi.RegisteredPoStProof, mid abi.ActorID, sectors []storiface.PostSectorChallenge, partitionIdx int, randomness abi.PoStRandomness) (storiface.WindowPoStResult, error) //perm:admin
|
||||||
|
|
||||||
TaskDisable(ctx context.Context, tt sealtasks.TaskType) error //perm:admin
|
TaskDisable(ctx context.Context, tt sealtasks.TaskType) error //perm:admin
|
||||||
TaskEnable(ctx context.Context, tt sealtasks.TaskType) error //perm:admin
|
TaskEnable(ctx context.Context, tt sealtasks.TaskType) error //perm:admin
|
||||||
|
|
||||||
|
|||||||
+58
-11
@@ -1,6 +1,7 @@
|
|||||||
package docgen
|
package docgen
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"go/ast"
|
"go/ast"
|
||||||
"go/parser"
|
"go/parser"
|
||||||
@@ -15,7 +16,7 @@ import (
|
|||||||
"github.com/filecoin-project/go-bitfield"
|
"github.com/filecoin-project/go-bitfield"
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
"github.com/ipfs/go-cid"
|
"github.com/ipfs/go-cid"
|
||||||
"github.com/ipfs/go-filestore"
|
"github.com/ipfs/go-graphsync"
|
||||||
"github.com/libp2p/go-libp2p-core/metrics"
|
"github.com/libp2p/go-libp2p-core/metrics"
|
||||||
"github.com/libp2p/go-libp2p-core/network"
|
"github.com/libp2p/go-libp2p-core/network"
|
||||||
"github.com/libp2p/go-libp2p-core/peer"
|
"github.com/libp2p/go-libp2p-core/peer"
|
||||||
@@ -24,9 +25,10 @@ import (
|
|||||||
"github.com/multiformats/go-multiaddr"
|
"github.com/multiformats/go-multiaddr"
|
||||||
|
|
||||||
datatransfer "github.com/filecoin-project/go-data-transfer"
|
datatransfer "github.com/filecoin-project/go-data-transfer"
|
||||||
filestore2 "github.com/filecoin-project/go-fil-markets/filestore"
|
filestore "github.com/filecoin-project/go-fil-markets/filestore"
|
||||||
"github.com/filecoin-project/go-fil-markets/retrievalmarket"
|
"github.com/filecoin-project/go-fil-markets/retrievalmarket"
|
||||||
"github.com/filecoin-project/go-jsonrpc/auth"
|
"github.com/filecoin-project/go-jsonrpc/auth"
|
||||||
|
textselector "github.com/ipld/go-ipld-selector-text-lite"
|
||||||
|
|
||||||
"github.com/filecoin-project/go-state-types/abi"
|
"github.com/filecoin-project/go-state-types/abi"
|
||||||
"github.com/filecoin-project/go-state-types/crypto"
|
"github.com/filecoin-project/go-state-types/crypto"
|
||||||
@@ -38,7 +40,6 @@ import (
|
|||||||
"github.com/filecoin-project/lotus/build"
|
"github.com/filecoin-project/lotus/build"
|
||||||
"github.com/filecoin-project/lotus/chain/types"
|
"github.com/filecoin-project/lotus/chain/types"
|
||||||
"github.com/filecoin-project/lotus/extern/sector-storage/sealtasks"
|
"github.com/filecoin-project/lotus/extern/sector-storage/sealtasks"
|
||||||
"github.com/filecoin-project/lotus/extern/sector-storage/stores"
|
|
||||||
"github.com/filecoin-project/lotus/extern/sector-storage/storiface"
|
"github.com/filecoin-project/lotus/extern/sector-storage/storiface"
|
||||||
sealing "github.com/filecoin-project/lotus/extern/storage-sealing"
|
sealing "github.com/filecoin-project/lotus/extern/storage-sealing"
|
||||||
"github.com/filecoin-project/lotus/node/modules/dtypes"
|
"github.com/filecoin-project/lotus/node/modules/dtypes"
|
||||||
@@ -90,6 +91,9 @@ func init() {
|
|||||||
addExample(&pid)
|
addExample(&pid)
|
||||||
|
|
||||||
storeIDExample := imports.ID(50)
|
storeIDExample := imports.ID(50)
|
||||||
|
textSelExample := textselector.Expression("Links/21/Hash/Links/42/Hash")
|
||||||
|
apiSelExample := api.Selector("Links/21/Hash/Links/42/Hash")
|
||||||
|
clientEvent := retrievalmarket.ClientEventDealAccepted
|
||||||
|
|
||||||
addExample(bitfield.NewFromSet([]uint64{5}))
|
addExample(bitfield.NewFromSet([]uint64{5}))
|
||||||
addExample(abi.RegisteredSealProof_StackedDrg32GiBV1_1)
|
addExample(abi.RegisteredSealProof_StackedDrg32GiBV1_1)
|
||||||
@@ -108,7 +112,6 @@ func init() {
|
|||||||
addExample(abi.UnpaddedPieceSize(1024))
|
addExample(abi.UnpaddedPieceSize(1024))
|
||||||
addExample(abi.UnpaddedPieceSize(1024).Padded())
|
addExample(abi.UnpaddedPieceSize(1024).Padded())
|
||||||
addExample(abi.DealID(5432))
|
addExample(abi.DealID(5432))
|
||||||
addExample(filestore.StatusFileChanged)
|
|
||||||
addExample(abi.SectorNumber(9))
|
addExample(abi.SectorNumber(9))
|
||||||
addExample(abi.SectorSize(32 * 1024 * 1024 * 1024))
|
addExample(abi.SectorSize(32 * 1024 * 1024 * 1024))
|
||||||
addExample(api.MpoolChange(0))
|
addExample(api.MpoolChange(0))
|
||||||
@@ -118,12 +121,17 @@ func init() {
|
|||||||
addExample(api.FullAPIVersion1)
|
addExample(api.FullAPIVersion1)
|
||||||
addExample(api.PCHInbound)
|
addExample(api.PCHInbound)
|
||||||
addExample(time.Minute)
|
addExample(time.Minute)
|
||||||
|
addExample(graphsync.NewRequestID())
|
||||||
addExample(datatransfer.TransferID(3))
|
addExample(datatransfer.TransferID(3))
|
||||||
addExample(datatransfer.Ongoing)
|
addExample(datatransfer.Ongoing)
|
||||||
addExample(storeIDExample)
|
addExample(storeIDExample)
|
||||||
addExample(&storeIDExample)
|
addExample(&storeIDExample)
|
||||||
|
addExample(clientEvent)
|
||||||
|
addExample(&clientEvent)
|
||||||
addExample(retrievalmarket.ClientEventDealAccepted)
|
addExample(retrievalmarket.ClientEventDealAccepted)
|
||||||
addExample(retrievalmarket.DealStatusNew)
|
addExample(retrievalmarket.DealStatusNew)
|
||||||
|
addExample(&textSelExample)
|
||||||
|
addExample(&apiSelExample)
|
||||||
addExample(network.ReachabilityPublic)
|
addExample(network.ReachabilityPublic)
|
||||||
addExample(build.NewestNetworkVersion)
|
addExample(build.NewestNetworkVersion)
|
||||||
addExample(map[string]int{"name": 42})
|
addExample(map[string]int{"name": 42})
|
||||||
@@ -175,7 +183,7 @@ func init() {
|
|||||||
ExampleValues[reflect.TypeOf(struct{ A multiaddr.Multiaddr }{}).Field(0).Type] = maddr
|
ExampleValues[reflect.TypeOf(struct{ A multiaddr.Multiaddr }{}).Field(0).Type] = maddr
|
||||||
|
|
||||||
// miner specific
|
// miner specific
|
||||||
addExample(filestore2.Path(".lotusminer/fstmp123"))
|
addExample(filestore.Path(".lotusminer/fstmp123"))
|
||||||
si := uint64(12)
|
si := uint64(12)
|
||||||
addExample(&si)
|
addExample(&si)
|
||||||
addExample(retrievalmarket.DealID(5))
|
addExample(retrievalmarket.DealID(5))
|
||||||
@@ -190,10 +198,10 @@ func init() {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
addExample(api.SectorState(sealing.Proving))
|
addExample(api.SectorState(sealing.Proving))
|
||||||
addExample(stores.ID("76f1988b-ef30-4d7e-b3ec-9a627f4ba5a8"))
|
addExample(storiface.ID("76f1988b-ef30-4d7e-b3ec-9a627f4ba5a8"))
|
||||||
addExample(storiface.FTUnsealed)
|
addExample(storiface.FTUnsealed)
|
||||||
addExample(storiface.PathSealing)
|
addExample(storiface.PathSealing)
|
||||||
addExample(map[stores.ID][]stores.Decl{
|
addExample(map[storiface.ID][]storiface.Decl{
|
||||||
"76f1988b-ef30-4d7e-b3ec-9a627f4ba5a8": {
|
"76f1988b-ef30-4d7e-b3ec-9a627f4ba5a8": {
|
||||||
{
|
{
|
||||||
SectorID: abi.SectorID{Miner: 1000, Number: 100},
|
SectorID: abi.SectorID{Miner: 1000, Number: 100},
|
||||||
@@ -201,7 +209,7 @@ func init() {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
addExample(map[stores.ID]string{
|
addExample(map[storiface.ID]string{
|
||||||
"76f1988b-ef30-4d7e-b3ec-9a627f4ba5a8": "/data/path",
|
"76f1988b-ef30-4d7e-b3ec-9a627f4ba5a8": "/data/path",
|
||||||
})
|
})
|
||||||
addExample(map[uuid.UUID][]storiface.WorkerJob{
|
addExample(map[uuid.UUID][]storiface.WorkerJob{
|
||||||
@@ -225,16 +233,18 @@ func init() {
|
|||||||
Hostname: "host",
|
Hostname: "host",
|
||||||
Resources: storiface.WorkerResources{
|
Resources: storiface.WorkerResources{
|
||||||
MemPhysical: 256 << 30,
|
MemPhysical: 256 << 30,
|
||||||
|
MemUsed: 2 << 30,
|
||||||
MemSwap: 120 << 30,
|
MemSwap: 120 << 30,
|
||||||
MemReserved: 2 << 30,
|
MemSwapUsed: 2 << 30,
|
||||||
CPUs: 64,
|
CPUs: 64,
|
||||||
GPUs: []string{"aGPU 1337"},
|
GPUs: []string{"aGPU 1337"},
|
||||||
|
Resources: storiface.ResourceTable,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Enabled: true,
|
Enabled: true,
|
||||||
MemUsedMin: 0,
|
MemUsedMin: 0,
|
||||||
MemUsedMax: 0,
|
MemUsedMax: 0,
|
||||||
GpuUsed: false,
|
GpuUsed: 0,
|
||||||
CpuUse: 0,
|
CpuUse: 0,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
@@ -242,10 +252,18 @@ func init() {
|
|||||||
addExample(map[abi.SectorNumber]string{
|
addExample(map[abi.SectorNumber]string{
|
||||||
123: "can't acquire read lock",
|
123: "can't acquire read lock",
|
||||||
})
|
})
|
||||||
|
addExample(json.RawMessage(`"json raw message"`))
|
||||||
addExample(map[api.SectorState]int{
|
addExample(map[api.SectorState]int{
|
||||||
api.SectorState(sealing.Proving): 120,
|
api.SectorState(sealing.Proving): 120,
|
||||||
})
|
})
|
||||||
addExample([]abi.SectorNumber{123, 124})
|
addExample([]abi.SectorNumber{123, 124})
|
||||||
|
addExample([]storiface.SectorLock{
|
||||||
|
{
|
||||||
|
Sector: abi.SectorID{Number: 123, Miner: 1000},
|
||||||
|
Write: [storiface.FileTypes]uint{0, 0, 1},
|
||||||
|
Read: [storiface.FileTypes]uint{2, 3, 0},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
// worker specific
|
// worker specific
|
||||||
addExample(storiface.AcquireMove)
|
addExample(storiface.AcquireMove)
|
||||||
@@ -280,6 +298,35 @@ func init() {
|
|||||||
State: "ShardStateAvailable",
|
State: "ShardStateAvailable",
|
||||||
Error: "<error>",
|
Error: "<error>",
|
||||||
})
|
})
|
||||||
|
addExample(storiface.ResourceTable)
|
||||||
|
addExample(network.ScopeStat{
|
||||||
|
Memory: 123,
|
||||||
|
NumStreamsInbound: 1,
|
||||||
|
NumStreamsOutbound: 2,
|
||||||
|
NumConnsInbound: 3,
|
||||||
|
NumConnsOutbound: 4,
|
||||||
|
NumFD: 5,
|
||||||
|
})
|
||||||
|
addExample(map[string]network.ScopeStat{
|
||||||
|
"abc": {
|
||||||
|
Memory: 123,
|
||||||
|
NumStreamsInbound: 1,
|
||||||
|
NumStreamsOutbound: 2,
|
||||||
|
NumConnsInbound: 3,
|
||||||
|
NumConnsOutbound: 4,
|
||||||
|
NumFD: 5,
|
||||||
|
}})
|
||||||
|
addExample(api.NetLimit{
|
||||||
|
Memory: 123,
|
||||||
|
StreamsInbound: 1,
|
||||||
|
StreamsOutbound: 2,
|
||||||
|
Streams: 3,
|
||||||
|
ConnsInbound: 3,
|
||||||
|
ConnsOutbound: 4,
|
||||||
|
Conns: 4,
|
||||||
|
FD: 5,
|
||||||
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetAPIType(name, pkg string) (i interface{}, t reflect.Type, permStruct []reflect.Type) {
|
func GetAPIType(name, pkg string) (i interface{}, t reflect.Type, permStruct []reflect.Type) {
|
||||||
@@ -330,7 +377,7 @@ func ExampleValue(method string, t, parent reflect.Type) interface{} {
|
|||||||
switch t.Kind() {
|
switch t.Kind() {
|
||||||
case reflect.Slice:
|
case reflect.Slice:
|
||||||
out := reflect.New(t).Elem()
|
out := reflect.New(t).Elem()
|
||||||
reflect.Append(out, reflect.ValueOf(ExampleValue(method, t.Elem(), t)))
|
out = reflect.Append(out, reflect.ValueOf(ExampleValue(method, t.Elem(), t)))
|
||||||
return out.Interface()
|
return out.Interface()
|
||||||
case reflect.Chan:
|
case reflect.Chan:
|
||||||
return ExampleValue(method, t.Elem(), nil)
|
return ExampleValue(method, t.Elem(), nil)
|
||||||
|
|||||||
+201
-55
@@ -8,6 +8,7 @@ import (
|
|||||||
context "context"
|
context "context"
|
||||||
json "encoding/json"
|
json "encoding/json"
|
||||||
reflect "reflect"
|
reflect "reflect"
|
||||||
|
time "time"
|
||||||
|
|
||||||
address "github.com/filecoin-project/go-address"
|
address "github.com/filecoin-project/go-address"
|
||||||
bitfield "github.com/filecoin-project/go-bitfield"
|
bitfield "github.com/filecoin-project/go-bitfield"
|
||||||
@@ -25,7 +26,6 @@ import (
|
|||||||
miner "github.com/filecoin-project/lotus/chain/actors/builtin/miner"
|
miner "github.com/filecoin-project/lotus/chain/actors/builtin/miner"
|
||||||
types "github.com/filecoin-project/lotus/chain/types"
|
types "github.com/filecoin-project/lotus/chain/types"
|
||||||
alerting "github.com/filecoin-project/lotus/journal/alerting"
|
alerting "github.com/filecoin-project/lotus/journal/alerting"
|
||||||
marketevents "github.com/filecoin-project/lotus/markets/loggers"
|
|
||||||
dtypes "github.com/filecoin-project/lotus/node/modules/dtypes"
|
dtypes "github.com/filecoin-project/lotus/node/modules/dtypes"
|
||||||
imports "github.com/filecoin-project/lotus/node/repo/imports"
|
imports "github.com/filecoin-project/lotus/node/repo/imports"
|
||||||
miner0 "github.com/filecoin-project/specs-actors/actors/builtin/miner"
|
miner0 "github.com/filecoin-project/specs-actors/actors/builtin/miner"
|
||||||
@@ -300,36 +300,6 @@ func (mr *MockFullNodeMockRecorder) ChainGetPath(arg0, arg1, arg2 interface{}) *
|
|||||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ChainGetPath", reflect.TypeOf((*MockFullNode)(nil).ChainGetPath), arg0, arg1, arg2)
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ChainGetPath", reflect.TypeOf((*MockFullNode)(nil).ChainGetPath), arg0, arg1, arg2)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ChainGetRandomnessFromBeacon mocks base method.
|
|
||||||
func (m *MockFullNode) ChainGetRandomnessFromBeacon(arg0 context.Context, arg1 types.TipSetKey, arg2 crypto.DomainSeparationTag, arg3 abi.ChainEpoch, arg4 []byte) (abi.Randomness, error) {
|
|
||||||
m.ctrl.T.Helper()
|
|
||||||
ret := m.ctrl.Call(m, "ChainGetRandomnessFromBeacon", arg0, arg1, arg2, arg3, arg4)
|
|
||||||
ret0, _ := ret[0].(abi.Randomness)
|
|
||||||
ret1, _ := ret[1].(error)
|
|
||||||
return ret0, ret1
|
|
||||||
}
|
|
||||||
|
|
||||||
// ChainGetRandomnessFromBeacon indicates an expected call of ChainGetRandomnessFromBeacon.
|
|
||||||
func (mr *MockFullNodeMockRecorder) ChainGetRandomnessFromBeacon(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call {
|
|
||||||
mr.mock.ctrl.T.Helper()
|
|
||||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ChainGetRandomnessFromBeacon", reflect.TypeOf((*MockFullNode)(nil).ChainGetRandomnessFromBeacon), arg0, arg1, arg2, arg3, arg4)
|
|
||||||
}
|
|
||||||
|
|
||||||
// ChainGetRandomnessFromTickets mocks base method.
|
|
||||||
func (m *MockFullNode) ChainGetRandomnessFromTickets(arg0 context.Context, arg1 types.TipSetKey, arg2 crypto.DomainSeparationTag, arg3 abi.ChainEpoch, arg4 []byte) (abi.Randomness, error) {
|
|
||||||
m.ctrl.T.Helper()
|
|
||||||
ret := m.ctrl.Call(m, "ChainGetRandomnessFromTickets", arg0, arg1, arg2, arg3, arg4)
|
|
||||||
ret0, _ := ret[0].(abi.Randomness)
|
|
||||||
ret1, _ := ret[1].(error)
|
|
||||||
return ret0, ret1
|
|
||||||
}
|
|
||||||
|
|
||||||
// ChainGetRandomnessFromTickets indicates an expected call of ChainGetRandomnessFromTickets.
|
|
||||||
func (mr *MockFullNodeMockRecorder) ChainGetRandomnessFromTickets(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call {
|
|
||||||
mr.mock.ctrl.T.Helper()
|
|
||||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ChainGetRandomnessFromTickets", reflect.TypeOf((*MockFullNode)(nil).ChainGetRandomnessFromTickets), arg0, arg1, arg2, arg3, arg4)
|
|
||||||
}
|
|
||||||
|
|
||||||
// ChainGetTipSet mocks base method.
|
// ChainGetTipSet mocks base method.
|
||||||
func (m *MockFullNode) ChainGetTipSet(arg0 context.Context, arg1 types.TipSetKey) (*types.TipSet, error) {
|
func (m *MockFullNode) ChainGetTipSet(arg0 context.Context, arg1 types.TipSetKey) (*types.TipSet, error) {
|
||||||
m.ctrl.T.Helper()
|
m.ctrl.T.Helper()
|
||||||
@@ -567,6 +537,20 @@ func (mr *MockFullNodeMockRecorder) ClientDealSize(arg0, arg1 interface{}) *gomo
|
|||||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientDealSize", reflect.TypeOf((*MockFullNode)(nil).ClientDealSize), arg0, arg1)
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientDealSize", reflect.TypeOf((*MockFullNode)(nil).ClientDealSize), arg0, arg1)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ClientExport mocks base method.
|
||||||
|
func (m *MockFullNode) ClientExport(arg0 context.Context, arg1 api.ExportRef, arg2 api.FileRef) error {
|
||||||
|
m.ctrl.T.Helper()
|
||||||
|
ret := m.ctrl.Call(m, "ClientExport", arg0, arg1, arg2)
|
||||||
|
ret0, _ := ret[0].(error)
|
||||||
|
return ret0
|
||||||
|
}
|
||||||
|
|
||||||
|
// ClientExport indicates an expected call of ClientExport.
|
||||||
|
func (mr *MockFullNodeMockRecorder) ClientExport(arg0, arg1, arg2 interface{}) *gomock.Call {
|
||||||
|
mr.mock.ctrl.T.Helper()
|
||||||
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientExport", reflect.TypeOf((*MockFullNode)(nil).ClientExport), arg0, arg1, arg2)
|
||||||
|
}
|
||||||
|
|
||||||
// ClientFindData mocks base method.
|
// ClientFindData mocks base method.
|
||||||
func (m *MockFullNode) ClientFindData(arg0 context.Context, arg1 cid.Cid, arg2 *cid.Cid) ([]api.QueryOffer, error) {
|
func (m *MockFullNode) ClientFindData(arg0 context.Context, arg1 cid.Cid, arg2 *cid.Cid) ([]api.QueryOffer, error) {
|
||||||
m.ctrl.T.Helper()
|
m.ctrl.T.Helper()
|
||||||
@@ -805,17 +789,18 @@ func (mr *MockFullNodeMockRecorder) ClientRestartDataTransfer(arg0, arg1, arg2,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ClientRetrieve mocks base method.
|
// ClientRetrieve mocks base method.
|
||||||
func (m *MockFullNode) ClientRetrieve(arg0 context.Context, arg1 api.RetrievalOrder, arg2 *api.FileRef) error {
|
func (m *MockFullNode) ClientRetrieve(arg0 context.Context, arg1 api.RetrievalOrder) (*api.RestrievalRes, error) {
|
||||||
m.ctrl.T.Helper()
|
m.ctrl.T.Helper()
|
||||||
ret := m.ctrl.Call(m, "ClientRetrieve", arg0, arg1, arg2)
|
ret := m.ctrl.Call(m, "ClientRetrieve", arg0, arg1)
|
||||||
ret0, _ := ret[0].(error)
|
ret0, _ := ret[0].(*api.RestrievalRes)
|
||||||
return ret0
|
ret1, _ := ret[1].(error)
|
||||||
|
return ret0, ret1
|
||||||
}
|
}
|
||||||
|
|
||||||
// ClientRetrieve indicates an expected call of ClientRetrieve.
|
// ClientRetrieve indicates an expected call of ClientRetrieve.
|
||||||
func (mr *MockFullNodeMockRecorder) ClientRetrieve(arg0, arg1, arg2 interface{}) *gomock.Call {
|
func (mr *MockFullNodeMockRecorder) ClientRetrieve(arg0, arg1 interface{}) *gomock.Call {
|
||||||
mr.mock.ctrl.T.Helper()
|
mr.mock.ctrl.T.Helper()
|
||||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientRetrieve", reflect.TypeOf((*MockFullNode)(nil).ClientRetrieve), arg0, arg1, arg2)
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientRetrieve", reflect.TypeOf((*MockFullNode)(nil).ClientRetrieve), arg0, arg1)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ClientRetrieveTryRestartInsufficientFunds mocks base method.
|
// ClientRetrieveTryRestartInsufficientFunds mocks base method.
|
||||||
@@ -832,19 +817,18 @@ func (mr *MockFullNodeMockRecorder) ClientRetrieveTryRestartInsufficientFunds(ar
|
|||||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientRetrieveTryRestartInsufficientFunds", reflect.TypeOf((*MockFullNode)(nil).ClientRetrieveTryRestartInsufficientFunds), arg0, arg1)
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientRetrieveTryRestartInsufficientFunds", reflect.TypeOf((*MockFullNode)(nil).ClientRetrieveTryRestartInsufficientFunds), arg0, arg1)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ClientRetrieveWithEvents mocks base method.
|
// ClientRetrieveWait mocks base method.
|
||||||
func (m *MockFullNode) ClientRetrieveWithEvents(arg0 context.Context, arg1 api.RetrievalOrder, arg2 *api.FileRef) (<-chan marketevents.RetrievalEvent, error) {
|
func (m *MockFullNode) ClientRetrieveWait(arg0 context.Context, arg1 retrievalmarket.DealID) error {
|
||||||
m.ctrl.T.Helper()
|
m.ctrl.T.Helper()
|
||||||
ret := m.ctrl.Call(m, "ClientRetrieveWithEvents", arg0, arg1, arg2)
|
ret := m.ctrl.Call(m, "ClientRetrieveWait", arg0, arg1)
|
||||||
ret0, _ := ret[0].(<-chan marketevents.RetrievalEvent)
|
ret0, _ := ret[0].(error)
|
||||||
ret1, _ := ret[1].(error)
|
return ret0
|
||||||
return ret0, ret1
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ClientRetrieveWithEvents indicates an expected call of ClientRetrieveWithEvents.
|
// ClientRetrieveWait indicates an expected call of ClientRetrieveWait.
|
||||||
func (mr *MockFullNodeMockRecorder) ClientRetrieveWithEvents(arg0, arg1, arg2 interface{}) *gomock.Call {
|
func (mr *MockFullNodeMockRecorder) ClientRetrieveWait(arg0, arg1 interface{}) *gomock.Call {
|
||||||
mr.mock.ctrl.T.Helper()
|
mr.mock.ctrl.T.Helper()
|
||||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientRetrieveWithEvents", reflect.TypeOf((*MockFullNode)(nil).ClientRetrieveWithEvents), arg0, arg1, arg2)
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientRetrieveWait", reflect.TypeOf((*MockFullNode)(nil).ClientRetrieveWait), arg0, arg1)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ClientStartDeal mocks base method.
|
// ClientStartDeal mocks base method.
|
||||||
@@ -1458,18 +1442,33 @@ func (mr *MockFullNodeMockRecorder) MsigApproveTxnHash(arg0, arg1, arg2, arg3, a
|
|||||||
}
|
}
|
||||||
|
|
||||||
// MsigCancel mocks base method.
|
// MsigCancel mocks base method.
|
||||||
func (m *MockFullNode) MsigCancel(arg0 context.Context, arg1 address.Address, arg2 uint64, arg3 address.Address, arg4 big.Int, arg5 address.Address, arg6 uint64, arg7 []byte) (*api.MessagePrototype, error) {
|
func (m *MockFullNode) MsigCancel(arg0 context.Context, arg1 address.Address, arg2 uint64, arg3 address.Address) (*api.MessagePrototype, error) {
|
||||||
m.ctrl.T.Helper()
|
m.ctrl.T.Helper()
|
||||||
ret := m.ctrl.Call(m, "MsigCancel", arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7)
|
ret := m.ctrl.Call(m, "MsigCancel", arg0, arg1, arg2, arg3)
|
||||||
ret0, _ := ret[0].(*api.MessagePrototype)
|
ret0, _ := ret[0].(*api.MessagePrototype)
|
||||||
ret1, _ := ret[1].(error)
|
ret1, _ := ret[1].(error)
|
||||||
return ret0, ret1
|
return ret0, ret1
|
||||||
}
|
}
|
||||||
|
|
||||||
// MsigCancel indicates an expected call of MsigCancel.
|
// MsigCancel indicates an expected call of MsigCancel.
|
||||||
func (mr *MockFullNodeMockRecorder) MsigCancel(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7 interface{}) *gomock.Call {
|
func (mr *MockFullNodeMockRecorder) MsigCancel(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
|
||||||
mr.mock.ctrl.T.Helper()
|
mr.mock.ctrl.T.Helper()
|
||||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MsigCancel", reflect.TypeOf((*MockFullNode)(nil).MsigCancel), arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7)
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MsigCancel", reflect.TypeOf((*MockFullNode)(nil).MsigCancel), arg0, arg1, arg2, arg3)
|
||||||
|
}
|
||||||
|
|
||||||
|
// MsigCancelTxnHash mocks base method.
|
||||||
|
func (m *MockFullNode) MsigCancelTxnHash(arg0 context.Context, arg1 address.Address, arg2 uint64, arg3 address.Address, arg4 big.Int, arg5 address.Address, arg6 uint64, arg7 []byte) (*api.MessagePrototype, error) {
|
||||||
|
m.ctrl.T.Helper()
|
||||||
|
ret := m.ctrl.Call(m, "MsigCancelTxnHash", arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7)
|
||||||
|
ret0, _ := ret[0].(*api.MessagePrototype)
|
||||||
|
ret1, _ := ret[1].(error)
|
||||||
|
return ret0, ret1
|
||||||
|
}
|
||||||
|
|
||||||
|
// MsigCancelTxnHash indicates an expected call of MsigCancelTxnHash.
|
||||||
|
func (mr *MockFullNodeMockRecorder) MsigCancelTxnHash(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7 interface{}) *gomock.Call {
|
||||||
|
mr.mock.ctrl.T.Helper()
|
||||||
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MsigCancelTxnHash", reflect.TypeOf((*MockFullNode)(nil).MsigCancelTxnHash), arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7)
|
||||||
}
|
}
|
||||||
|
|
||||||
// MsigCreate mocks base method.
|
// MsigCreate mocks base method.
|
||||||
@@ -1813,6 +1812,21 @@ func (mr *MockFullNodeMockRecorder) NetFindPeer(arg0, arg1 interface{}) *gomock.
|
|||||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetFindPeer", reflect.TypeOf((*MockFullNode)(nil).NetFindPeer), arg0, arg1)
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetFindPeer", reflect.TypeOf((*MockFullNode)(nil).NetFindPeer), arg0, arg1)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NetLimit mocks base method.
|
||||||
|
func (m *MockFullNode) NetLimit(arg0 context.Context, arg1 string) (api.NetLimit, error) {
|
||||||
|
m.ctrl.T.Helper()
|
||||||
|
ret := m.ctrl.Call(m, "NetLimit", arg0, arg1)
|
||||||
|
ret0, _ := ret[0].(api.NetLimit)
|
||||||
|
ret1, _ := ret[1].(error)
|
||||||
|
return ret0, ret1
|
||||||
|
}
|
||||||
|
|
||||||
|
// NetLimit indicates an expected call of NetLimit.
|
||||||
|
func (mr *MockFullNodeMockRecorder) NetLimit(arg0, arg1 interface{}) *gomock.Call {
|
||||||
|
mr.mock.ctrl.T.Helper()
|
||||||
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetLimit", reflect.TypeOf((*MockFullNode)(nil).NetLimit), arg0, arg1)
|
||||||
|
}
|
||||||
|
|
||||||
// NetPeerInfo mocks base method.
|
// NetPeerInfo mocks base method.
|
||||||
func (m *MockFullNode) NetPeerInfo(arg0 context.Context, arg1 peer.ID) (*api.ExtendedPeerInfo, error) {
|
func (m *MockFullNode) NetPeerInfo(arg0 context.Context, arg1 peer.ID) (*api.ExtendedPeerInfo, error) {
|
||||||
m.ctrl.T.Helper()
|
m.ctrl.T.Helper()
|
||||||
@@ -1843,6 +1857,64 @@ func (mr *MockFullNodeMockRecorder) NetPeers(arg0 interface{}) *gomock.Call {
|
|||||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetPeers", reflect.TypeOf((*MockFullNode)(nil).NetPeers), arg0)
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetPeers", reflect.TypeOf((*MockFullNode)(nil).NetPeers), arg0)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NetPing mocks base method.
|
||||||
|
func (m *MockFullNode) NetPing(arg0 context.Context, arg1 peer.ID) (time.Duration, error) {
|
||||||
|
m.ctrl.T.Helper()
|
||||||
|
ret := m.ctrl.Call(m, "NetPing", arg0, arg1)
|
||||||
|
ret0, _ := ret[0].(time.Duration)
|
||||||
|
ret1, _ := ret[1].(error)
|
||||||
|
return ret0, ret1
|
||||||
|
}
|
||||||
|
|
||||||
|
// NetPing indicates an expected call of NetPing.
|
||||||
|
func (mr *MockFullNodeMockRecorder) NetPing(arg0, arg1 interface{}) *gomock.Call {
|
||||||
|
mr.mock.ctrl.T.Helper()
|
||||||
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetPing", reflect.TypeOf((*MockFullNode)(nil).NetPing), arg0, arg1)
|
||||||
|
}
|
||||||
|
|
||||||
|
// NetProtectAdd mocks base method.
|
||||||
|
func (m *MockFullNode) NetProtectAdd(arg0 context.Context, arg1 []peer.ID) error {
|
||||||
|
m.ctrl.T.Helper()
|
||||||
|
ret := m.ctrl.Call(m, "NetProtectAdd", arg0, arg1)
|
||||||
|
ret0, _ := ret[0].(error)
|
||||||
|
return ret0
|
||||||
|
}
|
||||||
|
|
||||||
|
// NetProtectAdd indicates an expected call of NetProtectAdd.
|
||||||
|
func (mr *MockFullNodeMockRecorder) NetProtectAdd(arg0, arg1 interface{}) *gomock.Call {
|
||||||
|
mr.mock.ctrl.T.Helper()
|
||||||
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetProtectAdd", reflect.TypeOf((*MockFullNode)(nil).NetProtectAdd), arg0, arg1)
|
||||||
|
}
|
||||||
|
|
||||||
|
// NetProtectList mocks base method.
|
||||||
|
func (m *MockFullNode) NetProtectList(arg0 context.Context) ([]peer.ID, error) {
|
||||||
|
m.ctrl.T.Helper()
|
||||||
|
ret := m.ctrl.Call(m, "NetProtectList", arg0)
|
||||||
|
ret0, _ := ret[0].([]peer.ID)
|
||||||
|
ret1, _ := ret[1].(error)
|
||||||
|
return ret0, ret1
|
||||||
|
}
|
||||||
|
|
||||||
|
// NetProtectList indicates an expected call of NetProtectList.
|
||||||
|
func (mr *MockFullNodeMockRecorder) NetProtectList(arg0 interface{}) *gomock.Call {
|
||||||
|
mr.mock.ctrl.T.Helper()
|
||||||
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetProtectList", reflect.TypeOf((*MockFullNode)(nil).NetProtectList), arg0)
|
||||||
|
}
|
||||||
|
|
||||||
|
// NetProtectRemove mocks base method.
|
||||||
|
func (m *MockFullNode) NetProtectRemove(arg0 context.Context, arg1 []peer.ID) error {
|
||||||
|
m.ctrl.T.Helper()
|
||||||
|
ret := m.ctrl.Call(m, "NetProtectRemove", arg0, arg1)
|
||||||
|
ret0, _ := ret[0].(error)
|
||||||
|
return ret0
|
||||||
|
}
|
||||||
|
|
||||||
|
// NetProtectRemove indicates an expected call of NetProtectRemove.
|
||||||
|
func (mr *MockFullNodeMockRecorder) NetProtectRemove(arg0, arg1 interface{}) *gomock.Call {
|
||||||
|
mr.mock.ctrl.T.Helper()
|
||||||
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetProtectRemove", reflect.TypeOf((*MockFullNode)(nil).NetProtectRemove), arg0, arg1)
|
||||||
|
}
|
||||||
|
|
||||||
// NetPubsubScores mocks base method.
|
// NetPubsubScores mocks base method.
|
||||||
func (m *MockFullNode) NetPubsubScores(arg0 context.Context) ([]api.PubsubScore, error) {
|
func (m *MockFullNode) NetPubsubScores(arg0 context.Context) ([]api.PubsubScore, error) {
|
||||||
m.ctrl.T.Helper()
|
m.ctrl.T.Helper()
|
||||||
@@ -1858,6 +1930,35 @@ func (mr *MockFullNodeMockRecorder) NetPubsubScores(arg0 interface{}) *gomock.Ca
|
|||||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetPubsubScores", reflect.TypeOf((*MockFullNode)(nil).NetPubsubScores), arg0)
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetPubsubScores", reflect.TypeOf((*MockFullNode)(nil).NetPubsubScores), arg0)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NetSetLimit mocks base method.
|
||||||
|
func (m *MockFullNode) NetSetLimit(arg0 context.Context, arg1 string, arg2 api.NetLimit) error {
|
||||||
|
m.ctrl.T.Helper()
|
||||||
|
ret := m.ctrl.Call(m, "NetSetLimit", arg0, arg1, arg2)
|
||||||
|
ret0, _ := ret[0].(error)
|
||||||
|
return ret0
|
||||||
|
}
|
||||||
|
|
||||||
|
// NetSetLimit indicates an expected call of NetSetLimit.
|
||||||
|
func (mr *MockFullNodeMockRecorder) NetSetLimit(arg0, arg1, arg2 interface{}) *gomock.Call {
|
||||||
|
mr.mock.ctrl.T.Helper()
|
||||||
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetSetLimit", reflect.TypeOf((*MockFullNode)(nil).NetSetLimit), arg0, arg1, arg2)
|
||||||
|
}
|
||||||
|
|
||||||
|
// NetStat mocks base method.
|
||||||
|
func (m *MockFullNode) NetStat(arg0 context.Context, arg1 string) (api.NetStat, error) {
|
||||||
|
m.ctrl.T.Helper()
|
||||||
|
ret := m.ctrl.Call(m, "NetStat", arg0, arg1)
|
||||||
|
ret0, _ := ret[0].(api.NetStat)
|
||||||
|
ret1, _ := ret[1].(error)
|
||||||
|
return ret0, ret1
|
||||||
|
}
|
||||||
|
|
||||||
|
// NetStat indicates an expected call of NetStat.
|
||||||
|
func (mr *MockFullNodeMockRecorder) NetStat(arg0, arg1 interface{}) *gomock.Call {
|
||||||
|
mr.mock.ctrl.T.Helper()
|
||||||
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetStat", reflect.TypeOf((*MockFullNode)(nil).NetStat), arg0, arg1)
|
||||||
|
}
|
||||||
|
|
||||||
// NodeStatus mocks base method.
|
// NodeStatus mocks base method.
|
||||||
func (m *MockFullNode) NodeStatus(arg0 context.Context, arg1 bool) (api.NodeStatus, error) {
|
func (m *MockFullNode) NodeStatus(arg0 context.Context, arg1 bool) (api.NodeStatus, error) {
|
||||||
m.ctrl.T.Helper()
|
m.ctrl.T.Helper()
|
||||||
@@ -1933,19 +2034,34 @@ func (mr *MockFullNodeMockRecorder) PaychCollect(arg0, arg1 interface{}) *gomock
|
|||||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PaychCollect", reflect.TypeOf((*MockFullNode)(nil).PaychCollect), arg0, arg1)
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PaychCollect", reflect.TypeOf((*MockFullNode)(nil).PaychCollect), arg0, arg1)
|
||||||
}
|
}
|
||||||
|
|
||||||
// PaychGet mocks base method.
|
// PaychFund mocks base method.
|
||||||
func (m *MockFullNode) PaychGet(arg0 context.Context, arg1, arg2 address.Address, arg3 big.Int) (*api.ChannelInfo, error) {
|
func (m *MockFullNode) PaychFund(arg0 context.Context, arg1, arg2 address.Address, arg3 big.Int) (*api.ChannelInfo, error) {
|
||||||
m.ctrl.T.Helper()
|
m.ctrl.T.Helper()
|
||||||
ret := m.ctrl.Call(m, "PaychGet", arg0, arg1, arg2, arg3)
|
ret := m.ctrl.Call(m, "PaychFund", arg0, arg1, arg2, arg3)
|
||||||
|
ret0, _ := ret[0].(*api.ChannelInfo)
|
||||||
|
ret1, _ := ret[1].(error)
|
||||||
|
return ret0, ret1
|
||||||
|
}
|
||||||
|
|
||||||
|
// PaychFund indicates an expected call of PaychFund.
|
||||||
|
func (mr *MockFullNodeMockRecorder) PaychFund(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
|
||||||
|
mr.mock.ctrl.T.Helper()
|
||||||
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PaychFund", reflect.TypeOf((*MockFullNode)(nil).PaychFund), arg0, arg1, arg2, arg3)
|
||||||
|
}
|
||||||
|
|
||||||
|
// PaychGet mocks base method.
|
||||||
|
func (m *MockFullNode) PaychGet(arg0 context.Context, arg1, arg2 address.Address, arg3 big.Int, arg4 api.PaychGetOpts) (*api.ChannelInfo, error) {
|
||||||
|
m.ctrl.T.Helper()
|
||||||
|
ret := m.ctrl.Call(m, "PaychGet", arg0, arg1, arg2, arg3, arg4)
|
||||||
ret0, _ := ret[0].(*api.ChannelInfo)
|
ret0, _ := ret[0].(*api.ChannelInfo)
|
||||||
ret1, _ := ret[1].(error)
|
ret1, _ := ret[1].(error)
|
||||||
return ret0, ret1
|
return ret0, ret1
|
||||||
}
|
}
|
||||||
|
|
||||||
// PaychGet indicates an expected call of PaychGet.
|
// PaychGet indicates an expected call of PaychGet.
|
||||||
func (mr *MockFullNodeMockRecorder) PaychGet(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
|
func (mr *MockFullNodeMockRecorder) PaychGet(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call {
|
||||||
mr.mock.ctrl.T.Helper()
|
mr.mock.ctrl.T.Helper()
|
||||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PaychGet", reflect.TypeOf((*MockFullNode)(nil).PaychGet), arg0, arg1, arg2, arg3)
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PaychGet", reflect.TypeOf((*MockFullNode)(nil).PaychGet), arg0, arg1, arg2, arg3, arg4)
|
||||||
}
|
}
|
||||||
|
|
||||||
// PaychGetWaitReady mocks base method.
|
// PaychGetWaitReady mocks base method.
|
||||||
@@ -2291,6 +2407,36 @@ func (mr *MockFullNodeMockRecorder) StateGetActor(arg0, arg1, arg2 interface{})
|
|||||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateGetActor", reflect.TypeOf((*MockFullNode)(nil).StateGetActor), arg0, arg1, arg2)
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateGetActor", reflect.TypeOf((*MockFullNode)(nil).StateGetActor), arg0, arg1, arg2)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// StateGetRandomnessFromBeacon mocks base method.
|
||||||
|
func (m *MockFullNode) StateGetRandomnessFromBeacon(arg0 context.Context, arg1 crypto.DomainSeparationTag, arg2 abi.ChainEpoch, arg3 []byte, arg4 types.TipSetKey) (abi.Randomness, error) {
|
||||||
|
m.ctrl.T.Helper()
|
||||||
|
ret := m.ctrl.Call(m, "StateGetRandomnessFromBeacon", arg0, arg1, arg2, arg3, arg4)
|
||||||
|
ret0, _ := ret[0].(abi.Randomness)
|
||||||
|
ret1, _ := ret[1].(error)
|
||||||
|
return ret0, ret1
|
||||||
|
}
|
||||||
|
|
||||||
|
// StateGetRandomnessFromBeacon indicates an expected call of StateGetRandomnessFromBeacon.
|
||||||
|
func (mr *MockFullNodeMockRecorder) StateGetRandomnessFromBeacon(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call {
|
||||||
|
mr.mock.ctrl.T.Helper()
|
||||||
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateGetRandomnessFromBeacon", reflect.TypeOf((*MockFullNode)(nil).StateGetRandomnessFromBeacon), arg0, arg1, arg2, arg3, arg4)
|
||||||
|
}
|
||||||
|
|
||||||
|
// StateGetRandomnessFromTickets mocks base method.
|
||||||
|
func (m *MockFullNode) StateGetRandomnessFromTickets(arg0 context.Context, arg1 crypto.DomainSeparationTag, arg2 abi.ChainEpoch, arg3 []byte, arg4 types.TipSetKey) (abi.Randomness, error) {
|
||||||
|
m.ctrl.T.Helper()
|
||||||
|
ret := m.ctrl.Call(m, "StateGetRandomnessFromTickets", arg0, arg1, arg2, arg3, arg4)
|
||||||
|
ret0, _ := ret[0].(abi.Randomness)
|
||||||
|
ret1, _ := ret[1].(error)
|
||||||
|
return ret0, ret1
|
||||||
|
}
|
||||||
|
|
||||||
|
// StateGetRandomnessFromTickets indicates an expected call of StateGetRandomnessFromTickets.
|
||||||
|
func (mr *MockFullNodeMockRecorder) StateGetRandomnessFromTickets(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call {
|
||||||
|
mr.mock.ctrl.T.Helper()
|
||||||
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateGetRandomnessFromTickets", reflect.TypeOf((*MockFullNode)(nil).StateGetRandomnessFromTickets), arg0, arg1, arg2, arg3, arg4)
|
||||||
|
}
|
||||||
|
|
||||||
// StateListActors mocks base method.
|
// StateListActors mocks base method.
|
||||||
func (m *MockFullNode) StateListActors(arg0 context.Context, arg1 types.TipSetKey) ([]address.Address, error) {
|
func (m *MockFullNode) StateListActors(arg0 context.Context, arg1 types.TipSetKey) ([]address.Address, error) {
|
||||||
m.ctrl.T.Helper()
|
m.ctrl.T.Helper()
|
||||||
|
|||||||
+544
-102
File diff suppressed because it is too large
Load Diff
@@ -1,3 +1,4 @@
|
|||||||
|
//stm: #unit
|
||||||
package api
|
package api
|
||||||
|
|
||||||
import (
|
import (
|
||||||
@@ -29,6 +30,7 @@ type StrC struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestGetInternalStructs(t *testing.T) {
|
func TestGetInternalStructs(t *testing.T) {
|
||||||
|
//stm: @OTHER_IMPLEMENTATION_API_STRUCTS_001
|
||||||
var proxy StrA
|
var proxy StrA
|
||||||
|
|
||||||
sts := GetInternalStructs(&proxy)
|
sts := GetInternalStructs(&proxy)
|
||||||
@@ -44,6 +46,7 @@ func TestGetInternalStructs(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestNestedInternalStructs(t *testing.T) {
|
func TestNestedInternalStructs(t *testing.T) {
|
||||||
|
//stm: @OTHER_IMPLEMENTATION_API_STRUCTS_001
|
||||||
var proxy StrC
|
var proxy StrC
|
||||||
|
|
||||||
// check that only the top-level internal struct gets picked up
|
// check that only the top-level internal struct gets picked up
|
||||||
|
|||||||
+93
-2
@@ -5,12 +5,14 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/filecoin-project/go-fil-markets/retrievalmarket"
|
"github.com/libp2p/go-libp2p-core/network"
|
||||||
"github.com/filecoin-project/lotus/chain/types"
|
|
||||||
|
|
||||||
datatransfer "github.com/filecoin-project/go-data-transfer"
|
datatransfer "github.com/filecoin-project/go-data-transfer"
|
||||||
|
"github.com/filecoin-project/go-fil-markets/retrievalmarket"
|
||||||
"github.com/filecoin-project/go-state-types/abi"
|
"github.com/filecoin-project/go-state-types/abi"
|
||||||
|
"github.com/filecoin-project/lotus/chain/types"
|
||||||
"github.com/ipfs/go-cid"
|
"github.com/ipfs/go-cid"
|
||||||
|
"github.com/ipfs/go-graphsync"
|
||||||
|
|
||||||
"github.com/libp2p/go-libp2p-core/peer"
|
"github.com/libp2p/go-libp2p-core/peer"
|
||||||
pubsub "github.com/libp2p/go-libp2p-pubsub"
|
pubsub "github.com/libp2p/go-libp2p-pubsub"
|
||||||
@@ -54,6 +56,30 @@ type MessageSendSpec struct {
|
|||||||
MaxFee abi.TokenAmount
|
MaxFee abi.TokenAmount
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GraphSyncDataTransfer provides diagnostics on a data transfer happening over graphsync
|
||||||
|
type GraphSyncDataTransfer struct {
|
||||||
|
// GraphSync request id for this transfer
|
||||||
|
RequestID *graphsync.RequestID
|
||||||
|
// Graphsync state for this transfer
|
||||||
|
RequestState string
|
||||||
|
// If a channel ID is present, indicates whether this is the current graphsync request for this channel
|
||||||
|
// (could have changed in a restart)
|
||||||
|
IsCurrentChannelRequest bool
|
||||||
|
// Data transfer channel ID for this transfer
|
||||||
|
ChannelID *datatransfer.ChannelID
|
||||||
|
// Data transfer state for this transfer
|
||||||
|
ChannelState *DataTransferChannel
|
||||||
|
// Diagnostic information about this request -- and unexpected inconsistencies in
|
||||||
|
// request state
|
||||||
|
Diagnostics []string
|
||||||
|
}
|
||||||
|
|
||||||
|
// TransferDiagnostics give current information about transfers going over graphsync that may be helpful for debugging
|
||||||
|
type TransferDiagnostics struct {
|
||||||
|
ReceivingTransfers []*GraphSyncDataTransfer
|
||||||
|
SendingTransfers []*GraphSyncDataTransfer
|
||||||
|
}
|
||||||
|
|
||||||
type DataTransferChannel struct {
|
type DataTransferChannel struct {
|
||||||
TransferID datatransfer.TransferID
|
TransferID datatransfer.TransferID
|
||||||
Status datatransfer.Status
|
Status datatransfer.Status
|
||||||
@@ -99,6 +125,28 @@ func NewDataTransferChannel(hostID peer.ID, channelState datatransfer.ChannelSta
|
|||||||
return channel
|
return channel
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type NetStat struct {
|
||||||
|
System *network.ScopeStat `json:",omitempty"`
|
||||||
|
Transient *network.ScopeStat `json:",omitempty"`
|
||||||
|
Services map[string]network.ScopeStat `json:",omitempty"`
|
||||||
|
Protocols map[string]network.ScopeStat `json:",omitempty"`
|
||||||
|
Peers map[string]network.ScopeStat `json:",omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type NetLimit struct {
|
||||||
|
Dynamic bool `json:",omitempty"`
|
||||||
|
// set if Dynamic is false
|
||||||
|
Memory int64 `json:",omitempty"`
|
||||||
|
// set if Dynamic is true
|
||||||
|
MemoryFraction float64 `json:",omitempty"`
|
||||||
|
MinMemory int64 `json:",omitempty"`
|
||||||
|
MaxMemory int64 `json:",omitempty"`
|
||||||
|
|
||||||
|
Streams, StreamsInbound, StreamsOutbound int
|
||||||
|
Conns, ConnsInbound, ConnsOutbound int
|
||||||
|
FD int
|
||||||
|
}
|
||||||
|
|
||||||
type NetBlockList struct {
|
type NetBlockList struct {
|
||||||
Peers []peer.ID
|
Peers []peer.ID
|
||||||
IPAddrs []string
|
IPAddrs []string
|
||||||
@@ -194,4 +242,47 @@ type RetrievalInfo struct {
|
|||||||
|
|
||||||
TransferChannelID *datatransfer.ChannelID
|
TransferChannelID *datatransfer.ChannelID
|
||||||
DataTransfer *DataTransferChannel
|
DataTransfer *DataTransferChannel
|
||||||
|
|
||||||
|
// optional event if part of ClientGetRetrievalUpdates
|
||||||
|
Event *retrievalmarket.ClientEvent
|
||||||
|
}
|
||||||
|
|
||||||
|
type RestrievalRes struct {
|
||||||
|
DealID retrievalmarket.DealID
|
||||||
|
}
|
||||||
|
|
||||||
|
// Selector specifies ipld selector string
|
||||||
|
// - if the string starts with '{', it's interpreted as json selector string
|
||||||
|
// see https://ipld.io/specs/selectors/ and https://ipld.io/specs/selectors/fixtures/selector-fixtures-1/
|
||||||
|
// - otherwise the string is interpreted as ipld-selector-text-lite (simple ipld path)
|
||||||
|
// see https://github.com/ipld/go-ipld-selector-text-lite
|
||||||
|
type Selector string
|
||||||
|
|
||||||
|
type DagSpec struct {
|
||||||
|
// DataSelector matches data to be retrieved
|
||||||
|
// - when using textselector, the path specifies subtree
|
||||||
|
// - the matched graph must have a single root
|
||||||
|
DataSelector *Selector
|
||||||
|
|
||||||
|
// ExportMerkleProof is applicable only when exporting to a CAR file via a path textselector
|
||||||
|
// When true, in addition to the selection target, the resulting CAR will contain every block along the
|
||||||
|
// path back to, and including the original root
|
||||||
|
// When false the resulting CAR contains only the blocks of the target subdag
|
||||||
|
ExportMerkleProof bool
|
||||||
|
}
|
||||||
|
|
||||||
|
type ExportRef struct {
|
||||||
|
Root cid.Cid
|
||||||
|
|
||||||
|
// DAGs array specifies a list of DAGs to export
|
||||||
|
// - If exporting into unixfs files, only one DAG is supported, DataSelector is only used to find the targeted root node
|
||||||
|
// - If exporting into a car file
|
||||||
|
// - When exactly one text-path DataSelector is specified exports the subgraph and its full merkle-path from the original root
|
||||||
|
// - Otherwise ( multiple paths and/or JSON selector specs) determines each individual subroot and exports the subtrees as a multi-root car
|
||||||
|
// - When not specified defaults to a single DAG:
|
||||||
|
// - Data - the entire DAG: `{"R":{"l":{"none":{}},":>":{"a":{">":{"@":{}}}}}}`
|
||||||
|
DAGs []DagSpec
|
||||||
|
|
||||||
|
FromLocalCAR string // if specified, get data from a local CARv2 file.
|
||||||
|
DealID retrievalmarket.DealID
|
||||||
}
|
}
|
||||||
|
|||||||
+42
-2
@@ -12,6 +12,7 @@ import (
|
|||||||
"github.com/filecoin-project/go-state-types/crypto"
|
"github.com/filecoin-project/go-state-types/crypto"
|
||||||
"github.com/filecoin-project/go-state-types/dline"
|
"github.com/filecoin-project/go-state-types/dline"
|
||||||
"github.com/ipfs/go-cid"
|
"github.com/ipfs/go-cid"
|
||||||
|
textselector "github.com/ipld/go-ipld-selector-text-lite"
|
||||||
"github.com/libp2p/go-libp2p-core/peer"
|
"github.com/libp2p/go-libp2p-core/peer"
|
||||||
|
|
||||||
"github.com/filecoin-project/lotus/api"
|
"github.com/filecoin-project/lotus/api"
|
||||||
@@ -325,10 +326,10 @@ type FullNode interface {
|
|||||||
// ClientMinerQueryOffer returns a QueryOffer for the specific miner and file.
|
// ClientMinerQueryOffer returns a QueryOffer for the specific miner and file.
|
||||||
ClientMinerQueryOffer(ctx context.Context, miner address.Address, root cid.Cid, piece *cid.Cid) (api.QueryOffer, error) //perm:read
|
ClientMinerQueryOffer(ctx context.Context, miner address.Address, root cid.Cid, piece *cid.Cid) (api.QueryOffer, error) //perm:read
|
||||||
// ClientRetrieve initiates the retrieval of a file, as specified in the order.
|
// ClientRetrieve initiates the retrieval of a file, as specified in the order.
|
||||||
ClientRetrieve(ctx context.Context, order api.RetrievalOrder, ref *api.FileRef) error //perm:admin
|
ClientRetrieve(ctx context.Context, order RetrievalOrder, ref *api.FileRef) error //perm:admin
|
||||||
// ClientRetrieveWithEvents initiates the retrieval of a file, as specified in the order, and provides a channel
|
// ClientRetrieveWithEvents initiates the retrieval of a file, as specified in the order, and provides a channel
|
||||||
// of status updates.
|
// of status updates.
|
||||||
ClientRetrieveWithEvents(ctx context.Context, order api.RetrievalOrder, ref *api.FileRef) (<-chan marketevents.RetrievalEvent, error) //perm:admin
|
ClientRetrieveWithEvents(ctx context.Context, order RetrievalOrder, ref *api.FileRef) (<-chan marketevents.RetrievalEvent, error) //perm:admin
|
||||||
// ClientQueryAsk returns a signed StorageAsk from the specified miner.
|
// ClientQueryAsk returns a signed StorageAsk from the specified miner.
|
||||||
// ClientListRetrievals returns information about retrievals made by the local client
|
// ClientListRetrievals returns information about retrievals made by the local client
|
||||||
ClientListRetrievals(ctx context.Context) ([]api.RetrievalInfo, error) //perm:write
|
ClientListRetrievals(ctx context.Context) ([]api.RetrievalInfo, error) //perm:write
|
||||||
@@ -598,6 +599,11 @@ type FullNode interface {
|
|||||||
// StateNetworkVersion returns the network version at the given tipset
|
// StateNetworkVersion returns the network version at the given tipset
|
||||||
StateNetworkVersion(context.Context, types.TipSetKey) (apitypes.NetworkVersion, error) //perm:read
|
StateNetworkVersion(context.Context, types.TipSetKey) (apitypes.NetworkVersion, error) //perm:read
|
||||||
|
|
||||||
|
// StateGetRandomnessFromTickets is used to sample the chain for randomness.
|
||||||
|
StateGetRandomnessFromTickets(ctx context.Context, personalization crypto.DomainSeparationTag, randEpoch abi.ChainEpoch, entropy []byte, tsk types.TipSetKey) (abi.Randomness, error) //perm:read
|
||||||
|
// StateGetRandomnessFromBeacon is used to sample the beacon for randomness.
|
||||||
|
StateGetRandomnessFromBeacon(ctx context.Context, personalization crypto.DomainSeparationTag, randEpoch abi.ChainEpoch, entropy []byte, tsk types.TipSetKey) (abi.Randomness, error) //perm:read
|
||||||
|
|
||||||
// MethodGroup: Msig
|
// MethodGroup: Msig
|
||||||
// The Msig methods are used to interact with multisig wallets on the
|
// The Msig methods are used to interact with multisig wallets on the
|
||||||
// filecoin network
|
// filecoin network
|
||||||
@@ -709,3 +715,37 @@ type FullNode interface {
|
|||||||
// the path specified when calling CreateBackup is within the base path
|
// the path specified when calling CreateBackup is within the base path
|
||||||
CreateBackup(ctx context.Context, fpath string) error //perm:admin
|
CreateBackup(ctx context.Context, fpath string) error //perm:admin
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func OfferOrder(o api.QueryOffer, client address.Address) RetrievalOrder {
|
||||||
|
return RetrievalOrder{
|
||||||
|
Root: o.Root,
|
||||||
|
Piece: o.Piece,
|
||||||
|
Size: o.Size,
|
||||||
|
Total: o.MinPrice,
|
||||||
|
UnsealPrice: o.UnsealPrice,
|
||||||
|
PaymentInterval: o.PaymentInterval,
|
||||||
|
PaymentIntervalIncrease: o.PaymentIntervalIncrease,
|
||||||
|
Client: client,
|
||||||
|
|
||||||
|
Miner: o.Miner,
|
||||||
|
MinerPeer: &o.MinerPeer,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
type RetrievalOrder struct {
|
||||||
|
// TODO: make this less unixfs specific
|
||||||
|
Root cid.Cid
|
||||||
|
Piece *cid.Cid
|
||||||
|
DatamodelPathSelector *textselector.Expression
|
||||||
|
Size uint64
|
||||||
|
|
||||||
|
FromLocalCAR string // if specified, get data from a local CARv2 file.
|
||||||
|
// TODO: support offset
|
||||||
|
Total types.BigInt
|
||||||
|
UnsealPrice types.BigInt
|
||||||
|
PaymentInterval uint64
|
||||||
|
PaymentIntervalIncrease uint64
|
||||||
|
Client address.Address
|
||||||
|
Miner address.Address
|
||||||
|
MinerPeer *retrievalmarket.RetrievalPeer
|
||||||
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import (
|
|||||||
"github.com/filecoin-project/go-address"
|
"github.com/filecoin-project/go-address"
|
||||||
"github.com/filecoin-project/go-state-types/abi"
|
"github.com/filecoin-project/go-state-types/abi"
|
||||||
"github.com/filecoin-project/go-state-types/dline"
|
"github.com/filecoin-project/go-state-types/dline"
|
||||||
"github.com/filecoin-project/go-state-types/network"
|
abinetwork "github.com/filecoin-project/go-state-types/network"
|
||||||
|
|
||||||
"github.com/filecoin-project/lotus/api"
|
"github.com/filecoin-project/lotus/api"
|
||||||
"github.com/filecoin-project/lotus/chain/actors/builtin/miner"
|
"github.com/filecoin-project/lotus/chain/actors/builtin/miner"
|
||||||
@@ -57,7 +57,7 @@ type Gateway interface {
|
|||||||
StateMinerInfo(ctx context.Context, actor address.Address, tsk types.TipSetKey) (miner.MinerInfo, error)
|
StateMinerInfo(ctx context.Context, actor address.Address, tsk types.TipSetKey) (miner.MinerInfo, error)
|
||||||
StateMinerProvingDeadline(ctx context.Context, addr address.Address, tsk types.TipSetKey) (*dline.Info, error)
|
StateMinerProvingDeadline(ctx context.Context, addr address.Address, tsk types.TipSetKey) (*dline.Info, error)
|
||||||
StateMinerPower(context.Context, address.Address, types.TipSetKey) (*api.MinerPower, error)
|
StateMinerPower(context.Context, address.Address, types.TipSetKey) (*api.MinerPower, error)
|
||||||
StateNetworkVersion(context.Context, types.TipSetKey) (network.Version, error)
|
StateNetworkVersion(context.Context, types.TipSetKey) (abinetwork.Version, error)
|
||||||
StateSearchMsg(ctx context.Context, msg cid.Cid) (*api.MsgLookup, error)
|
StateSearchMsg(ctx context.Context, msg cid.Cid) (*api.MsgLookup, error)
|
||||||
StateSectorGetInfo(ctx context.Context, maddr address.Address, n abi.SectorNumber, tsk types.TipSetKey) (*miner.SectorOnChainInfo, error)
|
StateSectorGetInfo(ctx context.Context, maddr address.Address, n abi.SectorNumber, tsk types.TipSetKey) (*miner.SectorOnChainInfo, error)
|
||||||
StateVerifiedClientStatus(ctx context.Context, addr address.Address, tsk types.TipSetKey) (*abi.StoragePower, error)
|
StateVerifiedClientStatus(ctx context.Context, addr address.Address, tsk types.TipSetKey) (*abi.StoragePower, error)
|
||||||
|
|||||||
+38
-12
@@ -13,7 +13,7 @@ import (
|
|||||||
"github.com/filecoin-project/go-state-types/abi"
|
"github.com/filecoin-project/go-state-types/abi"
|
||||||
"github.com/filecoin-project/go-state-types/crypto"
|
"github.com/filecoin-project/go-state-types/crypto"
|
||||||
"github.com/filecoin-project/go-state-types/dline"
|
"github.com/filecoin-project/go-state-types/dline"
|
||||||
"github.com/filecoin-project/go-state-types/network"
|
abinetwork "github.com/filecoin-project/go-state-types/network"
|
||||||
"github.com/filecoin-project/lotus/api"
|
"github.com/filecoin-project/lotus/api"
|
||||||
apitypes "github.com/filecoin-project/lotus/api/types"
|
apitypes "github.com/filecoin-project/lotus/api/types"
|
||||||
"github.com/filecoin-project/lotus/chain/actors/builtin/miner"
|
"github.com/filecoin-project/lotus/chain/actors/builtin/miner"
|
||||||
@@ -125,11 +125,11 @@ type FullNodeStruct struct {
|
|||||||
|
|
||||||
ClientRestartDataTransfer func(p0 context.Context, p1 datatransfer.TransferID, p2 peer.ID, p3 bool) error `perm:"write"`
|
ClientRestartDataTransfer func(p0 context.Context, p1 datatransfer.TransferID, p2 peer.ID, p3 bool) error `perm:"write"`
|
||||||
|
|
||||||
ClientRetrieve func(p0 context.Context, p1 api.RetrievalOrder, p2 *api.FileRef) error `perm:"admin"`
|
ClientRetrieve func(p0 context.Context, p1 RetrievalOrder, p2 *api.FileRef) error `perm:"admin"`
|
||||||
|
|
||||||
ClientRetrieveTryRestartInsufficientFunds func(p0 context.Context, p1 address.Address) error `perm:"write"`
|
ClientRetrieveTryRestartInsufficientFunds func(p0 context.Context, p1 address.Address) error `perm:"write"`
|
||||||
|
|
||||||
ClientRetrieveWithEvents func(p0 context.Context, p1 api.RetrievalOrder, p2 *api.FileRef) (<-chan marketevents.RetrievalEvent, error) `perm:"admin"`
|
ClientRetrieveWithEvents func(p0 context.Context, p1 RetrievalOrder, p2 *api.FileRef) (<-chan marketevents.RetrievalEvent, error) `perm:"admin"`
|
||||||
|
|
||||||
ClientStartDeal func(p0 context.Context, p1 *api.StartDealParams) (*cid.Cid, error) `perm:"admin"`
|
ClientStartDeal func(p0 context.Context, p1 *api.StartDealParams) (*cid.Cid, error) `perm:"admin"`
|
||||||
|
|
||||||
@@ -267,6 +267,10 @@ type FullNodeStruct struct {
|
|||||||
|
|
||||||
StateGetActor func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*types.Actor, error) `perm:"read"`
|
StateGetActor func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*types.Actor, error) `perm:"read"`
|
||||||
|
|
||||||
|
StateGetRandomnessFromBeacon func(p0 context.Context, p1 crypto.DomainSeparationTag, p2 abi.ChainEpoch, p3 []byte, p4 types.TipSetKey) (abi.Randomness, error) `perm:"read"`
|
||||||
|
|
||||||
|
StateGetRandomnessFromTickets func(p0 context.Context, p1 crypto.DomainSeparationTag, p2 abi.ChainEpoch, p3 []byte, p4 types.TipSetKey) (abi.Randomness, error) `perm:"read"`
|
||||||
|
|
||||||
StateGetReceipt func(p0 context.Context, p1 cid.Cid, p2 types.TipSetKey) (*types.MessageReceipt, error) `perm:"read"`
|
StateGetReceipt func(p0 context.Context, p1 cid.Cid, p2 types.TipSetKey) (*types.MessageReceipt, error) `perm:"read"`
|
||||||
|
|
||||||
StateListActors func(p0 context.Context, p1 types.TipSetKey) ([]address.Address, error) `perm:"read"`
|
StateListActors func(p0 context.Context, p1 types.TipSetKey) ([]address.Address, error) `perm:"read"`
|
||||||
@@ -447,7 +451,7 @@ type GatewayStruct struct {
|
|||||||
|
|
||||||
StateMinerProvingDeadline func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*dline.Info, error) ``
|
StateMinerProvingDeadline func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*dline.Info, error) ``
|
||||||
|
|
||||||
StateNetworkVersion func(p0 context.Context, p1 types.TipSetKey) (network.Version, error) ``
|
StateNetworkVersion func(p0 context.Context, p1 types.TipSetKey) (abinetwork.Version, error) ``
|
||||||
|
|
||||||
StateSearchMsg func(p0 context.Context, p1 cid.Cid) (*api.MsgLookup, error) ``
|
StateSearchMsg func(p0 context.Context, p1 cid.Cid) (*api.MsgLookup, error) ``
|
||||||
|
|
||||||
@@ -961,14 +965,14 @@ func (s *FullNodeStub) ClientRestartDataTransfer(p0 context.Context, p1 datatran
|
|||||||
return ErrNotSupported
|
return ErrNotSupported
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *FullNodeStruct) ClientRetrieve(p0 context.Context, p1 api.RetrievalOrder, p2 *api.FileRef) error {
|
func (s *FullNodeStruct) ClientRetrieve(p0 context.Context, p1 RetrievalOrder, p2 *api.FileRef) error {
|
||||||
if s.Internal.ClientRetrieve == nil {
|
if s.Internal.ClientRetrieve == nil {
|
||||||
return ErrNotSupported
|
return ErrNotSupported
|
||||||
}
|
}
|
||||||
return s.Internal.ClientRetrieve(p0, p1, p2)
|
return s.Internal.ClientRetrieve(p0, p1, p2)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *FullNodeStub) ClientRetrieve(p0 context.Context, p1 api.RetrievalOrder, p2 *api.FileRef) error {
|
func (s *FullNodeStub) ClientRetrieve(p0 context.Context, p1 RetrievalOrder, p2 *api.FileRef) error {
|
||||||
return ErrNotSupported
|
return ErrNotSupported
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -983,14 +987,14 @@ func (s *FullNodeStub) ClientRetrieveTryRestartInsufficientFunds(p0 context.Cont
|
|||||||
return ErrNotSupported
|
return ErrNotSupported
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *FullNodeStruct) ClientRetrieveWithEvents(p0 context.Context, p1 api.RetrievalOrder, p2 *api.FileRef) (<-chan marketevents.RetrievalEvent, error) {
|
func (s *FullNodeStruct) ClientRetrieveWithEvents(p0 context.Context, p1 RetrievalOrder, p2 *api.FileRef) (<-chan marketevents.RetrievalEvent, error) {
|
||||||
if s.Internal.ClientRetrieveWithEvents == nil {
|
if s.Internal.ClientRetrieveWithEvents == nil {
|
||||||
return nil, ErrNotSupported
|
return nil, ErrNotSupported
|
||||||
}
|
}
|
||||||
return s.Internal.ClientRetrieveWithEvents(p0, p1, p2)
|
return s.Internal.ClientRetrieveWithEvents(p0, p1, p2)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *FullNodeStub) ClientRetrieveWithEvents(p0 context.Context, p1 api.RetrievalOrder, p2 *api.FileRef) (<-chan marketevents.RetrievalEvent, error) {
|
func (s *FullNodeStub) ClientRetrieveWithEvents(p0 context.Context, p1 RetrievalOrder, p2 *api.FileRef) (<-chan marketevents.RetrievalEvent, error) {
|
||||||
return nil, ErrNotSupported
|
return nil, ErrNotSupported
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1742,6 +1746,28 @@ func (s *FullNodeStub) StateGetActor(p0 context.Context, p1 address.Address, p2
|
|||||||
return nil, ErrNotSupported
|
return nil, ErrNotSupported
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *FullNodeStruct) StateGetRandomnessFromBeacon(p0 context.Context, p1 crypto.DomainSeparationTag, p2 abi.ChainEpoch, p3 []byte, p4 types.TipSetKey) (abi.Randomness, error) {
|
||||||
|
if s.Internal.StateGetRandomnessFromBeacon == nil {
|
||||||
|
return *new(abi.Randomness), ErrNotSupported
|
||||||
|
}
|
||||||
|
return s.Internal.StateGetRandomnessFromBeacon(p0, p1, p2, p3, p4)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *FullNodeStub) StateGetRandomnessFromBeacon(p0 context.Context, p1 crypto.DomainSeparationTag, p2 abi.ChainEpoch, p3 []byte, p4 types.TipSetKey) (abi.Randomness, error) {
|
||||||
|
return *new(abi.Randomness), ErrNotSupported
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *FullNodeStruct) StateGetRandomnessFromTickets(p0 context.Context, p1 crypto.DomainSeparationTag, p2 abi.ChainEpoch, p3 []byte, p4 types.TipSetKey) (abi.Randomness, error) {
|
||||||
|
if s.Internal.StateGetRandomnessFromTickets == nil {
|
||||||
|
return *new(abi.Randomness), ErrNotSupported
|
||||||
|
}
|
||||||
|
return s.Internal.StateGetRandomnessFromTickets(p0, p1, p2, p3, p4)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *FullNodeStub) StateGetRandomnessFromTickets(p0 context.Context, p1 crypto.DomainSeparationTag, p2 abi.ChainEpoch, p3 []byte, p4 types.TipSetKey) (abi.Randomness, error) {
|
||||||
|
return *new(abi.Randomness), ErrNotSupported
|
||||||
|
}
|
||||||
|
|
||||||
func (s *FullNodeStruct) StateGetReceipt(p0 context.Context, p1 cid.Cid, p2 types.TipSetKey) (*types.MessageReceipt, error) {
|
func (s *FullNodeStruct) StateGetReceipt(p0 context.Context, p1 cid.Cid, p2 types.TipSetKey) (*types.MessageReceipt, error) {
|
||||||
if s.Internal.StateGetReceipt == nil {
|
if s.Internal.StateGetReceipt == nil {
|
||||||
return nil, ErrNotSupported
|
return nil, ErrNotSupported
|
||||||
@@ -2677,15 +2703,15 @@ func (s *GatewayStub) StateMinerProvingDeadline(p0 context.Context, p1 address.A
|
|||||||
return nil, ErrNotSupported
|
return nil, ErrNotSupported
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *GatewayStruct) StateNetworkVersion(p0 context.Context, p1 types.TipSetKey) (network.Version, error) {
|
func (s *GatewayStruct) StateNetworkVersion(p0 context.Context, p1 types.TipSetKey) (abinetwork.Version, error) {
|
||||||
if s.Internal.StateNetworkVersion == nil {
|
if s.Internal.StateNetworkVersion == nil {
|
||||||
return *new(network.Version), ErrNotSupported
|
return *new(abinetwork.Version), ErrNotSupported
|
||||||
}
|
}
|
||||||
return s.Internal.StateNetworkVersion(p0, p1)
|
return s.Internal.StateNetworkVersion(p0, p1)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *GatewayStub) StateNetworkVersion(p0 context.Context, p1 types.TipSetKey) (network.Version, error) {
|
func (s *GatewayStub) StateNetworkVersion(p0 context.Context, p1 types.TipSetKey) (abinetwork.Version, error) {
|
||||||
return *new(network.Version), ErrNotSupported
|
return *new(abinetwork.Version), ErrNotSupported
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *GatewayStruct) StateSearchMsg(p0 context.Context, p1 cid.Cid) (*api.MsgLookup, error) {
|
func (s *GatewayStruct) StateSearchMsg(p0 context.Context, p1 cid.Cid) (*api.MsgLookup, error) {
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ package v0mocks
|
|||||||
import (
|
import (
|
||||||
context "context"
|
context "context"
|
||||||
reflect "reflect"
|
reflect "reflect"
|
||||||
|
time "time"
|
||||||
|
|
||||||
address "github.com/filecoin-project/go-address"
|
address "github.com/filecoin-project/go-address"
|
||||||
bitfield "github.com/filecoin-project/go-bitfield"
|
bitfield "github.com/filecoin-project/go-bitfield"
|
||||||
@@ -21,6 +22,7 @@ import (
|
|||||||
network "github.com/filecoin-project/go-state-types/network"
|
network "github.com/filecoin-project/go-state-types/network"
|
||||||
api "github.com/filecoin-project/lotus/api"
|
api "github.com/filecoin-project/lotus/api"
|
||||||
apitypes "github.com/filecoin-project/lotus/api/types"
|
apitypes "github.com/filecoin-project/lotus/api/types"
|
||||||
|
v0api "github.com/filecoin-project/lotus/api/v0api"
|
||||||
miner "github.com/filecoin-project/lotus/chain/actors/builtin/miner"
|
miner "github.com/filecoin-project/lotus/chain/actors/builtin/miner"
|
||||||
types "github.com/filecoin-project/lotus/chain/types"
|
types "github.com/filecoin-project/lotus/chain/types"
|
||||||
alerting "github.com/filecoin-project/lotus/journal/alerting"
|
alerting "github.com/filecoin-project/lotus/journal/alerting"
|
||||||
@@ -760,7 +762,7 @@ func (mr *MockFullNodeMockRecorder) ClientRestartDataTransfer(arg0, arg1, arg2,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ClientRetrieve mocks base method.
|
// ClientRetrieve mocks base method.
|
||||||
func (m *MockFullNode) ClientRetrieve(arg0 context.Context, arg1 api.RetrievalOrder, arg2 *api.FileRef) error {
|
func (m *MockFullNode) ClientRetrieve(arg0 context.Context, arg1 v0api.RetrievalOrder, arg2 *api.FileRef) error {
|
||||||
m.ctrl.T.Helper()
|
m.ctrl.T.Helper()
|
||||||
ret := m.ctrl.Call(m, "ClientRetrieve", arg0, arg1, arg2)
|
ret := m.ctrl.Call(m, "ClientRetrieve", arg0, arg1, arg2)
|
||||||
ret0, _ := ret[0].(error)
|
ret0, _ := ret[0].(error)
|
||||||
@@ -788,7 +790,7 @@ func (mr *MockFullNodeMockRecorder) ClientRetrieveTryRestartInsufficientFunds(ar
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ClientRetrieveWithEvents mocks base method.
|
// ClientRetrieveWithEvents mocks base method.
|
||||||
func (m *MockFullNode) ClientRetrieveWithEvents(arg0 context.Context, arg1 api.RetrievalOrder, arg2 *api.FileRef) (<-chan marketevents.RetrievalEvent, error) {
|
func (m *MockFullNode) ClientRetrieveWithEvents(arg0 context.Context, arg1 v0api.RetrievalOrder, arg2 *api.FileRef) (<-chan marketevents.RetrievalEvent, error) {
|
||||||
m.ctrl.T.Helper()
|
m.ctrl.T.Helper()
|
||||||
ret := m.ctrl.Call(m, "ClientRetrieveWithEvents", arg0, arg1, arg2)
|
ret := m.ctrl.Call(m, "ClientRetrieveWithEvents", arg0, arg1, arg2)
|
||||||
ret0, _ := ret[0].(<-chan marketevents.RetrievalEvent)
|
ret0, _ := ret[0].(<-chan marketevents.RetrievalEvent)
|
||||||
@@ -1723,6 +1725,21 @@ func (mr *MockFullNodeMockRecorder) NetFindPeer(arg0, arg1 interface{}) *gomock.
|
|||||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetFindPeer", reflect.TypeOf((*MockFullNode)(nil).NetFindPeer), arg0, arg1)
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetFindPeer", reflect.TypeOf((*MockFullNode)(nil).NetFindPeer), arg0, arg1)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NetLimit mocks base method.
|
||||||
|
func (m *MockFullNode) NetLimit(arg0 context.Context, arg1 string) (api.NetLimit, error) {
|
||||||
|
m.ctrl.T.Helper()
|
||||||
|
ret := m.ctrl.Call(m, "NetLimit", arg0, arg1)
|
||||||
|
ret0, _ := ret[0].(api.NetLimit)
|
||||||
|
ret1, _ := ret[1].(error)
|
||||||
|
return ret0, ret1
|
||||||
|
}
|
||||||
|
|
||||||
|
// NetLimit indicates an expected call of NetLimit.
|
||||||
|
func (mr *MockFullNodeMockRecorder) NetLimit(arg0, arg1 interface{}) *gomock.Call {
|
||||||
|
mr.mock.ctrl.T.Helper()
|
||||||
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetLimit", reflect.TypeOf((*MockFullNode)(nil).NetLimit), arg0, arg1)
|
||||||
|
}
|
||||||
|
|
||||||
// NetPeerInfo mocks base method.
|
// NetPeerInfo mocks base method.
|
||||||
func (m *MockFullNode) NetPeerInfo(arg0 context.Context, arg1 peer.ID) (*api.ExtendedPeerInfo, error) {
|
func (m *MockFullNode) NetPeerInfo(arg0 context.Context, arg1 peer.ID) (*api.ExtendedPeerInfo, error) {
|
||||||
m.ctrl.T.Helper()
|
m.ctrl.T.Helper()
|
||||||
@@ -1753,6 +1770,64 @@ func (mr *MockFullNodeMockRecorder) NetPeers(arg0 interface{}) *gomock.Call {
|
|||||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetPeers", reflect.TypeOf((*MockFullNode)(nil).NetPeers), arg0)
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetPeers", reflect.TypeOf((*MockFullNode)(nil).NetPeers), arg0)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NetPing mocks base method.
|
||||||
|
func (m *MockFullNode) NetPing(arg0 context.Context, arg1 peer.ID) (time.Duration, error) {
|
||||||
|
m.ctrl.T.Helper()
|
||||||
|
ret := m.ctrl.Call(m, "NetPing", arg0, arg1)
|
||||||
|
ret0, _ := ret[0].(time.Duration)
|
||||||
|
ret1, _ := ret[1].(error)
|
||||||
|
return ret0, ret1
|
||||||
|
}
|
||||||
|
|
||||||
|
// NetPing indicates an expected call of NetPing.
|
||||||
|
func (mr *MockFullNodeMockRecorder) NetPing(arg0, arg1 interface{}) *gomock.Call {
|
||||||
|
mr.mock.ctrl.T.Helper()
|
||||||
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetPing", reflect.TypeOf((*MockFullNode)(nil).NetPing), arg0, arg1)
|
||||||
|
}
|
||||||
|
|
||||||
|
// NetProtectAdd mocks base method.
|
||||||
|
func (m *MockFullNode) NetProtectAdd(arg0 context.Context, arg1 []peer.ID) error {
|
||||||
|
m.ctrl.T.Helper()
|
||||||
|
ret := m.ctrl.Call(m, "NetProtectAdd", arg0, arg1)
|
||||||
|
ret0, _ := ret[0].(error)
|
||||||
|
return ret0
|
||||||
|
}
|
||||||
|
|
||||||
|
// NetProtectAdd indicates an expected call of NetProtectAdd.
|
||||||
|
func (mr *MockFullNodeMockRecorder) NetProtectAdd(arg0, arg1 interface{}) *gomock.Call {
|
||||||
|
mr.mock.ctrl.T.Helper()
|
||||||
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetProtectAdd", reflect.TypeOf((*MockFullNode)(nil).NetProtectAdd), arg0, arg1)
|
||||||
|
}
|
||||||
|
|
||||||
|
// NetProtectList mocks base method.
|
||||||
|
func (m *MockFullNode) NetProtectList(arg0 context.Context) ([]peer.ID, error) {
|
||||||
|
m.ctrl.T.Helper()
|
||||||
|
ret := m.ctrl.Call(m, "NetProtectList", arg0)
|
||||||
|
ret0, _ := ret[0].([]peer.ID)
|
||||||
|
ret1, _ := ret[1].(error)
|
||||||
|
return ret0, ret1
|
||||||
|
}
|
||||||
|
|
||||||
|
// NetProtectList indicates an expected call of NetProtectList.
|
||||||
|
func (mr *MockFullNodeMockRecorder) NetProtectList(arg0 interface{}) *gomock.Call {
|
||||||
|
mr.mock.ctrl.T.Helper()
|
||||||
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetProtectList", reflect.TypeOf((*MockFullNode)(nil).NetProtectList), arg0)
|
||||||
|
}
|
||||||
|
|
||||||
|
// NetProtectRemove mocks base method.
|
||||||
|
func (m *MockFullNode) NetProtectRemove(arg0 context.Context, arg1 []peer.ID) error {
|
||||||
|
m.ctrl.T.Helper()
|
||||||
|
ret := m.ctrl.Call(m, "NetProtectRemove", arg0, arg1)
|
||||||
|
ret0, _ := ret[0].(error)
|
||||||
|
return ret0
|
||||||
|
}
|
||||||
|
|
||||||
|
// NetProtectRemove indicates an expected call of NetProtectRemove.
|
||||||
|
func (mr *MockFullNodeMockRecorder) NetProtectRemove(arg0, arg1 interface{}) *gomock.Call {
|
||||||
|
mr.mock.ctrl.T.Helper()
|
||||||
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetProtectRemove", reflect.TypeOf((*MockFullNode)(nil).NetProtectRemove), arg0, arg1)
|
||||||
|
}
|
||||||
|
|
||||||
// NetPubsubScores mocks base method.
|
// NetPubsubScores mocks base method.
|
||||||
func (m *MockFullNode) NetPubsubScores(arg0 context.Context) ([]api.PubsubScore, error) {
|
func (m *MockFullNode) NetPubsubScores(arg0 context.Context) ([]api.PubsubScore, error) {
|
||||||
m.ctrl.T.Helper()
|
m.ctrl.T.Helper()
|
||||||
@@ -1768,6 +1843,35 @@ func (mr *MockFullNodeMockRecorder) NetPubsubScores(arg0 interface{}) *gomock.Ca
|
|||||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetPubsubScores", reflect.TypeOf((*MockFullNode)(nil).NetPubsubScores), arg0)
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetPubsubScores", reflect.TypeOf((*MockFullNode)(nil).NetPubsubScores), arg0)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NetSetLimit mocks base method.
|
||||||
|
func (m *MockFullNode) NetSetLimit(arg0 context.Context, arg1 string, arg2 api.NetLimit) error {
|
||||||
|
m.ctrl.T.Helper()
|
||||||
|
ret := m.ctrl.Call(m, "NetSetLimit", arg0, arg1, arg2)
|
||||||
|
ret0, _ := ret[0].(error)
|
||||||
|
return ret0
|
||||||
|
}
|
||||||
|
|
||||||
|
// NetSetLimit indicates an expected call of NetSetLimit.
|
||||||
|
func (mr *MockFullNodeMockRecorder) NetSetLimit(arg0, arg1, arg2 interface{}) *gomock.Call {
|
||||||
|
mr.mock.ctrl.T.Helper()
|
||||||
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetSetLimit", reflect.TypeOf((*MockFullNode)(nil).NetSetLimit), arg0, arg1, arg2)
|
||||||
|
}
|
||||||
|
|
||||||
|
// NetStat mocks base method.
|
||||||
|
func (m *MockFullNode) NetStat(arg0 context.Context, arg1 string) (api.NetStat, error) {
|
||||||
|
m.ctrl.T.Helper()
|
||||||
|
ret := m.ctrl.Call(m, "NetStat", arg0, arg1)
|
||||||
|
ret0, _ := ret[0].(api.NetStat)
|
||||||
|
ret1, _ := ret[1].(error)
|
||||||
|
return ret0, ret1
|
||||||
|
}
|
||||||
|
|
||||||
|
// NetStat indicates an expected call of NetStat.
|
||||||
|
func (mr *MockFullNodeMockRecorder) NetStat(arg0, arg1 interface{}) *gomock.Call {
|
||||||
|
mr.mock.ctrl.T.Helper()
|
||||||
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetStat", reflect.TypeOf((*MockFullNode)(nil).NetStat), arg0, arg1)
|
||||||
|
}
|
||||||
|
|
||||||
// PaychAllocateLane mocks base method.
|
// PaychAllocateLane mocks base method.
|
||||||
func (m *MockFullNode) PaychAllocateLane(arg0 context.Context, arg1 address.Address) (uint64, error) {
|
func (m *MockFullNode) PaychAllocateLane(arg0 context.Context, arg1 address.Address) (uint64, error) {
|
||||||
m.ctrl.T.Helper()
|
m.ctrl.T.Helper()
|
||||||
@@ -2171,6 +2275,36 @@ func (mr *MockFullNodeMockRecorder) StateGetActor(arg0, arg1, arg2 interface{})
|
|||||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateGetActor", reflect.TypeOf((*MockFullNode)(nil).StateGetActor), arg0, arg1, arg2)
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateGetActor", reflect.TypeOf((*MockFullNode)(nil).StateGetActor), arg0, arg1, arg2)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// StateGetRandomnessFromBeacon mocks base method.
|
||||||
|
func (m *MockFullNode) StateGetRandomnessFromBeacon(arg0 context.Context, arg1 crypto.DomainSeparationTag, arg2 abi.ChainEpoch, arg3 []byte, arg4 types.TipSetKey) (abi.Randomness, error) {
|
||||||
|
m.ctrl.T.Helper()
|
||||||
|
ret := m.ctrl.Call(m, "StateGetRandomnessFromBeacon", arg0, arg1, arg2, arg3, arg4)
|
||||||
|
ret0, _ := ret[0].(abi.Randomness)
|
||||||
|
ret1, _ := ret[1].(error)
|
||||||
|
return ret0, ret1
|
||||||
|
}
|
||||||
|
|
||||||
|
// StateGetRandomnessFromBeacon indicates an expected call of StateGetRandomnessFromBeacon.
|
||||||
|
func (mr *MockFullNodeMockRecorder) StateGetRandomnessFromBeacon(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call {
|
||||||
|
mr.mock.ctrl.T.Helper()
|
||||||
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateGetRandomnessFromBeacon", reflect.TypeOf((*MockFullNode)(nil).StateGetRandomnessFromBeacon), arg0, arg1, arg2, arg3, arg4)
|
||||||
|
}
|
||||||
|
|
||||||
|
// StateGetRandomnessFromTickets mocks base method.
|
||||||
|
func (m *MockFullNode) StateGetRandomnessFromTickets(arg0 context.Context, arg1 crypto.DomainSeparationTag, arg2 abi.ChainEpoch, arg3 []byte, arg4 types.TipSetKey) (abi.Randomness, error) {
|
||||||
|
m.ctrl.T.Helper()
|
||||||
|
ret := m.ctrl.Call(m, "StateGetRandomnessFromTickets", arg0, arg1, arg2, arg3, arg4)
|
||||||
|
ret0, _ := ret[0].(abi.Randomness)
|
||||||
|
ret1, _ := ret[1].(error)
|
||||||
|
return ret0, ret1
|
||||||
|
}
|
||||||
|
|
||||||
|
// StateGetRandomnessFromTickets indicates an expected call of StateGetRandomnessFromTickets.
|
||||||
|
func (mr *MockFullNodeMockRecorder) StateGetRandomnessFromTickets(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call {
|
||||||
|
mr.mock.ctrl.T.Helper()
|
||||||
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateGetRandomnessFromTickets", reflect.TypeOf((*MockFullNode)(nil).StateGetRandomnessFromTickets), arg0, arg1, arg2, arg3, arg4)
|
||||||
|
}
|
||||||
|
|
||||||
// StateGetReceipt mocks base method.
|
// StateGetReceipt mocks base method.
|
||||||
func (m *MockFullNode) StateGetReceipt(arg0 context.Context, arg1 cid.Cid, arg2 types.TipSetKey) (*types.MessageReceipt, error) {
|
func (m *MockFullNode) StateGetReceipt(arg0 context.Context, arg1 cid.Cid, arg2 types.TipSetKey) (*types.MessageReceipt, error) {
|
||||||
m.ctrl.T.Helper()
|
m.ctrl.T.Helper()
|
||||||
|
|||||||
+158
-1
@@ -3,6 +3,11 @@ package v0api
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
|
"github.com/filecoin-project/go-fil-markets/retrievalmarket"
|
||||||
|
"github.com/filecoin-project/go-state-types/big"
|
||||||
|
"github.com/filecoin-project/go-state-types/crypto"
|
||||||
|
marketevents "github.com/filecoin-project/lotus/markets/loggers"
|
||||||
|
|
||||||
"github.com/filecoin-project/go-address"
|
"github.com/filecoin-project/go-address"
|
||||||
"github.com/filecoin-project/lotus/chain/types"
|
"github.com/filecoin-project/lotus/chain/types"
|
||||||
"golang.org/x/xerrors"
|
"golang.org/x/xerrors"
|
||||||
@@ -106,7 +111,7 @@ func (w *WrapperV1Full) MsigApproveTxnHash(ctx context.Context, msig address.Add
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (w *WrapperV1Full) MsigCancel(ctx context.Context, msig address.Address, txID uint64, to address.Address, amt types.BigInt, src address.Address, method uint64, params []byte) (cid.Cid, error) {
|
func (w *WrapperV1Full) MsigCancel(ctx context.Context, msig address.Address, txID uint64, to address.Address, amt types.BigInt, src address.Address, method uint64, params []byte) (cid.Cid, error) {
|
||||||
p, err := w.FullNode.MsigCancel(ctx, msig, txID, to, amt, src, method, params)
|
p, err := w.FullNode.MsigCancelTxnHash(ctx, msig, txID, to, amt, src, method, params)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return cid.Undef, xerrors.Errorf("creating prototype: %w", err)
|
return cid.Undef, xerrors.Errorf("creating prototype: %w", err)
|
||||||
}
|
}
|
||||||
@@ -184,4 +189,156 @@ func (w *WrapperV1Full) MsigRemoveSigner(ctx context.Context, msig address.Addre
|
|||||||
return w.executePrototype(ctx, p)
|
return w.executePrototype(ctx, p)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (w *WrapperV1Full) ChainGetRandomnessFromTickets(ctx context.Context, tsk types.TipSetKey, personalization crypto.DomainSeparationTag, randEpoch abi.ChainEpoch, entropy []byte) (abi.Randomness, error) {
|
||||||
|
return w.StateGetRandomnessFromTickets(ctx, personalization, randEpoch, entropy, tsk)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (w *WrapperV1Full) ChainGetRandomnessFromBeacon(ctx context.Context, tsk types.TipSetKey, personalization crypto.DomainSeparationTag, randEpoch abi.ChainEpoch, entropy []byte) (abi.Randomness, error) {
|
||||||
|
return w.StateGetRandomnessFromBeacon(ctx, personalization, randEpoch, entropy, tsk)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (w *WrapperV1Full) ClientRetrieve(ctx context.Context, order RetrievalOrder, ref *api.FileRef) error {
|
||||||
|
events := make(chan marketevents.RetrievalEvent)
|
||||||
|
go w.clientRetrieve(ctx, order, ref, events)
|
||||||
|
|
||||||
|
for {
|
||||||
|
select {
|
||||||
|
case evt, ok := <-events:
|
||||||
|
if !ok { // done successfully
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
if evt.Err != "" {
|
||||||
|
return xerrors.Errorf("retrieval failed: %s", evt.Err)
|
||||||
|
}
|
||||||
|
case <-ctx.Done():
|
||||||
|
return xerrors.Errorf("retrieval timed out")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (w *WrapperV1Full) ClientRetrieveWithEvents(ctx context.Context, order RetrievalOrder, ref *api.FileRef) (<-chan marketevents.RetrievalEvent, error) {
|
||||||
|
events := make(chan marketevents.RetrievalEvent)
|
||||||
|
go w.clientRetrieve(ctx, order, ref, events)
|
||||||
|
return events, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func readSubscribeEvents(ctx context.Context, dealID retrievalmarket.DealID, subscribeEvents <-chan api.RetrievalInfo, events chan marketevents.RetrievalEvent) error {
|
||||||
|
for {
|
||||||
|
var subscribeEvent api.RetrievalInfo
|
||||||
|
var evt retrievalmarket.ClientEvent
|
||||||
|
select {
|
||||||
|
case <-ctx.Done():
|
||||||
|
return xerrors.New("Retrieval Timed Out")
|
||||||
|
case subscribeEvent = <-subscribeEvents:
|
||||||
|
if subscribeEvent.ID != dealID {
|
||||||
|
// we can't check the deal ID ahead of time because:
|
||||||
|
// 1. We need to subscribe before retrieving.
|
||||||
|
// 2. We won't know the deal ID until after retrieving.
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if subscribeEvent.Event != nil {
|
||||||
|
evt = *subscribeEvent.Event
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
select {
|
||||||
|
case <-ctx.Done():
|
||||||
|
return xerrors.New("Retrieval Timed Out")
|
||||||
|
case events <- marketevents.RetrievalEvent{
|
||||||
|
Event: evt,
|
||||||
|
Status: subscribeEvent.Status,
|
||||||
|
BytesReceived: subscribeEvent.BytesReceived,
|
||||||
|
FundsSpent: subscribeEvent.TotalPaid,
|
||||||
|
}:
|
||||||
|
}
|
||||||
|
|
||||||
|
switch subscribeEvent.Status {
|
||||||
|
case retrievalmarket.DealStatusCompleted:
|
||||||
|
return nil
|
||||||
|
case retrievalmarket.DealStatusRejected:
|
||||||
|
return xerrors.Errorf("Retrieval Proposal Rejected: %s", subscribeEvent.Message)
|
||||||
|
case
|
||||||
|
retrievalmarket.DealStatusDealNotFound,
|
||||||
|
retrievalmarket.DealStatusErrored:
|
||||||
|
return xerrors.Errorf("Retrieval Error: %s", subscribeEvent.Message)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (w *WrapperV1Full) clientRetrieve(ctx context.Context, order RetrievalOrder, ref *api.FileRef, events chan marketevents.RetrievalEvent) {
|
||||||
|
defer close(events)
|
||||||
|
|
||||||
|
finish := func(e error) {
|
||||||
|
if e != nil {
|
||||||
|
events <- marketevents.RetrievalEvent{Err: e.Error(), FundsSpent: big.Zero()}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var dealID retrievalmarket.DealID
|
||||||
|
if order.FromLocalCAR == "" {
|
||||||
|
// Subscribe to events before retrieving to avoid losing events.
|
||||||
|
subscribeCtx, cancel := context.WithCancel(ctx)
|
||||||
|
defer cancel()
|
||||||
|
retrievalEvents, err := w.ClientGetRetrievalUpdates(subscribeCtx)
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
finish(xerrors.Errorf("GetRetrievalUpdates failed: %w", err))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
retrievalRes, err := w.FullNode.ClientRetrieve(ctx, api.RetrievalOrder{
|
||||||
|
Root: order.Root,
|
||||||
|
Piece: order.Piece,
|
||||||
|
Size: order.Size,
|
||||||
|
Total: order.Total,
|
||||||
|
UnsealPrice: order.UnsealPrice,
|
||||||
|
PaymentInterval: order.PaymentInterval,
|
||||||
|
PaymentIntervalIncrease: order.PaymentIntervalIncrease,
|
||||||
|
Client: order.Client,
|
||||||
|
Miner: order.Miner,
|
||||||
|
MinerPeer: order.MinerPeer,
|
||||||
|
})
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
finish(xerrors.Errorf("Retrieve failed: %w", err))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
dealID = retrievalRes.DealID
|
||||||
|
|
||||||
|
err = readSubscribeEvents(ctx, retrievalRes.DealID, retrievalEvents, events)
|
||||||
|
if err != nil {
|
||||||
|
finish(xerrors.Errorf("Retrieve: %w", err))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// If ref is nil, it only fetches the data into the configured blockstore.
|
||||||
|
if ref == nil {
|
||||||
|
finish(nil)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
eref := api.ExportRef{
|
||||||
|
Root: order.Root,
|
||||||
|
FromLocalCAR: order.FromLocalCAR,
|
||||||
|
DealID: dealID,
|
||||||
|
}
|
||||||
|
|
||||||
|
if order.DatamodelPathSelector != nil {
|
||||||
|
s := api.Selector(*order.DatamodelPathSelector)
|
||||||
|
eref.DAGs = append(eref.DAGs, api.DagSpec{
|
||||||
|
DataSelector: &s,
|
||||||
|
ExportMerkleProof: true,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
finish(w.ClientExport(ctx, eref, *ref))
|
||||||
|
}
|
||||||
|
|
||||||
|
func (w *WrapperV1Full) PaychGet(ctx context.Context, from, to address.Address, amt types.BigInt) (*api.ChannelInfo, error) {
|
||||||
|
return w.FullNode.PaychFund(ctx, from, to, amt)
|
||||||
|
}
|
||||||
|
|
||||||
var _ FullNode = &WrapperV1Full{}
|
var _ FullNode = &WrapperV1Full{}
|
||||||
|
|||||||
+4
-4
@@ -54,11 +54,11 @@ func VersionForType(nodeType NodeType) (Version, error) {
|
|||||||
|
|
||||||
// semver versions of the rpc api exposed
|
// semver versions of the rpc api exposed
|
||||||
var (
|
var (
|
||||||
FullAPIVersion0 = newVer(1, 3, 0)
|
FullAPIVersion0 = newVer(1, 5, 0)
|
||||||
FullAPIVersion1 = newVer(2, 1, 0)
|
FullAPIVersion1 = newVer(2, 2, 0)
|
||||||
|
|
||||||
MinerAPIVersion0 = newVer(1, 2, 0)
|
MinerAPIVersion0 = newVer(1, 5, 0)
|
||||||
WorkerAPIVersion0 = newVer(1, 1, 0)
|
WorkerAPIVersion0 = newVer(1, 6, 0)
|
||||||
)
|
)
|
||||||
|
|
||||||
//nolint:varcheck,deadcode
|
//nolint:varcheck,deadcode
|
||||||
|
|||||||
+9
-9
@@ -25,35 +25,35 @@ func NewAPIBlockstore(cio ChainIO) Blockstore {
|
|||||||
return Adapt(bs) // return an adapted blockstore.
|
return Adapt(bs) // return an adapted blockstore.
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *apiBlockstore) DeleteBlock(cid.Cid) error {
|
func (a *apiBlockstore) DeleteBlock(context.Context, cid.Cid) error {
|
||||||
return xerrors.New("not supported")
|
return xerrors.New("not supported")
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *apiBlockstore) Has(c cid.Cid) (bool, error) {
|
func (a *apiBlockstore) Has(ctx context.Context, c cid.Cid) (bool, error) {
|
||||||
return a.api.ChainHasObj(context.TODO(), c)
|
return a.api.ChainHasObj(ctx, c)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *apiBlockstore) Get(c cid.Cid) (blocks.Block, error) {
|
func (a *apiBlockstore) Get(ctx context.Context, c cid.Cid) (blocks.Block, error) {
|
||||||
bb, err := a.api.ChainReadObj(context.TODO(), c)
|
bb, err := a.api.ChainReadObj(ctx, c)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return blocks.NewBlockWithCid(bb, c)
|
return blocks.NewBlockWithCid(bb, c)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *apiBlockstore) GetSize(c cid.Cid) (int, error) {
|
func (a *apiBlockstore) GetSize(ctx context.Context, c cid.Cid) (int, error) {
|
||||||
bb, err := a.api.ChainReadObj(context.TODO(), c)
|
bb, err := a.api.ChainReadObj(ctx, c)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
return len(bb), nil
|
return len(bb), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *apiBlockstore) Put(blocks.Block) error {
|
func (a *apiBlockstore) Put(context.Context, blocks.Block) error {
|
||||||
return xerrors.New("not supported")
|
return xerrors.New("not supported")
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *apiBlockstore) PutMany([]blocks.Block) error {
|
func (a *apiBlockstore) PutMany(context.Context, []blocks.Block) error {
|
||||||
return xerrors.New("not supported")
|
return xerrors.New("not supported")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,262 @@
|
|||||||
|
package blockstore
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"sync"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"golang.org/x/xerrors"
|
||||||
|
|
||||||
|
block "github.com/ipfs/go-block-format"
|
||||||
|
"github.com/ipfs/go-cid"
|
||||||
|
)
|
||||||
|
|
||||||
|
// autolog is a logger for the autobatching blockstore. It is subscoped from the
|
||||||
|
// blockstore logger.
|
||||||
|
var autolog = log.Named("auto")
|
||||||
|
|
||||||
|
// contains the same set of blocks twice, once as an ordered list for flushing, and as a map for fast access
|
||||||
|
type blockBatch struct {
|
||||||
|
blockList []block.Block
|
||||||
|
blockMap map[cid.Cid]block.Block
|
||||||
|
}
|
||||||
|
|
||||||
|
type AutobatchBlockstore struct {
|
||||||
|
// TODO: drop if memory consumption is too high
|
||||||
|
addedCids map[cid.Cid]struct{}
|
||||||
|
|
||||||
|
stateLock sync.Mutex
|
||||||
|
bufferedBatch blockBatch
|
||||||
|
|
||||||
|
flushingBatch blockBatch
|
||||||
|
flushErr error
|
||||||
|
|
||||||
|
flushCh chan struct{}
|
||||||
|
|
||||||
|
doFlushLock sync.Mutex
|
||||||
|
flushRetryDelay time.Duration
|
||||||
|
doneCh chan struct{}
|
||||||
|
shutdown context.CancelFunc
|
||||||
|
|
||||||
|
backingBs Blockstore
|
||||||
|
|
||||||
|
bufferCapacity int
|
||||||
|
bufferSize int
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewAutobatch(ctx context.Context, backingBs Blockstore, bufferCapacity int) *AutobatchBlockstore {
|
||||||
|
ctx, cancel := context.WithCancel(ctx)
|
||||||
|
bs := &AutobatchBlockstore{
|
||||||
|
addedCids: make(map[cid.Cid]struct{}),
|
||||||
|
backingBs: backingBs,
|
||||||
|
bufferCapacity: bufferCapacity,
|
||||||
|
flushCh: make(chan struct{}, 1),
|
||||||
|
doneCh: make(chan struct{}),
|
||||||
|
// could be made configable
|
||||||
|
flushRetryDelay: time.Millisecond * 100,
|
||||||
|
shutdown: cancel,
|
||||||
|
}
|
||||||
|
|
||||||
|
bs.bufferedBatch.blockMap = make(map[cid.Cid]block.Block)
|
||||||
|
|
||||||
|
go bs.flushWorker(ctx)
|
||||||
|
|
||||||
|
return bs
|
||||||
|
}
|
||||||
|
|
||||||
|
func (bs *AutobatchBlockstore) Put(ctx context.Context, blk block.Block) error {
|
||||||
|
bs.stateLock.Lock()
|
||||||
|
defer bs.stateLock.Unlock()
|
||||||
|
|
||||||
|
_, ok := bs.addedCids[blk.Cid()]
|
||||||
|
if !ok {
|
||||||
|
bs.addedCids[blk.Cid()] = struct{}{}
|
||||||
|
bs.bufferedBatch.blockList = append(bs.bufferedBatch.blockList, blk)
|
||||||
|
bs.bufferedBatch.blockMap[blk.Cid()] = blk
|
||||||
|
bs.bufferSize += len(blk.RawData())
|
||||||
|
if bs.bufferSize >= bs.bufferCapacity {
|
||||||
|
// signal that a flush is appropriate, may be ignored
|
||||||
|
select {
|
||||||
|
case bs.flushCh <- struct{}{}:
|
||||||
|
default:
|
||||||
|
// do nothing
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (bs *AutobatchBlockstore) flushWorker(ctx context.Context) {
|
||||||
|
defer close(bs.doneCh)
|
||||||
|
for {
|
||||||
|
select {
|
||||||
|
case <-bs.flushCh:
|
||||||
|
// TODO: check if we _should_ actually flush. We could get a spurious wakeup
|
||||||
|
// here.
|
||||||
|
putErr := bs.doFlush(ctx, false)
|
||||||
|
for putErr != nil {
|
||||||
|
select {
|
||||||
|
case <-ctx.Done():
|
||||||
|
return
|
||||||
|
case <-time.After(bs.flushRetryDelay):
|
||||||
|
autolog.Errorf("FLUSH ERRORED: %w, retrying after %v", putErr, bs.flushRetryDelay)
|
||||||
|
putErr = bs.doFlush(ctx, true)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case <-ctx.Done():
|
||||||
|
// Do one last flush.
|
||||||
|
_ = bs.doFlush(ctx, false)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// caller must NOT hold stateLock
|
||||||
|
// set retryOnly to true to only retry a failed flush and not flush anything new.
|
||||||
|
func (bs *AutobatchBlockstore) doFlush(ctx context.Context, retryOnly bool) error {
|
||||||
|
bs.doFlushLock.Lock()
|
||||||
|
defer bs.doFlushLock.Unlock()
|
||||||
|
|
||||||
|
// If we failed to flush last time, try flushing again.
|
||||||
|
if bs.flushErr != nil {
|
||||||
|
bs.flushErr = bs.backingBs.PutMany(ctx, bs.flushingBatch.blockList)
|
||||||
|
}
|
||||||
|
|
||||||
|
// If we failed, or we're _only_ retrying, bail.
|
||||||
|
if retryOnly || bs.flushErr != nil {
|
||||||
|
return bs.flushErr
|
||||||
|
}
|
||||||
|
|
||||||
|
// Then take the current batch...
|
||||||
|
bs.stateLock.Lock()
|
||||||
|
// We do NOT clear addedCids here, because its purpose is to expedite Puts
|
||||||
|
bs.flushingBatch = bs.bufferedBatch
|
||||||
|
bs.bufferedBatch.blockList = make([]block.Block, 0, len(bs.flushingBatch.blockList))
|
||||||
|
bs.bufferedBatch.blockMap = make(map[cid.Cid]block.Block, len(bs.flushingBatch.blockMap))
|
||||||
|
bs.stateLock.Unlock()
|
||||||
|
|
||||||
|
// And try to flush it.
|
||||||
|
bs.flushErr = bs.backingBs.PutMany(ctx, bs.flushingBatch.blockList)
|
||||||
|
|
||||||
|
// If we succeeded, reset the batch. Otherwise, we'll try again next time.
|
||||||
|
if bs.flushErr == nil {
|
||||||
|
bs.stateLock.Lock()
|
||||||
|
bs.flushingBatch = blockBatch{}
|
||||||
|
bs.stateLock.Unlock()
|
||||||
|
}
|
||||||
|
|
||||||
|
return bs.flushErr
|
||||||
|
}
|
||||||
|
|
||||||
|
// caller must NOT hold stateLock
|
||||||
|
func (bs *AutobatchBlockstore) Flush(ctx context.Context) error {
|
||||||
|
return bs.doFlush(ctx, false)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (bs *AutobatchBlockstore) Shutdown(ctx context.Context) error {
|
||||||
|
// TODO: Prevent puts after we call this to avoid losing data.
|
||||||
|
bs.shutdown()
|
||||||
|
select {
|
||||||
|
case <-bs.doneCh:
|
||||||
|
case <-ctx.Done():
|
||||||
|
return ctx.Err()
|
||||||
|
}
|
||||||
|
|
||||||
|
bs.doFlushLock.Lock()
|
||||||
|
defer bs.doFlushLock.Unlock()
|
||||||
|
|
||||||
|
return bs.flushErr
|
||||||
|
}
|
||||||
|
|
||||||
|
func (bs *AutobatchBlockstore) Get(ctx context.Context, c cid.Cid) (block.Block, error) {
|
||||||
|
// may seem backward to check the backingBs first, but that is the likeliest case
|
||||||
|
blk, err := bs.backingBs.Get(ctx, c)
|
||||||
|
if err == nil {
|
||||||
|
return blk, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
if err != ErrNotFound {
|
||||||
|
return blk, err
|
||||||
|
}
|
||||||
|
|
||||||
|
bs.stateLock.Lock()
|
||||||
|
defer bs.stateLock.Unlock()
|
||||||
|
v, ok := bs.flushingBatch.blockMap[c]
|
||||||
|
if ok {
|
||||||
|
return v, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
v, ok = bs.bufferedBatch.blockMap[c]
|
||||||
|
if ok {
|
||||||
|
return v, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
return bs.Get(ctx, c)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (bs *AutobatchBlockstore) DeleteBlock(context.Context, cid.Cid) error {
|
||||||
|
// if we wanted to support this, we would have to:
|
||||||
|
// - flush
|
||||||
|
// - delete from the backingBs (if present)
|
||||||
|
// - remove from addedCids (if present)
|
||||||
|
// - if present in addedCids, also walk the ordered lists and remove if present
|
||||||
|
return xerrors.New("deletion is unsupported")
|
||||||
|
}
|
||||||
|
|
||||||
|
func (bs *AutobatchBlockstore) DeleteMany(ctx context.Context, cids []cid.Cid) error {
|
||||||
|
// see note in DeleteBlock()
|
||||||
|
return xerrors.New("deletion is unsupported")
|
||||||
|
}
|
||||||
|
|
||||||
|
func (bs *AutobatchBlockstore) Has(ctx context.Context, c cid.Cid) (bool, error) {
|
||||||
|
_, err := bs.Get(ctx, c)
|
||||||
|
if err == nil {
|
||||||
|
return true, nil
|
||||||
|
}
|
||||||
|
if err == ErrNotFound {
|
||||||
|
return false, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
return false, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func (bs *AutobatchBlockstore) GetSize(ctx context.Context, c cid.Cid) (int, error) {
|
||||||
|
blk, err := bs.Get(ctx, c)
|
||||||
|
if err != nil {
|
||||||
|
return 0, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return len(blk.RawData()), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (bs *AutobatchBlockstore) PutMany(ctx context.Context, blks []block.Block) error {
|
||||||
|
for _, blk := range blks {
|
||||||
|
if err := bs.Put(ctx, blk); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (bs *AutobatchBlockstore) AllKeysChan(ctx context.Context) (<-chan cid.Cid, error) {
|
||||||
|
if err := bs.Flush(ctx); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return bs.backingBs.AllKeysChan(ctx)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (bs *AutobatchBlockstore) HashOnRead(enabled bool) {
|
||||||
|
bs.backingBs.HashOnRead(enabled)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (bs *AutobatchBlockstore) View(ctx context.Context, cid cid.Cid, callback func([]byte) error) error {
|
||||||
|
blk, err := bs.Get(ctx, cid)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return callback(blk.RawData())
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
package blockstore
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
"github.com/stretchr/testify/require"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestAutobatchBlockstore(t *testing.T) {
|
||||||
|
ctx, cancel := context.WithCancel(context.Background())
|
||||||
|
defer cancel()
|
||||||
|
|
||||||
|
ab := NewAutobatch(ctx, NewMemory(), len(b0.RawData())+len(b1.RawData())-1)
|
||||||
|
|
||||||
|
require.NoError(t, ab.Put(ctx, b0))
|
||||||
|
require.NoError(t, ab.Put(ctx, b1))
|
||||||
|
require.NoError(t, ab.Put(ctx, b2))
|
||||||
|
|
||||||
|
v0, err := ab.Get(ctx, b0.Cid())
|
||||||
|
require.NoError(t, err)
|
||||||
|
require.Equal(t, b0.RawData(), v0.RawData())
|
||||||
|
|
||||||
|
v1, err := ab.Get(ctx, b1.Cid())
|
||||||
|
require.NoError(t, err)
|
||||||
|
require.Equal(t, b1.RawData(), v1.RawData())
|
||||||
|
|
||||||
|
v2, err := ab.Get(ctx, b2.Cid())
|
||||||
|
require.NoError(t, err)
|
||||||
|
require.Equal(t, b2.RawData(), v2.RawData())
|
||||||
|
|
||||||
|
require.NoError(t, ab.Flush(ctx))
|
||||||
|
require.NoError(t, ab.Shutdown(ctx))
|
||||||
|
}
|
||||||
@@ -525,7 +525,7 @@ func (b *Blockstore) Size() (int64, error) {
|
|||||||
|
|
||||||
// View implements blockstore.Viewer, which leverages zero-copy read-only
|
// View implements blockstore.Viewer, which leverages zero-copy read-only
|
||||||
// access to values.
|
// access to values.
|
||||||
func (b *Blockstore) View(cid cid.Cid, fn func([]byte) error) error {
|
func (b *Blockstore) View(ctx context.Context, cid cid.Cid, fn func([]byte) error) error {
|
||||||
if err := b.access(); err != nil {
|
if err := b.access(); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@@ -552,7 +552,7 @@ func (b *Blockstore) View(cid cid.Cid, fn func([]byte) error) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Has implements Blockstore.Has.
|
// Has implements Blockstore.Has.
|
||||||
func (b *Blockstore) Has(cid cid.Cid) (bool, error) {
|
func (b *Blockstore) Has(ctx context.Context, cid cid.Cid) (bool, error) {
|
||||||
if err := b.access(); err != nil {
|
if err := b.access(); err != nil {
|
||||||
return false, err
|
return false, err
|
||||||
}
|
}
|
||||||
@@ -582,7 +582,7 @@ func (b *Blockstore) Has(cid cid.Cid) (bool, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get implements Blockstore.Get.
|
// Get implements Blockstore.Get.
|
||||||
func (b *Blockstore) Get(cid cid.Cid) (blocks.Block, error) {
|
func (b *Blockstore) Get(ctx context.Context, cid cid.Cid) (blocks.Block, error) {
|
||||||
if !cid.Defined() {
|
if !cid.Defined() {
|
||||||
return nil, blockstore.ErrNotFound
|
return nil, blockstore.ErrNotFound
|
||||||
}
|
}
|
||||||
@@ -619,7 +619,7 @@ func (b *Blockstore) Get(cid cid.Cid) (blocks.Block, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// GetSize implements Blockstore.GetSize.
|
// GetSize implements Blockstore.GetSize.
|
||||||
func (b *Blockstore) GetSize(cid cid.Cid) (int, error) {
|
func (b *Blockstore) GetSize(ctx context.Context, cid cid.Cid) (int, error) {
|
||||||
if err := b.access(); err != nil {
|
if err := b.access(); err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
@@ -652,7 +652,7 @@ func (b *Blockstore) GetSize(cid cid.Cid) (int, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Put implements Blockstore.Put.
|
// Put implements Blockstore.Put.
|
||||||
func (b *Blockstore) Put(block blocks.Block) error {
|
func (b *Blockstore) Put(ctx context.Context, block blocks.Block) error {
|
||||||
if err := b.access(); err != nil {
|
if err := b.access(); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@@ -691,7 +691,7 @@ func (b *Blockstore) Put(block blocks.Block) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// PutMany implements Blockstore.PutMany.
|
// PutMany implements Blockstore.PutMany.
|
||||||
func (b *Blockstore) PutMany(blocks []blocks.Block) error {
|
func (b *Blockstore) PutMany(ctx context.Context, blocks []blocks.Block) error {
|
||||||
if err := b.access(); err != nil {
|
if err := b.access(); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@@ -755,7 +755,7 @@ func (b *Blockstore) PutMany(blocks []blocks.Block) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// DeleteBlock implements Blockstore.DeleteBlock.
|
// DeleteBlock implements Blockstore.DeleteBlock.
|
||||||
func (b *Blockstore) DeleteBlock(cid cid.Cid) error {
|
func (b *Blockstore) DeleteBlock(ctx context.Context, cid cid.Cid) error {
|
||||||
if err := b.access(); err != nil {
|
if err := b.access(); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@@ -774,7 +774,7 @@ func (b *Blockstore) DeleteBlock(cid cid.Cid) error {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *Blockstore) DeleteMany(cids []cid.Cid) error {
|
func (b *Blockstore) DeleteMany(ctx context.Context, cids []cid.Cid) error {
|
||||||
if err := b.access(); err != nil {
|
if err := b.access(); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
|
//stm: #unit
|
||||||
package badgerbs
|
package badgerbs
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
@@ -19,6 +20,8 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func TestBadgerBlockstore(t *testing.T) {
|
func TestBadgerBlockstore(t *testing.T) {
|
||||||
|
//stm: @SPLITSTORE_BADGER_PUT_001, @SPLITSTORE_BADGER_POOLED_STORAGE_KEY_001
|
||||||
|
//stm: @SPLITSTORE_BADGER_OPEN_001, @SPLITSTORE_BADGER_CLOSE_001
|
||||||
(&Suite{
|
(&Suite{
|
||||||
NewBlockstore: newBlockstore(DefaultOptions),
|
NewBlockstore: newBlockstore(DefaultOptions),
|
||||||
OpenBlockstore: openBlockstore(DefaultOptions),
|
OpenBlockstore: openBlockstore(DefaultOptions),
|
||||||
@@ -37,6 +40,8 @@ func TestBadgerBlockstore(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestStorageKey(t *testing.T) {
|
func TestStorageKey(t *testing.T) {
|
||||||
|
//stm: @SPLITSTORE_BADGER_OPEN_001, @SPLITSTORE_BADGER_CLOSE_001
|
||||||
|
//stm: @SPLITSTORE_BADGER_STORAGE_KEY_001
|
||||||
bs, _ := newBlockstore(DefaultOptions)(t)
|
bs, _ := newBlockstore(DefaultOptions)(t)
|
||||||
bbs := bs.(*Blockstore)
|
bbs := bs.(*Blockstore)
|
||||||
defer bbs.Close() //nolint:errcheck
|
defer bbs.Close() //nolint:errcheck
|
||||||
@@ -72,20 +77,13 @@ func newBlockstore(optsSupplier func(path string) Options) func(tb testing.TB) (
|
|||||||
return func(tb testing.TB) (bs blockstore.BasicBlockstore, path string) {
|
return func(tb testing.TB) (bs blockstore.BasicBlockstore, path string) {
|
||||||
tb.Helper()
|
tb.Helper()
|
||||||
|
|
||||||
path, err := ioutil.TempDir("", "")
|
path = tb.TempDir()
|
||||||
if err != nil {
|
|
||||||
tb.Fatal(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
db, err := Open(optsSupplier(path))
|
db, err := Open(optsSupplier(path))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
tb.Fatal(err)
|
tb.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
tb.Cleanup(func() {
|
|
||||||
_ = os.RemoveAll(path)
|
|
||||||
})
|
|
||||||
|
|
||||||
return db, path
|
return db, path
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -98,17 +96,11 @@ func openBlockstore(optsSupplier func(path string) Options) func(tb testing.TB,
|
|||||||
}
|
}
|
||||||
|
|
||||||
func testMove(t *testing.T, optsF func(string) Options) {
|
func testMove(t *testing.T, optsF func(string) Options) {
|
||||||
basePath, err := ioutil.TempDir("", "")
|
ctx := context.Background()
|
||||||
if err != nil {
|
basePath := t.TempDir()
|
||||||
t.Fatal(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
dbPath := filepath.Join(basePath, "db")
|
dbPath := filepath.Join(basePath, "db")
|
||||||
|
|
||||||
t.Cleanup(func() {
|
|
||||||
_ = os.RemoveAll(basePath)
|
|
||||||
})
|
|
||||||
|
|
||||||
db, err := Open(optsF(dbPath))
|
db, err := Open(optsF(dbPath))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
@@ -122,7 +114,7 @@ func testMove(t *testing.T, optsF func(string) Options) {
|
|||||||
// add some blocks
|
// add some blocks
|
||||||
for i := 0; i < 10; i++ {
|
for i := 0; i < 10; i++ {
|
||||||
blk := blocks.NewBlock([]byte(fmt.Sprintf("some data %d", i)))
|
blk := blocks.NewBlock([]byte(fmt.Sprintf("some data %d", i)))
|
||||||
err := db.Put(blk)
|
err := db.Put(ctx, blk)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
@@ -132,7 +124,7 @@ func testMove(t *testing.T, optsF func(string) Options) {
|
|||||||
// delete some of them
|
// delete some of them
|
||||||
for i := 5; i < 10; i++ {
|
for i := 5; i < 10; i++ {
|
||||||
c := have[i].Cid()
|
c := have[i].Cid()
|
||||||
err := db.DeleteBlock(c)
|
err := db.DeleteBlock(ctx, c)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
@@ -145,7 +137,7 @@ func testMove(t *testing.T, optsF func(string) Options) {
|
|||||||
g.Go(func() error {
|
g.Go(func() error {
|
||||||
for i := 10; i < 1000; i++ {
|
for i := 10; i < 1000; i++ {
|
||||||
blk := blocks.NewBlock([]byte(fmt.Sprintf("some data %d", i)))
|
blk := blocks.NewBlock([]byte(fmt.Sprintf("some data %d", i)))
|
||||||
err := db.Put(blk)
|
err := db.Put(ctx, blk)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@@ -165,7 +157,7 @@ func testMove(t *testing.T, optsF func(string) Options) {
|
|||||||
// now check that we have all the blocks in have and none in the deleted lists
|
// now check that we have all the blocks in have and none in the deleted lists
|
||||||
checkBlocks := func() {
|
checkBlocks := func() {
|
||||||
for _, blk := range have {
|
for _, blk := range have {
|
||||||
has, err := db.Has(blk.Cid())
|
has, err := db.Has(ctx, blk.Cid())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
@@ -174,7 +166,7 @@ func testMove(t *testing.T, optsF func(string) Options) {
|
|||||||
t.Fatal("missing block")
|
t.Fatal("missing block")
|
||||||
}
|
}
|
||||||
|
|
||||||
blk2, err := db.Get(blk.Cid())
|
blk2, err := db.Get(ctx, blk.Cid())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
@@ -185,7 +177,7 @@ func testMove(t *testing.T, optsF func(string) Options) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for _, c := range deleted {
|
for _, c := range deleted {
|
||||||
has, err := db.Has(c)
|
has, err := db.Has(ctx, c)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
@@ -263,10 +255,16 @@ func testMove(t *testing.T, optsF func(string) Options) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestMoveNoPrefix(t *testing.T) {
|
func TestMoveNoPrefix(t *testing.T) {
|
||||||
|
//stm: @SPLITSTORE_BADGER_OPEN_001, @SPLITSTORE_BADGER_CLOSE_001
|
||||||
|
//stm: @SPLITSTORE_BADGER_PUT_001, @SPLITSTORE_BADGER_POOLED_STORAGE_KEY_001
|
||||||
|
//stm: @SPLITSTORE_BADGER_DELETE_001, @SPLITSTORE_BADGER_COLLECT_GARBAGE_001
|
||||||
testMove(t, DefaultOptions)
|
testMove(t, DefaultOptions)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestMoveWithPrefix(t *testing.T) {
|
func TestMoveWithPrefix(t *testing.T) {
|
||||||
|
//stm: @SPLITSTORE_BADGER_OPEN_001, @SPLITSTORE_BADGER_CLOSE_001
|
||||||
|
//stm: @SPLITSTORE_BADGER_PUT_001, @SPLITSTORE_BADGER_POOLED_STORAGE_KEY_001
|
||||||
|
//stm: @SPLITSTORE_BADGER_DELETE_001, @SPLITSTORE_BADGER_COLLECT_GARBAGE_001
|
||||||
testMove(t, func(path string) Options {
|
testMove(t, func(path string) Options {
|
||||||
opts := DefaultOptions(path)
|
opts := DefaultOptions(path)
|
||||||
opts.Prefix = "/prefixed/"
|
opts.Prefix = "/prefixed/"
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
//stm: #unit
|
||||||
package badgerbs
|
package badgerbs
|
||||||
|
|
||||||
import (
|
import (
|
||||||
@@ -44,28 +45,38 @@ func (s *Suite) RunTests(t *testing.T, prefix string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *Suite) TestGetWhenKeyNotPresent(t *testing.T) {
|
func (s *Suite) TestGetWhenKeyNotPresent(t *testing.T) {
|
||||||
|
//stm: @SPLITSTORE_BADGER_OPEN_001, @SPLITSTORE_BADGER_CLOSE_001
|
||||||
|
//stm: @SPLITSTORE_BADGER_GET_001, @SPLITSTORE_BADGER_POOLED_STORAGE_KEY_001
|
||||||
|
ctx := context.Background()
|
||||||
bs, _ := s.NewBlockstore(t)
|
bs, _ := s.NewBlockstore(t)
|
||||||
if c, ok := bs.(io.Closer); ok {
|
if c, ok := bs.(io.Closer); ok {
|
||||||
defer func() { require.NoError(t, c.Close()) }()
|
defer func() { require.NoError(t, c.Close()) }()
|
||||||
}
|
}
|
||||||
|
|
||||||
c := cid.NewCidV0(u.Hash([]byte("stuff")))
|
c := cid.NewCidV0(u.Hash([]byte("stuff")))
|
||||||
bl, err := bs.Get(c)
|
bl, err := bs.Get(ctx, c)
|
||||||
require.Nil(t, bl)
|
require.Nil(t, bl)
|
||||||
require.Equal(t, blockstore.ErrNotFound, err)
|
require.Equal(t, blockstore.ErrNotFound, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Suite) TestGetWhenKeyIsNil(t *testing.T) {
|
func (s *Suite) TestGetWhenKeyIsNil(t *testing.T) {
|
||||||
|
//stm: @SPLITSTORE_BADGER_OPEN_001, @SPLITSTORE_BADGER_CLOSE_001
|
||||||
|
//stm: @SPLITSTORE_BADGER_GET_001
|
||||||
|
ctx := context.Background()
|
||||||
bs, _ := s.NewBlockstore(t)
|
bs, _ := s.NewBlockstore(t)
|
||||||
if c, ok := bs.(io.Closer); ok {
|
if c, ok := bs.(io.Closer); ok {
|
||||||
defer func() { require.NoError(t, c.Close()) }()
|
defer func() { require.NoError(t, c.Close()) }()
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err := bs.Get(cid.Undef)
|
_, err := bs.Get(ctx, cid.Undef)
|
||||||
require.Equal(t, blockstore.ErrNotFound, err)
|
require.Equal(t, blockstore.ErrNotFound, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Suite) TestPutThenGetBlock(t *testing.T) {
|
func (s *Suite) TestPutThenGetBlock(t *testing.T) {
|
||||||
|
//stm: @SPLITSTORE_BADGER_OPEN_001, @SPLITSTORE_BADGER_CLOSE_001
|
||||||
|
//stm: @SPLITSTORE_BADGER_PUT_001, @SPLITSTORE_BADGER_POOLED_STORAGE_KEY_001
|
||||||
|
//stm: @SPLITSTORE_BADGER_GET_001
|
||||||
|
ctx := context.Background()
|
||||||
bs, _ := s.NewBlockstore(t)
|
bs, _ := s.NewBlockstore(t)
|
||||||
if c, ok := bs.(io.Closer); ok {
|
if c, ok := bs.(io.Closer); ok {
|
||||||
defer func() { require.NoError(t, c.Close()) }()
|
defer func() { require.NoError(t, c.Close()) }()
|
||||||
@@ -73,15 +84,18 @@ func (s *Suite) TestPutThenGetBlock(t *testing.T) {
|
|||||||
|
|
||||||
orig := blocks.NewBlock([]byte("some data"))
|
orig := blocks.NewBlock([]byte("some data"))
|
||||||
|
|
||||||
err := bs.Put(orig)
|
err := bs.Put(ctx, orig)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
fetched, err := bs.Get(orig.Cid())
|
fetched, err := bs.Get(ctx, orig.Cid())
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.Equal(t, orig.RawData(), fetched.RawData())
|
require.Equal(t, orig.RawData(), fetched.RawData())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Suite) TestHas(t *testing.T) {
|
func (s *Suite) TestHas(t *testing.T) {
|
||||||
|
//stm: @SPLITSTORE_BADGER_OPEN_001, @SPLITSTORE_BADGER_CLOSE_001
|
||||||
|
//stm: @SPLITSTORE_BADGER_HAS_001, @SPLITSTORE_BADGER_POOLED_STORAGE_KEY_001
|
||||||
|
ctx := context.Background()
|
||||||
bs, _ := s.NewBlockstore(t)
|
bs, _ := s.NewBlockstore(t)
|
||||||
if c, ok := bs.(io.Closer); ok {
|
if c, ok := bs.(io.Closer); ok {
|
||||||
defer func() { require.NoError(t, c.Close()) }()
|
defer func() { require.NoError(t, c.Close()) }()
|
||||||
@@ -89,19 +103,23 @@ func (s *Suite) TestHas(t *testing.T) {
|
|||||||
|
|
||||||
orig := blocks.NewBlock([]byte("some data"))
|
orig := blocks.NewBlock([]byte("some data"))
|
||||||
|
|
||||||
err := bs.Put(orig)
|
err := bs.Put(ctx, orig)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
ok, err := bs.Has(orig.Cid())
|
ok, err := bs.Has(ctx, orig.Cid())
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.True(t, ok)
|
require.True(t, ok)
|
||||||
|
|
||||||
ok, err = bs.Has(blocks.NewBlock([]byte("another thing")).Cid())
|
ok, err = bs.Has(ctx, blocks.NewBlock([]byte("another thing")).Cid())
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.False(t, ok)
|
require.False(t, ok)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Suite) TestCidv0v1(t *testing.T) {
|
func (s *Suite) TestCidv0v1(t *testing.T) {
|
||||||
|
//stm: @SPLITSTORE_BADGER_OPEN_001, @SPLITSTORE_BADGER_CLOSE_001
|
||||||
|
//stm: @SPLITSTORE_BADGER_PUT_001, @SPLITSTORE_BADGER_POOLED_STORAGE_KEY_001
|
||||||
|
//stm: @SPLITSTORE_BADGER_GET_001
|
||||||
|
ctx := context.Background()
|
||||||
bs, _ := s.NewBlockstore(t)
|
bs, _ := s.NewBlockstore(t)
|
||||||
if c, ok := bs.(io.Closer); ok {
|
if c, ok := bs.(io.Closer); ok {
|
||||||
defer func() { require.NoError(t, c.Close()) }()
|
defer func() { require.NoError(t, c.Close()) }()
|
||||||
@@ -109,15 +127,20 @@ func (s *Suite) TestCidv0v1(t *testing.T) {
|
|||||||
|
|
||||||
orig := blocks.NewBlock([]byte("some data"))
|
orig := blocks.NewBlock([]byte("some data"))
|
||||||
|
|
||||||
err := bs.Put(orig)
|
err := bs.Put(ctx, orig)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
fetched, err := bs.Get(cid.NewCidV1(cid.DagProtobuf, orig.Cid().Hash()))
|
fetched, err := bs.Get(ctx, cid.NewCidV1(cid.DagProtobuf, orig.Cid().Hash()))
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.Equal(t, orig.RawData(), fetched.RawData())
|
require.Equal(t, orig.RawData(), fetched.RawData())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Suite) TestPutThenGetSizeBlock(t *testing.T) {
|
func (s *Suite) TestPutThenGetSizeBlock(t *testing.T) {
|
||||||
|
//stm: @SPLITSTORE_BADGER_OPEN_001, @SPLITSTORE_BADGER_CLOSE_001
|
||||||
|
//stm: @SPLITSTORE_BADGER_PUT_001, @SPLITSTORE_BADGER_POOLED_STORAGE_KEY_001
|
||||||
|
//stm: @SPLITSTORE_BADGER_GET_SIZE_001
|
||||||
|
ctx := context.Background()
|
||||||
|
|
||||||
bs, _ := s.NewBlockstore(t)
|
bs, _ := s.NewBlockstore(t)
|
||||||
if c, ok := bs.(io.Closer); ok {
|
if c, ok := bs.(io.Closer); ok {
|
||||||
defer func() { require.NoError(t, c.Close()) }()
|
defer func() { require.NoError(t, c.Close()) }()
|
||||||
@@ -127,26 +150,28 @@ func (s *Suite) TestPutThenGetSizeBlock(t *testing.T) {
|
|||||||
missingBlock := blocks.NewBlock([]byte("missingBlock"))
|
missingBlock := blocks.NewBlock([]byte("missingBlock"))
|
||||||
emptyBlock := blocks.NewBlock([]byte{})
|
emptyBlock := blocks.NewBlock([]byte{})
|
||||||
|
|
||||||
err := bs.Put(block)
|
err := bs.Put(ctx, block)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
blockSize, err := bs.GetSize(block.Cid())
|
blockSize, err := bs.GetSize(ctx, block.Cid())
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.Len(t, block.RawData(), blockSize)
|
require.Len(t, block.RawData(), blockSize)
|
||||||
|
|
||||||
err = bs.Put(emptyBlock)
|
err = bs.Put(ctx, emptyBlock)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
emptySize, err := bs.GetSize(emptyBlock.Cid())
|
emptySize, err := bs.GetSize(ctx, emptyBlock.Cid())
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.Zero(t, emptySize)
|
require.Zero(t, emptySize)
|
||||||
|
|
||||||
missingSize, err := bs.GetSize(missingBlock.Cid())
|
missingSize, err := bs.GetSize(ctx, missingBlock.Cid())
|
||||||
require.Equal(t, blockstore.ErrNotFound, err)
|
require.Equal(t, blockstore.ErrNotFound, err)
|
||||||
require.Equal(t, -1, missingSize)
|
require.Equal(t, -1, missingSize)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Suite) TestAllKeysSimple(t *testing.T) {
|
func (s *Suite) TestAllKeysSimple(t *testing.T) {
|
||||||
|
//stm: @SPLITSTORE_BADGER_OPEN_001, @SPLITSTORE_BADGER_CLOSE_001
|
||||||
|
//stm: @SPLITSTORE_BADGER_PUT_001, @SPLITSTORE_BADGER_POOLED_STORAGE_KEY_001
|
||||||
bs, _ := s.NewBlockstore(t)
|
bs, _ := s.NewBlockstore(t)
|
||||||
if c, ok := bs.(io.Closer); ok {
|
if c, ok := bs.(io.Closer); ok {
|
||||||
defer func() { require.NoError(t, c.Close()) }()
|
defer func() { require.NoError(t, c.Close()) }()
|
||||||
@@ -163,6 +188,9 @@ func (s *Suite) TestAllKeysSimple(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *Suite) TestAllKeysRespectsContext(t *testing.T) {
|
func (s *Suite) TestAllKeysRespectsContext(t *testing.T) {
|
||||||
|
//stm: @SPLITSTORE_BADGER_OPEN_001, @SPLITSTORE_BADGER_CLOSE_001
|
||||||
|
//stm: @SPLITSTORE_BADGER_PUT_001, @SPLITSTORE_BADGER_POOLED_STORAGE_KEY_001
|
||||||
|
//stm: @SPLITSTORE_BADGER_ALL_KEYS_CHAN_001
|
||||||
bs, _ := s.NewBlockstore(t)
|
bs, _ := s.NewBlockstore(t)
|
||||||
if c, ok := bs.(io.Closer); ok {
|
if c, ok := bs.(io.Closer); ok {
|
||||||
defer func() { require.NoError(t, c.Close()) }()
|
defer func() { require.NoError(t, c.Close()) }()
|
||||||
@@ -193,6 +221,7 @@ func (s *Suite) TestAllKeysRespectsContext(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *Suite) TestDoubleClose(t *testing.T) {
|
func (s *Suite) TestDoubleClose(t *testing.T) {
|
||||||
|
//stm: @SPLITSTORE_BADGER_OPEN_001, @SPLITSTORE_BADGER_CLOSE_001
|
||||||
bs, _ := s.NewBlockstore(t)
|
bs, _ := s.NewBlockstore(t)
|
||||||
c, ok := bs.(io.Closer)
|
c, ok := bs.(io.Closer)
|
||||||
if !ok {
|
if !ok {
|
||||||
@@ -203,6 +232,10 @@ func (s *Suite) TestDoubleClose(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *Suite) TestReopenPutGet(t *testing.T) {
|
func (s *Suite) TestReopenPutGet(t *testing.T) {
|
||||||
|
//stm: @SPLITSTORE_BADGER_OPEN_001, @SPLITSTORE_BADGER_CLOSE_001
|
||||||
|
//stm: @SPLITSTORE_BADGER_PUT_001, @SPLITSTORE_BADGER_POOLED_STORAGE_KEY_001
|
||||||
|
//stm: @SPLITSTORE_BADGER_GET_001
|
||||||
|
ctx := context.Background()
|
||||||
bs, path := s.NewBlockstore(t)
|
bs, path := s.NewBlockstore(t)
|
||||||
c, ok := bs.(io.Closer)
|
c, ok := bs.(io.Closer)
|
||||||
if !ok {
|
if !ok {
|
||||||
@@ -210,7 +243,7 @@ func (s *Suite) TestReopenPutGet(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
orig := blocks.NewBlock([]byte("some data"))
|
orig := blocks.NewBlock([]byte("some data"))
|
||||||
err := bs.Put(orig)
|
err := bs.Put(ctx, orig)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
err = c.Close()
|
err = c.Close()
|
||||||
@@ -219,7 +252,7 @@ func (s *Suite) TestReopenPutGet(t *testing.T) {
|
|||||||
bs, err = s.OpenBlockstore(t, path)
|
bs, err = s.OpenBlockstore(t, path)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
fetched, err := bs.Get(orig.Cid())
|
fetched, err := bs.Get(ctx, orig.Cid())
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.Equal(t, orig.RawData(), fetched.RawData())
|
require.Equal(t, orig.RawData(), fetched.RawData())
|
||||||
|
|
||||||
@@ -228,6 +261,11 @@ func (s *Suite) TestReopenPutGet(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *Suite) TestPutMany(t *testing.T) {
|
func (s *Suite) TestPutMany(t *testing.T) {
|
||||||
|
//stm: @SPLITSTORE_BADGER_OPEN_001, @SPLITSTORE_BADGER_CLOSE_001
|
||||||
|
//stm: @SPLITSTORE_BADGER_HAS_001, @SPLITSTORE_BADGER_POOLED_STORAGE_KEY_001
|
||||||
|
//stm: @SPLITSTORE_BADGER_GET_001, @SPLITSTORE_BADGER_PUT_MANY_001
|
||||||
|
//stm: @SPLITSTORE_BADGER_ALL_KEYS_CHAN_001
|
||||||
|
ctx := context.Background()
|
||||||
bs, _ := s.NewBlockstore(t)
|
bs, _ := s.NewBlockstore(t)
|
||||||
if c, ok := bs.(io.Closer); ok {
|
if c, ok := bs.(io.Closer); ok {
|
||||||
defer func() { require.NoError(t, c.Close()) }()
|
defer func() { require.NoError(t, c.Close()) }()
|
||||||
@@ -238,15 +276,15 @@ func (s *Suite) TestPutMany(t *testing.T) {
|
|||||||
blocks.NewBlock([]byte("foo2")),
|
blocks.NewBlock([]byte("foo2")),
|
||||||
blocks.NewBlock([]byte("foo3")),
|
blocks.NewBlock([]byte("foo3")),
|
||||||
}
|
}
|
||||||
err := bs.PutMany(blks)
|
err := bs.PutMany(ctx, blks)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
for _, blk := range blks {
|
for _, blk := range blks {
|
||||||
fetched, err := bs.Get(blk.Cid())
|
fetched, err := bs.Get(ctx, blk.Cid())
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.Equal(t, blk.RawData(), fetched.RawData())
|
require.Equal(t, blk.RawData(), fetched.RawData())
|
||||||
|
|
||||||
ok, err := bs.Has(blk.Cid())
|
ok, err := bs.Has(ctx, blk.Cid())
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.True(t, ok)
|
require.True(t, ok)
|
||||||
}
|
}
|
||||||
@@ -259,6 +297,12 @@ func (s *Suite) TestPutMany(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *Suite) TestDelete(t *testing.T) {
|
func (s *Suite) TestDelete(t *testing.T) {
|
||||||
|
//stm: @SPLITSTORE_BADGER_PUT_001, @SPLITSTORE_BADGER_POOLED_STORAGE_KEY_001
|
||||||
|
//stm: @SPLITSTORE_BADGER_DELETE_001, @SPLITSTORE_BADGER_POOLED_STORAGE_HAS_001
|
||||||
|
//stm: @SPLITSTORE_BADGER_ALL_KEYS_CHAN_001, @SPLITSTORE_BADGER_HAS_001
|
||||||
|
//stm: @SPLITSTORE_BADGER_PUT_MANY_001
|
||||||
|
|
||||||
|
ctx := context.Background()
|
||||||
bs, _ := s.NewBlockstore(t)
|
bs, _ := s.NewBlockstore(t)
|
||||||
if c, ok := bs.(io.Closer); ok {
|
if c, ok := bs.(io.Closer); ok {
|
||||||
defer func() { require.NoError(t, c.Close()) }()
|
defer func() { require.NoError(t, c.Close()) }()
|
||||||
@@ -269,10 +313,10 @@ func (s *Suite) TestDelete(t *testing.T) {
|
|||||||
blocks.NewBlock([]byte("foo2")),
|
blocks.NewBlock([]byte("foo2")),
|
||||||
blocks.NewBlock([]byte("foo3")),
|
blocks.NewBlock([]byte("foo3")),
|
||||||
}
|
}
|
||||||
err := bs.PutMany(blks)
|
err := bs.PutMany(ctx, blks)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
err = bs.DeleteBlock(blks[1].Cid())
|
err = bs.DeleteBlock(ctx, blks[1].Cid())
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
ch, err := bs.AllKeysChan(context.Background())
|
ch, err := bs.AllKeysChan(context.Background())
|
||||||
@@ -285,17 +329,17 @@ func (s *Suite) TestDelete(t *testing.T) {
|
|||||||
cid.NewCidV1(cid.Raw, blks[2].Cid().Hash()),
|
cid.NewCidV1(cid.Raw, blks[2].Cid().Hash()),
|
||||||
})
|
})
|
||||||
|
|
||||||
has, err := bs.Has(blks[1].Cid())
|
has, err := bs.Has(ctx, blks[1].Cid())
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.False(t, has)
|
require.False(t, has)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func insertBlocks(t *testing.T, bs blockstore.BasicBlockstore, count int) []cid.Cid {
|
func insertBlocks(t *testing.T, bs blockstore.BasicBlockstore, count int) []cid.Cid {
|
||||||
|
ctx := context.Background()
|
||||||
keys := make([]cid.Cid, count)
|
keys := make([]cid.Cid, count)
|
||||||
for i := 0; i < count; i++ {
|
for i := 0; i < count; i++ {
|
||||||
block := blocks.NewBlock([]byte(fmt.Sprintf("some data %d", i)))
|
block := blocks.NewBlock([]byte(fmt.Sprintf("some data %d", i)))
|
||||||
err := bs.Put(block)
|
err := bs.Put(ctx, block)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
// NewBlock assigns a CIDv0; we convert it to CIDv1 because that's what
|
// NewBlock assigns a CIDv0; we convert it to CIDv1 because that's what
|
||||||
// the store returns.
|
// the store returns.
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
package blockstore
|
package blockstore
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
|
|
||||||
cid "github.com/ipfs/go-cid"
|
cid "github.com/ipfs/go-cid"
|
||||||
ds "github.com/ipfs/go-datastore"
|
ds "github.com/ipfs/go-datastore"
|
||||||
logging "github.com/ipfs/go-log/v2"
|
logging "github.com/ipfs/go-log/v2"
|
||||||
@@ -27,7 +29,7 @@ type BasicBlockstore = blockstore.Blockstore
|
|||||||
type Viewer = blockstore.Viewer
|
type Viewer = blockstore.Viewer
|
||||||
|
|
||||||
type BatchDeleter interface {
|
type BatchDeleter interface {
|
||||||
DeleteMany(cids []cid.Cid) error
|
DeleteMany(ctx context.Context, cids []cid.Cid) error
|
||||||
}
|
}
|
||||||
|
|
||||||
// BlockstoreIterator is a trait for efficient iteration
|
// BlockstoreIterator is a trait for efficient iteration
|
||||||
@@ -93,17 +95,17 @@ type adaptedBlockstore struct {
|
|||||||
|
|
||||||
var _ Blockstore = (*adaptedBlockstore)(nil)
|
var _ Blockstore = (*adaptedBlockstore)(nil)
|
||||||
|
|
||||||
func (a *adaptedBlockstore) View(cid cid.Cid, callback func([]byte) error) error {
|
func (a *adaptedBlockstore) View(ctx context.Context, cid cid.Cid, callback func([]byte) error) error {
|
||||||
blk, err := a.Get(cid)
|
blk, err := a.Get(ctx, cid)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
return callback(blk.RawData())
|
return callback(blk.RawData())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *adaptedBlockstore) DeleteMany(cids []cid.Cid) error {
|
func (a *adaptedBlockstore) DeleteMany(ctx context.Context, cids []cid.Cid) error {
|
||||||
for _, cid := range cids {
|
for _, cid := range cids {
|
||||||
err := a.DeleteBlock(cid)
|
err := a.DeleteBlock(ctx, cid)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
+23
-23
@@ -88,34 +88,34 @@ func (bs *BufferedBlockstore) AllKeysChan(ctx context.Context) (<-chan cid.Cid,
|
|||||||
return out, nil
|
return out, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (bs *BufferedBlockstore) DeleteBlock(c cid.Cid) error {
|
func (bs *BufferedBlockstore) DeleteBlock(ctx context.Context, c cid.Cid) error {
|
||||||
if err := bs.read.DeleteBlock(c); err != nil {
|
if err := bs.read.DeleteBlock(ctx, c); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
return bs.write.DeleteBlock(c)
|
return bs.write.DeleteBlock(ctx, c)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (bs *BufferedBlockstore) DeleteMany(cids []cid.Cid) error {
|
func (bs *BufferedBlockstore) DeleteMany(ctx context.Context, cids []cid.Cid) error {
|
||||||
if err := bs.read.DeleteMany(cids); err != nil {
|
if err := bs.read.DeleteMany(ctx, cids); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
return bs.write.DeleteMany(cids)
|
return bs.write.DeleteMany(ctx, cids)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (bs *BufferedBlockstore) View(c cid.Cid, callback func([]byte) error) error {
|
func (bs *BufferedBlockstore) View(ctx context.Context, c cid.Cid, callback func([]byte) error) error {
|
||||||
// both stores are viewable.
|
// both stores are viewable.
|
||||||
if err := bs.write.View(c, callback); err == ErrNotFound {
|
if err := bs.write.View(ctx, c, callback); err == ErrNotFound {
|
||||||
// not found in write blockstore; fall through.
|
// not found in write blockstore; fall through.
|
||||||
} else {
|
} else {
|
||||||
return err // propagate errors, or nil, i.e. found.
|
return err // propagate errors, or nil, i.e. found.
|
||||||
}
|
}
|
||||||
return bs.read.View(c, callback)
|
return bs.read.View(ctx, c, callback)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (bs *BufferedBlockstore) Get(c cid.Cid) (block.Block, error) {
|
func (bs *BufferedBlockstore) Get(ctx context.Context, c cid.Cid) (block.Block, error) {
|
||||||
if out, err := bs.write.Get(c); err != nil {
|
if out, err := bs.write.Get(ctx, c); err != nil {
|
||||||
if err != ErrNotFound {
|
if err != ErrNotFound {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -123,20 +123,20 @@ func (bs *BufferedBlockstore) Get(c cid.Cid) (block.Block, error) {
|
|||||||
return out, nil
|
return out, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
return bs.read.Get(c)
|
return bs.read.Get(ctx, c)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (bs *BufferedBlockstore) GetSize(c cid.Cid) (int, error) {
|
func (bs *BufferedBlockstore) GetSize(ctx context.Context, c cid.Cid) (int, error) {
|
||||||
s, err := bs.read.GetSize(c)
|
s, err := bs.read.GetSize(ctx, c)
|
||||||
if err == ErrNotFound || s == 0 {
|
if err == ErrNotFound || s == 0 {
|
||||||
return bs.write.GetSize(c)
|
return bs.write.GetSize(ctx, c)
|
||||||
}
|
}
|
||||||
|
|
||||||
return s, err
|
return s, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (bs *BufferedBlockstore) Put(blk block.Block) error {
|
func (bs *BufferedBlockstore) Put(ctx context.Context, blk block.Block) error {
|
||||||
has, err := bs.read.Has(blk.Cid()) // TODO: consider dropping this check
|
has, err := bs.read.Has(ctx, blk.Cid()) // TODO: consider dropping this check
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@@ -145,11 +145,11 @@ func (bs *BufferedBlockstore) Put(blk block.Block) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
return bs.write.Put(blk)
|
return bs.write.Put(ctx, blk)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (bs *BufferedBlockstore) Has(c cid.Cid) (bool, error) {
|
func (bs *BufferedBlockstore) Has(ctx context.Context, c cid.Cid) (bool, error) {
|
||||||
has, err := bs.write.Has(c)
|
has, err := bs.write.Has(ctx, c)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, err
|
return false, err
|
||||||
}
|
}
|
||||||
@@ -157,7 +157,7 @@ func (bs *BufferedBlockstore) Has(c cid.Cid) (bool, error) {
|
|||||||
return true, nil
|
return true, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
return bs.read.Has(c)
|
return bs.read.Has(ctx, c)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (bs *BufferedBlockstore) HashOnRead(hor bool) {
|
func (bs *BufferedBlockstore) HashOnRead(hor bool) {
|
||||||
@@ -165,8 +165,8 @@ func (bs *BufferedBlockstore) HashOnRead(hor bool) {
|
|||||||
bs.write.HashOnRead(hor)
|
bs.write.HashOnRead(hor)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (bs *BufferedBlockstore) PutMany(blks []block.Block) error {
|
func (bs *BufferedBlockstore) PutMany(ctx context.Context, blks []block.Block) error {
|
||||||
return bs.write.PutMany(blks)
|
return bs.write.PutMany(ctx, blks)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (bs *BufferedBlockstore) Read() Blockstore {
|
func (bs *BufferedBlockstore) Read() Blockstore {
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package blockstore
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
)
|
||||||
|
|
||||||
|
type hotViewKey struct{}
|
||||||
|
|
||||||
|
var hotView = hotViewKey{}
|
||||||
|
|
||||||
|
// WithHotView constructs a new context with an option that provides a hint to the blockstore
|
||||||
|
// (e.g. the splitstore) that the object (and its ipld references) should be kept hot.
|
||||||
|
func WithHotView(ctx context.Context) context.Context {
|
||||||
|
return context.WithValue(ctx, hotView, struct{}{})
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsHotView returns true if the hot view option is set in the context
|
||||||
|
func IsHotView(ctx context.Context) bool {
|
||||||
|
v := ctx.Value(hotView)
|
||||||
|
return v != nil
|
||||||
|
}
|
||||||
+12
-12
@@ -18,39 +18,39 @@ func NewDiscardStore(bs Blockstore) Blockstore {
|
|||||||
return &discardstore{bs: bs}
|
return &discardstore{bs: bs}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *discardstore) Has(cid cid.Cid) (bool, error) {
|
func (b *discardstore) Has(ctx context.Context, cid cid.Cid) (bool, error) {
|
||||||
return b.bs.Has(cid)
|
return b.bs.Has(ctx, cid)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *discardstore) HashOnRead(hor bool) {
|
func (b *discardstore) HashOnRead(hor bool) {
|
||||||
b.bs.HashOnRead(hor)
|
b.bs.HashOnRead(hor)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *discardstore) Get(cid cid.Cid) (blocks.Block, error) {
|
func (b *discardstore) Get(ctx context.Context, cid cid.Cid) (blocks.Block, error) {
|
||||||
return b.bs.Get(cid)
|
return b.bs.Get(ctx, cid)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *discardstore) GetSize(cid cid.Cid) (int, error) {
|
func (b *discardstore) GetSize(ctx context.Context, cid cid.Cid) (int, error) {
|
||||||
return b.bs.GetSize(cid)
|
return b.bs.GetSize(ctx, cid)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *discardstore) View(cid cid.Cid, f func([]byte) error) error {
|
func (b *discardstore) View(ctx context.Context, cid cid.Cid, f func([]byte) error) error {
|
||||||
return b.bs.View(cid, f)
|
return b.bs.View(ctx, cid, f)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *discardstore) Put(blk blocks.Block) error {
|
func (b *discardstore) Put(ctx context.Context, blk blocks.Block) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *discardstore) PutMany(blks []blocks.Block) error {
|
func (b *discardstore) PutMany(ctx context.Context, blks []blocks.Block) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *discardstore) DeleteBlock(cid cid.Cid) error {
|
func (b *discardstore) DeleteBlock(ctx context.Context, cid cid.Cid) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *discardstore) DeleteMany(cids []cid.Cid) error {
|
func (b *discardstore) DeleteMany(ctx context.Context, cids []cid.Cid) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -71,14 +71,14 @@ func (fbs *FallbackStore) getFallback(c cid.Cid) (blocks.Block, error) {
|
|||||||
// chain bitswap puts blocks in temp blockstore which is cleaned up
|
// chain bitswap puts blocks in temp blockstore which is cleaned up
|
||||||
// every few min (to drop any messages we fetched but don't want)
|
// every few min (to drop any messages we fetched but don't want)
|
||||||
// in this case we want to keep this block around
|
// in this case we want to keep this block around
|
||||||
if err := fbs.Put(b); err != nil {
|
if err := fbs.Put(ctx, b); err != nil {
|
||||||
return nil, xerrors.Errorf("persisting fallback-fetched block: %w", err)
|
return nil, xerrors.Errorf("persisting fallback-fetched block: %w", err)
|
||||||
}
|
}
|
||||||
return b, nil
|
return b, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (fbs *FallbackStore) Get(c cid.Cid) (blocks.Block, error) {
|
func (fbs *FallbackStore) Get(ctx context.Context, c cid.Cid) (blocks.Block, error) {
|
||||||
b, err := fbs.Blockstore.Get(c)
|
b, err := fbs.Blockstore.Get(ctx, c)
|
||||||
switch err {
|
switch err {
|
||||||
case nil:
|
case nil:
|
||||||
return b, nil
|
return b, nil
|
||||||
@@ -89,8 +89,8 @@ func (fbs *FallbackStore) Get(c cid.Cid) (blocks.Block, error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (fbs *FallbackStore) GetSize(c cid.Cid) (int, error) {
|
func (fbs *FallbackStore) GetSize(ctx context.Context, c cid.Cid) (int, error) {
|
||||||
sz, err := fbs.Blockstore.GetSize(c)
|
sz, err := fbs.Blockstore.GetSize(ctx, c)
|
||||||
switch err {
|
switch err {
|
||||||
case nil:
|
case nil:
|
||||||
return sz, nil
|
return sz, nil
|
||||||
|
|||||||
+16
-16
@@ -38,7 +38,7 @@ func decodeCid(cid cid.Cid) (inline bool, data []byte, err error) {
|
|||||||
return false, nil, err
|
return false, nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *idstore) Has(cid cid.Cid) (bool, error) {
|
func (b *idstore) Has(ctx context.Context, cid cid.Cid) (bool, error) {
|
||||||
inline, _, err := decodeCid(cid)
|
inline, _, err := decodeCid(cid)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, xerrors.Errorf("error decoding Cid: %w", err)
|
return false, xerrors.Errorf("error decoding Cid: %w", err)
|
||||||
@@ -48,10 +48,10 @@ func (b *idstore) Has(cid cid.Cid) (bool, error) {
|
|||||||
return true, nil
|
return true, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
return b.bs.Has(cid)
|
return b.bs.Has(ctx, cid)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *idstore) Get(cid cid.Cid) (blocks.Block, error) {
|
func (b *idstore) Get(ctx context.Context, cid cid.Cid) (blocks.Block, error) {
|
||||||
inline, data, err := decodeCid(cid)
|
inline, data, err := decodeCid(cid)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, xerrors.Errorf("error decoding Cid: %w", err)
|
return nil, xerrors.Errorf("error decoding Cid: %w", err)
|
||||||
@@ -61,10 +61,10 @@ func (b *idstore) Get(cid cid.Cid) (blocks.Block, error) {
|
|||||||
return blocks.NewBlockWithCid(data, cid)
|
return blocks.NewBlockWithCid(data, cid)
|
||||||
}
|
}
|
||||||
|
|
||||||
return b.bs.Get(cid)
|
return b.bs.Get(ctx, cid)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *idstore) GetSize(cid cid.Cid) (int, error) {
|
func (b *idstore) GetSize(ctx context.Context, cid cid.Cid) (int, error) {
|
||||||
inline, data, err := decodeCid(cid)
|
inline, data, err := decodeCid(cid)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, xerrors.Errorf("error decoding Cid: %w", err)
|
return 0, xerrors.Errorf("error decoding Cid: %w", err)
|
||||||
@@ -74,10 +74,10 @@ func (b *idstore) GetSize(cid cid.Cid) (int, error) {
|
|||||||
return len(data), err
|
return len(data), err
|
||||||
}
|
}
|
||||||
|
|
||||||
return b.bs.GetSize(cid)
|
return b.bs.GetSize(ctx, cid)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *idstore) View(cid cid.Cid, cb func([]byte) error) error {
|
func (b *idstore) View(ctx context.Context, cid cid.Cid, cb func([]byte) error) error {
|
||||||
inline, data, err := decodeCid(cid)
|
inline, data, err := decodeCid(cid)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return xerrors.Errorf("error decoding Cid: %w", err)
|
return xerrors.Errorf("error decoding Cid: %w", err)
|
||||||
@@ -87,10 +87,10 @@ func (b *idstore) View(cid cid.Cid, cb func([]byte) error) error {
|
|||||||
return cb(data)
|
return cb(data)
|
||||||
}
|
}
|
||||||
|
|
||||||
return b.bs.View(cid, cb)
|
return b.bs.View(ctx, cid, cb)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *idstore) Put(blk blocks.Block) error {
|
func (b *idstore) Put(ctx context.Context, blk blocks.Block) error {
|
||||||
inline, _, err := decodeCid(blk.Cid())
|
inline, _, err := decodeCid(blk.Cid())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return xerrors.Errorf("error decoding Cid: %w", err)
|
return xerrors.Errorf("error decoding Cid: %w", err)
|
||||||
@@ -100,10 +100,10 @@ func (b *idstore) Put(blk blocks.Block) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
return b.bs.Put(blk)
|
return b.bs.Put(ctx, blk)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *idstore) PutMany(blks []blocks.Block) error {
|
func (b *idstore) PutMany(ctx context.Context, blks []blocks.Block) error {
|
||||||
toPut := make([]blocks.Block, 0, len(blks))
|
toPut := make([]blocks.Block, 0, len(blks))
|
||||||
for _, blk := range blks {
|
for _, blk := range blks {
|
||||||
inline, _, err := decodeCid(blk.Cid())
|
inline, _, err := decodeCid(blk.Cid())
|
||||||
@@ -118,13 +118,13 @@ func (b *idstore) PutMany(blks []blocks.Block) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if len(toPut) > 0 {
|
if len(toPut) > 0 {
|
||||||
return b.bs.PutMany(toPut)
|
return b.bs.PutMany(ctx, toPut)
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *idstore) DeleteBlock(cid cid.Cid) error {
|
func (b *idstore) DeleteBlock(ctx context.Context, cid cid.Cid) error {
|
||||||
inline, _, err := decodeCid(cid)
|
inline, _, err := decodeCid(cid)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return xerrors.Errorf("error decoding Cid: %w", err)
|
return xerrors.Errorf("error decoding Cid: %w", err)
|
||||||
@@ -134,10 +134,10 @@ func (b *idstore) DeleteBlock(cid cid.Cid) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
return b.bs.DeleteBlock(cid)
|
return b.bs.DeleteBlock(ctx, cid)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *idstore) DeleteMany(cids []cid.Cid) error {
|
func (b *idstore) DeleteMany(ctx context.Context, cids []cid.Cid) error {
|
||||||
toDelete := make([]cid.Cid, 0, len(cids))
|
toDelete := make([]cid.Cid, 0, len(cids))
|
||||||
for _, cid := range cids {
|
for _, cid := range cids {
|
||||||
inline, _, err := decodeCid(cid)
|
inline, _, err := decodeCid(cid)
|
||||||
@@ -152,7 +152,7 @@ func (b *idstore) DeleteMany(cids []cid.Cid) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if len(toDelete) > 0 {
|
if len(toDelete) > 0 {
|
||||||
return b.bs.DeleteMany(toDelete)
|
return b.bs.DeleteMany(ctx, toDelete)
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
+11
-11
@@ -79,12 +79,12 @@ func NewRemoteIPFSBlockstore(ctx context.Context, maddr multiaddr.Multiaddr, onl
|
|||||||
return Adapt(bs), nil
|
return Adapt(bs), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *IPFSBlockstore) DeleteBlock(cid cid.Cid) error {
|
func (i *IPFSBlockstore) DeleteBlock(ctx context.Context, cid cid.Cid) error {
|
||||||
return xerrors.Errorf("not supported")
|
return xerrors.Errorf("not supported")
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *IPFSBlockstore) Has(cid cid.Cid) (bool, error) {
|
func (i *IPFSBlockstore) Has(ctx context.Context, cid cid.Cid) (bool, error) {
|
||||||
_, err := i.offlineAPI.Block().Stat(i.ctx, path.IpldPath(cid))
|
_, err := i.offlineAPI.Block().Stat(ctx, path.IpldPath(cid))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// The underlying client is running in Offline mode.
|
// The underlying client is running in Offline mode.
|
||||||
// Stat() will fail with an err if the block isn't in the
|
// Stat() will fail with an err if the block isn't in the
|
||||||
@@ -99,8 +99,8 @@ func (i *IPFSBlockstore) Has(cid cid.Cid) (bool, error) {
|
|||||||
return true, nil
|
return true, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *IPFSBlockstore) Get(cid cid.Cid) (blocks.Block, error) {
|
func (i *IPFSBlockstore) Get(ctx context.Context, cid cid.Cid) (blocks.Block, error) {
|
||||||
rd, err := i.api.Block().Get(i.ctx, path.IpldPath(cid))
|
rd, err := i.api.Block().Get(ctx, path.IpldPath(cid))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, xerrors.Errorf("getting ipfs block: %w", err)
|
return nil, xerrors.Errorf("getting ipfs block: %w", err)
|
||||||
}
|
}
|
||||||
@@ -113,8 +113,8 @@ func (i *IPFSBlockstore) Get(cid cid.Cid) (blocks.Block, error) {
|
|||||||
return blocks.NewBlockWithCid(data, cid)
|
return blocks.NewBlockWithCid(data, cid)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *IPFSBlockstore) GetSize(cid cid.Cid) (int, error) {
|
func (i *IPFSBlockstore) GetSize(ctx context.Context, cid cid.Cid) (int, error) {
|
||||||
st, err := i.api.Block().Stat(i.ctx, path.IpldPath(cid))
|
st, err := i.api.Block().Stat(ctx, path.IpldPath(cid))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, xerrors.Errorf("getting ipfs block: %w", err)
|
return 0, xerrors.Errorf("getting ipfs block: %w", err)
|
||||||
}
|
}
|
||||||
@@ -122,23 +122,23 @@ func (i *IPFSBlockstore) GetSize(cid cid.Cid) (int, error) {
|
|||||||
return st.Size(), nil
|
return st.Size(), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *IPFSBlockstore) Put(block blocks.Block) error {
|
func (i *IPFSBlockstore) Put(ctx context.Context, block blocks.Block) error {
|
||||||
mhd, err := multihash.Decode(block.Cid().Hash())
|
mhd, err := multihash.Decode(block.Cid().Hash())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err = i.api.Block().Put(i.ctx, bytes.NewReader(block.RawData()),
|
_, err = i.api.Block().Put(ctx, bytes.NewReader(block.RawData()),
|
||||||
options.Block.Hash(mhd.Code, mhd.Length),
|
options.Block.Hash(mhd.Code, mhd.Length),
|
||||||
options.Block.Format(cid.CodecToStr[block.Cid().Type()]))
|
options.Block.Format(cid.CodecToStr[block.Cid().Type()]))
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *IPFSBlockstore) PutMany(blocks []blocks.Block) error {
|
func (i *IPFSBlockstore) PutMany(ctx context.Context, blocks []blocks.Block) error {
|
||||||
// TODO: could be done in parallel
|
// TODO: could be done in parallel
|
||||||
|
|
||||||
for _, block := range blocks {
|
for _, block := range blocks {
|
||||||
if err := i.Put(block); err != nil {
|
if err := i.Put(ctx, block); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+9
-9
@@ -15,24 +15,24 @@ func NewMemory() MemBlockstore {
|
|||||||
// MemBlockstore is a terminal blockstore that keeps blocks in memory.
|
// MemBlockstore is a terminal blockstore that keeps blocks in memory.
|
||||||
type MemBlockstore map[cid.Cid]blocks.Block
|
type MemBlockstore map[cid.Cid]blocks.Block
|
||||||
|
|
||||||
func (m MemBlockstore) DeleteBlock(k cid.Cid) error {
|
func (m MemBlockstore) DeleteBlock(ctx context.Context, k cid.Cid) error {
|
||||||
delete(m, k)
|
delete(m, k)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m MemBlockstore) DeleteMany(ks []cid.Cid) error {
|
func (m MemBlockstore) DeleteMany(ctx context.Context, ks []cid.Cid) error {
|
||||||
for _, k := range ks {
|
for _, k := range ks {
|
||||||
delete(m, k)
|
delete(m, k)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m MemBlockstore) Has(k cid.Cid) (bool, error) {
|
func (m MemBlockstore) Has(ctx context.Context, k cid.Cid) (bool, error) {
|
||||||
_, ok := m[k]
|
_, ok := m[k]
|
||||||
return ok, nil
|
return ok, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m MemBlockstore) View(k cid.Cid, callback func([]byte) error) error {
|
func (m MemBlockstore) View(ctx context.Context, k cid.Cid, callback func([]byte) error) error {
|
||||||
b, ok := m[k]
|
b, ok := m[k]
|
||||||
if !ok {
|
if !ok {
|
||||||
return ErrNotFound
|
return ErrNotFound
|
||||||
@@ -40,7 +40,7 @@ func (m MemBlockstore) View(k cid.Cid, callback func([]byte) error) error {
|
|||||||
return callback(b.RawData())
|
return callback(b.RawData())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m MemBlockstore) Get(k cid.Cid) (blocks.Block, error) {
|
func (m MemBlockstore) Get(ctx context.Context, k cid.Cid) (blocks.Block, error) {
|
||||||
b, ok := m[k]
|
b, ok := m[k]
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, ErrNotFound
|
return nil, ErrNotFound
|
||||||
@@ -49,7 +49,7 @@ func (m MemBlockstore) Get(k cid.Cid) (blocks.Block, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// GetSize returns the CIDs mapped BlockSize
|
// GetSize returns the CIDs mapped BlockSize
|
||||||
func (m MemBlockstore) GetSize(k cid.Cid) (int, error) {
|
func (m MemBlockstore) GetSize(ctx context.Context, k cid.Cid) (int, error) {
|
||||||
b, ok := m[k]
|
b, ok := m[k]
|
||||||
if !ok {
|
if !ok {
|
||||||
return 0, ErrNotFound
|
return 0, ErrNotFound
|
||||||
@@ -58,7 +58,7 @@ func (m MemBlockstore) GetSize(k cid.Cid) (int, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Put puts a given block to the underlying datastore
|
// Put puts a given block to the underlying datastore
|
||||||
func (m MemBlockstore) Put(b blocks.Block) error {
|
func (m MemBlockstore) Put(ctx context.Context, b blocks.Block) error {
|
||||||
// Convert to a basic block for safety, but try to reuse the existing
|
// Convert to a basic block for safety, but try to reuse the existing
|
||||||
// block if it's already a basic block.
|
// block if it's already a basic block.
|
||||||
k := b.Cid()
|
k := b.Cid()
|
||||||
@@ -76,9 +76,9 @@ func (m MemBlockstore) Put(b blocks.Block) error {
|
|||||||
|
|
||||||
// PutMany puts a slice of blocks at the same time using batching
|
// PutMany puts a slice of blocks at the same time using batching
|
||||||
// capabilities of the underlying datastore whenever possible.
|
// capabilities of the underlying datastore whenever possible.
|
||||||
func (m MemBlockstore) PutMany(bs []blocks.Block) error {
|
func (m MemBlockstore) PutMany(ctx context.Context, bs []blocks.Block) error {
|
||||||
for _, b := range bs {
|
for _, b := range bs {
|
||||||
_ = m.Put(b) // can't fail
|
_ = m.Put(ctx, b) // can't fail
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,10 +49,11 @@ These are options in the `[Chainstore.Splitstore]` section of the configuration:
|
|||||||
blockstore and discards writes; this is necessary to support syncing from a snapshot.
|
blockstore and discards writes; this is necessary to support syncing from a snapshot.
|
||||||
- `MarkSetType` -- specifies the type of markset to use during compaction.
|
- `MarkSetType` -- specifies the type of markset to use during compaction.
|
||||||
The markset is the data structure used by compaction/gc to track live objects.
|
The markset is the data structure used by compaction/gc to track live objects.
|
||||||
The default value is `"map"`, which will use an in-memory map; if you are limited
|
The default value is "badger", which will use a disk backed markset using badger.
|
||||||
in memory (or indeed see compaction run out of memory), you can also specify
|
If you have a lot of memory (48G or more) you can also use "map", which will use
|
||||||
`"badger"` which will use an disk backed markset, using badger. This will use
|
an in memory markset, speeding up compaction at the cost of higher memory usage.
|
||||||
much less memory, but will also make compaction slower.
|
Note: If you are using a VPS with a network volume, you need to provision at least
|
||||||
|
3000 IOPs with the badger markset.
|
||||||
- `HotStoreMessageRetention` -- specifies how many finalities, beyond the 4
|
- `HotStoreMessageRetention` -- specifies how many finalities, beyond the 4
|
||||||
finalities maintained by default, to maintain messages and message receipts in the
|
finalities maintained by default, to maintain messages and message receipts in the
|
||||||
hotstore. This is useful for assistive nodes that want to support syncing for other
|
hotstore. This is useful for assistive nodes that want to support syncing for other
|
||||||
@@ -105,6 +106,12 @@ Compaction works transactionally with the following algorithm:
|
|||||||
- We delete in small batches taking a lock; each batch is checked again for marks, from the concurrent transactional mark, so as to never delete anything live
|
- We delete in small batches taking a lock; each batch is checked again for marks, from the concurrent transactional mark, so as to never delete anything live
|
||||||
- We then end the transaction and compact/gc the hotstore.
|
- We then end the transaction and compact/gc the hotstore.
|
||||||
|
|
||||||
|
As of [#8008](https://github.com/filecoin-project/lotus/pull/8008) the compaction algorithm has been
|
||||||
|
modified to eliminate sorting and maintain the cold object set on disk. This drastically reduces
|
||||||
|
memory usage; in fact, when using badger as the markset compaction uses very little memory, and
|
||||||
|
it should be now possible to run splitstore with 32GB of RAM or less without danger of running out of
|
||||||
|
memory during compaction.
|
||||||
|
|
||||||
## Garbage Collection
|
## Garbage Collection
|
||||||
|
|
||||||
TBD -- see [#6577](https://github.com/filecoin-project/lotus/issues/6577)
|
TBD -- see [#6577](https://github.com/filecoin-project/lotus/issues/6577)
|
||||||
|
|||||||
@@ -0,0 +1,118 @@
|
|||||||
|
package splitstore
|
||||||
|
|
||||||
|
import (
|
||||||
|
"bufio"
|
||||||
|
"io"
|
||||||
|
"os"
|
||||||
|
|
||||||
|
"golang.org/x/xerrors"
|
||||||
|
|
||||||
|
cid "github.com/ipfs/go-cid"
|
||||||
|
mh "github.com/multiformats/go-multihash"
|
||||||
|
)
|
||||||
|
|
||||||
|
type Checkpoint struct {
|
||||||
|
file *os.File
|
||||||
|
buf *bufio.Writer
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewCheckpoint(path string) (*Checkpoint, error) {
|
||||||
|
file, err := os.OpenFile(path, os.O_CREATE|os.O_TRUNC|os.O_WRONLY|os.O_SYNC, 0644)
|
||||||
|
if err != nil {
|
||||||
|
return nil, xerrors.Errorf("error creating checkpoint: %w", err)
|
||||||
|
}
|
||||||
|
buf := bufio.NewWriter(file)
|
||||||
|
|
||||||
|
return &Checkpoint{
|
||||||
|
file: file,
|
||||||
|
buf: buf,
|
||||||
|
}, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func OpenCheckpoint(path string) (*Checkpoint, cid.Cid, error) {
|
||||||
|
filein, err := os.Open(path)
|
||||||
|
if err != nil {
|
||||||
|
return nil, cid.Undef, xerrors.Errorf("error opening checkpoint for reading: %w", err)
|
||||||
|
}
|
||||||
|
defer filein.Close() //nolint:errcheck
|
||||||
|
|
||||||
|
bufin := bufio.NewReader(filein)
|
||||||
|
start, err := readRawCid(bufin, nil)
|
||||||
|
if err != nil && err != io.EOF {
|
||||||
|
return nil, cid.Undef, xerrors.Errorf("error reading cid from checkpoint: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
fileout, err := os.OpenFile(path, os.O_WRONLY|os.O_SYNC, 0644)
|
||||||
|
if err != nil {
|
||||||
|
return nil, cid.Undef, xerrors.Errorf("error opening checkpoint for writing: %w", err)
|
||||||
|
}
|
||||||
|
bufout := bufio.NewWriter(fileout)
|
||||||
|
|
||||||
|
return &Checkpoint{
|
||||||
|
file: fileout,
|
||||||
|
buf: bufout,
|
||||||
|
}, start, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (cp *Checkpoint) Set(c cid.Cid) error {
|
||||||
|
if _, err := cp.file.Seek(0, io.SeekStart); err != nil {
|
||||||
|
return xerrors.Errorf("error seeking beginning of checkpoint: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := writeRawCid(cp.buf, c, true); err != nil {
|
||||||
|
return xerrors.Errorf("error writing cid to checkpoint: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (cp *Checkpoint) Close() error {
|
||||||
|
if cp.file == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
err := cp.file.Close()
|
||||||
|
cp.file = nil
|
||||||
|
cp.buf = nil
|
||||||
|
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
func readRawCid(buf *bufio.Reader, hbuf []byte) (cid.Cid, error) {
|
||||||
|
sz, err := buf.ReadByte()
|
||||||
|
if err != nil {
|
||||||
|
return cid.Undef, err // don't wrap EOF as it is not an error here
|
||||||
|
}
|
||||||
|
|
||||||
|
if hbuf == nil {
|
||||||
|
hbuf = make([]byte, int(sz))
|
||||||
|
} else {
|
||||||
|
hbuf = hbuf[:int(sz)]
|
||||||
|
}
|
||||||
|
|
||||||
|
if _, err := io.ReadFull(buf, hbuf); err != nil {
|
||||||
|
return cid.Undef, xerrors.Errorf("error reading hash: %w", err) // wrap EOF, it's corrupt
|
||||||
|
}
|
||||||
|
|
||||||
|
hash, err := mh.Cast(hbuf)
|
||||||
|
if err != nil {
|
||||||
|
return cid.Undef, xerrors.Errorf("error casting multihash: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
return cid.NewCidV1(cid.Raw, hash), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func writeRawCid(buf *bufio.Writer, c cid.Cid, flush bool) error {
|
||||||
|
hash := c.Hash()
|
||||||
|
if err := buf.WriteByte(byte(len(hash))); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if _, err := buf.Write(hash); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if flush {
|
||||||
|
return buf.Flush()
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
@@ -0,0 +1,138 @@
|
|||||||
|
package splitstore
|
||||||
|
|
||||||
|
import (
|
||||||
|
"path/filepath"
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
"github.com/ipfs/go-cid"
|
||||||
|
"github.com/multiformats/go-multihash"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestCheckpoint(t *testing.T) {
|
||||||
|
dir := t.TempDir()
|
||||||
|
|
||||||
|
path := filepath.Join(dir, "checkpoint")
|
||||||
|
|
||||||
|
makeCid := func(key string) cid.Cid {
|
||||||
|
h, err := multihash.Sum([]byte(key), multihash.SHA2_256, -1)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
return cid.NewCidV1(cid.Raw, h)
|
||||||
|
}
|
||||||
|
|
||||||
|
k1 := makeCid("a")
|
||||||
|
k2 := makeCid("b")
|
||||||
|
k3 := makeCid("c")
|
||||||
|
k4 := makeCid("d")
|
||||||
|
|
||||||
|
cp, err := NewCheckpoint(path)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := cp.Set(k1); err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
if err := cp.Set(k2); err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := cp.Close(); err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
cp, start, err := OpenCheckpoint(path)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
if !start.Equals(k2) {
|
||||||
|
t.Fatalf("expected start to be %s; got %s", k2, start)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := cp.Set(k3); err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
if err := cp.Set(k4); err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := cp.Close(); err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
cp, start, err = OpenCheckpoint(path)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
if !start.Equals(k4) {
|
||||||
|
t.Fatalf("expected start to be %s; got %s", k4, start)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := cp.Close(); err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
// also test correct operation with an empty checkpoint
|
||||||
|
cp, err = NewCheckpoint(path)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := cp.Close(); err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
cp, start, err = OpenCheckpoint(path)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if start.Defined() {
|
||||||
|
t.Fatal("expected start to be undefined")
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := cp.Set(k1); err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
if err := cp.Set(k2); err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := cp.Close(); err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
cp, start, err = OpenCheckpoint(path)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
if !start.Equals(k2) {
|
||||||
|
t.Fatalf("expected start to be %s; got %s", k2, start)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := cp.Set(k3); err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
if err := cp.Set(k4); err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := cp.Close(); err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
cp, start, err = OpenCheckpoint(path)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
if !start.Equals(k4) {
|
||||||
|
t.Fatalf("expected start to be %s; got %s", k4, start)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := cp.Close(); err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,102 @@
|
|||||||
|
package splitstore
|
||||||
|
|
||||||
|
import (
|
||||||
|
"bufio"
|
||||||
|
"io"
|
||||||
|
"os"
|
||||||
|
|
||||||
|
"golang.org/x/xerrors"
|
||||||
|
|
||||||
|
cid "github.com/ipfs/go-cid"
|
||||||
|
)
|
||||||
|
|
||||||
|
type ColdSetWriter struct {
|
||||||
|
file *os.File
|
||||||
|
buf *bufio.Writer
|
||||||
|
}
|
||||||
|
|
||||||
|
type ColdSetReader struct {
|
||||||
|
file *os.File
|
||||||
|
buf *bufio.Reader
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewColdSetWriter(path string) (*ColdSetWriter, error) {
|
||||||
|
file, err := os.OpenFile(path, os.O_CREATE|os.O_TRUNC|os.O_WRONLY, 0644)
|
||||||
|
if err != nil {
|
||||||
|
return nil, xerrors.Errorf("error creating coldset: %w", err)
|
||||||
|
}
|
||||||
|
buf := bufio.NewWriter(file)
|
||||||
|
|
||||||
|
return &ColdSetWriter{
|
||||||
|
file: file,
|
||||||
|
buf: buf,
|
||||||
|
}, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewColdSetReader(path string) (*ColdSetReader, error) {
|
||||||
|
file, err := os.Open(path)
|
||||||
|
if err != nil {
|
||||||
|
return nil, xerrors.Errorf("error opening coldset: %w", err)
|
||||||
|
}
|
||||||
|
buf := bufio.NewReader(file)
|
||||||
|
|
||||||
|
return &ColdSetReader{
|
||||||
|
file: file,
|
||||||
|
buf: buf,
|
||||||
|
}, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *ColdSetWriter) Write(c cid.Cid) error {
|
||||||
|
return writeRawCid(s.buf, c, false)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *ColdSetWriter) Close() error {
|
||||||
|
if s.file == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
err1 := s.buf.Flush()
|
||||||
|
err2 := s.file.Close()
|
||||||
|
s.buf = nil
|
||||||
|
s.file = nil
|
||||||
|
|
||||||
|
if err1 != nil {
|
||||||
|
return err1
|
||||||
|
}
|
||||||
|
return err2
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *ColdSetReader) ForEach(f func(cid.Cid) error) error {
|
||||||
|
hbuf := make([]byte, 256)
|
||||||
|
for {
|
||||||
|
next, err := readRawCid(s.buf, hbuf)
|
||||||
|
if err != nil {
|
||||||
|
if err == io.EOF {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
return xerrors.Errorf("error reading coldset: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := f(next); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *ColdSetReader) Reset() error {
|
||||||
|
_, err := s.file.Seek(0, io.SeekStart)
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *ColdSetReader) Close() error {
|
||||||
|
if s.file == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
err := s.file.Close()
|
||||||
|
s.file = nil
|
||||||
|
s.buf = nil
|
||||||
|
|
||||||
|
return err
|
||||||
|
}
|
||||||
@@ -0,0 +1,90 @@
|
|||||||
|
package splitstore
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"path/filepath"
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
"github.com/ipfs/go-cid"
|
||||||
|
"github.com/multiformats/go-multihash"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestColdSet(t *testing.T) {
|
||||||
|
dir := t.TempDir()
|
||||||
|
|
||||||
|
path := filepath.Join(dir, "coldset")
|
||||||
|
|
||||||
|
makeCid := func(i int) cid.Cid {
|
||||||
|
h, err := multihash.Sum([]byte(fmt.Sprintf("cid.%d", i)), multihash.SHA2_256, -1)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
return cid.NewCidV1(cid.Raw, h)
|
||||||
|
}
|
||||||
|
|
||||||
|
const count = 1000
|
||||||
|
cids := make([]cid.Cid, 0, count)
|
||||||
|
for i := 0; i < count; i++ {
|
||||||
|
cids = append(cids, makeCid(i))
|
||||||
|
}
|
||||||
|
|
||||||
|
cw, err := NewColdSetWriter(path)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, c := range cids {
|
||||||
|
if err := cw.Write(c); err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := cw.Close(); err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
cr, err := NewColdSetReader(path)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
index := 0
|
||||||
|
err = cr.ForEach(func(c cid.Cid) error {
|
||||||
|
if index >= count {
|
||||||
|
t.Fatal("too many cids")
|
||||||
|
}
|
||||||
|
|
||||||
|
if !c.Equals(cids[index]) {
|
||||||
|
t.Fatalf("wrong cid %d; expected %s but got %s", index, cids[index], c)
|
||||||
|
}
|
||||||
|
|
||||||
|
index++
|
||||||
|
return nil
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := cr.Reset(); err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
index = 0
|
||||||
|
err = cr.ForEach(func(c cid.Cid) error {
|
||||||
|
if index >= count {
|
||||||
|
t.Fatal("too many cids")
|
||||||
|
}
|
||||||
|
|
||||||
|
if !c.Equals(cids[index]) {
|
||||||
|
t.Fatalf("wrong cid; expected %s but got %s", cids[index], c)
|
||||||
|
}
|
||||||
|
|
||||||
|
index++
|
||||||
|
return nil
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -10,39 +10,36 @@ import (
|
|||||||
|
|
||||||
var errMarkSetClosed = errors.New("markset closed")
|
var errMarkSetClosed = errors.New("markset closed")
|
||||||
|
|
||||||
// MarkSet is a utility to keep track of seen CID, and later query for them.
|
// MarkSet is an interface for tracking CIDs during chain and object walks
|
||||||
//
|
|
||||||
// * If the expected dataset is large, it can be backed by a datastore (e.g. bbolt).
|
|
||||||
// * If a probabilistic result is acceptable, it can be backed by a bloom filter
|
|
||||||
type MarkSet interface {
|
type MarkSet interface {
|
||||||
|
ObjectVisitor
|
||||||
Mark(cid.Cid) error
|
Mark(cid.Cid) error
|
||||||
|
MarkMany([]cid.Cid) error
|
||||||
Has(cid.Cid) (bool, error)
|
Has(cid.Cid) (bool, error)
|
||||||
Close() error
|
Close() error
|
||||||
SetConcurrent()
|
|
||||||
}
|
|
||||||
|
|
||||||
type MarkSetVisitor interface {
|
// BeginCriticalSection ensures that the markset is persisted to disk for recovery in case
|
||||||
MarkSet
|
// of abnormal termination during the critical section span.
|
||||||
ObjectVisitor
|
BeginCriticalSection() error
|
||||||
|
// EndCriticalSection ends the critical section span.
|
||||||
|
EndCriticalSection()
|
||||||
}
|
}
|
||||||
|
|
||||||
type MarkSetEnv interface {
|
type MarkSetEnv interface {
|
||||||
// Create creates a new markset within the environment.
|
// New creates a new markset within the environment.
|
||||||
// name is a unique name for this markset, mapped to the filesystem in disk-backed environments
|
// name is a unique name for this markset, mapped to the filesystem for on-disk persistence.
|
||||||
// sizeHint is a hint about the expected size of the markset
|
// sizeHint is a hint about the expected size of the markset
|
||||||
Create(name string, sizeHint int64) (MarkSet, error)
|
New(name string, sizeHint int64) (MarkSet, error)
|
||||||
// CreateVisitor is like Create, but returns a wider interface that supports atomic visits.
|
// Recover recovers an existing markset persisted on-disk.
|
||||||
// It may not be supported by some markset types (e.g. bloom).
|
Recover(name string) (MarkSet, error)
|
||||||
CreateVisitor(name string, sizeHint int64) (MarkSetVisitor, error)
|
// Close closes the markset
|
||||||
// SupportsVisitor returns true if the marksets created by this environment support the visitor interface.
|
|
||||||
SupportsVisitor() bool
|
|
||||||
Close() error
|
Close() error
|
||||||
}
|
}
|
||||||
|
|
||||||
func OpenMarkSetEnv(path string, mtype string) (MarkSetEnv, error) {
|
func OpenMarkSetEnv(path string, mtype string) (MarkSetEnv, error) {
|
||||||
switch mtype {
|
switch mtype {
|
||||||
case "map":
|
case "map":
|
||||||
return NewMapMarkSetEnv()
|
return NewMapMarkSetEnv(path)
|
||||||
case "badger":
|
case "badger":
|
||||||
return NewBadgerMarkSetEnv(path)
|
return NewBadgerMarkSetEnv(path)
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package splitstore
|
|||||||
import (
|
import (
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"runtime"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"golang.org/x/xerrors"
|
"golang.org/x/xerrors"
|
||||||
@@ -28,13 +29,13 @@ type BadgerMarkSet struct {
|
|||||||
writers int
|
writers int
|
||||||
seqno int
|
seqno int
|
||||||
version int
|
version int
|
||||||
|
persist bool
|
||||||
|
|
||||||
db *badger.DB
|
db *badger.DB
|
||||||
path string
|
path string
|
||||||
}
|
}
|
||||||
|
|
||||||
var _ MarkSet = (*BadgerMarkSet)(nil)
|
var _ MarkSet = (*BadgerMarkSet)(nil)
|
||||||
var _ MarkSetVisitor = (*BadgerMarkSet)(nil)
|
|
||||||
|
|
||||||
var badgerMarkSetBatchSize = 16384
|
var badgerMarkSetBatchSize = 16384
|
||||||
|
|
||||||
@@ -48,11 +49,10 @@ func NewBadgerMarkSetEnv(path string) (MarkSetEnv, error) {
|
|||||||
return &BadgerMarkSetEnv{path: msPath}, nil
|
return &BadgerMarkSetEnv{path: msPath}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (e *BadgerMarkSetEnv) create(name string, sizeHint int64) (*BadgerMarkSet, error) {
|
func (e *BadgerMarkSetEnv) New(name string, sizeHint int64) (MarkSet, error) {
|
||||||
name += ".tmp"
|
|
||||||
path := filepath.Join(e.path, name)
|
path := filepath.Join(e.path, name)
|
||||||
|
|
||||||
db, err := openTransientBadgerDB(path)
|
db, err := openBadgerDB(path, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, xerrors.Errorf("error creating badger db: %w", err)
|
return nil, xerrors.Errorf("error creating badger db: %w", err)
|
||||||
}
|
}
|
||||||
@@ -68,18 +68,72 @@ func (e *BadgerMarkSetEnv) create(name string, sizeHint int64) (*BadgerMarkSet,
|
|||||||
return ms, nil
|
return ms, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (e *BadgerMarkSetEnv) Create(name string, sizeHint int64) (MarkSet, error) {
|
func (e *BadgerMarkSetEnv) Recover(name string) (MarkSet, error) {
|
||||||
return e.create(name, sizeHint)
|
path := filepath.Join(e.path, name)
|
||||||
}
|
|
||||||
|
|
||||||
func (e *BadgerMarkSetEnv) CreateVisitor(name string, sizeHint int64) (MarkSetVisitor, error) {
|
if _, err := os.Stat(path); err != nil {
|
||||||
return e.create(name, sizeHint)
|
return nil, xerrors.Errorf("error stating badger db path: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (e *BadgerMarkSetEnv) SupportsVisitor() bool { return true }
|
db, err := openBadgerDB(path, true)
|
||||||
|
if err != nil {
|
||||||
|
return nil, xerrors.Errorf("error creating badger db: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
ms := &BadgerMarkSet{
|
||||||
|
pend: make(map[string]struct{}),
|
||||||
|
writing: make(map[int]map[string]struct{}),
|
||||||
|
db: db,
|
||||||
|
path: path,
|
||||||
|
persist: true,
|
||||||
|
}
|
||||||
|
ms.cond.L = &ms.mx
|
||||||
|
|
||||||
|
return ms, nil
|
||||||
|
}
|
||||||
|
|
||||||
func (e *BadgerMarkSetEnv) Close() error {
|
func (e *BadgerMarkSetEnv) Close() error {
|
||||||
return os.RemoveAll(e.path)
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *BadgerMarkSet) BeginCriticalSection() error {
|
||||||
|
s.mx.Lock()
|
||||||
|
|
||||||
|
if s.persist {
|
||||||
|
s.mx.Unlock()
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
var write bool
|
||||||
|
var seqno int
|
||||||
|
if len(s.pend) > 0 {
|
||||||
|
write = true
|
||||||
|
seqno = s.nextBatch()
|
||||||
|
}
|
||||||
|
|
||||||
|
s.persist = true
|
||||||
|
s.mx.Unlock()
|
||||||
|
|
||||||
|
if write {
|
||||||
|
// all writes sync once perist is true
|
||||||
|
return s.write(seqno)
|
||||||
|
}
|
||||||
|
|
||||||
|
// wait for any pending writes and sync
|
||||||
|
s.mx.Lock()
|
||||||
|
for s.writers > 0 {
|
||||||
|
s.cond.Wait()
|
||||||
|
}
|
||||||
|
s.mx.Unlock()
|
||||||
|
|
||||||
|
return s.db.Sync()
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *BadgerMarkSet) EndCriticalSection() {
|
||||||
|
s.mx.Lock()
|
||||||
|
defer s.mx.Unlock()
|
||||||
|
|
||||||
|
s.persist = false
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *BadgerMarkSet) Mark(c cid.Cid) error {
|
func (s *BadgerMarkSet) Mark(c cid.Cid) error {
|
||||||
@@ -99,6 +153,23 @@ func (s *BadgerMarkSet) Mark(c cid.Cid) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *BadgerMarkSet) MarkMany(batch []cid.Cid) error {
|
||||||
|
s.mx.Lock()
|
||||||
|
if s.pend == nil {
|
||||||
|
s.mx.Unlock()
|
||||||
|
return errMarkSetClosed
|
||||||
|
}
|
||||||
|
|
||||||
|
write, seqno := s.putMany(batch)
|
||||||
|
s.mx.Unlock()
|
||||||
|
|
||||||
|
if write {
|
||||||
|
return s.write(seqno)
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
func (s *BadgerMarkSet) Has(c cid.Cid) (bool, error) {
|
func (s *BadgerMarkSet) Has(c cid.Cid) (bool, error) {
|
||||||
s.mx.RLock()
|
s.mx.RLock()
|
||||||
defer s.mx.RUnlock()
|
defer s.mx.RUnlock()
|
||||||
@@ -204,16 +275,34 @@ func (s *BadgerMarkSet) tryDB(key []byte) (has bool, err error) {
|
|||||||
// writer holds the exclusive lock
|
// writer holds the exclusive lock
|
||||||
func (s *BadgerMarkSet) put(key string) (write bool, seqno int) {
|
func (s *BadgerMarkSet) put(key string) (write bool, seqno int) {
|
||||||
s.pend[key] = struct{}{}
|
s.pend[key] = struct{}{}
|
||||||
if len(s.pend) < badgerMarkSetBatchSize {
|
if !s.persist && len(s.pend) < badgerMarkSetBatchSize {
|
||||||
return false, 0
|
return false, 0
|
||||||
}
|
}
|
||||||
|
|
||||||
seqno = s.seqno
|
seqno = s.nextBatch()
|
||||||
|
return true, seqno
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *BadgerMarkSet) putMany(batch []cid.Cid) (write bool, seqno int) {
|
||||||
|
for _, c := range batch {
|
||||||
|
key := string(c.Hash())
|
||||||
|
s.pend[key] = struct{}{}
|
||||||
|
}
|
||||||
|
|
||||||
|
if !s.persist && len(s.pend) < badgerMarkSetBatchSize {
|
||||||
|
return false, 0
|
||||||
|
}
|
||||||
|
|
||||||
|
seqno = s.nextBatch()
|
||||||
|
return true, seqno
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *BadgerMarkSet) nextBatch() int {
|
||||||
|
seqno := s.seqno
|
||||||
s.seqno++
|
s.seqno++
|
||||||
s.writing[seqno] = s.pend
|
s.writing[seqno] = s.pend
|
||||||
s.pend = make(map[string]struct{})
|
s.pend = make(map[string]struct{})
|
||||||
|
return seqno
|
||||||
return true, seqno
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *BadgerMarkSet) write(seqno int) (err error) {
|
func (s *BadgerMarkSet) write(seqno int) (err error) {
|
||||||
@@ -258,6 +347,14 @@ func (s *BadgerMarkSet) write(seqno int) (err error) {
|
|||||||
return xerrors.Errorf("error flushing batch to badger markset: %w", err)
|
return xerrors.Errorf("error flushing batch to badger markset: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
s.mx.RLock()
|
||||||
|
persist := s.persist
|
||||||
|
s.mx.RUnlock()
|
||||||
|
|
||||||
|
if persist {
|
||||||
|
return s.db.Sync()
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -277,26 +374,29 @@ func (s *BadgerMarkSet) Close() error {
|
|||||||
db := s.db
|
db := s.db
|
||||||
s.db = nil
|
s.db = nil
|
||||||
|
|
||||||
return closeTransientBadgerDB(db, s.path)
|
return closeBadgerDB(db, s.path, s.persist)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *BadgerMarkSet) SetConcurrent() {}
|
func openBadgerDB(path string, recover bool) (*badger.DB, error) {
|
||||||
|
// if it is not a recovery, clean up first
|
||||||
|
if !recover {
|
||||||
|
err := os.RemoveAll(path)
|
||||||
|
if err != nil {
|
||||||
|
return nil, xerrors.Errorf("error clearing markset directory: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
func openTransientBadgerDB(path string) (*badger.DB, error) {
|
err = os.MkdirAll(path, 0755) //nolint:gosec
|
||||||
// clean up first
|
if err != nil {
|
||||||
err := os.RemoveAll(path)
|
return nil, xerrors.Errorf("error creating markset directory: %w", err)
|
||||||
if err != nil {
|
}
|
||||||
return nil, xerrors.Errorf("error clearing markset directory: %w", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
err = os.MkdirAll(path, 0755) //nolint:gosec
|
|
||||||
if err != nil {
|
|
||||||
return nil, xerrors.Errorf("error creating markset directory: %w", err)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
opts := badger.DefaultOptions(path)
|
opts := badger.DefaultOptions(path)
|
||||||
|
// we manually sync when we are in critical section
|
||||||
opts.SyncWrites = false
|
opts.SyncWrites = false
|
||||||
|
// no need to do that
|
||||||
opts.CompactL0OnClose = false
|
opts.CompactL0OnClose = false
|
||||||
|
// we store hashes, not much to gain by compression
|
||||||
opts.Compression = options.None
|
opts.Compression = options.None
|
||||||
// Note: We use FileIO for loading modes to avoid memory thrashing and interference
|
// Note: We use FileIO for loading modes to avoid memory thrashing and interference
|
||||||
// between the system blockstore and the markset.
|
// between the system blockstore and the markset.
|
||||||
@@ -305,6 +405,15 @@ func openTransientBadgerDB(path string) (*badger.DB, error) {
|
|||||||
// exceeded 1GB in size.
|
// exceeded 1GB in size.
|
||||||
opts.TableLoadingMode = options.FileIO
|
opts.TableLoadingMode = options.FileIO
|
||||||
opts.ValueLogLoadingMode = options.FileIO
|
opts.ValueLogLoadingMode = options.FileIO
|
||||||
|
// We increase the number of L0 tables before compaction to make it unlikely to
|
||||||
|
// be necessary.
|
||||||
|
opts.NumLevelZeroTables = 20 // default is 5
|
||||||
|
opts.NumLevelZeroTablesStall = 30 // default is 10
|
||||||
|
// increase the number of compactors from default 2 so that if we ever have to
|
||||||
|
// compact, it is fast
|
||||||
|
if runtime.NumCPU()/2 > opts.NumCompactors {
|
||||||
|
opts.NumCompactors = runtime.NumCPU() / 2
|
||||||
|
}
|
||||||
opts.Logger = &badgerLogger{
|
opts.Logger = &badgerLogger{
|
||||||
SugaredLogger: log.Desugar().WithOptions(zap.AddCallerSkip(1)).Sugar(),
|
SugaredLogger: log.Desugar().WithOptions(zap.AddCallerSkip(1)).Sugar(),
|
||||||
skip2: log.Desugar().WithOptions(zap.AddCallerSkip(2)).Sugar(),
|
skip2: log.Desugar().WithOptions(zap.AddCallerSkip(2)).Sugar(),
|
||||||
@@ -313,12 +422,16 @@ func openTransientBadgerDB(path string) (*badger.DB, error) {
|
|||||||
return badger.Open(opts)
|
return badger.Open(opts)
|
||||||
}
|
}
|
||||||
|
|
||||||
func closeTransientBadgerDB(db *badger.DB, path string) error {
|
func closeBadgerDB(db *badger.DB, path string, persist bool) error {
|
||||||
err := db.Close()
|
err := db.Close()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return xerrors.Errorf("error closing badger markset: %w", err)
|
return xerrors.Errorf("error closing badger markset: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if persist {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
err = os.RemoveAll(path)
|
err = os.RemoveAll(path)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return xerrors.Errorf("error deleting badger markset: %w", err)
|
return xerrors.Errorf("error deleting badger markset: %w", err)
|
||||||
|
|||||||
@@ -1,12 +1,20 @@
|
|||||||
package splitstore
|
package splitstore
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"bufio"
|
||||||
|
"io"
|
||||||
|
"os"
|
||||||
|
"path/filepath"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
|
"golang.org/x/xerrors"
|
||||||
|
|
||||||
cid "github.com/ipfs/go-cid"
|
cid "github.com/ipfs/go-cid"
|
||||||
)
|
)
|
||||||
|
|
||||||
type MapMarkSetEnv struct{}
|
type MapMarkSetEnv struct {
|
||||||
|
path string
|
||||||
|
}
|
||||||
|
|
||||||
var _ MarkSetEnv = (*MapMarkSetEnv)(nil)
|
var _ MarkSetEnv = (*MapMarkSetEnv)(nil)
|
||||||
|
|
||||||
@@ -14,55 +22,194 @@ type MapMarkSet struct {
|
|||||||
mx sync.RWMutex
|
mx sync.RWMutex
|
||||||
set map[string]struct{}
|
set map[string]struct{}
|
||||||
|
|
||||||
ts bool
|
persist bool
|
||||||
|
file *os.File
|
||||||
|
buf *bufio.Writer
|
||||||
|
|
||||||
|
path string
|
||||||
}
|
}
|
||||||
|
|
||||||
var _ MarkSet = (*MapMarkSet)(nil)
|
var _ MarkSet = (*MapMarkSet)(nil)
|
||||||
var _ MarkSetVisitor = (*MapMarkSet)(nil)
|
|
||||||
|
|
||||||
func NewMapMarkSetEnv() (*MapMarkSetEnv, error) {
|
func NewMapMarkSetEnv(path string) (*MapMarkSetEnv, error) {
|
||||||
return &MapMarkSetEnv{}, nil
|
msPath := filepath.Join(path, "markset.map")
|
||||||
|
err := os.MkdirAll(msPath, 0755) //nolint:gosec
|
||||||
|
if err != nil {
|
||||||
|
return nil, xerrors.Errorf("error creating markset directory: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
return &MapMarkSetEnv{path: msPath}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (e *MapMarkSetEnv) create(name string, sizeHint int64) (*MapMarkSet, error) {
|
func (e *MapMarkSetEnv) New(name string, sizeHint int64) (MarkSet, error) {
|
||||||
|
path := filepath.Join(e.path, name)
|
||||||
return &MapMarkSet{
|
return &MapMarkSet{
|
||||||
set: make(map[string]struct{}, sizeHint),
|
set: make(map[string]struct{}, sizeHint),
|
||||||
|
path: path,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (e *MapMarkSetEnv) Create(name string, sizeHint int64) (MarkSet, error) {
|
func (e *MapMarkSetEnv) Recover(name string) (MarkSet, error) {
|
||||||
return e.create(name, sizeHint)
|
path := filepath.Join(e.path, name)
|
||||||
}
|
s := &MapMarkSet{
|
||||||
|
set: make(map[string]struct{}),
|
||||||
|
path: path,
|
||||||
|
}
|
||||||
|
|
||||||
func (e *MapMarkSetEnv) CreateVisitor(name string, sizeHint int64) (MarkSetVisitor, error) {
|
in, err := os.Open(path)
|
||||||
return e.create(name, sizeHint)
|
if err != nil {
|
||||||
}
|
return nil, xerrors.Errorf("error opening markset file for read: %w", err)
|
||||||
|
}
|
||||||
|
defer in.Close() //nolint:errcheck
|
||||||
|
|
||||||
func (e *MapMarkSetEnv) SupportsVisitor() bool { return true }
|
// wrap a buffered reader to make this faster
|
||||||
|
buf := bufio.NewReader(in)
|
||||||
|
for {
|
||||||
|
var sz byte
|
||||||
|
if sz, err = buf.ReadByte(); err != nil {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
|
key := make([]byte, int(sz))
|
||||||
|
if _, err = io.ReadFull(buf, key); err != nil {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
|
s.set[string(key)] = struct{}{}
|
||||||
|
}
|
||||||
|
|
||||||
|
if err != io.EOF {
|
||||||
|
return nil, xerrors.Errorf("error reading markset file: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
file, err := os.OpenFile(s.path, os.O_WRONLY|os.O_APPEND, 0)
|
||||||
|
if err != nil {
|
||||||
|
return nil, xerrors.Errorf("error opening markset file for write: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
s.persist = true
|
||||||
|
s.file = file
|
||||||
|
s.buf = bufio.NewWriter(file)
|
||||||
|
|
||||||
|
return s, nil
|
||||||
|
}
|
||||||
|
|
||||||
func (e *MapMarkSetEnv) Close() error {
|
func (e *MapMarkSetEnv) Close() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *MapMarkSet) Mark(cid cid.Cid) error {
|
func (s *MapMarkSet) BeginCriticalSection() error {
|
||||||
if s.ts {
|
s.mx.Lock()
|
||||||
s.mx.Lock()
|
defer s.mx.Unlock()
|
||||||
defer s.mx.Unlock()
|
|
||||||
}
|
|
||||||
|
|
||||||
if s.set == nil {
|
if s.set == nil {
|
||||||
return errMarkSetClosed
|
return errMarkSetClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
s.set[string(cid.Hash())] = struct{}{}
|
if s.persist {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
file, err := os.OpenFile(s.path, os.O_CREATE|os.O_TRUNC|os.O_WRONLY, 0644)
|
||||||
|
if err != nil {
|
||||||
|
return xerrors.Errorf("error opening markset file: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
// wrap a buffered writer to make this faster
|
||||||
|
s.buf = bufio.NewWriter(file)
|
||||||
|
for key := range s.set {
|
||||||
|
if err := s.writeKey([]byte(key), false); err != nil {
|
||||||
|
_ = file.Close()
|
||||||
|
s.buf = nil
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if err := s.buf.Flush(); err != nil {
|
||||||
|
_ = file.Close()
|
||||||
|
s.buf = nil
|
||||||
|
return xerrors.Errorf("error flushing markset file buffer: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
s.file = file
|
||||||
|
s.persist = true
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *MapMarkSet) EndCriticalSection() {
|
||||||
|
s.mx.Lock()
|
||||||
|
defer s.mx.Unlock()
|
||||||
|
|
||||||
|
if !s.persist {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
_ = s.file.Close()
|
||||||
|
_ = os.Remove(s.path)
|
||||||
|
s.file = nil
|
||||||
|
s.buf = nil
|
||||||
|
s.persist = false
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *MapMarkSet) Mark(c cid.Cid) error {
|
||||||
|
s.mx.Lock()
|
||||||
|
defer s.mx.Unlock()
|
||||||
|
|
||||||
|
if s.set == nil {
|
||||||
|
return errMarkSetClosed
|
||||||
|
}
|
||||||
|
|
||||||
|
hash := c.Hash()
|
||||||
|
s.set[string(hash)] = struct{}{}
|
||||||
|
|
||||||
|
if s.persist {
|
||||||
|
if err := s.writeKey(hash, true); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := s.file.Sync(); err != nil {
|
||||||
|
return xerrors.Errorf("error syncing markset: %w", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *MapMarkSet) MarkMany(batch []cid.Cid) error {
|
||||||
|
s.mx.Lock()
|
||||||
|
defer s.mx.Unlock()
|
||||||
|
|
||||||
|
if s.set == nil {
|
||||||
|
return errMarkSetClosed
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, c := range batch {
|
||||||
|
hash := c.Hash()
|
||||||
|
s.set[string(hash)] = struct{}{}
|
||||||
|
|
||||||
|
if s.persist {
|
||||||
|
if err := s.writeKey(hash, false); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if s.persist {
|
||||||
|
if err := s.buf.Flush(); err != nil {
|
||||||
|
return xerrors.Errorf("error flushing markset buffer to disk: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := s.file.Sync(); err != nil {
|
||||||
|
return xerrors.Errorf("error syncing markset: %w", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *MapMarkSet) Has(cid cid.Cid) (bool, error) {
|
func (s *MapMarkSet) Has(cid cid.Cid) (bool, error) {
|
||||||
if s.ts {
|
s.mx.RLock()
|
||||||
s.mx.RLock()
|
defer s.mx.RUnlock()
|
||||||
defer s.mx.RUnlock()
|
|
||||||
}
|
|
||||||
|
|
||||||
if s.set == nil {
|
if s.set == nil {
|
||||||
return false, errMarkSetClosed
|
return false, errMarkSetClosed
|
||||||
@@ -73,33 +220,70 @@ func (s *MapMarkSet) Has(cid cid.Cid) (bool, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *MapMarkSet) Visit(c cid.Cid) (bool, error) {
|
func (s *MapMarkSet) Visit(c cid.Cid) (bool, error) {
|
||||||
if s.ts {
|
s.mx.Lock()
|
||||||
s.mx.Lock()
|
defer s.mx.Unlock()
|
||||||
defer s.mx.Unlock()
|
|
||||||
}
|
|
||||||
|
|
||||||
if s.set == nil {
|
if s.set == nil {
|
||||||
return false, errMarkSetClosed
|
return false, errMarkSetClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
key := string(c.Hash())
|
hash := c.Hash()
|
||||||
|
key := string(hash)
|
||||||
if _, ok := s.set[key]; ok {
|
if _, ok := s.set[key]; ok {
|
||||||
return false, nil
|
return false, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
s.set[key] = struct{}{}
|
s.set[key] = struct{}{}
|
||||||
|
|
||||||
|
if s.persist {
|
||||||
|
if err := s.writeKey(hash, true); err != nil {
|
||||||
|
return false, err
|
||||||
|
}
|
||||||
|
if err := s.file.Sync(); err != nil {
|
||||||
|
return false, xerrors.Errorf("error syncing markset: %w", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return true, nil
|
return true, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *MapMarkSet) Close() error {
|
func (s *MapMarkSet) Close() error {
|
||||||
if s.ts {
|
s.mx.Lock()
|
||||||
s.mx.Lock()
|
defer s.mx.Unlock()
|
||||||
defer s.mx.Unlock()
|
|
||||||
|
if s.set == nil {
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
s.set = nil
|
s.set = nil
|
||||||
|
|
||||||
|
if s.file != nil {
|
||||||
|
if err := s.file.Close(); err != nil {
|
||||||
|
log.Warnf("error closing markset file: %s", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if !s.persist {
|
||||||
|
if err := os.Remove(s.path); err != nil {
|
||||||
|
log.Warnf("error removing markset file: %s", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *MapMarkSet) SetConcurrent() {
|
func (s *MapMarkSet) writeKey(k []byte, flush bool) error {
|
||||||
s.ts = true
|
if err := s.buf.WriteByte(byte(len(k))); err != nil {
|
||||||
|
return xerrors.Errorf("error writing markset key length to disk: %w", err)
|
||||||
|
}
|
||||||
|
if _, err := s.buf.Write(k); err != nil {
|
||||||
|
return xerrors.Errorf("error writing markset key to disk: %w", err)
|
||||||
|
}
|
||||||
|
if flush {
|
||||||
|
if err := s.buf.Flush(); err != nil {
|
||||||
|
return xerrors.Errorf("error flushing markset buffer to disk: %w", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
|
//stm: #unit
|
||||||
package splitstore
|
package splitstore
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"io/ioutil"
|
|
||||||
"os"
|
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
cid "github.com/ipfs/go-cid"
|
cid "github.com/ipfs/go-cid"
|
||||||
@@ -10,31 +9,32 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func TestMapMarkSet(t *testing.T) {
|
func TestMapMarkSet(t *testing.T) {
|
||||||
|
//stm: @SPLITSTORE_MARKSET_CREATE_001, @SPLITSTORE_MARKSET_HAS_001, @@SPLITSTORE_MARKSET_MARK_001
|
||||||
|
//stm: @SPLITSTORE_MARKSET_CLOSE_001, @SPLITSTORE_MARKSET_CREATE_VISITOR_001
|
||||||
testMarkSet(t, "map")
|
testMarkSet(t, "map")
|
||||||
|
testMarkSetRecovery(t, "map")
|
||||||
|
testMarkSetMarkMany(t, "map")
|
||||||
testMarkSetVisitor(t, "map")
|
testMarkSetVisitor(t, "map")
|
||||||
|
testMarkSetVisitorRecovery(t, "map")
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestBadgerMarkSet(t *testing.T) {
|
func TestBadgerMarkSet(t *testing.T) {
|
||||||
|
//stm: @SPLITSTORE_MARKSET_CREATE_001, @SPLITSTORE_MARKSET_HAS_001, @@SPLITSTORE_MARKSET_MARK_001
|
||||||
|
//stm: @SPLITSTORE_MARKSET_CLOSE_001, @SPLITSTORE_MARKSET_CREATE_VISITOR_001
|
||||||
bs := badgerMarkSetBatchSize
|
bs := badgerMarkSetBatchSize
|
||||||
badgerMarkSetBatchSize = 1
|
badgerMarkSetBatchSize = 1
|
||||||
t.Cleanup(func() {
|
t.Cleanup(func() {
|
||||||
badgerMarkSetBatchSize = bs
|
badgerMarkSetBatchSize = bs
|
||||||
})
|
})
|
||||||
testMarkSet(t, "badger")
|
testMarkSet(t, "badger")
|
||||||
|
testMarkSetRecovery(t, "badger")
|
||||||
|
testMarkSetMarkMany(t, "badger")
|
||||||
testMarkSetVisitor(t, "badger")
|
testMarkSetVisitor(t, "badger")
|
||||||
|
testMarkSetVisitorRecovery(t, "badger")
|
||||||
}
|
}
|
||||||
|
|
||||||
func testMarkSet(t *testing.T, lsType string) {
|
func testMarkSet(t *testing.T, lsType string) {
|
||||||
t.Helper()
|
path := t.TempDir()
|
||||||
|
|
||||||
path, err := ioutil.TempDir("", "markset.*")
|
|
||||||
if err != nil {
|
|
||||||
t.Fatal(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
t.Cleanup(func() {
|
|
||||||
_ = os.RemoveAll(path)
|
|
||||||
})
|
|
||||||
|
|
||||||
env, err := OpenMarkSetEnv(path, lsType)
|
env, err := OpenMarkSetEnv(path, lsType)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -42,12 +42,13 @@ func testMarkSet(t *testing.T, lsType string) {
|
|||||||
}
|
}
|
||||||
defer env.Close() //nolint:errcheck
|
defer env.Close() //nolint:errcheck
|
||||||
|
|
||||||
hotSet, err := env.Create("hot", 0)
|
// stm: @SPLITSTORE_MARKSET_CREATE_001
|
||||||
|
hotSet, err := env.New("hot", 0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
coldSet, err := env.Create("cold", 0)
|
coldSet, err := env.New("cold", 0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
@@ -61,7 +62,9 @@ func testMarkSet(t *testing.T, lsType string) {
|
|||||||
return cid.NewCidV1(cid.Raw, h)
|
return cid.NewCidV1(cid.Raw, h)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// stm: @SPLITSTORE_MARKSET_HAS_001
|
||||||
mustHave := func(s MarkSet, cid cid.Cid) {
|
mustHave := func(s MarkSet, cid cid.Cid) {
|
||||||
|
t.Helper()
|
||||||
has, err := s.Has(cid)
|
has, err := s.Has(cid)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
@@ -73,6 +76,7 @@ func testMarkSet(t *testing.T, lsType string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
mustNotHave := func(s MarkSet, cid cid.Cid) {
|
mustNotHave := func(s MarkSet, cid cid.Cid) {
|
||||||
|
t.Helper()
|
||||||
has, err := s.Has(cid)
|
has, err := s.Has(cid)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
@@ -88,6 +92,7 @@ func testMarkSet(t *testing.T, lsType string) {
|
|||||||
k3 := makeCid("c")
|
k3 := makeCid("c")
|
||||||
k4 := makeCid("d")
|
k4 := makeCid("d")
|
||||||
|
|
||||||
|
// stm: @SPLITSTORE_MARKSET_MARK_001
|
||||||
hotSet.Mark(k1) //nolint
|
hotSet.Mark(k1) //nolint
|
||||||
hotSet.Mark(k2) //nolint
|
hotSet.Mark(k2) //nolint
|
||||||
coldSet.Mark(k3) //nolint
|
coldSet.Mark(k3) //nolint
|
||||||
@@ -114,12 +119,12 @@ func testMarkSet(t *testing.T, lsType string) {
|
|||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
hotSet, err = env.Create("hot", 0)
|
hotSet, err = env.New("hot", 0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
coldSet, err = env.Create("cold", 0)
|
coldSet, err = env.New("cold", 0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
@@ -138,6 +143,7 @@ func testMarkSet(t *testing.T, lsType string) {
|
|||||||
mustNotHave(coldSet, k3)
|
mustNotHave(coldSet, k3)
|
||||||
mustNotHave(coldSet, k4)
|
mustNotHave(coldSet, k4)
|
||||||
|
|
||||||
|
//stm: @SPLITSTORE_MARKSET_CLOSE_001
|
||||||
err = hotSet.Close()
|
err = hotSet.Close()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
@@ -150,16 +156,7 @@ func testMarkSet(t *testing.T, lsType string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func testMarkSetVisitor(t *testing.T, lsType string) {
|
func testMarkSetVisitor(t *testing.T, lsType string) {
|
||||||
t.Helper()
|
path := t.TempDir()
|
||||||
|
|
||||||
path, err := ioutil.TempDir("", "markset.*")
|
|
||||||
if err != nil {
|
|
||||||
t.Fatal(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
t.Cleanup(func() {
|
|
||||||
_ = os.RemoveAll(path)
|
|
||||||
})
|
|
||||||
|
|
||||||
env, err := OpenMarkSetEnv(path, lsType)
|
env, err := OpenMarkSetEnv(path, lsType)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -167,7 +164,8 @@ func testMarkSetVisitor(t *testing.T, lsType string) {
|
|||||||
}
|
}
|
||||||
defer env.Close() //nolint:errcheck
|
defer env.Close() //nolint:errcheck
|
||||||
|
|
||||||
visitor, err := env.CreateVisitor("test", 0)
|
//stm: @SPLITSTORE_MARKSET_CREATE_VISITOR_001
|
||||||
|
visitor, err := env.New("test", 0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
@@ -219,3 +217,301 @@ func testMarkSetVisitor(t *testing.T, lsType string) {
|
|||||||
mustNotVisit(visitor, k3)
|
mustNotVisit(visitor, k3)
|
||||||
mustNotVisit(visitor, k4)
|
mustNotVisit(visitor, k4)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func testMarkSetVisitorRecovery(t *testing.T, lsType string) {
|
||||||
|
path := t.TempDir()
|
||||||
|
|
||||||
|
env, err := OpenMarkSetEnv(path, lsType)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
defer env.Close() //nolint:errcheck
|
||||||
|
|
||||||
|
visitor, err := env.New("test", 0)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
defer visitor.Close() //nolint:errcheck
|
||||||
|
|
||||||
|
makeCid := func(key string) cid.Cid {
|
||||||
|
h, err := multihash.Sum([]byte(key), multihash.SHA2_256, -1)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
return cid.NewCidV1(cid.Raw, h)
|
||||||
|
}
|
||||||
|
|
||||||
|
mustVisit := func(v ObjectVisitor, cid cid.Cid) {
|
||||||
|
visit, err := v.Visit(cid)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if !visit {
|
||||||
|
t.Fatal("object should be visited")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mustNotVisit := func(v ObjectVisitor, cid cid.Cid) {
|
||||||
|
visit, err := v.Visit(cid)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if visit {
|
||||||
|
t.Fatal("unexpected visit")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
k1 := makeCid("a")
|
||||||
|
k2 := makeCid("b")
|
||||||
|
k3 := makeCid("c")
|
||||||
|
k4 := makeCid("d")
|
||||||
|
|
||||||
|
mustVisit(visitor, k1)
|
||||||
|
mustVisit(visitor, k2)
|
||||||
|
|
||||||
|
if err := visitor.BeginCriticalSection(); err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
mustVisit(visitor, k3)
|
||||||
|
mustVisit(visitor, k4)
|
||||||
|
|
||||||
|
mustNotVisit(visitor, k1)
|
||||||
|
mustNotVisit(visitor, k2)
|
||||||
|
mustNotVisit(visitor, k3)
|
||||||
|
mustNotVisit(visitor, k4)
|
||||||
|
|
||||||
|
if err := visitor.Close(); err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
visitor, err = env.Recover("test")
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
mustNotVisit(visitor, k1)
|
||||||
|
mustNotVisit(visitor, k2)
|
||||||
|
mustNotVisit(visitor, k3)
|
||||||
|
mustNotVisit(visitor, k4)
|
||||||
|
|
||||||
|
visitor.EndCriticalSection()
|
||||||
|
|
||||||
|
if err := visitor.Close(); err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
_, err = env.Recover("test")
|
||||||
|
if err == nil {
|
||||||
|
t.Fatal("expected recovery to fail")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func testMarkSetRecovery(t *testing.T, lsType string) {
|
||||||
|
path := t.TempDir()
|
||||||
|
|
||||||
|
env, err := OpenMarkSetEnv(path, lsType)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
defer env.Close() //nolint:errcheck
|
||||||
|
|
||||||
|
markSet, err := env.New("test", 0)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
makeCid := func(key string) cid.Cid {
|
||||||
|
h, err := multihash.Sum([]byte(key), multihash.SHA2_256, -1)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
return cid.NewCidV1(cid.Raw, h)
|
||||||
|
}
|
||||||
|
|
||||||
|
mustHave := func(s MarkSet, cid cid.Cid) {
|
||||||
|
t.Helper()
|
||||||
|
has, err := s.Has(cid)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if !has {
|
||||||
|
t.Fatal("mark not found")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mustNotHave := func(s MarkSet, cid cid.Cid) {
|
||||||
|
t.Helper()
|
||||||
|
has, err := s.Has(cid)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if has {
|
||||||
|
t.Fatal("unexpected mark")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
k1 := makeCid("a")
|
||||||
|
k2 := makeCid("b")
|
||||||
|
k3 := makeCid("c")
|
||||||
|
k4 := makeCid("d")
|
||||||
|
|
||||||
|
if err := markSet.Mark(k1); err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
if err := markSet.Mark(k2); err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
mustHave(markSet, k1)
|
||||||
|
mustHave(markSet, k2)
|
||||||
|
mustNotHave(markSet, k3)
|
||||||
|
mustNotHave(markSet, k4)
|
||||||
|
|
||||||
|
if err := markSet.BeginCriticalSection(); err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := markSet.Mark(k3); err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
if err := markSet.Mark(k4); err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
mustHave(markSet, k1)
|
||||||
|
mustHave(markSet, k2)
|
||||||
|
mustHave(markSet, k3)
|
||||||
|
mustHave(markSet, k4)
|
||||||
|
|
||||||
|
if err := markSet.Close(); err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
markSet, err = env.Recover("test")
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
mustHave(markSet, k1)
|
||||||
|
mustHave(markSet, k2)
|
||||||
|
mustHave(markSet, k3)
|
||||||
|
mustHave(markSet, k4)
|
||||||
|
|
||||||
|
markSet.EndCriticalSection()
|
||||||
|
|
||||||
|
if err := markSet.Close(); err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
_, err = env.Recover("test")
|
||||||
|
if err == nil {
|
||||||
|
t.Fatal("expected recovery to fail")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func testMarkSetMarkMany(t *testing.T, lsType string) {
|
||||||
|
path := t.TempDir()
|
||||||
|
|
||||||
|
env, err := OpenMarkSetEnv(path, lsType)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
defer env.Close() //nolint:errcheck
|
||||||
|
|
||||||
|
markSet, err := env.New("test", 0)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
makeCid := func(key string) cid.Cid {
|
||||||
|
h, err := multihash.Sum([]byte(key), multihash.SHA2_256, -1)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
return cid.NewCidV1(cid.Raw, h)
|
||||||
|
}
|
||||||
|
|
||||||
|
mustHave := func(s MarkSet, cid cid.Cid) {
|
||||||
|
t.Helper()
|
||||||
|
has, err := s.Has(cid)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if !has {
|
||||||
|
t.Fatal("mark not found")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mustNotHave := func(s MarkSet, cid cid.Cid) {
|
||||||
|
t.Helper()
|
||||||
|
has, err := s.Has(cid)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if has {
|
||||||
|
t.Fatal("unexpected mark")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
k1 := makeCid("a")
|
||||||
|
k2 := makeCid("b")
|
||||||
|
k3 := makeCid("c")
|
||||||
|
k4 := makeCid("d")
|
||||||
|
|
||||||
|
if err := markSet.MarkMany([]cid.Cid{k1, k2}); err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
mustHave(markSet, k1)
|
||||||
|
mustHave(markSet, k2)
|
||||||
|
mustNotHave(markSet, k3)
|
||||||
|
mustNotHave(markSet, k4)
|
||||||
|
|
||||||
|
if err := markSet.BeginCriticalSection(); err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := markSet.MarkMany([]cid.Cid{k3, k4}); err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
mustHave(markSet, k1)
|
||||||
|
mustHave(markSet, k2)
|
||||||
|
mustHave(markSet, k3)
|
||||||
|
mustHave(markSet, k4)
|
||||||
|
|
||||||
|
if err := markSet.Close(); err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
markSet, err = env.Recover("test")
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
mustHave(markSet, k1)
|
||||||
|
mustHave(markSet, k2)
|
||||||
|
mustHave(markSet, k3)
|
||||||
|
mustHave(markSet, k4)
|
||||||
|
|
||||||
|
markSet.EndCriticalSection()
|
||||||
|
|
||||||
|
if err := markSet.Close(); err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
_, err = env.Recover("test")
|
||||||
|
if err == nil {
|
||||||
|
t.Fatal("expected recovery to fail")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -18,6 +18,8 @@ import (
|
|||||||
|
|
||||||
"github.com/filecoin-project/go-state-types/abi"
|
"github.com/filecoin-project/go-state-types/abi"
|
||||||
bstore "github.com/filecoin-project/lotus/blockstore"
|
bstore "github.com/filecoin-project/lotus/blockstore"
|
||||||
|
"github.com/filecoin-project/lotus/build"
|
||||||
|
"github.com/filecoin-project/lotus/chain/stmgr"
|
||||||
"github.com/filecoin-project/lotus/chain/types"
|
"github.com/filecoin-project/lotus/chain/types"
|
||||||
"github.com/filecoin-project/lotus/metrics"
|
"github.com/filecoin-project/lotus/metrics"
|
||||||
|
|
||||||
@@ -47,6 +49,9 @@ var (
|
|||||||
enableDebugLog = false
|
enableDebugLog = false
|
||||||
// set this to true if you want to track origin stack traces in the write log
|
// set this to true if you want to track origin stack traces in the write log
|
||||||
enableDebugLogWriteTraces = false
|
enableDebugLogWriteTraces = false
|
||||||
|
|
||||||
|
// upgradeBoundary is the boundary before and after an upgrade where we suppress compaction
|
||||||
|
upgradeBoundary = build.Finality
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
@@ -98,6 +103,12 @@ type ChainAccessor interface {
|
|||||||
SubscribeHeadChanges(change func(revert []*types.TipSet, apply []*types.TipSet) error)
|
SubscribeHeadChanges(change func(revert []*types.TipSet, apply []*types.TipSet) error)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// upgradeRange is a precomputed epoch range during which we shouldn't compact so as to not
|
||||||
|
// interfere with an upgrade
|
||||||
|
type upgradeRange struct {
|
||||||
|
start, end abi.ChainEpoch
|
||||||
|
}
|
||||||
|
|
||||||
// hotstore is the interface that must be satisfied by the hot blockstore; it is an extension
|
// hotstore is the interface that must be satisfied by the hot blockstore; it is an extension
|
||||||
// of the Blockstore interface with the traits we need for compaction.
|
// of the Blockstore interface with the traits we need for compaction.
|
||||||
type hotstore interface {
|
type hotstore interface {
|
||||||
@@ -118,13 +129,13 @@ type SplitStore struct {
|
|||||||
|
|
||||||
headChangeMx sync.Mutex
|
headChangeMx sync.Mutex
|
||||||
|
|
||||||
coldPurgeSize int
|
|
||||||
|
|
||||||
chain ChainAccessor
|
chain ChainAccessor
|
||||||
ds dstore.Datastore
|
ds dstore.Datastore
|
||||||
cold bstore.Blockstore
|
cold bstore.Blockstore
|
||||||
hot hotstore
|
hot hotstore
|
||||||
|
|
||||||
|
upgrades []upgradeRange
|
||||||
|
|
||||||
markSetEnv MarkSetEnv
|
markSetEnv MarkSetEnv
|
||||||
markSetSize int64
|
markSetSize int64
|
||||||
|
|
||||||
@@ -145,6 +156,17 @@ type SplitStore struct {
|
|||||||
txnRefsMx sync.Mutex
|
txnRefsMx sync.Mutex
|
||||||
txnRefs map[cid.Cid]struct{}
|
txnRefs map[cid.Cid]struct{}
|
||||||
txnMissing map[cid.Cid]struct{}
|
txnMissing map[cid.Cid]struct{}
|
||||||
|
txnMarkSet MarkSet
|
||||||
|
txnSyncMx sync.Mutex
|
||||||
|
txnSyncCond sync.Cond
|
||||||
|
txnSync bool
|
||||||
|
|
||||||
|
// background cold object reification
|
||||||
|
reifyWorkers sync.WaitGroup
|
||||||
|
reifyMx sync.Mutex
|
||||||
|
reifyCond sync.Cond
|
||||||
|
reifyPend map[cid.Cid]struct{}
|
||||||
|
reifyInProgress map[cid.Cid]struct{}
|
||||||
|
|
||||||
// registered protectors
|
// registered protectors
|
||||||
protectors []func(func(cid.Cid) error) error
|
protectors []func(func(cid.Cid) error) error
|
||||||
@@ -173,10 +195,6 @@ func Open(path string, ds dstore.Datastore, hot, cold bstore.Blockstore, cfg *Co
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
if !markSetEnv.SupportsVisitor() {
|
|
||||||
return nil, xerrors.Errorf("markset type does not support atomic visitors")
|
|
||||||
}
|
|
||||||
|
|
||||||
// and now we can make a SplitStore
|
// and now we can make a SplitStore
|
||||||
ss := &SplitStore{
|
ss := &SplitStore{
|
||||||
cfg: cfg,
|
cfg: cfg,
|
||||||
@@ -185,13 +203,16 @@ func Open(path string, ds dstore.Datastore, hot, cold bstore.Blockstore, cfg *Co
|
|||||||
cold: cold,
|
cold: cold,
|
||||||
hot: hots,
|
hot: hots,
|
||||||
markSetEnv: markSetEnv,
|
markSetEnv: markSetEnv,
|
||||||
|
|
||||||
coldPurgeSize: defaultColdPurgeSize,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ss.txnViewsCond.L = &ss.txnViewsMx
|
ss.txnViewsCond.L = &ss.txnViewsMx
|
||||||
|
ss.txnSyncCond.L = &ss.txnSyncMx
|
||||||
ss.ctx, ss.cancel = context.WithCancel(context.Background())
|
ss.ctx, ss.cancel = context.WithCancel(context.Background())
|
||||||
|
|
||||||
|
ss.reifyCond.L = &ss.reifyMx
|
||||||
|
ss.reifyPend = make(map[cid.Cid]struct{})
|
||||||
|
ss.reifyInProgress = make(map[cid.Cid]struct{})
|
||||||
|
|
||||||
if enableDebugLog {
|
if enableDebugLog {
|
||||||
ss.debug, err = openDebugLog(path)
|
ss.debug, err = openDebugLog(path)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -199,21 +220,29 @@ func Open(path string, ds dstore.Datastore, hot, cold bstore.Blockstore, cfg *Co
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ss.checkpointExists() {
|
||||||
|
log.Info("found compaction checkpoint; resuming compaction")
|
||||||
|
if err := ss.completeCompaction(); err != nil {
|
||||||
|
markSetEnv.Close() //nolint:errcheck
|
||||||
|
return nil, xerrors.Errorf("error resuming compaction: %w", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return ss, nil
|
return ss, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Blockstore interface
|
// Blockstore interface
|
||||||
func (s *SplitStore) DeleteBlock(_ cid.Cid) error {
|
func (s *SplitStore) DeleteBlock(_ context.Context, _ cid.Cid) error {
|
||||||
// afaict we don't seem to be using this method, so it's not implemented
|
// afaict we don't seem to be using this method, so it's not implemented
|
||||||
return errors.New("DeleteBlock not implemented on SplitStore; don't do this Luke!") //nolint
|
return errors.New("DeleteBlock not implemented on SplitStore; don't do this Luke!") //nolint
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *SplitStore) DeleteMany(_ []cid.Cid) error {
|
func (s *SplitStore) DeleteMany(_ context.Context, _ []cid.Cid) error {
|
||||||
// afaict we don't seem to be using this method, so it's not implemented
|
// afaict we don't seem to be using this method, so it's not implemented
|
||||||
return errors.New("DeleteMany not implemented on SplitStore; don't do this Luke!") //nolint
|
return errors.New("DeleteMany not implemented on SplitStore; don't do this Luke!") //nolint
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *SplitStore) Has(cid cid.Cid) (bool, error) {
|
func (s *SplitStore) Has(ctx context.Context, cid cid.Cid) (bool, error) {
|
||||||
if isIdentiyCid(cid) {
|
if isIdentiyCid(cid) {
|
||||||
return true, nil
|
return true, nil
|
||||||
}
|
}
|
||||||
@@ -221,7 +250,21 @@ func (s *SplitStore) Has(cid cid.Cid) (bool, error) {
|
|||||||
s.txnLk.RLock()
|
s.txnLk.RLock()
|
||||||
defer s.txnLk.RUnlock()
|
defer s.txnLk.RUnlock()
|
||||||
|
|
||||||
has, err := s.hot.Has(cid)
|
// critical section
|
||||||
|
if s.txnMarkSet != nil {
|
||||||
|
has, err := s.txnMarkSet.Has(cid)
|
||||||
|
if err != nil {
|
||||||
|
return false, err
|
||||||
|
}
|
||||||
|
|
||||||
|
if has {
|
||||||
|
return s.has(cid)
|
||||||
|
}
|
||||||
|
|
||||||
|
return s.cold.Has(ctx, cid)
|
||||||
|
}
|
||||||
|
|
||||||
|
has, err := s.hot.Has(ctx, cid)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return has, err
|
return has, err
|
||||||
@@ -232,10 +275,16 @@ func (s *SplitStore) Has(cid cid.Cid) (bool, error) {
|
|||||||
return true, nil
|
return true, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
return s.cold.Has(cid)
|
has, err = s.cold.Has(ctx, cid)
|
||||||
|
if has && bstore.IsHotView(ctx) {
|
||||||
|
s.reifyColdObject(cid)
|
||||||
|
}
|
||||||
|
|
||||||
|
return has, err
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *SplitStore) Get(cid cid.Cid) (blocks.Block, error) {
|
func (s *SplitStore) Get(ctx context.Context, cid cid.Cid) (blocks.Block, error) {
|
||||||
if isIdentiyCid(cid) {
|
if isIdentiyCid(cid) {
|
||||||
data, err := decodeIdentityCid(cid)
|
data, err := decodeIdentityCid(cid)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -248,7 +297,21 @@ func (s *SplitStore) Get(cid cid.Cid) (blocks.Block, error) {
|
|||||||
s.txnLk.RLock()
|
s.txnLk.RLock()
|
||||||
defer s.txnLk.RUnlock()
|
defer s.txnLk.RUnlock()
|
||||||
|
|
||||||
blk, err := s.hot.Get(cid)
|
// critical section
|
||||||
|
if s.txnMarkSet != nil {
|
||||||
|
has, err := s.txnMarkSet.Has(cid)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
if has {
|
||||||
|
return s.get(cid)
|
||||||
|
}
|
||||||
|
|
||||||
|
return s.cold.Get(ctx, cid)
|
||||||
|
}
|
||||||
|
|
||||||
|
blk, err := s.hot.Get(ctx, cid)
|
||||||
|
|
||||||
switch err {
|
switch err {
|
||||||
case nil:
|
case nil:
|
||||||
@@ -260,10 +323,13 @@ func (s *SplitStore) Get(cid cid.Cid) (blocks.Block, error) {
|
|||||||
s.debug.LogReadMiss(cid)
|
s.debug.LogReadMiss(cid)
|
||||||
}
|
}
|
||||||
|
|
||||||
blk, err = s.cold.Get(cid)
|
blk, err = s.cold.Get(ctx, cid)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
stats.Record(s.ctx, metrics.SplitstoreMiss.M(1))
|
if bstore.IsHotView(ctx) {
|
||||||
|
s.reifyColdObject(cid)
|
||||||
|
}
|
||||||
|
|
||||||
|
stats.Record(s.ctx, metrics.SplitstoreMiss.M(1))
|
||||||
}
|
}
|
||||||
return blk, err
|
return blk, err
|
||||||
|
|
||||||
@@ -272,7 +338,7 @@ func (s *SplitStore) Get(cid cid.Cid) (blocks.Block, error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *SplitStore) GetSize(cid cid.Cid) (int, error) {
|
func (s *SplitStore) GetSize(ctx context.Context, cid cid.Cid) (int, error) {
|
||||||
if isIdentiyCid(cid) {
|
if isIdentiyCid(cid) {
|
||||||
data, err := decodeIdentityCid(cid)
|
data, err := decodeIdentityCid(cid)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -285,7 +351,21 @@ func (s *SplitStore) GetSize(cid cid.Cid) (int, error) {
|
|||||||
s.txnLk.RLock()
|
s.txnLk.RLock()
|
||||||
defer s.txnLk.RUnlock()
|
defer s.txnLk.RUnlock()
|
||||||
|
|
||||||
size, err := s.hot.GetSize(cid)
|
// critical section
|
||||||
|
if s.txnMarkSet != nil {
|
||||||
|
has, err := s.txnMarkSet.Has(cid)
|
||||||
|
if err != nil {
|
||||||
|
return 0, err
|
||||||
|
}
|
||||||
|
|
||||||
|
if has {
|
||||||
|
return s.getSize(cid)
|
||||||
|
}
|
||||||
|
|
||||||
|
return s.cold.GetSize(ctx, cid)
|
||||||
|
}
|
||||||
|
|
||||||
|
size, err := s.hot.GetSize(ctx, cid)
|
||||||
|
|
||||||
switch err {
|
switch err {
|
||||||
case nil:
|
case nil:
|
||||||
@@ -297,8 +377,12 @@ func (s *SplitStore) GetSize(cid cid.Cid) (int, error) {
|
|||||||
s.debug.LogReadMiss(cid)
|
s.debug.LogReadMiss(cid)
|
||||||
}
|
}
|
||||||
|
|
||||||
size, err = s.cold.GetSize(cid)
|
size, err = s.cold.GetSize(ctx, cid)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
|
if bstore.IsHotView(ctx) {
|
||||||
|
s.reifyColdObject(cid)
|
||||||
|
}
|
||||||
|
|
||||||
stats.Record(s.ctx, metrics.SplitstoreMiss.M(1))
|
stats.Record(s.ctx, metrics.SplitstoreMiss.M(1))
|
||||||
}
|
}
|
||||||
return size, err
|
return size, err
|
||||||
@@ -308,7 +392,7 @@ func (s *SplitStore) GetSize(cid cid.Cid) (int, error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *SplitStore) Put(blk blocks.Block) error {
|
func (s *SplitStore) Put(ctx context.Context, blk blocks.Block) error {
|
||||||
if isIdentiyCid(blk.Cid()) {
|
if isIdentiyCid(blk.Cid()) {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@@ -316,18 +400,24 @@ func (s *SplitStore) Put(blk blocks.Block) error {
|
|||||||
s.txnLk.RLock()
|
s.txnLk.RLock()
|
||||||
defer s.txnLk.RUnlock()
|
defer s.txnLk.RUnlock()
|
||||||
|
|
||||||
err := s.hot.Put(blk)
|
err := s.hot.Put(ctx, blk)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
s.debug.LogWrite(blk)
|
s.debug.LogWrite(blk)
|
||||||
|
|
||||||
|
// critical section
|
||||||
|
if s.txnMarkSet != nil {
|
||||||
|
s.markLiveRefs([]cid.Cid{blk.Cid()})
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
s.trackTxnRef(blk.Cid())
|
s.trackTxnRef(blk.Cid())
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *SplitStore) PutMany(blks []blocks.Block) error {
|
func (s *SplitStore) PutMany(ctx context.Context, blks []blocks.Block) error {
|
||||||
// filter identites
|
// filter identites
|
||||||
idcids := 0
|
idcids := 0
|
||||||
for _, blk := range blks {
|
for _, blk := range blks {
|
||||||
@@ -361,13 +451,19 @@ func (s *SplitStore) PutMany(blks []blocks.Block) error {
|
|||||||
s.txnLk.RLock()
|
s.txnLk.RLock()
|
||||||
defer s.txnLk.RUnlock()
|
defer s.txnLk.RUnlock()
|
||||||
|
|
||||||
err := s.hot.PutMany(blks)
|
err := s.hot.PutMany(ctx, blks)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
s.debug.LogWriteMany(blks)
|
s.debug.LogWriteMany(blks)
|
||||||
|
|
||||||
|
// critical section
|
||||||
|
if s.txnMarkSet != nil {
|
||||||
|
s.markLiveRefs(batch)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
s.trackTxnRefMany(batch)
|
s.trackTxnRefMany(batch)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@@ -417,7 +513,7 @@ func (s *SplitStore) HashOnRead(enabled bool) {
|
|||||||
s.cold.HashOnRead(enabled)
|
s.cold.HashOnRead(enabled)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *SplitStore) View(cid cid.Cid, cb func([]byte) error) error {
|
func (s *SplitStore) View(ctx context.Context, cid cid.Cid, cb func([]byte) error) error {
|
||||||
if isIdentiyCid(cid) {
|
if isIdentiyCid(cid) {
|
||||||
data, err := decodeIdentityCid(cid)
|
data, err := decodeIdentityCid(cid)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -427,6 +523,23 @@ func (s *SplitStore) View(cid cid.Cid, cb func([]byte) error) error {
|
|||||||
return cb(data)
|
return cb(data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// critical section
|
||||||
|
s.txnLk.RLock() // the lock is released in protectView if we are not in critical section
|
||||||
|
if s.txnMarkSet != nil {
|
||||||
|
has, err := s.txnMarkSet.Has(cid)
|
||||||
|
s.txnLk.RUnlock()
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if has {
|
||||||
|
return s.view(cid, cb)
|
||||||
|
}
|
||||||
|
|
||||||
|
return s.cold.View(ctx, cid, cb)
|
||||||
|
}
|
||||||
|
|
||||||
// views are (optimistically) protected two-fold:
|
// views are (optimistically) protected two-fold:
|
||||||
// - if there is an active transaction, then the reference is protected.
|
// - if there is an active transaction, then the reference is protected.
|
||||||
// - if there is no active transaction, active views are tracked in a
|
// - if there is no active transaction, active views are tracked in a
|
||||||
@@ -438,15 +551,19 @@ func (s *SplitStore) View(cid cid.Cid, cb func([]byte) error) error {
|
|||||||
s.protectView(cid)
|
s.protectView(cid)
|
||||||
defer s.viewDone()
|
defer s.viewDone()
|
||||||
|
|
||||||
err := s.hot.View(cid, cb)
|
err := s.hot.View(ctx, cid, cb)
|
||||||
switch err {
|
switch err {
|
||||||
case bstore.ErrNotFound:
|
case bstore.ErrNotFound:
|
||||||
if s.isWarm() {
|
if s.isWarm() {
|
||||||
s.debug.LogReadMiss(cid)
|
s.debug.LogReadMiss(cid)
|
||||||
}
|
}
|
||||||
|
|
||||||
err = s.cold.View(cid, cb)
|
err = s.cold.View(ctx, cid, cb)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
|
if bstore.IsHotView(ctx) {
|
||||||
|
s.reifyColdObject(cid)
|
||||||
|
}
|
||||||
|
|
||||||
stats.Record(s.ctx, metrics.SplitstoreMiss.M(1))
|
stats.Record(s.ctx, metrics.SplitstoreMiss.M(1))
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
@@ -463,16 +580,33 @@ func (s *SplitStore) isWarm() bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// State tracking
|
// State tracking
|
||||||
func (s *SplitStore) Start(chain ChainAccessor) error {
|
func (s *SplitStore) Start(chain ChainAccessor, us stmgr.UpgradeSchedule) error {
|
||||||
s.chain = chain
|
s.chain = chain
|
||||||
curTs := chain.GetHeaviestTipSet()
|
curTs := chain.GetHeaviestTipSet()
|
||||||
|
|
||||||
|
// precompute the upgrade boundaries
|
||||||
|
s.upgrades = make([]upgradeRange, 0, len(us))
|
||||||
|
for _, upgrade := range us {
|
||||||
|
boundary := upgrade.Height
|
||||||
|
for _, pre := range upgrade.PreMigrations {
|
||||||
|
preMigrationBoundary := upgrade.Height - pre.StartWithin
|
||||||
|
if preMigrationBoundary < boundary {
|
||||||
|
boundary = preMigrationBoundary
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
upgradeStart := boundary - upgradeBoundary
|
||||||
|
upgradeEnd := upgrade.Height + upgradeBoundary
|
||||||
|
|
||||||
|
s.upgrades = append(s.upgrades, upgradeRange{start: upgradeStart, end: upgradeEnd})
|
||||||
|
}
|
||||||
|
|
||||||
// should we warmup
|
// should we warmup
|
||||||
warmup := false
|
warmup := false
|
||||||
|
|
||||||
// load base epoch from metadata ds
|
// load base epoch from metadata ds
|
||||||
// if none, then use current epoch because it's a fresh start
|
// if none, then use current epoch because it's a fresh start
|
||||||
bs, err := s.ds.Get(baseEpochKey)
|
bs, err := s.ds.Get(s.ctx, baseEpochKey)
|
||||||
switch err {
|
switch err {
|
||||||
case nil:
|
case nil:
|
||||||
s.baseEpoch = bytesToEpoch(bs)
|
s.baseEpoch = bytesToEpoch(bs)
|
||||||
@@ -493,7 +627,7 @@ func (s *SplitStore) Start(chain ChainAccessor) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// load warmup epoch from metadata ds
|
// load warmup epoch from metadata ds
|
||||||
bs, err = s.ds.Get(warmupEpochKey)
|
bs, err = s.ds.Get(s.ctx, warmupEpochKey)
|
||||||
switch err {
|
switch err {
|
||||||
case nil:
|
case nil:
|
||||||
s.warmupEpoch = bytesToEpoch(bs)
|
s.warmupEpoch = bytesToEpoch(bs)
|
||||||
@@ -506,7 +640,7 @@ func (s *SplitStore) Start(chain ChainAccessor) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// load markSetSize from metadata ds to provide a size hint for marksets
|
// load markSetSize from metadata ds to provide a size hint for marksets
|
||||||
bs, err = s.ds.Get(markSetSizeKey)
|
bs, err = s.ds.Get(s.ctx, markSetSizeKey)
|
||||||
switch err {
|
switch err {
|
||||||
case nil:
|
case nil:
|
||||||
s.markSetSize = bytesToInt64(bs)
|
s.markSetSize = bytesToInt64(bs)
|
||||||
@@ -517,7 +651,7 @@ func (s *SplitStore) Start(chain ChainAccessor) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// load compactionIndex from metadata ds to provide a hint as to when to perform moving gc
|
// load compactionIndex from metadata ds to provide a hint as to when to perform moving gc
|
||||||
bs, err = s.ds.Get(compactionIndexKey)
|
bs, err = s.ds.Get(s.ctx, compactionIndexKey)
|
||||||
switch err {
|
switch err {
|
||||||
case nil:
|
case nil:
|
||||||
s.compactionIndex = bytesToInt64(bs)
|
s.compactionIndex = bytesToInt64(bs)
|
||||||
@@ -539,6 +673,9 @@ func (s *SplitStore) Start(chain ChainAccessor) error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// spawn the reifier
|
||||||
|
go s.reifyOrchestrator()
|
||||||
|
|
||||||
// watch the chain
|
// watch the chain
|
||||||
chain.SubscribeHeadChanges(s.HeadChange)
|
chain.SubscribeHeadChanges(s.HeadChange)
|
||||||
|
|
||||||
@@ -559,12 +696,19 @@ func (s *SplitStore) Close() error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if atomic.LoadInt32(&s.compacting) == 1 {
|
if atomic.LoadInt32(&s.compacting) == 1 {
|
||||||
|
s.txnSyncMx.Lock()
|
||||||
|
s.txnSync = true
|
||||||
|
s.txnSyncCond.Broadcast()
|
||||||
|
s.txnSyncMx.Unlock()
|
||||||
|
|
||||||
log.Warn("close with ongoing compaction in progress; waiting for it to finish...")
|
log.Warn("close with ongoing compaction in progress; waiting for it to finish...")
|
||||||
for atomic.LoadInt32(&s.compacting) == 1 {
|
for atomic.LoadInt32(&s.compacting) == 1 {
|
||||||
time.Sleep(time.Second)
|
time.Sleep(time.Second)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
s.reifyCond.Broadcast()
|
||||||
|
s.reifyWorkers.Wait()
|
||||||
s.cancel()
|
s.cancel()
|
||||||
return multierr.Combine(s.markSetEnv.Close(), s.debug.Close())
|
return multierr.Combine(s.markSetEnv.Close(), s.debug.Close())
|
||||||
}
|
}
|
||||||
@@ -579,5 +723,5 @@ func (s *SplitStore) checkClosing() error {
|
|||||||
|
|
||||||
func (s *SplitStore) setBaseEpoch(epoch abi.ChainEpoch) error {
|
func (s *SplitStore) setBaseEpoch(epoch abi.ChainEpoch) error {
|
||||||
s.baseEpoch = epoch
|
s.baseEpoch = epoch
|
||||||
return s.ds.Put(baseEpochKey, epochToBytes(epoch))
|
return s.ds.Put(s.ctx, baseEpochKey, epochToBytes(epoch))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"sync"
|
||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@@ -67,7 +68,10 @@ func (s *SplitStore) doCheck(curTs *types.TipSet) error {
|
|||||||
}
|
}
|
||||||
defer output.Close() //nolint:errcheck
|
defer output.Close() //nolint:errcheck
|
||||||
|
|
||||||
|
var mx sync.Mutex
|
||||||
write := func(format string, args ...interface{}) {
|
write := func(format string, args ...interface{}) {
|
||||||
|
mx.Lock()
|
||||||
|
defer mx.Unlock()
|
||||||
_, err := fmt.Fprintf(output, format+"\n", args...)
|
_, err := fmt.Fprintf(output, format+"\n", args...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Warnf("error writing check output: %s", err)
|
log.Warnf("error writing check output: %s", err)
|
||||||
@@ -82,9 +86,10 @@ func (s *SplitStore) doCheck(curTs *types.TipSet) error {
|
|||||||
write("compaction index: %d", s.compactionIndex)
|
write("compaction index: %d", s.compactionIndex)
|
||||||
write("--")
|
write("--")
|
||||||
|
|
||||||
var coldCnt, missingCnt int64
|
coldCnt := new(int64)
|
||||||
|
missingCnt := new(int64)
|
||||||
|
|
||||||
visitor, err := s.markSetEnv.CreateVisitor("check", 0)
|
visitor, err := s.markSetEnv.New("check", 0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return xerrors.Errorf("error creating visitor: %w", err)
|
return xerrors.Errorf("error creating visitor: %w", err)
|
||||||
}
|
}
|
||||||
@@ -96,7 +101,7 @@ func (s *SplitStore) doCheck(curTs *types.TipSet) error {
|
|||||||
return errStopWalk
|
return errStopWalk
|
||||||
}
|
}
|
||||||
|
|
||||||
has, err := s.hot.Has(c)
|
has, err := s.hot.Has(s.ctx, c)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return xerrors.Errorf("error checking hotstore: %w", err)
|
return xerrors.Errorf("error checking hotstore: %w", err)
|
||||||
}
|
}
|
||||||
@@ -105,16 +110,16 @@ func (s *SplitStore) doCheck(curTs *types.TipSet) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
has, err = s.cold.Has(c)
|
has, err = s.cold.Has(s.ctx, c)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return xerrors.Errorf("error checking coldstore: %w", err)
|
return xerrors.Errorf("error checking coldstore: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if has {
|
if has {
|
||||||
coldCnt++
|
atomic.AddInt64(coldCnt, 1)
|
||||||
write("cold object reference: %s", c)
|
write("cold object reference: %s", c)
|
||||||
} else {
|
} else {
|
||||||
missingCnt++
|
atomic.AddInt64(missingCnt, 1)
|
||||||
write("missing object reference: %s", c)
|
write("missing object reference: %s", c)
|
||||||
return errStopWalk
|
return errStopWalk
|
||||||
}
|
}
|
||||||
@@ -128,9 +133,9 @@ func (s *SplitStore) doCheck(curTs *types.TipSet) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Infow("check done", "cold", coldCnt, "missing", missingCnt)
|
log.Infow("check done", "cold", *coldCnt, "missing", *missingCnt)
|
||||||
write("--")
|
write("--")
|
||||||
write("cold: %d missing: %d", coldCnt, missingCnt)
|
write("cold: %d missing: %d", *coldCnt, *missingCnt)
|
||||||
write("DONE")
|
write("DONE")
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -20,28 +20,28 @@ func (s *SplitStore) Expose() bstore.Blockstore {
|
|||||||
return &exposedSplitStore{s: s}
|
return &exposedSplitStore{s: s}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (es *exposedSplitStore) DeleteBlock(_ cid.Cid) error {
|
func (es *exposedSplitStore) DeleteBlock(_ context.Context, _ cid.Cid) error {
|
||||||
return errors.New("DeleteBlock: operation not supported")
|
return errors.New("DeleteBlock: operation not supported")
|
||||||
}
|
}
|
||||||
|
|
||||||
func (es *exposedSplitStore) DeleteMany(_ []cid.Cid) error {
|
func (es *exposedSplitStore) DeleteMany(_ context.Context, _ []cid.Cid) error {
|
||||||
return errors.New("DeleteMany: operation not supported")
|
return errors.New("DeleteMany: operation not supported")
|
||||||
}
|
}
|
||||||
|
|
||||||
func (es *exposedSplitStore) Has(c cid.Cid) (bool, error) {
|
func (es *exposedSplitStore) Has(ctx context.Context, c cid.Cid) (bool, error) {
|
||||||
if isIdentiyCid(c) {
|
if isIdentiyCid(c) {
|
||||||
return true, nil
|
return true, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
has, err := es.s.hot.Has(c)
|
has, err := es.s.hot.Has(ctx, c)
|
||||||
if has || err != nil {
|
if has || err != nil {
|
||||||
return has, err
|
return has, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return es.s.cold.Has(c)
|
return es.s.cold.Has(ctx, c)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (es *exposedSplitStore) Get(c cid.Cid) (blocks.Block, error) {
|
func (es *exposedSplitStore) Get(ctx context.Context, c cid.Cid) (blocks.Block, error) {
|
||||||
if isIdentiyCid(c) {
|
if isIdentiyCid(c) {
|
||||||
data, err := decodeIdentityCid(c)
|
data, err := decodeIdentityCid(c)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -51,16 +51,16 @@ func (es *exposedSplitStore) Get(c cid.Cid) (blocks.Block, error) {
|
|||||||
return blocks.NewBlockWithCid(data, c)
|
return blocks.NewBlockWithCid(data, c)
|
||||||
}
|
}
|
||||||
|
|
||||||
blk, err := es.s.hot.Get(c)
|
blk, err := es.s.hot.Get(ctx, c)
|
||||||
switch err {
|
switch err {
|
||||||
case bstore.ErrNotFound:
|
case bstore.ErrNotFound:
|
||||||
return es.s.cold.Get(c)
|
return es.s.cold.Get(ctx, c)
|
||||||
default:
|
default:
|
||||||
return blk, err
|
return blk, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (es *exposedSplitStore) GetSize(c cid.Cid) (int, error) {
|
func (es *exposedSplitStore) GetSize(ctx context.Context, c cid.Cid) (int, error) {
|
||||||
if isIdentiyCid(c) {
|
if isIdentiyCid(c) {
|
||||||
data, err := decodeIdentityCid(c)
|
data, err := decodeIdentityCid(c)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -70,21 +70,21 @@ func (es *exposedSplitStore) GetSize(c cid.Cid) (int, error) {
|
|||||||
return len(data), nil
|
return len(data), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
size, err := es.s.hot.GetSize(c)
|
size, err := es.s.hot.GetSize(ctx, c)
|
||||||
switch err {
|
switch err {
|
||||||
case bstore.ErrNotFound:
|
case bstore.ErrNotFound:
|
||||||
return es.s.cold.GetSize(c)
|
return es.s.cold.GetSize(ctx, c)
|
||||||
default:
|
default:
|
||||||
return size, err
|
return size, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (es *exposedSplitStore) Put(blk blocks.Block) error {
|
func (es *exposedSplitStore) Put(ctx context.Context, blk blocks.Block) error {
|
||||||
return es.s.Put(blk)
|
return es.s.Put(ctx, blk)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (es *exposedSplitStore) PutMany(blks []blocks.Block) error {
|
func (es *exposedSplitStore) PutMany(ctx context.Context, blks []blocks.Block) error {
|
||||||
return es.s.PutMany(blks)
|
return es.s.PutMany(ctx, blks)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (es *exposedSplitStore) AllKeysChan(ctx context.Context) (<-chan cid.Cid, error) {
|
func (es *exposedSplitStore) AllKeysChan(ctx context.Context) (<-chan cid.Cid, error) {
|
||||||
@@ -93,7 +93,7 @@ func (es *exposedSplitStore) AllKeysChan(ctx context.Context) (<-chan cid.Cid, e
|
|||||||
|
|
||||||
func (es *exposedSplitStore) HashOnRead(enabled bool) {}
|
func (es *exposedSplitStore) HashOnRead(enabled bool) {}
|
||||||
|
|
||||||
func (es *exposedSplitStore) View(c cid.Cid, f func([]byte) error) error {
|
func (es *exposedSplitStore) View(ctx context.Context, c cid.Cid, f func([]byte) error) error {
|
||||||
if isIdentiyCid(c) {
|
if isIdentiyCid(c) {
|
||||||
data, err := decodeIdentityCid(c)
|
data, err := decodeIdentityCid(c)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -103,10 +103,10 @@ func (es *exposedSplitStore) View(c cid.Cid, f func([]byte) error) error {
|
|||||||
return f(data)
|
return f(data)
|
||||||
}
|
}
|
||||||
|
|
||||||
err := es.s.hot.View(c, f)
|
err := es.s.hot.View(ctx, c, f)
|
||||||
switch err {
|
switch err {
|
||||||
case bstore.ErrNotFound:
|
case bstore.ErrNotFound:
|
||||||
return es.s.cold.View(c, f)
|
return es.s.cold.View(ctx, c, f)
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return err
|
return err
|
||||||
|
|||||||
@@ -0,0 +1,214 @@
|
|||||||
|
package splitstore
|
||||||
|
|
||||||
|
import (
|
||||||
|
"errors"
|
||||||
|
"runtime"
|
||||||
|
"sync/atomic"
|
||||||
|
|
||||||
|
"golang.org/x/xerrors"
|
||||||
|
|
||||||
|
blocks "github.com/ipfs/go-block-format"
|
||||||
|
cid "github.com/ipfs/go-cid"
|
||||||
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
errReifyLimit = errors.New("reification limit reached")
|
||||||
|
ReifyLimit = 16384
|
||||||
|
)
|
||||||
|
|
||||||
|
func (s *SplitStore) reifyColdObject(c cid.Cid) {
|
||||||
|
if !s.isWarm() {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if isUnitaryObject(c) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
s.reifyMx.Lock()
|
||||||
|
defer s.reifyMx.Unlock()
|
||||||
|
|
||||||
|
_, ok := s.reifyInProgress[c]
|
||||||
|
if ok {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
s.reifyPend[c] = struct{}{}
|
||||||
|
s.reifyCond.Broadcast()
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *SplitStore) reifyOrchestrator() {
|
||||||
|
workers := runtime.NumCPU() / 4
|
||||||
|
if workers < 2 {
|
||||||
|
workers = 2
|
||||||
|
}
|
||||||
|
|
||||||
|
workch := make(chan cid.Cid, workers)
|
||||||
|
defer close(workch)
|
||||||
|
|
||||||
|
for i := 0; i < workers; i++ {
|
||||||
|
s.reifyWorkers.Add(1)
|
||||||
|
go s.reifyWorker(workch)
|
||||||
|
}
|
||||||
|
|
||||||
|
for {
|
||||||
|
s.reifyMx.Lock()
|
||||||
|
for len(s.reifyPend) == 0 && atomic.LoadInt32(&s.closing) == 0 {
|
||||||
|
s.reifyCond.Wait()
|
||||||
|
}
|
||||||
|
|
||||||
|
if atomic.LoadInt32(&s.closing) != 0 {
|
||||||
|
s.reifyMx.Unlock()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
reifyPend := s.reifyPend
|
||||||
|
s.reifyPend = make(map[cid.Cid]struct{})
|
||||||
|
s.reifyMx.Unlock()
|
||||||
|
|
||||||
|
for c := range reifyPend {
|
||||||
|
select {
|
||||||
|
case workch <- c:
|
||||||
|
case <-s.ctx.Done():
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *SplitStore) reifyWorker(workch chan cid.Cid) {
|
||||||
|
defer s.reifyWorkers.Done()
|
||||||
|
for c := range workch {
|
||||||
|
s.doReify(c)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *SplitStore) doReify(c cid.Cid) {
|
||||||
|
var toreify, totrack, toforget []cid.Cid
|
||||||
|
|
||||||
|
defer func() {
|
||||||
|
s.reifyMx.Lock()
|
||||||
|
defer s.reifyMx.Unlock()
|
||||||
|
|
||||||
|
for _, c := range toreify {
|
||||||
|
delete(s.reifyInProgress, c)
|
||||||
|
}
|
||||||
|
for _, c := range totrack {
|
||||||
|
delete(s.reifyInProgress, c)
|
||||||
|
}
|
||||||
|
for _, c := range toforget {
|
||||||
|
delete(s.reifyInProgress, c)
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
|
s.txnLk.RLock()
|
||||||
|
defer s.txnLk.RUnlock()
|
||||||
|
|
||||||
|
count := 0
|
||||||
|
err := s.walkObjectIncomplete(c, newTmpVisitor(),
|
||||||
|
func(c cid.Cid) error {
|
||||||
|
if isUnitaryObject(c) {
|
||||||
|
return errStopWalk
|
||||||
|
}
|
||||||
|
|
||||||
|
count++
|
||||||
|
if count > ReifyLimit {
|
||||||
|
return errReifyLimit
|
||||||
|
}
|
||||||
|
|
||||||
|
s.reifyMx.Lock()
|
||||||
|
_, inProgress := s.reifyInProgress[c]
|
||||||
|
if !inProgress {
|
||||||
|
s.reifyInProgress[c] = struct{}{}
|
||||||
|
}
|
||||||
|
s.reifyMx.Unlock()
|
||||||
|
|
||||||
|
if inProgress {
|
||||||
|
return errStopWalk
|
||||||
|
}
|
||||||
|
|
||||||
|
has, err := s.hot.Has(s.ctx, c)
|
||||||
|
if err != nil {
|
||||||
|
return xerrors.Errorf("error checking hotstore: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if has {
|
||||||
|
if s.txnMarkSet != nil {
|
||||||
|
hasMark, err := s.txnMarkSet.Has(c)
|
||||||
|
if err != nil {
|
||||||
|
log.Warnf("error checking markset: %s", err)
|
||||||
|
} else if hasMark {
|
||||||
|
toforget = append(toforget, c)
|
||||||
|
return errStopWalk
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
totrack = append(totrack, c)
|
||||||
|
return errStopWalk
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
toreify = append(toreify, c)
|
||||||
|
return nil
|
||||||
|
},
|
||||||
|
func(missing cid.Cid) error {
|
||||||
|
log.Warnf("missing reference while reifying %s: %s", c, missing)
|
||||||
|
return errStopWalk
|
||||||
|
})
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
if xerrors.Is(err, errReifyLimit) {
|
||||||
|
log.Debug("reification aborted; reify limit reached")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
log.Warnf("error walking cold object for reification (cid: %s): %s", c, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
log.Debugf("reifying %d objects rooted at %s", len(toreify), c)
|
||||||
|
|
||||||
|
// this should not get too big, maybe some 100s of objects.
|
||||||
|
batch := make([]blocks.Block, 0, len(toreify))
|
||||||
|
for _, c := range toreify {
|
||||||
|
blk, err := s.cold.Get(s.ctx, c)
|
||||||
|
if err != nil {
|
||||||
|
log.Warnf("error retrieving cold object for reification (cid: %s): %s", c, err)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := s.checkClosing(); err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
batch = append(batch, blk)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(batch) > 0 {
|
||||||
|
err = s.hot.PutMany(s.ctx, batch)
|
||||||
|
if err != nil {
|
||||||
|
log.Warnf("error reifying cold object (cid: %s): %s", c, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if s.txnMarkSet != nil {
|
||||||
|
if len(toreify) > 0 {
|
||||||
|
if err := s.txnMarkSet.MarkMany(toreify); err != nil {
|
||||||
|
log.Warnf("error marking reified objects: %s", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if len(totrack) > 0 {
|
||||||
|
if err := s.txnMarkSet.MarkMany(totrack); err != nil {
|
||||||
|
log.Warnf("error marking tracked objects: %s", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// if txnActive is false these are noops
|
||||||
|
if len(toreify) > 0 {
|
||||||
|
s.trackTxnRefMany(toreify)
|
||||||
|
}
|
||||||
|
if len(totrack) > 0 {
|
||||||
|
s.trackTxnRefMany(totrack)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,9 +1,11 @@
|
|||||||
|
//stm: #unit
|
||||||
package splitstore
|
package splitstore
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"math/rand"
|
||||||
"sync"
|
"sync"
|
||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
"testing"
|
"testing"
|
||||||
@@ -11,6 +13,7 @@ import (
|
|||||||
|
|
||||||
"github.com/filecoin-project/go-state-types/abi"
|
"github.com/filecoin-project/go-state-types/abi"
|
||||||
"github.com/filecoin-project/lotus/blockstore"
|
"github.com/filecoin-project/lotus/blockstore"
|
||||||
|
"github.com/filecoin-project/lotus/chain/stmgr"
|
||||||
"github.com/filecoin-project/lotus/chain/types"
|
"github.com/filecoin-project/lotus/chain/types"
|
||||||
"github.com/filecoin-project/lotus/chain/types/mock"
|
"github.com/filecoin-project/lotus/chain/types/mock"
|
||||||
|
|
||||||
@@ -19,16 +22,19 @@ import (
|
|||||||
datastore "github.com/ipfs/go-datastore"
|
datastore "github.com/ipfs/go-datastore"
|
||||||
dssync "github.com/ipfs/go-datastore/sync"
|
dssync "github.com/ipfs/go-datastore/sync"
|
||||||
logging "github.com/ipfs/go-log/v2"
|
logging "github.com/ipfs/go-log/v2"
|
||||||
|
mh "github.com/multiformats/go-multihash"
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
CompactionThreshold = 5
|
CompactionThreshold = 5
|
||||||
CompactionBoundary = 2
|
CompactionBoundary = 2
|
||||||
WarmupBoundary = 0
|
WarmupBoundary = 0
|
||||||
|
SyncWaitTime = time.Millisecond
|
||||||
logging.SetLogLevel("splitstore", "DEBUG")
|
logging.SetLogLevel("splitstore", "DEBUG")
|
||||||
}
|
}
|
||||||
|
|
||||||
func testSplitStore(t *testing.T, cfg *Config) {
|
func testSplitStore(t *testing.T, cfg *Config) {
|
||||||
|
ctx := context.Background()
|
||||||
chain := &mockChain{t: t}
|
chain := &mockChain{t: t}
|
||||||
|
|
||||||
// the myriads of stores
|
// the myriads of stores
|
||||||
@@ -38,7 +44,7 @@ func testSplitStore(t *testing.T, cfg *Config) {
|
|||||||
|
|
||||||
// this is necessary to avoid the garbage mock puts in the blocks
|
// this is necessary to avoid the garbage mock puts in the blocks
|
||||||
garbage := blocks.NewBlock([]byte{1, 2, 3})
|
garbage := blocks.NewBlock([]byte{1, 2, 3})
|
||||||
err := cold.Put(garbage)
|
err := cold.Put(ctx, garbage)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
@@ -59,27 +65,29 @@ func testSplitStore(t *testing.T, cfg *Config) {
|
|||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
err = cold.Put(blk)
|
err = cold.Put(ctx, blk)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// create a garbage block that is protected with a rgistered protector
|
// create a garbage block that is protected with a rgistered protector
|
||||||
protected := blocks.NewBlock([]byte("protected!"))
|
protected := blocks.NewBlock([]byte("protected!"))
|
||||||
err = hot.Put(protected)
|
err = hot.Put(ctx, protected)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// and another one that is not protected
|
// and another one that is not protected
|
||||||
unprotected := blocks.NewBlock([]byte("unprotected!"))
|
unprotected := blocks.NewBlock([]byte("unprotected!"))
|
||||||
err = hot.Put(unprotected)
|
err = hot.Put(ctx, unprotected)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
path := t.TempDir()
|
||||||
|
|
||||||
// open the splitstore
|
// open the splitstore
|
||||||
ss, err := Open("", ds, hot, cold, cfg)
|
ss, err := Open(path, ds, hot, cold, cfg)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
@@ -90,7 +98,7 @@ func testSplitStore(t *testing.T, cfg *Config) {
|
|||||||
return protect(protected.Cid())
|
return protect(protected.Cid())
|
||||||
})
|
})
|
||||||
|
|
||||||
err = ss.Start(chain)
|
err = ss.Start(chain, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
@@ -108,11 +116,11 @@ func testSplitStore(t *testing.T, cfg *Config) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
err = ss.Put(stateRoot)
|
err = ss.Put(ctx, stateRoot)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
err = ss.Put(sblk)
|
err = ss.Put(ctx, sblk)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
@@ -123,6 +131,10 @@ func testSplitStore(t *testing.T, cfg *Config) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
waitForCompaction := func() {
|
waitForCompaction := func() {
|
||||||
|
ss.txnSyncMx.Lock()
|
||||||
|
ss.txnSync = true
|
||||||
|
ss.txnSyncCond.Broadcast()
|
||||||
|
ss.txnSyncMx.Unlock()
|
||||||
for atomic.LoadInt32(&ss.compacting) == 1 {
|
for atomic.LoadInt32(&ss.compacting) == 1 {
|
||||||
time.Sleep(100 * time.Millisecond)
|
time.Sleep(100 * time.Millisecond)
|
||||||
}
|
}
|
||||||
@@ -175,7 +187,7 @@ func testSplitStore(t *testing.T, cfg *Config) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ensure our protected block is still there
|
// ensure our protected block is still there
|
||||||
has, err := hot.Has(protected.Cid())
|
has, err := hot.Has(ctx, protected.Cid())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
@@ -185,7 +197,7 @@ func testSplitStore(t *testing.T, cfg *Config) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ensure our unprotected block is in the coldstore now
|
// ensure our unprotected block is in the coldstore now
|
||||||
has, err = hot.Has(unprotected.Cid())
|
has, err = hot.Has(ctx, unprotected.Cid())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
@@ -194,7 +206,7 @@ func testSplitStore(t *testing.T, cfg *Config) {
|
|||||||
t.Fatal("unprotected block is still in hotstore")
|
t.Fatal("unprotected block is still in hotstore")
|
||||||
}
|
}
|
||||||
|
|
||||||
has, err = cold.Has(unprotected.Cid())
|
has, err = cold.Has(ctx, unprotected.Cid())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
@@ -208,10 +220,16 @@ func testSplitStore(t *testing.T, cfg *Config) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestSplitStoreCompaction(t *testing.T) {
|
func TestSplitStoreCompaction(t *testing.T) {
|
||||||
|
//stm: @SPLITSTORE_SPLITSTORE_OPEN_001, @SPLITSTORE_SPLITSTORE_CLOSE_001
|
||||||
|
//stm: @SPLITSTORE_SPLITSTORE_PUT_001, @SPLITSTORE_SPLITSTORE_ADD_PROTECTOR_001
|
||||||
|
//stm: @SPLITSTORE_SPLITSTORE_CLOSE_001
|
||||||
testSplitStore(t, &Config{MarkSetType: "map"})
|
testSplitStore(t, &Config{MarkSetType: "map"})
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestSplitStoreCompactionWithBadger(t *testing.T) {
|
func TestSplitStoreCompactionWithBadger(t *testing.T) {
|
||||||
|
//stm: @SPLITSTORE_SPLITSTORE_OPEN_001, @SPLITSTORE_SPLITSTORE_CLOSE_001
|
||||||
|
//stm: @SPLITSTORE_SPLITSTORE_PUT_001, @SPLITSTORE_SPLITSTORE_ADD_PROTECTOR_001
|
||||||
|
//stm: @SPLITSTORE_SPLITSTORE_CLOSE_001
|
||||||
bs := badgerMarkSetBatchSize
|
bs := badgerMarkSetBatchSize
|
||||||
badgerMarkSetBatchSize = 1
|
badgerMarkSetBatchSize = 1
|
||||||
t.Cleanup(func() {
|
t.Cleanup(func() {
|
||||||
@@ -220,6 +238,365 @@ func TestSplitStoreCompactionWithBadger(t *testing.T) {
|
|||||||
testSplitStore(t, &Config{MarkSetType: "badger"})
|
testSplitStore(t, &Config{MarkSetType: "badger"})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestSplitStoreSuppressCompactionNearUpgrade(t *testing.T) {
|
||||||
|
//stm: @SPLITSTORE_SPLITSTORE_OPEN_001, @SPLITSTORE_SPLITSTORE_CLOSE_001
|
||||||
|
//stm: @SPLITSTORE_SPLITSTORE_PUT_001, @SPLITSTORE_SPLITSTORE_ADD_PROTECTOR_001
|
||||||
|
//stm: @SPLITSTORE_SPLITSTORE_CLOSE_001
|
||||||
|
ctx := context.Background()
|
||||||
|
chain := &mockChain{t: t}
|
||||||
|
|
||||||
|
// the myriads of stores
|
||||||
|
ds := dssync.MutexWrap(datastore.NewMapDatastore())
|
||||||
|
hot := newMockStore()
|
||||||
|
cold := newMockStore()
|
||||||
|
|
||||||
|
// this is necessary to avoid the garbage mock puts in the blocks
|
||||||
|
garbage := blocks.NewBlock([]byte{1, 2, 3})
|
||||||
|
err := cold.Put(ctx, garbage)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
// genesis
|
||||||
|
genBlock := mock.MkBlock(nil, 0, 0)
|
||||||
|
genBlock.Messages = garbage.Cid()
|
||||||
|
genBlock.ParentMessageReceipts = garbage.Cid()
|
||||||
|
genBlock.ParentStateRoot = garbage.Cid()
|
||||||
|
genBlock.Timestamp = uint64(time.Now().Unix())
|
||||||
|
|
||||||
|
genTs := mock.TipSet(genBlock)
|
||||||
|
chain.push(genTs)
|
||||||
|
|
||||||
|
// put the genesis block to cold store
|
||||||
|
blk, err := genBlock.ToStorageBlock()
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
err = cold.Put(ctx, blk)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
path := t.TempDir()
|
||||||
|
|
||||||
|
// open the splitstore
|
||||||
|
ss, err := Open(path, ds, hot, cold, &Config{MarkSetType: "map"})
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
defer ss.Close() //nolint
|
||||||
|
|
||||||
|
// create an upgrade schedule that will suppress compaction during the test
|
||||||
|
upgradeBoundary = 0
|
||||||
|
upgrade := stmgr.Upgrade{
|
||||||
|
Height: 10,
|
||||||
|
PreMigrations: []stmgr.PreMigration{{StartWithin: 10}},
|
||||||
|
}
|
||||||
|
|
||||||
|
err = ss.Start(chain, []stmgr.Upgrade{upgrade})
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
mkBlock := func(curTs *types.TipSet, i int, stateRoot blocks.Block) *types.TipSet {
|
||||||
|
blk := mock.MkBlock(curTs, uint64(i), uint64(i))
|
||||||
|
|
||||||
|
blk.Messages = garbage.Cid()
|
||||||
|
blk.ParentMessageReceipts = garbage.Cid()
|
||||||
|
blk.ParentStateRoot = stateRoot.Cid()
|
||||||
|
blk.Timestamp = uint64(time.Now().Unix())
|
||||||
|
|
||||||
|
sblk, err := blk.ToStorageBlock()
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
err = ss.Put(ctx, stateRoot)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
err = ss.Put(ctx, sblk)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
ts := mock.TipSet(blk)
|
||||||
|
chain.push(ts)
|
||||||
|
|
||||||
|
return ts
|
||||||
|
}
|
||||||
|
|
||||||
|
waitForCompaction := func() {
|
||||||
|
ss.txnSyncMx.Lock()
|
||||||
|
ss.txnSync = true
|
||||||
|
ss.txnSyncCond.Broadcast()
|
||||||
|
ss.txnSyncMx.Unlock()
|
||||||
|
for atomic.LoadInt32(&ss.compacting) == 1 {
|
||||||
|
time.Sleep(100 * time.Millisecond)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
curTs := genTs
|
||||||
|
for i := 1; i < 10; i++ {
|
||||||
|
stateRoot := blocks.NewBlock([]byte{byte(i), 3, 3, 7})
|
||||||
|
curTs = mkBlock(curTs, i, stateRoot)
|
||||||
|
waitForCompaction()
|
||||||
|
}
|
||||||
|
|
||||||
|
countBlocks := func(bs blockstore.Blockstore) int {
|
||||||
|
count := 0
|
||||||
|
_ = bs.(blockstore.BlockstoreIterator).ForEachKey(func(_ cid.Cid) error {
|
||||||
|
count++
|
||||||
|
return nil
|
||||||
|
})
|
||||||
|
return count
|
||||||
|
}
|
||||||
|
|
||||||
|
// we should not have compacted due to suppression and everything should still be hot
|
||||||
|
hotCnt := countBlocks(hot)
|
||||||
|
coldCnt := countBlocks(cold)
|
||||||
|
|
||||||
|
if hotCnt != 20 {
|
||||||
|
t.Errorf("expected %d blocks, but got %d", 20, hotCnt)
|
||||||
|
}
|
||||||
|
|
||||||
|
if coldCnt != 2 {
|
||||||
|
t.Errorf("expected %d blocks, but got %d", 2, coldCnt)
|
||||||
|
}
|
||||||
|
|
||||||
|
// put some more blocks, now we should compact
|
||||||
|
for i := 10; i < 20; i++ {
|
||||||
|
stateRoot := blocks.NewBlock([]byte{byte(i), 3, 3, 7})
|
||||||
|
curTs = mkBlock(curTs, i, stateRoot)
|
||||||
|
waitForCompaction()
|
||||||
|
}
|
||||||
|
|
||||||
|
hotCnt = countBlocks(hot)
|
||||||
|
coldCnt = countBlocks(cold)
|
||||||
|
|
||||||
|
if hotCnt != 24 {
|
||||||
|
t.Errorf("expected %d blocks, but got %d", 24, hotCnt)
|
||||||
|
}
|
||||||
|
|
||||||
|
if coldCnt != 18 {
|
||||||
|
t.Errorf("expected %d blocks, but got %d", 18, coldCnt)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func testSplitStoreReification(t *testing.T, f func(context.Context, blockstore.Blockstore, cid.Cid) error) {
|
||||||
|
ds := dssync.MutexWrap(datastore.NewMapDatastore())
|
||||||
|
hot := newMockStore()
|
||||||
|
cold := newMockStore()
|
||||||
|
|
||||||
|
mkRandomBlock := func() blocks.Block {
|
||||||
|
data := make([]byte, 128)
|
||||||
|
_, err := rand.Read(data)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
return blocks.NewBlock(data)
|
||||||
|
}
|
||||||
|
|
||||||
|
block1 := mkRandomBlock()
|
||||||
|
block2 := mkRandomBlock()
|
||||||
|
block3 := mkRandomBlock()
|
||||||
|
|
||||||
|
hdr := mock.MkBlock(nil, 0, 0)
|
||||||
|
hdr.Messages = block1.Cid()
|
||||||
|
hdr.ParentMessageReceipts = block2.Cid()
|
||||||
|
hdr.ParentStateRoot = block3.Cid()
|
||||||
|
block4, err := hdr.ToStorageBlock()
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
allBlocks := []blocks.Block{block1, block2, block3, block4}
|
||||||
|
for _, blk := range allBlocks {
|
||||||
|
err := cold.Put(context.Background(), blk)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
path := t.TempDir()
|
||||||
|
|
||||||
|
ss, err := Open(path, ds, hot, cold, &Config{MarkSetType: "map"})
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
defer ss.Close() //nolint
|
||||||
|
|
||||||
|
ss.warmupEpoch = 1
|
||||||
|
go ss.reifyOrchestrator()
|
||||||
|
|
||||||
|
waitForReification := func() {
|
||||||
|
for {
|
||||||
|
ss.reifyMx.Lock()
|
||||||
|
ready := len(ss.reifyPend) == 0 && len(ss.reifyInProgress) == 0
|
||||||
|
ss.reifyMx.Unlock()
|
||||||
|
|
||||||
|
if ready {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
time.Sleep(time.Millisecond)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// first access using the standard view
|
||||||
|
err = f(context.Background(), ss, block4.Cid())
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
// nothing should be reified
|
||||||
|
waitForReification()
|
||||||
|
for _, blk := range allBlocks {
|
||||||
|
has, err := hot.Has(context.Background(), blk.Cid())
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if has {
|
||||||
|
t.Fatal("block unexpectedly reified")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// now make the hot/reifying view and ensure access reifies
|
||||||
|
err = f(blockstore.WithHotView(context.Background()), ss, block4.Cid())
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
// everything should be reified
|
||||||
|
waitForReification()
|
||||||
|
for i, blk := range allBlocks {
|
||||||
|
has, err := hot.Has(context.Background(), blk.Cid())
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if !has {
|
||||||
|
t.Fatalf("block%d was not reified", i+1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func testSplitStoreReificationLimit(t *testing.T, f func(context.Context, blockstore.Blockstore, cid.Cid) error) {
|
||||||
|
ds := dssync.MutexWrap(datastore.NewMapDatastore())
|
||||||
|
hot := newMockStore()
|
||||||
|
cold := newMockStore()
|
||||||
|
|
||||||
|
mkRandomBlock := func() blocks.Block {
|
||||||
|
data := make([]byte, 128)
|
||||||
|
_, err := rand.Read(data)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
return blocks.NewBlock(data)
|
||||||
|
}
|
||||||
|
|
||||||
|
block1 := mkRandomBlock()
|
||||||
|
block2 := mkRandomBlock()
|
||||||
|
block3 := mkRandomBlock()
|
||||||
|
|
||||||
|
hdr := mock.MkBlock(nil, 0, 0)
|
||||||
|
hdr.Messages = block1.Cid()
|
||||||
|
hdr.ParentMessageReceipts = block2.Cid()
|
||||||
|
hdr.ParentStateRoot = block3.Cid()
|
||||||
|
block4, err := hdr.ToStorageBlock()
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
allBlocks := []blocks.Block{block1, block2, block3, block4}
|
||||||
|
for _, blk := range allBlocks {
|
||||||
|
err := cold.Put(context.Background(), blk)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
path := t.TempDir()
|
||||||
|
|
||||||
|
ss, err := Open(path, ds, hot, cold, &Config{MarkSetType: "map"})
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
defer ss.Close() //nolint
|
||||||
|
|
||||||
|
ss.warmupEpoch = 1
|
||||||
|
go ss.reifyOrchestrator()
|
||||||
|
|
||||||
|
waitForReification := func() {
|
||||||
|
for {
|
||||||
|
ss.reifyMx.Lock()
|
||||||
|
ready := len(ss.reifyPend) == 0 && len(ss.reifyInProgress) == 0
|
||||||
|
ss.reifyMx.Unlock()
|
||||||
|
|
||||||
|
if ready {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
time.Sleep(time.Millisecond)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// do a hot access -- nothing should be reified as the limit should be exceeded
|
||||||
|
oldReifyLimit := ReifyLimit
|
||||||
|
ReifyLimit = 2
|
||||||
|
t.Cleanup(func() {
|
||||||
|
ReifyLimit = oldReifyLimit
|
||||||
|
})
|
||||||
|
|
||||||
|
err = f(blockstore.WithHotView(context.Background()), ss, block4.Cid())
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
waitForReification()
|
||||||
|
|
||||||
|
for _, blk := range allBlocks {
|
||||||
|
has, err := hot.Has(context.Background(), blk.Cid())
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if has {
|
||||||
|
t.Fatal("block unexpectedly reified")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestSplitStoreReification(t *testing.T) {
|
||||||
|
t.Log("test reification with Has")
|
||||||
|
testSplitStoreReification(t, func(ctx context.Context, s blockstore.Blockstore, c cid.Cid) error {
|
||||||
|
_, err := s.Has(ctx, c)
|
||||||
|
return err
|
||||||
|
})
|
||||||
|
t.Log("test reification with Get")
|
||||||
|
testSplitStoreReification(t, func(ctx context.Context, s blockstore.Blockstore, c cid.Cid) error {
|
||||||
|
_, err := s.Get(ctx, c)
|
||||||
|
return err
|
||||||
|
})
|
||||||
|
t.Log("test reification with GetSize")
|
||||||
|
testSplitStoreReification(t, func(ctx context.Context, s blockstore.Blockstore, c cid.Cid) error {
|
||||||
|
_, err := s.GetSize(ctx, c)
|
||||||
|
return err
|
||||||
|
})
|
||||||
|
t.Log("test reification with View")
|
||||||
|
testSplitStoreReification(t, func(ctx context.Context, s blockstore.Blockstore, c cid.Cid) error {
|
||||||
|
return s.View(ctx, c, func(_ []byte) error { return nil })
|
||||||
|
})
|
||||||
|
t.Log("test reification limit")
|
||||||
|
testSplitStoreReificationLimit(t, func(ctx context.Context, s blockstore.Blockstore, c cid.Cid) error {
|
||||||
|
_, err := s.Has(ctx, c)
|
||||||
|
return err
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
type mockChain struct {
|
type mockChain struct {
|
||||||
t testing.TB
|
t testing.TB
|
||||||
|
|
||||||
@@ -289,35 +666,43 @@ func (c *mockChain) SubscribeHeadChanges(change func(revert []*types.TipSet, app
|
|||||||
|
|
||||||
type mockStore struct {
|
type mockStore struct {
|
||||||
mx sync.Mutex
|
mx sync.Mutex
|
||||||
set map[cid.Cid]blocks.Block
|
set map[string]blocks.Block
|
||||||
}
|
}
|
||||||
|
|
||||||
func newMockStore() *mockStore {
|
func newMockStore() *mockStore {
|
||||||
return &mockStore{set: make(map[cid.Cid]blocks.Block)}
|
return &mockStore{set: make(map[string]blocks.Block)}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *mockStore) Has(cid cid.Cid) (bool, error) {
|
func (b *mockStore) keyOf(c cid.Cid) string {
|
||||||
|
return string(c.Hash())
|
||||||
|
}
|
||||||
|
|
||||||
|
func (b *mockStore) cidOf(k string) cid.Cid {
|
||||||
|
return cid.NewCidV1(cid.Raw, mh.Multihash([]byte(k)))
|
||||||
|
}
|
||||||
|
|
||||||
|
func (b *mockStore) Has(_ context.Context, cid cid.Cid) (bool, error) {
|
||||||
b.mx.Lock()
|
b.mx.Lock()
|
||||||
defer b.mx.Unlock()
|
defer b.mx.Unlock()
|
||||||
_, ok := b.set[cid]
|
_, ok := b.set[b.keyOf(cid)]
|
||||||
return ok, nil
|
return ok, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *mockStore) HashOnRead(hor bool) {}
|
func (b *mockStore) HashOnRead(hor bool) {}
|
||||||
|
|
||||||
func (b *mockStore) Get(cid cid.Cid) (blocks.Block, error) {
|
func (b *mockStore) Get(_ context.Context, cid cid.Cid) (blocks.Block, error) {
|
||||||
b.mx.Lock()
|
b.mx.Lock()
|
||||||
defer b.mx.Unlock()
|
defer b.mx.Unlock()
|
||||||
|
|
||||||
blk, ok := b.set[cid]
|
blk, ok := b.set[b.keyOf(cid)]
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, blockstore.ErrNotFound
|
return nil, blockstore.ErrNotFound
|
||||||
}
|
}
|
||||||
return blk, nil
|
return blk, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *mockStore) GetSize(cid cid.Cid) (int, error) {
|
func (b *mockStore) GetSize(ctx context.Context, cid cid.Cid) (int, error) {
|
||||||
blk, err := b.Get(cid)
|
blk, err := b.Get(ctx, cid)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
@@ -325,46 +710,46 @@ func (b *mockStore) GetSize(cid cid.Cid) (int, error) {
|
|||||||
return len(blk.RawData()), nil
|
return len(blk.RawData()), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *mockStore) View(cid cid.Cid, f func([]byte) error) error {
|
func (b *mockStore) View(ctx context.Context, cid cid.Cid, f func([]byte) error) error {
|
||||||
blk, err := b.Get(cid)
|
blk, err := b.Get(ctx, cid)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
return f(blk.RawData())
|
return f(blk.RawData())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *mockStore) Put(blk blocks.Block) error {
|
func (b *mockStore) Put(_ context.Context, blk blocks.Block) error {
|
||||||
b.mx.Lock()
|
b.mx.Lock()
|
||||||
defer b.mx.Unlock()
|
defer b.mx.Unlock()
|
||||||
|
|
||||||
b.set[blk.Cid()] = blk
|
b.set[b.keyOf(blk.Cid())] = blk
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *mockStore) PutMany(blks []blocks.Block) error {
|
func (b *mockStore) PutMany(_ context.Context, blks []blocks.Block) error {
|
||||||
b.mx.Lock()
|
b.mx.Lock()
|
||||||
defer b.mx.Unlock()
|
defer b.mx.Unlock()
|
||||||
|
|
||||||
for _, blk := range blks {
|
for _, blk := range blks {
|
||||||
b.set[blk.Cid()] = blk
|
b.set[b.keyOf(blk.Cid())] = blk
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *mockStore) DeleteBlock(cid cid.Cid) error {
|
func (b *mockStore) DeleteBlock(_ context.Context, cid cid.Cid) error {
|
||||||
b.mx.Lock()
|
b.mx.Lock()
|
||||||
defer b.mx.Unlock()
|
defer b.mx.Unlock()
|
||||||
|
|
||||||
delete(b.set, cid)
|
delete(b.set, b.keyOf(cid))
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *mockStore) DeleteMany(cids []cid.Cid) error {
|
func (b *mockStore) DeleteMany(_ context.Context, cids []cid.Cid) error {
|
||||||
b.mx.Lock()
|
b.mx.Lock()
|
||||||
defer b.mx.Unlock()
|
defer b.mx.Unlock()
|
||||||
|
|
||||||
for _, c := range cids {
|
for _, c := range cids {
|
||||||
delete(b.set, c)
|
delete(b.set, b.keyOf(c))
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@@ -378,7 +763,7 @@ func (b *mockStore) ForEachKey(f func(cid.Cid) error) error {
|
|||||||
defer b.mx.Unlock()
|
defer b.mx.Unlock()
|
||||||
|
|
||||||
for c := range b.set {
|
for c := range b.set {
|
||||||
err := f(c)
|
err := f(b.cidOf(c))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package splitstore
|
package splitstore
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"sync"
|
||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@@ -55,12 +56,13 @@ func (s *SplitStore) doWarmup(curTs *types.TipSet) error {
|
|||||||
if WarmupBoundary < epoch {
|
if WarmupBoundary < epoch {
|
||||||
boundaryEpoch = epoch - WarmupBoundary
|
boundaryEpoch = epoch - WarmupBoundary
|
||||||
}
|
}
|
||||||
|
var mx sync.Mutex
|
||||||
batchHot := make([]blocks.Block, 0, batchSize)
|
batchHot := make([]blocks.Block, 0, batchSize)
|
||||||
count := int64(0)
|
count := new(int64)
|
||||||
xcount := int64(0)
|
xcount := new(int64)
|
||||||
missing := int64(0)
|
missing := new(int64)
|
||||||
|
|
||||||
visitor, err := s.markSetEnv.CreateVisitor("warmup", 0)
|
visitor, err := s.markSetEnv.New("warmup", 0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return xerrors.Errorf("error creating visitor: %w", err)
|
return xerrors.Errorf("error creating visitor: %w", err)
|
||||||
}
|
}
|
||||||
@@ -73,9 +75,9 @@ func (s *SplitStore) doWarmup(curTs *types.TipSet) error {
|
|||||||
return errStopWalk
|
return errStopWalk
|
||||||
}
|
}
|
||||||
|
|
||||||
count++
|
atomic.AddInt64(count, 1)
|
||||||
|
|
||||||
has, err := s.hot.Has(c)
|
has, err := s.hot.Has(s.ctx, c)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@@ -84,25 +86,28 @@ func (s *SplitStore) doWarmup(curTs *types.TipSet) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
blk, err := s.cold.Get(c)
|
blk, err := s.cold.Get(s.ctx, c)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if err == bstore.ErrNotFound {
|
if err == bstore.ErrNotFound {
|
||||||
missing++
|
atomic.AddInt64(missing, 1)
|
||||||
return errStopWalk
|
return errStopWalk
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
xcount++
|
atomic.AddInt64(xcount, 1)
|
||||||
|
|
||||||
|
mx.Lock()
|
||||||
batchHot = append(batchHot, blk)
|
batchHot = append(batchHot, blk)
|
||||||
if len(batchHot) == batchSize {
|
if len(batchHot) == batchSize {
|
||||||
err = s.hot.PutMany(batchHot)
|
err = s.hot.PutMany(s.ctx, batchHot)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
mx.Unlock()
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
batchHot = batchHot[:0]
|
batchHot = batchHot[:0]
|
||||||
}
|
}
|
||||||
|
mx.Unlock()
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
@@ -112,22 +117,22 @@ func (s *SplitStore) doWarmup(curTs *types.TipSet) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if len(batchHot) > 0 {
|
if len(batchHot) > 0 {
|
||||||
err = s.hot.PutMany(batchHot)
|
err = s.hot.PutMany(s.ctx, batchHot)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Infow("warmup stats", "visited", count, "warm", xcount, "missing", missing)
|
log.Infow("warmup stats", "visited", *count, "warm", *xcount, "missing", *missing)
|
||||||
|
|
||||||
s.markSetSize = count + count>>2 // overestimate a bit
|
s.markSetSize = *count + *count>>2 // overestimate a bit
|
||||||
err = s.ds.Put(markSetSizeKey, int64ToBytes(s.markSetSize))
|
err = s.ds.Put(s.ctx, markSetSizeKey, int64ToBytes(s.markSetSize))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Warnf("error saving mark set size: %s", err)
|
log.Warnf("error saving mark set size: %s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// save the warmup epoch
|
// save the warmup epoch
|
||||||
err = s.ds.Put(warmupEpochKey, epochToBytes(epoch))
|
err = s.ds.Put(s.ctx, warmupEpochKey, epochToBytes(epoch))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return xerrors.Errorf("error saving warm up epoch: %w", err)
|
return xerrors.Errorf("error saving warm up epoch: %w", err)
|
||||||
}
|
}
|
||||||
@@ -136,7 +141,7 @@ func (s *SplitStore) doWarmup(curTs *types.TipSet) error {
|
|||||||
s.mx.Unlock()
|
s.mx.Unlock()
|
||||||
|
|
||||||
// also save the compactionIndex, as this is used as an indicator of warmup for upgraded nodes
|
// also save the compactionIndex, as this is used as an indicator of warmup for upgraded nodes
|
||||||
err = s.ds.Put(compactionIndexKey, int64ToBytes(s.compactionIndex))
|
err = s.ds.Put(s.ctx, compactionIndexKey, int64ToBytes(s.compactionIndex))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return xerrors.Errorf("error saving compaction index: %w", err)
|
return xerrors.Errorf("error saving compaction index: %w", err)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
package splitstore
|
package splitstore
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"sync"
|
||||||
|
|
||||||
cid "github.com/ipfs/go-cid"
|
cid "github.com/ipfs/go-cid"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -17,16 +19,42 @@ func (v *noopVisitor) Visit(_ cid.Cid) (bool, error) {
|
|||||||
return true, nil
|
return true, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type cidSetVisitor struct {
|
type tmpVisitor struct {
|
||||||
set *cid.Set
|
set *cid.Set
|
||||||
}
|
}
|
||||||
|
|
||||||
var _ ObjectVisitor = (*cidSetVisitor)(nil)
|
var _ ObjectVisitor = (*tmpVisitor)(nil)
|
||||||
|
|
||||||
|
func (v *tmpVisitor) Visit(c cid.Cid) (bool, error) {
|
||||||
|
if isUnitaryObject(c) {
|
||||||
|
return false, nil
|
||||||
|
}
|
||||||
|
|
||||||
func (v *cidSetVisitor) Visit(c cid.Cid) (bool, error) {
|
|
||||||
return v.set.Visit(c), nil
|
return v.set.Visit(c), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func tmpVisitor() ObjectVisitor {
|
func newTmpVisitor() ObjectVisitor {
|
||||||
return &cidSetVisitor{set: cid.NewSet()}
|
return &tmpVisitor{set: cid.NewSet()}
|
||||||
|
}
|
||||||
|
|
||||||
|
type concurrentVisitor struct {
|
||||||
|
mx sync.Mutex
|
||||||
|
set *cid.Set
|
||||||
|
}
|
||||||
|
|
||||||
|
var _ ObjectVisitor = (*concurrentVisitor)(nil)
|
||||||
|
|
||||||
|
func newConcurrentVisitor() *concurrentVisitor {
|
||||||
|
return &concurrentVisitor{set: cid.NewSet()}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (v *concurrentVisitor) Visit(c cid.Cid) (bool, error) {
|
||||||
|
if isUnitaryObject(c) {
|
||||||
|
return false, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
v.mx.Lock()
|
||||||
|
defer v.mx.Unlock()
|
||||||
|
|
||||||
|
return v.set.Visit(c), nil
|
||||||
}
|
}
|
||||||
|
|||||||
+16
-16
@@ -20,53 +20,53 @@ type SyncBlockstore struct {
|
|||||||
bs MemBlockstore // specifically use a memStore to save indirection overhead.
|
bs MemBlockstore // specifically use a memStore to save indirection overhead.
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *SyncBlockstore) DeleteBlock(k cid.Cid) error {
|
func (m *SyncBlockstore) DeleteBlock(ctx context.Context, k cid.Cid) error {
|
||||||
m.mu.Lock()
|
m.mu.Lock()
|
||||||
defer m.mu.Unlock()
|
defer m.mu.Unlock()
|
||||||
return m.bs.DeleteBlock(k)
|
return m.bs.DeleteBlock(ctx, k)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *SyncBlockstore) DeleteMany(ks []cid.Cid) error {
|
func (m *SyncBlockstore) DeleteMany(ctx context.Context, ks []cid.Cid) error {
|
||||||
m.mu.Lock()
|
m.mu.Lock()
|
||||||
defer m.mu.Unlock()
|
defer m.mu.Unlock()
|
||||||
return m.bs.DeleteMany(ks)
|
return m.bs.DeleteMany(ctx, ks)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *SyncBlockstore) Has(k cid.Cid) (bool, error) {
|
func (m *SyncBlockstore) Has(ctx context.Context, k cid.Cid) (bool, error) {
|
||||||
m.mu.RLock()
|
m.mu.RLock()
|
||||||
defer m.mu.RUnlock()
|
defer m.mu.RUnlock()
|
||||||
return m.bs.Has(k)
|
return m.bs.Has(ctx, k)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *SyncBlockstore) View(k cid.Cid, callback func([]byte) error) error {
|
func (m *SyncBlockstore) View(ctx context.Context, k cid.Cid, callback func([]byte) error) error {
|
||||||
m.mu.RLock()
|
m.mu.RLock()
|
||||||
defer m.mu.RUnlock()
|
defer m.mu.RUnlock()
|
||||||
|
|
||||||
return m.bs.View(k, callback)
|
return m.bs.View(ctx, k, callback)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *SyncBlockstore) Get(k cid.Cid) (blocks.Block, error) {
|
func (m *SyncBlockstore) Get(ctx context.Context, k cid.Cid) (blocks.Block, error) {
|
||||||
m.mu.RLock()
|
m.mu.RLock()
|
||||||
defer m.mu.RUnlock()
|
defer m.mu.RUnlock()
|
||||||
return m.bs.Get(k)
|
return m.bs.Get(ctx, k)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *SyncBlockstore) GetSize(k cid.Cid) (int, error) {
|
func (m *SyncBlockstore) GetSize(ctx context.Context, k cid.Cid) (int, error) {
|
||||||
m.mu.RLock()
|
m.mu.RLock()
|
||||||
defer m.mu.RUnlock()
|
defer m.mu.RUnlock()
|
||||||
return m.bs.GetSize(k)
|
return m.bs.GetSize(ctx, k)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *SyncBlockstore) Put(b blocks.Block) error {
|
func (m *SyncBlockstore) Put(ctx context.Context, b blocks.Block) error {
|
||||||
m.mu.Lock()
|
m.mu.Lock()
|
||||||
defer m.mu.Unlock()
|
defer m.mu.Unlock()
|
||||||
return m.bs.Put(b)
|
return m.bs.Put(ctx, b)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *SyncBlockstore) PutMany(bs []blocks.Block) error {
|
func (m *SyncBlockstore) PutMany(ctx context.Context, bs []blocks.Block) error {
|
||||||
m.mu.Lock()
|
m.mu.Lock()
|
||||||
defer m.mu.Unlock()
|
defer m.mu.Unlock()
|
||||||
return m.bs.PutMany(bs)
|
return m.bs.PutMany(ctx, bs)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *SyncBlockstore) AllKeysChan(ctx context.Context) (<-chan cid.Cid, error) {
|
func (m *SyncBlockstore) AllKeysChan(ctx context.Context) (<-chan cid.Cid, error) {
|
||||||
|
|||||||
+20
-20
@@ -92,28 +92,28 @@ func (t *TimedCacheBlockstore) rotate() {
|
|||||||
t.mu.Unlock()
|
t.mu.Unlock()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *TimedCacheBlockstore) Put(b blocks.Block) error {
|
func (t *TimedCacheBlockstore) Put(ctx context.Context, b blocks.Block) error {
|
||||||
// Don't check the inactive set here. We want to keep this block for at
|
// Don't check the inactive set here. We want to keep this block for at
|
||||||
// least one interval.
|
// least one interval.
|
||||||
t.mu.Lock()
|
t.mu.Lock()
|
||||||
defer t.mu.Unlock()
|
defer t.mu.Unlock()
|
||||||
return t.active.Put(b)
|
return t.active.Put(ctx, b)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *TimedCacheBlockstore) PutMany(bs []blocks.Block) error {
|
func (t *TimedCacheBlockstore) PutMany(ctx context.Context, bs []blocks.Block) error {
|
||||||
t.mu.Lock()
|
t.mu.Lock()
|
||||||
defer t.mu.Unlock()
|
defer t.mu.Unlock()
|
||||||
return t.active.PutMany(bs)
|
return t.active.PutMany(ctx, bs)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *TimedCacheBlockstore) View(k cid.Cid, callback func([]byte) error) error {
|
func (t *TimedCacheBlockstore) View(ctx context.Context, k cid.Cid, callback func([]byte) error) error {
|
||||||
// The underlying blockstore is always a "mem" blockstore so there's no difference,
|
// The underlying blockstore is always a "mem" blockstore so there's no difference,
|
||||||
// from a performance perspective, between view & get. So we call Get to avoid
|
// from a performance perspective, between view & get. So we call Get to avoid
|
||||||
// calling an arbitrary callback while holding a lock.
|
// calling an arbitrary callback while holding a lock.
|
||||||
t.mu.RLock()
|
t.mu.RLock()
|
||||||
block, err := t.active.Get(k)
|
block, err := t.active.Get(ctx, k)
|
||||||
if err == ErrNotFound {
|
if err == ErrNotFound {
|
||||||
block, err = t.inactive.Get(k)
|
block, err = t.inactive.Get(ctx, k)
|
||||||
}
|
}
|
||||||
t.mu.RUnlock()
|
t.mu.RUnlock()
|
||||||
|
|
||||||
@@ -123,51 +123,51 @@ func (t *TimedCacheBlockstore) View(k cid.Cid, callback func([]byte) error) erro
|
|||||||
return callback(block.RawData())
|
return callback(block.RawData())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *TimedCacheBlockstore) Get(k cid.Cid) (blocks.Block, error) {
|
func (t *TimedCacheBlockstore) Get(ctx context.Context, k cid.Cid) (blocks.Block, error) {
|
||||||
t.mu.RLock()
|
t.mu.RLock()
|
||||||
defer t.mu.RUnlock()
|
defer t.mu.RUnlock()
|
||||||
b, err := t.active.Get(k)
|
b, err := t.active.Get(ctx, k)
|
||||||
if err == ErrNotFound {
|
if err == ErrNotFound {
|
||||||
b, err = t.inactive.Get(k)
|
b, err = t.inactive.Get(ctx, k)
|
||||||
}
|
}
|
||||||
return b, err
|
return b, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *TimedCacheBlockstore) GetSize(k cid.Cid) (int, error) {
|
func (t *TimedCacheBlockstore) GetSize(ctx context.Context, k cid.Cid) (int, error) {
|
||||||
t.mu.RLock()
|
t.mu.RLock()
|
||||||
defer t.mu.RUnlock()
|
defer t.mu.RUnlock()
|
||||||
size, err := t.active.GetSize(k)
|
size, err := t.active.GetSize(ctx, k)
|
||||||
if err == ErrNotFound {
|
if err == ErrNotFound {
|
||||||
size, err = t.inactive.GetSize(k)
|
size, err = t.inactive.GetSize(ctx, k)
|
||||||
}
|
}
|
||||||
return size, err
|
return size, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *TimedCacheBlockstore) Has(k cid.Cid) (bool, error) {
|
func (t *TimedCacheBlockstore) Has(ctx context.Context, k cid.Cid) (bool, error) {
|
||||||
t.mu.RLock()
|
t.mu.RLock()
|
||||||
defer t.mu.RUnlock()
|
defer t.mu.RUnlock()
|
||||||
if has, err := t.active.Has(k); err != nil {
|
if has, err := t.active.Has(ctx, k); err != nil {
|
||||||
return false, err
|
return false, err
|
||||||
} else if has {
|
} else if has {
|
||||||
return true, nil
|
return true, nil
|
||||||
}
|
}
|
||||||
return t.inactive.Has(k)
|
return t.inactive.Has(ctx, k)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *TimedCacheBlockstore) HashOnRead(_ bool) {
|
func (t *TimedCacheBlockstore) HashOnRead(_ bool) {
|
||||||
// no-op
|
// no-op
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *TimedCacheBlockstore) DeleteBlock(k cid.Cid) error {
|
func (t *TimedCacheBlockstore) DeleteBlock(ctx context.Context, k cid.Cid) error {
|
||||||
t.mu.Lock()
|
t.mu.Lock()
|
||||||
defer t.mu.Unlock()
|
defer t.mu.Unlock()
|
||||||
return multierr.Combine(t.active.DeleteBlock(k), t.inactive.DeleteBlock(k))
|
return multierr.Combine(t.active.DeleteBlock(ctx, k), t.inactive.DeleteBlock(ctx, k))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *TimedCacheBlockstore) DeleteMany(ks []cid.Cid) error {
|
func (t *TimedCacheBlockstore) DeleteMany(ctx context.Context, ks []cid.Cid) error {
|
||||||
t.mu.Lock()
|
t.mu.Lock()
|
||||||
defer t.mu.Unlock()
|
defer t.mu.Unlock()
|
||||||
return multierr.Combine(t.active.DeleteMany(ks), t.inactive.DeleteMany(ks))
|
return multierr.Combine(t.active.DeleteMany(ctx, ks), t.inactive.DeleteMany(ctx, ks))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *TimedCacheBlockstore) AllKeysChan(_ context.Context) (<-chan cid.Cid, error) {
|
func (t *TimedCacheBlockstore) AllKeysChan(_ context.Context) (<-chan cid.Cid, error) {
|
||||||
|
|||||||
+17
-11
@@ -1,3 +1,4 @@
|
|||||||
|
//stm: #unit
|
||||||
package blockstore
|
package blockstore
|
||||||
|
|
||||||
import (
|
import (
|
||||||
@@ -13,12 +14,17 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func TestTimedCacheBlockstoreSimple(t *testing.T) {
|
func TestTimedCacheBlockstoreSimple(t *testing.T) {
|
||||||
|
//stm: @SPLITSTORE_TIMED_BLOCKSTORE_START_001
|
||||||
|
//stm: @SPLITSTORE_TIMED_BLOCKSTORE_PUT_001, @SPLITSTORE_TIMED_BLOCKSTORE_HAS_001, @SPLITSTORE_TIMED_BLOCKSTORE_GET_001
|
||||||
|
//stm: @SPLITSTORE_TIMED_BLOCKSTORE_ALL_KEYS_CHAN_001
|
||||||
tc := NewTimedCacheBlockstore(10 * time.Millisecond)
|
tc := NewTimedCacheBlockstore(10 * time.Millisecond)
|
||||||
mClock := clock.NewMock()
|
mClock := clock.NewMock()
|
||||||
mClock.Set(time.Now())
|
mClock.Set(time.Now())
|
||||||
tc.clock = mClock
|
tc.clock = mClock
|
||||||
tc.doneRotatingCh = make(chan struct{})
|
tc.doneRotatingCh = make(chan struct{})
|
||||||
|
|
||||||
|
ctx := context.Background()
|
||||||
|
|
||||||
_ = tc.Start(context.Background())
|
_ = tc.Start(context.Background())
|
||||||
mClock.Add(1) // IDK why it is needed but it makes it work
|
mClock.Add(1) // IDK why it is needed but it makes it work
|
||||||
|
|
||||||
@@ -27,18 +33,18 @@ func TestTimedCacheBlockstoreSimple(t *testing.T) {
|
|||||||
}()
|
}()
|
||||||
|
|
||||||
b1 := blocks.NewBlock([]byte("foo"))
|
b1 := blocks.NewBlock([]byte("foo"))
|
||||||
require.NoError(t, tc.Put(b1))
|
require.NoError(t, tc.Put(ctx, b1))
|
||||||
|
|
||||||
b2 := blocks.NewBlock([]byte("bar"))
|
b2 := blocks.NewBlock([]byte("bar"))
|
||||||
require.NoError(t, tc.Put(b2))
|
require.NoError(t, tc.Put(ctx, b2))
|
||||||
|
|
||||||
b3 := blocks.NewBlock([]byte("baz"))
|
b3 := blocks.NewBlock([]byte("baz"))
|
||||||
|
|
||||||
b1out, err := tc.Get(b1.Cid())
|
b1out, err := tc.Get(ctx, b1.Cid())
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.Equal(t, b1.RawData(), b1out.RawData())
|
require.Equal(t, b1.RawData(), b1out.RawData())
|
||||||
|
|
||||||
has, err := tc.Has(b1.Cid())
|
has, err := tc.Has(ctx, b1.Cid())
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.True(t, has)
|
require.True(t, has)
|
||||||
|
|
||||||
@@ -46,17 +52,17 @@ func TestTimedCacheBlockstoreSimple(t *testing.T) {
|
|||||||
<-tc.doneRotatingCh
|
<-tc.doneRotatingCh
|
||||||
|
|
||||||
// We should still have everything.
|
// We should still have everything.
|
||||||
has, err = tc.Has(b1.Cid())
|
has, err = tc.Has(ctx, b1.Cid())
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.True(t, has)
|
require.True(t, has)
|
||||||
|
|
||||||
has, err = tc.Has(b2.Cid())
|
has, err = tc.Has(ctx, b2.Cid())
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.True(t, has)
|
require.True(t, has)
|
||||||
|
|
||||||
// extend b2, add b3.
|
// extend b2, add b3.
|
||||||
require.NoError(t, tc.Put(b2))
|
require.NoError(t, tc.Put(ctx, b2))
|
||||||
require.NoError(t, tc.Put(b3))
|
require.NoError(t, tc.Put(ctx, b3))
|
||||||
|
|
||||||
// all keys once.
|
// all keys once.
|
||||||
allKeys, err := tc.AllKeysChan(context.Background())
|
allKeys, err := tc.AllKeysChan(context.Background())
|
||||||
@@ -71,15 +77,15 @@ func TestTimedCacheBlockstoreSimple(t *testing.T) {
|
|||||||
<-tc.doneRotatingCh
|
<-tc.doneRotatingCh
|
||||||
// should still have b2, and b3, but not b1
|
// should still have b2, and b3, but not b1
|
||||||
|
|
||||||
has, err = tc.Has(b1.Cid())
|
has, err = tc.Has(ctx, b1.Cid())
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.False(t, has)
|
require.False(t, has)
|
||||||
|
|
||||||
has, err = tc.Has(b2.Cid())
|
has, err = tc.Has(ctx, b2.Cid())
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.True(t, has)
|
require.True(t, has)
|
||||||
|
|
||||||
has, err = tc.Has(b3.Cid())
|
has, err = tc.Has(ctx, b3.Cid())
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.True(t, has)
|
require.True(t, has)
|
||||||
}
|
}
|
||||||
|
|||||||
+16
-16
@@ -19,72 +19,72 @@ func Union(stores ...Blockstore) Blockstore {
|
|||||||
return unionBlockstore(stores)
|
return unionBlockstore(stores)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m unionBlockstore) Has(cid cid.Cid) (has bool, err error) {
|
func (m unionBlockstore) Has(ctx context.Context, cid cid.Cid) (has bool, err error) {
|
||||||
for _, bs := range m {
|
for _, bs := range m {
|
||||||
if has, err = bs.Has(cid); has || err != nil {
|
if has, err = bs.Has(ctx, cid); has || err != nil {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return has, err
|
return has, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m unionBlockstore) Get(cid cid.Cid) (blk blocks.Block, err error) {
|
func (m unionBlockstore) Get(ctx context.Context, cid cid.Cid) (blk blocks.Block, err error) {
|
||||||
for _, bs := range m {
|
for _, bs := range m {
|
||||||
if blk, err = bs.Get(cid); err == nil || err != ErrNotFound {
|
if blk, err = bs.Get(ctx, cid); err == nil || err != ErrNotFound {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return blk, err
|
return blk, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m unionBlockstore) View(cid cid.Cid, callback func([]byte) error) (err error) {
|
func (m unionBlockstore) View(ctx context.Context, cid cid.Cid, callback func([]byte) error) (err error) {
|
||||||
for _, bs := range m {
|
for _, bs := range m {
|
||||||
if err = bs.View(cid, callback); err == nil || err != ErrNotFound {
|
if err = bs.View(ctx, cid, callback); err == nil || err != ErrNotFound {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m unionBlockstore) GetSize(cid cid.Cid) (size int, err error) {
|
func (m unionBlockstore) GetSize(ctx context.Context, cid cid.Cid) (size int, err error) {
|
||||||
for _, bs := range m {
|
for _, bs := range m {
|
||||||
if size, err = bs.GetSize(cid); err == nil || err != ErrNotFound {
|
if size, err = bs.GetSize(ctx, cid); err == nil || err != ErrNotFound {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return size, err
|
return size, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m unionBlockstore) Put(block blocks.Block) (err error) {
|
func (m unionBlockstore) Put(ctx context.Context, block blocks.Block) (err error) {
|
||||||
for _, bs := range m {
|
for _, bs := range m {
|
||||||
if err = bs.Put(block); err != nil {
|
if err = bs.Put(ctx, block); err != nil {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m unionBlockstore) PutMany(blks []blocks.Block) (err error) {
|
func (m unionBlockstore) PutMany(ctx context.Context, blks []blocks.Block) (err error) {
|
||||||
for _, bs := range m {
|
for _, bs := range m {
|
||||||
if err = bs.PutMany(blks); err != nil {
|
if err = bs.PutMany(ctx, blks); err != nil {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m unionBlockstore) DeleteBlock(cid cid.Cid) (err error) {
|
func (m unionBlockstore) DeleteBlock(ctx context.Context, cid cid.Cid) (err error) {
|
||||||
for _, bs := range m {
|
for _, bs := range m {
|
||||||
if err = bs.DeleteBlock(cid); err != nil {
|
if err = bs.DeleteBlock(ctx, cid); err != nil {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m unionBlockstore) DeleteMany(cids []cid.Cid) (err error) {
|
func (m unionBlockstore) DeleteMany(ctx context.Context, cids []cid.Cid) (err error) {
|
||||||
for _, bs := range m {
|
for _, bs := range m {
|
||||||
if err = bs.DeleteMany(cids); err != nil {
|
if err = bs.DeleteMany(ctx, cids); err != nil {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+26
-19
@@ -1,3 +1,4 @@
|
|||||||
|
//stm: #unit
|
||||||
package blockstore
|
package blockstore
|
||||||
|
|
||||||
import (
|
import (
|
||||||
@@ -15,79 +16,85 @@ var (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func TestUnionBlockstore_Get(t *testing.T) {
|
func TestUnionBlockstore_Get(t *testing.T) {
|
||||||
|
//stm: @SPLITSTORE_UNION_BLOCKSTORE_GET_001
|
||||||
|
ctx := context.Background()
|
||||||
m1 := NewMemory()
|
m1 := NewMemory()
|
||||||
m2 := NewMemory()
|
m2 := NewMemory()
|
||||||
|
|
||||||
_ = m1.Put(b1)
|
_ = m1.Put(ctx, b1)
|
||||||
_ = m2.Put(b2)
|
_ = m2.Put(ctx, b2)
|
||||||
|
|
||||||
u := Union(m1, m2)
|
u := Union(m1, m2)
|
||||||
|
|
||||||
v1, err := u.Get(b1.Cid())
|
v1, err := u.Get(ctx, b1.Cid())
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.Equal(t, b1.RawData(), v1.RawData())
|
require.Equal(t, b1.RawData(), v1.RawData())
|
||||||
|
|
||||||
v2, err := u.Get(b2.Cid())
|
v2, err := u.Get(ctx, b2.Cid())
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.Equal(t, b2.RawData(), v2.RawData())
|
require.Equal(t, b2.RawData(), v2.RawData())
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestUnionBlockstore_Put_PutMany_Delete_AllKeysChan(t *testing.T) {
|
func TestUnionBlockstore_Put_PutMany_Delete_AllKeysChan(t *testing.T) {
|
||||||
|
//stm: @SPLITSTORE_UNION_BLOCKSTORE_PUT_001, @SPLITSTORE_UNION_BLOCKSTORE_HAS_001
|
||||||
|
//stm: @SPLITSTORE_UNION_BLOCKSTORE_PUT_MANY_001, @SPLITSTORE_UNION_BLOCKSTORE_DELETE_001
|
||||||
|
//stm: @SPLITSTORE_UNION_BLOCKSTORE_ALL_KEYS_CHAN_001
|
||||||
|
ctx := context.Background()
|
||||||
m1 := NewMemory()
|
m1 := NewMemory()
|
||||||
m2 := NewMemory()
|
m2 := NewMemory()
|
||||||
|
|
||||||
u := Union(m1, m2)
|
u := Union(m1, m2)
|
||||||
|
|
||||||
err := u.Put(b0)
|
err := u.Put(ctx, b0)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
var has bool
|
var has bool
|
||||||
|
|
||||||
// write was broadcasted to all stores.
|
// write was broadcasted to all stores.
|
||||||
has, _ = m1.Has(b0.Cid())
|
has, _ = m1.Has(ctx, b0.Cid())
|
||||||
require.True(t, has)
|
require.True(t, has)
|
||||||
|
|
||||||
has, _ = m2.Has(b0.Cid())
|
has, _ = m2.Has(ctx, b0.Cid())
|
||||||
require.True(t, has)
|
require.True(t, has)
|
||||||
|
|
||||||
has, _ = u.Has(b0.Cid())
|
has, _ = u.Has(ctx, b0.Cid())
|
||||||
require.True(t, has)
|
require.True(t, has)
|
||||||
|
|
||||||
// put many.
|
// put many.
|
||||||
err = u.PutMany([]blocks.Block{b1, b2})
|
err = u.PutMany(ctx, []blocks.Block{b1, b2})
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
// write was broadcasted to all stores.
|
// write was broadcasted to all stores.
|
||||||
has, _ = m1.Has(b1.Cid())
|
has, _ = m1.Has(ctx, b1.Cid())
|
||||||
require.True(t, has)
|
require.True(t, has)
|
||||||
|
|
||||||
has, _ = m1.Has(b2.Cid())
|
has, _ = m1.Has(ctx, b2.Cid())
|
||||||
require.True(t, has)
|
require.True(t, has)
|
||||||
|
|
||||||
has, _ = m2.Has(b1.Cid())
|
has, _ = m2.Has(ctx, b1.Cid())
|
||||||
require.True(t, has)
|
require.True(t, has)
|
||||||
|
|
||||||
has, _ = m2.Has(b2.Cid())
|
has, _ = m2.Has(ctx, b2.Cid())
|
||||||
require.True(t, has)
|
require.True(t, has)
|
||||||
|
|
||||||
// also in the union store.
|
// also in the union store.
|
||||||
has, _ = u.Has(b1.Cid())
|
has, _ = u.Has(ctx, b1.Cid())
|
||||||
require.True(t, has)
|
require.True(t, has)
|
||||||
|
|
||||||
has, _ = u.Has(b2.Cid())
|
has, _ = u.Has(ctx, b2.Cid())
|
||||||
require.True(t, has)
|
require.True(t, has)
|
||||||
|
|
||||||
// deleted from all stores.
|
// deleted from all stores.
|
||||||
err = u.DeleteBlock(b1.Cid())
|
err = u.DeleteBlock(ctx, b1.Cid())
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
has, _ = u.Has(b1.Cid())
|
has, _ = u.Has(ctx, b1.Cid())
|
||||||
require.False(t, has)
|
require.False(t, has)
|
||||||
|
|
||||||
has, _ = m1.Has(b1.Cid())
|
has, _ = m1.Has(ctx, b1.Cid())
|
||||||
require.False(t, has)
|
require.False(t, has)
|
||||||
|
|
||||||
has, _ = m2.Has(b1.Cid())
|
has, _ = m2.Has(ctx, b1.Cid())
|
||||||
require.False(t, has)
|
require.False(t, has)
|
||||||
|
|
||||||
// check that AllKeysChan returns b0 and b2, twice (once per backing store)
|
// check that AllKeysChan returns b0 and b2, twice (once per backing store)
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
/dns4/bootstrap-0.butterfly.fildev.network/tcp/1347/p2p/12D3KooWBbZd7Su9XfLUQ12RynGQ3ZmGY1nGqFntmqop9pLNJE6g
|
/dns4/bootstrap-0.butterfly.fildev.network/tcp/1347/p2p/12D3KooWFHDtFx7CVTy4xoCDutVo1cScvSnQjDeaM8UzwVS1qwkh
|
||||||
/dns4/bootstrap-1.butterfly.fildev.network/tcp/1347/p2p/12D3KooWGKRzEY4tJFTmAmrYUpa1CVVohmV9YjJbC9v5XWY2gUji
|
/dns4/bootstrap-1.butterfly.fildev.network/tcp/1347/p2p/12D3KooWKt8cwpkiumkT8x32c3YFxsPRwhV5J8hCYPn9mhUmcAXt
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
/dns4/bootstrap-0.interop.fildev.network/tcp/1347/p2p/12D3KooWLGPq9JL1xwL6gHok7HSNxtK1Q5kyfg4Hk69ifRPghn4i
|
/dns4/bootstrap-0.interop.fildev.network/tcp/1347/p2p/12D3KooWPfaWdJjpPTQp5kSqsqvauJaM4cFz5NWja7qyjx7vVfjL
|
||||||
/dns4/bootstrap-1.interop.fildev.network/tcp/1347/p2p/12D3KooWFYS1f31zafv8mqqYu8U3hEqYvaZ6avWzYU3BmZdpyH3h
|
/dns4/bootstrap-1.interop.fildev.network/tcp/1347/p2p/12D3KooWS5tjcL6s4hHZ1HVRTgGKaXpKkiHfbBSJdjbzgejgJpEh
|
||||||
|
|||||||
@@ -1,4 +0,0 @@
|
|||||||
/dns4/bootstrap-2.nerpa.interplanetary.dev/tcp/1347/p2p/12D3KooWQcL6ReWmR6ASWx4iT7EiAmxKDQpvgq1MKNTQZp5NPnWW
|
|
||||||
/dns4/bootstrap-0.nerpa.interplanetary.dev/tcp/1347/p2p/12D3KooWGyJCwCm7EfupM15CFPXM4c7zRVHwwwjcuy9umaGeztMX
|
|
||||||
/dns4/bootstrap-3.nerpa.interplanetary.dev/tcp/1347/p2p/12D3KooWNK9RmfksKXSCQj7ZwAM7L6roqbN4kwJteihq7yPvSgPs
|
|
||||||
/dns4/bootstrap-1.nerpa.interplanetary.dev/tcp/1347/p2p/12D3KooWCWSaH6iUyXYspYxELjDfzToBsyVGVz3QvC7ysXv7wESo
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,3 +1,4 @@
|
|||||||
|
//stm: #unit
|
||||||
package build
|
package build
|
||||||
|
|
||||||
import (
|
import (
|
||||||
@@ -7,6 +8,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func TestOpenRPCDiscoverJSON_Version(t *testing.T) {
|
func TestOpenRPCDiscoverJSON_Version(t *testing.T) {
|
||||||
|
//stm: @OTHER_IMPLEMENTATION_OPENRPC_VERSION_001
|
||||||
// openRPCDocVersion is the current OpenRPC version of the API docs.
|
// openRPCDocVersion is the current OpenRPC version of the API docs.
|
||||||
openRPCDocVersion := "1.2.6"
|
openRPCDocVersion := "1.2.6"
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,183 @@
|
|||||||
|
package build
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"io"
|
||||||
|
"os"
|
||||||
|
"path/filepath"
|
||||||
|
"runtime/debug"
|
||||||
|
"runtime/pprof"
|
||||||
|
"strconv"
|
||||||
|
"strings"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/icza/backscanner"
|
||||||
|
logging "github.com/ipfs/go-log/v2"
|
||||||
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
panicLog = logging.Logger("panic-reporter")
|
||||||
|
defaultJournalTail = 500
|
||||||
|
)
|
||||||
|
|
||||||
|
// PanicReportingPath is the name of the subdir created within the repoPath
|
||||||
|
// path provided to GeneratePanicReport
|
||||||
|
var PanicReportingPath = "panic-reports"
|
||||||
|
|
||||||
|
// PanicReportJournalTail is the number of lines captured from the end of
|
||||||
|
// the lotus journal to be included in the panic report.
|
||||||
|
var PanicReportJournalTail = defaultJournalTail
|
||||||
|
|
||||||
|
// GeneratePanicReport produces a timestamped dump of the application state
|
||||||
|
// for inspection and debugging purposes. Call this function from any place
|
||||||
|
// where a panic or severe error needs to be examined. `persistPath` is the
|
||||||
|
// path where the reports should be saved. `repoPath` is the path where the
|
||||||
|
// journal should be read from. `label` is an optional string to include
|
||||||
|
// next to the report timestamp.
|
||||||
|
func GeneratePanicReport(persistPath, repoPath, label string) {
|
||||||
|
// make sure we always dump the latest logs on the way out
|
||||||
|
// especially since we're probably panicking
|
||||||
|
defer panicLog.Sync() //nolint:errcheck
|
||||||
|
|
||||||
|
if persistPath == "" && repoPath == "" {
|
||||||
|
panicLog.Warn("missing persist and repo paths, aborting panic report creation")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
reportPath := filepath.Join(repoPath, PanicReportingPath, generateReportName(label))
|
||||||
|
if persistPath != "" {
|
||||||
|
reportPath = filepath.Join(persistPath, generateReportName(label))
|
||||||
|
}
|
||||||
|
panicLog.Warnf("generating panic report at %s", reportPath)
|
||||||
|
|
||||||
|
tl := os.Getenv("LOTUS_PANIC_JOURNAL_LOOKBACK")
|
||||||
|
if tl != "" && PanicReportJournalTail == defaultJournalTail {
|
||||||
|
i, err := strconv.Atoi(tl)
|
||||||
|
if err == nil {
|
||||||
|
PanicReportJournalTail = i
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
err := os.MkdirAll(reportPath, 0755)
|
||||||
|
if err != nil {
|
||||||
|
panicLog.Error(err.Error())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
writeAppVersion(filepath.Join(reportPath, "version"))
|
||||||
|
writeStackTrace(filepath.Join(reportPath, "stacktrace.dump"))
|
||||||
|
writeProfile("goroutines", filepath.Join(reportPath, "goroutines.pprof.gz"))
|
||||||
|
writeProfile("heap", filepath.Join(reportPath, "heap.pprof.gz"))
|
||||||
|
writeJournalTail(PanicReportJournalTail, repoPath, filepath.Join(reportPath, "journal.ndjson"))
|
||||||
|
}
|
||||||
|
|
||||||
|
func writeAppVersion(file string) {
|
||||||
|
f, err := os.Create(file)
|
||||||
|
if err != nil {
|
||||||
|
panicLog.Error(err.Error())
|
||||||
|
}
|
||||||
|
defer f.Close() //nolint:errcheck
|
||||||
|
|
||||||
|
versionString := []byte(BuildVersion + BuildTypeString() + CurrentCommit + "\n")
|
||||||
|
if _, err := f.Write(versionString); err != nil {
|
||||||
|
panicLog.Error(err.Error())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func writeStackTrace(file string) {
|
||||||
|
f, err := os.Create(file)
|
||||||
|
if err != nil {
|
||||||
|
panicLog.Error(err.Error())
|
||||||
|
}
|
||||||
|
defer f.Close() //nolint:errcheck
|
||||||
|
|
||||||
|
if _, err := f.Write(debug.Stack()); err != nil {
|
||||||
|
panicLog.Error(err.Error())
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
func writeProfile(profileType string, file string) {
|
||||||
|
p := pprof.Lookup(profileType)
|
||||||
|
if p == nil {
|
||||||
|
panicLog.Warnf("%s profile not available", profileType)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
f, err := os.Create(file)
|
||||||
|
if err != nil {
|
||||||
|
panicLog.Error(err.Error())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
defer f.Close() //nolint:errcheck
|
||||||
|
|
||||||
|
if err := p.WriteTo(f, 0); err != nil {
|
||||||
|
panicLog.Error(err.Error())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func writeJournalTail(tailLen int, repoPath, file string) {
|
||||||
|
if repoPath == "" {
|
||||||
|
panicLog.Warn("repo path is empty, aborting copy of journal log")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
f, err := os.Create(file)
|
||||||
|
if err != nil {
|
||||||
|
panicLog.Error(err.Error())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
defer f.Close() //nolint:errcheck
|
||||||
|
|
||||||
|
jPath, err := getLatestJournalFilePath(repoPath)
|
||||||
|
if err != nil {
|
||||||
|
panicLog.Warnf("failed getting latest journal: %s", err.Error())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
j, err := os.OpenFile(jPath, os.O_RDONLY, 0400)
|
||||||
|
if err != nil {
|
||||||
|
panicLog.Error(err.Error())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
js, err := j.Stat()
|
||||||
|
if err != nil {
|
||||||
|
panicLog.Error(err.Error())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
jScan := backscanner.New(j, int(js.Size()))
|
||||||
|
linesWritten := 0
|
||||||
|
for {
|
||||||
|
if linesWritten > tailLen {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
line, _, err := jScan.LineBytes()
|
||||||
|
if err != nil {
|
||||||
|
if err != io.EOF {
|
||||||
|
panicLog.Error(err.Error())
|
||||||
|
}
|
||||||
|
break
|
||||||
|
}
|
||||||
|
if _, err := f.Write(line); err != nil {
|
||||||
|
panicLog.Error(err.Error())
|
||||||
|
break
|
||||||
|
}
|
||||||
|
if _, err := f.Write([]byte("\n")); err != nil {
|
||||||
|
panicLog.Error(err.Error())
|
||||||
|
break
|
||||||
|
}
|
||||||
|
linesWritten++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func getLatestJournalFilePath(repoPath string) (string, error) {
|
||||||
|
journalPath := filepath.Join(repoPath, "journal")
|
||||||
|
entries, err := os.ReadDir(journalPath)
|
||||||
|
if err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
return filepath.Join(journalPath, entries[len(entries)-1].Name()), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func generateReportName(label string) string {
|
||||||
|
label = strings.ReplaceAll(label, " ", "")
|
||||||
|
return fmt.Sprintf("report_%s_%s", label, time.Now().Format("2006-01-02T150405"))
|
||||||
|
}
|
||||||
@@ -10,12 +10,15 @@ import (
|
|||||||
"github.com/ipfs/go-cid"
|
"github.com/ipfs/go-cid"
|
||||||
|
|
||||||
"github.com/filecoin-project/go-state-types/abi"
|
"github.com/filecoin-project/go-state-types/abi"
|
||||||
|
"github.com/filecoin-project/go-state-types/network"
|
||||||
"github.com/filecoin-project/lotus/chain/actors/policy"
|
"github.com/filecoin-project/lotus/chain/actors/policy"
|
||||||
)
|
)
|
||||||
|
|
||||||
const BootstrappersFile = ""
|
const BootstrappersFile = ""
|
||||||
const GenesisFile = ""
|
const GenesisFile = ""
|
||||||
|
|
||||||
|
const GenesisNetworkVersion = network.Version15
|
||||||
|
|
||||||
var UpgradeBreezeHeight = abi.ChainEpoch(-1)
|
var UpgradeBreezeHeight = abi.ChainEpoch(-1)
|
||||||
|
|
||||||
const BreezeGasTampingDuration = 0
|
const BreezeGasTampingDuration = 0
|
||||||
@@ -42,6 +45,10 @@ var UpgradeTurboHeight = abi.ChainEpoch(-15)
|
|||||||
|
|
||||||
var UpgradeHyperdriveHeight = abi.ChainEpoch(-16)
|
var UpgradeHyperdriveHeight = abi.ChainEpoch(-16)
|
||||||
|
|
||||||
|
var UpgradeChocolateHeight = abi.ChainEpoch(-17)
|
||||||
|
|
||||||
|
var UpgradeOhSnapHeight = abi.ChainEpoch(-18)
|
||||||
|
|
||||||
var DrandSchedule = map[abi.ChainEpoch]DrandEnum{
|
var DrandSchedule = map[abi.ChainEpoch]DrandEnum{
|
||||||
0: DrandMainnet,
|
0: DrandMainnet,
|
||||||
}
|
}
|
||||||
@@ -82,8 +89,11 @@ func init() {
|
|||||||
UpgradeNorwegianHeight = getUpgradeHeight("LOTUS_NORWEGIAN_HEIGHT", UpgradeNorwegianHeight)
|
UpgradeNorwegianHeight = getUpgradeHeight("LOTUS_NORWEGIAN_HEIGHT", UpgradeNorwegianHeight)
|
||||||
UpgradeTurboHeight = getUpgradeHeight("LOTUS_ACTORSV4_HEIGHT", UpgradeTurboHeight)
|
UpgradeTurboHeight = getUpgradeHeight("LOTUS_ACTORSV4_HEIGHT", UpgradeTurboHeight)
|
||||||
UpgradeHyperdriveHeight = getUpgradeHeight("LOTUS_HYPERDRIVE_HEIGHT", UpgradeHyperdriveHeight)
|
UpgradeHyperdriveHeight = getUpgradeHeight("LOTUS_HYPERDRIVE_HEIGHT", UpgradeHyperdriveHeight)
|
||||||
|
UpgradeChocolateHeight = getUpgradeHeight("LOTUS_CHOCOLATE_HEIGHT", UpgradeChocolateHeight)
|
||||||
|
UpgradeOhSnapHeight = getUpgradeHeight("LOTUS_OHSNAP_HEIGHT", UpgradeOhSnapHeight)
|
||||||
|
|
||||||
BuildType |= Build2k
|
BuildType |= Build2k
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const BlockDelaySecs = uint64(4)
|
const BlockDelaySecs = uint64(4)
|
||||||
|
|||||||
+20
-12
@@ -6,6 +6,7 @@ package build
|
|||||||
import (
|
import (
|
||||||
"github.com/filecoin-project/go-address"
|
"github.com/filecoin-project/go-address"
|
||||||
"github.com/filecoin-project/go-state-types/abi"
|
"github.com/filecoin-project/go-state-types/abi"
|
||||||
|
"github.com/filecoin-project/go-state-types/network"
|
||||||
"github.com/filecoin-project/lotus/chain/actors/policy"
|
"github.com/filecoin-project/lotus/chain/actors/policy"
|
||||||
builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin"
|
builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin"
|
||||||
"github.com/ipfs/go-cid"
|
"github.com/ipfs/go-cid"
|
||||||
@@ -15,6 +16,8 @@ var DrandSchedule = map[abi.ChainEpoch]DrandEnum{
|
|||||||
0: DrandMainnet,
|
0: DrandMainnet,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const GenesisNetworkVersion = network.Version14
|
||||||
|
|
||||||
const BootstrappersFile = "butterflynet.pi"
|
const BootstrappersFile = "butterflynet.pi"
|
||||||
const GenesisFile = "butterflynet.car"
|
const GenesisFile = "butterflynet.car"
|
||||||
|
|
||||||
@@ -24,24 +27,29 @@ const UpgradeSmokeHeight = -2
|
|||||||
const UpgradeIgnitionHeight = -3
|
const UpgradeIgnitionHeight = -3
|
||||||
const UpgradeRefuelHeight = -4
|
const UpgradeRefuelHeight = -4
|
||||||
|
|
||||||
var UpgradeAssemblyHeight = abi.ChainEpoch(30)
|
var UpgradeAssemblyHeight = abi.ChainEpoch(-5)
|
||||||
|
|
||||||
const UpgradeTapeHeight = 60
|
const UpgradeTapeHeight = -6
|
||||||
const UpgradeLiftoffHeight = -5
|
const UpgradeLiftoffHeight = -7
|
||||||
const UpgradeKumquatHeight = 90
|
const UpgradeKumquatHeight = -8
|
||||||
const UpgradeCalicoHeight = 120
|
const UpgradeCalicoHeight = -9
|
||||||
const UpgradePersianHeight = 150
|
const UpgradePersianHeight = -10
|
||||||
const UpgradeClausHeight = 180
|
const UpgradeClausHeight = -11
|
||||||
const UpgradeOrangeHeight = 210
|
const UpgradeOrangeHeight = -12
|
||||||
const UpgradeTrustHeight = 240
|
const UpgradeTrustHeight = -13
|
||||||
const UpgradeNorwegianHeight = UpgradeTrustHeight + (builtin2.EpochsInHour * 12)
|
const UpgradeNorwegianHeight = -14
|
||||||
const UpgradeTurboHeight = 8922
|
const UpgradeTurboHeight = -15
|
||||||
const UpgradeHyperdriveHeight = 9999999
|
const UpgradeHyperdriveHeight = -16
|
||||||
|
const UpgradeChocolateHeight = -17
|
||||||
|
|
||||||
|
const UpgradeOhSnapHeight = 240
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
policy.SetConsensusMinerMinPower(abi.NewStoragePower(2 << 30))
|
policy.SetConsensusMinerMinPower(abi.NewStoragePower(2 << 30))
|
||||||
policy.SetSupportedProofTypes(
|
policy.SetSupportedProofTypes(
|
||||||
abi.RegisteredSealProof_StackedDrg512MiBV1,
|
abi.RegisteredSealProof_StackedDrg512MiBV1,
|
||||||
|
abi.RegisteredSealProof_StackedDrg32GiBV1,
|
||||||
|
abi.RegisteredSealProof_StackedDrg64GiBV1,
|
||||||
)
|
)
|
||||||
|
|
||||||
SetAddressNetwork(address.Testnet)
|
SetAddressNetwork(address.Testnet)
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ package build
|
|||||||
import (
|
import (
|
||||||
"github.com/filecoin-project/go-address"
|
"github.com/filecoin-project/go-address"
|
||||||
"github.com/filecoin-project/go-state-types/abi"
|
"github.com/filecoin-project/go-state-types/abi"
|
||||||
|
"github.com/filecoin-project/go-state-types/network"
|
||||||
"github.com/filecoin-project/lotus/chain/actors/policy"
|
"github.com/filecoin-project/lotus/chain/actors/policy"
|
||||||
builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin"
|
builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin"
|
||||||
"github.com/ipfs/go-cid"
|
"github.com/ipfs/go-cid"
|
||||||
@@ -15,6 +16,8 @@ var DrandSchedule = map[abi.ChainEpoch]DrandEnum{
|
|||||||
0: DrandMainnet,
|
0: DrandMainnet,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const GenesisNetworkVersion = network.Version0
|
||||||
|
|
||||||
const BootstrappersFile = "calibnet.pi"
|
const BootstrappersFile = "calibnet.pi"
|
||||||
const GenesisFile = "calibnet.car"
|
const GenesisFile = "calibnet.car"
|
||||||
|
|
||||||
@@ -49,6 +52,11 @@ const UpgradeTurboHeight = 390
|
|||||||
|
|
||||||
const UpgradeHyperdriveHeight = 420
|
const UpgradeHyperdriveHeight = 420
|
||||||
|
|
||||||
|
const UpgradeChocolateHeight = 312746
|
||||||
|
|
||||||
|
// 2022-02-10T19:23:00Z
|
||||||
|
const UpgradeOhSnapHeight = 682006
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
policy.SetConsensusMinerMinPower(abi.NewStoragePower(32 << 30))
|
policy.SetConsensusMinerMinPower(abi.NewStoragePower(32 << 30))
|
||||||
policy.SetSupportedProofTypes(
|
policy.SetSupportedProofTypes(
|
||||||
@@ -61,6 +69,7 @@ func init() {
|
|||||||
Devnet = true
|
Devnet = true
|
||||||
|
|
||||||
BuildType = BuildCalibnet
|
BuildType = BuildCalibnet
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const BlockDelaySecs = uint64(builtin2.EpochDurationSeconds)
|
const BlockDelaySecs = uint64(builtin2.EpochDurationSeconds)
|
||||||
|
|||||||
+19
-10
@@ -11,14 +11,15 @@ import (
|
|||||||
|
|
||||||
"github.com/filecoin-project/go-address"
|
"github.com/filecoin-project/go-address"
|
||||||
"github.com/filecoin-project/go-state-types/abi"
|
"github.com/filecoin-project/go-state-types/abi"
|
||||||
builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin"
|
"github.com/filecoin-project/go-state-types/network"
|
||||||
|
|
||||||
"github.com/filecoin-project/lotus/chain/actors/policy"
|
"github.com/filecoin-project/lotus/chain/actors/policy"
|
||||||
)
|
)
|
||||||
|
|
||||||
const BootstrappersFile = "interopnet.pi"
|
const BootstrappersFile = "interopnet.pi"
|
||||||
const GenesisFile = "interopnet.car"
|
const GenesisFile = "interopnet.car"
|
||||||
|
|
||||||
|
const GenesisNetworkVersion = network.Version15
|
||||||
|
|
||||||
var UpgradeBreezeHeight = abi.ChainEpoch(-1)
|
var UpgradeBreezeHeight = abi.ChainEpoch(-1)
|
||||||
|
|
||||||
const BreezeGasTampingDuration = 0
|
const BreezeGasTampingDuration = 0
|
||||||
@@ -44,21 +45,26 @@ var UpgradeNorwegianHeight = abi.ChainEpoch(-14)
|
|||||||
var UpgradeTurboHeight = abi.ChainEpoch(-15)
|
var UpgradeTurboHeight = abi.ChainEpoch(-15)
|
||||||
|
|
||||||
var UpgradeHyperdriveHeight = abi.ChainEpoch(-16)
|
var UpgradeHyperdriveHeight = abi.ChainEpoch(-16)
|
||||||
|
var UpgradeChocolateHeight = abi.ChainEpoch(-17)
|
||||||
|
var UpgradeOhSnapHeight = abi.ChainEpoch(-18)
|
||||||
|
|
||||||
var DrandSchedule = map[abi.ChainEpoch]DrandEnum{
|
var DrandSchedule = map[abi.ChainEpoch]DrandEnum{
|
||||||
0: DrandMainnet,
|
0: DrandMainnet,
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
policy.SetSupportedProofTypes(
|
|
||||||
abi.RegisteredSealProof_StackedDrg2KiBV1,
|
|
||||||
abi.RegisteredSealProof_StackedDrg8MiBV1,
|
|
||||||
abi.RegisteredSealProof_StackedDrg512MiBV1,
|
|
||||||
)
|
|
||||||
policy.SetConsensusMinerMinPower(abi.NewStoragePower(2048))
|
|
||||||
policy.SetMinVerifiedDealSize(abi.NewStoragePower(256))
|
policy.SetMinVerifiedDealSize(abi.NewStoragePower(256))
|
||||||
policy.SetPreCommitChallengeDelay(abi.ChainEpoch(10))
|
policy.SetPreCommitChallengeDelay(abi.ChainEpoch(10))
|
||||||
|
|
||||||
|
InsecurePoStValidation = true
|
||||||
|
|
||||||
|
policy.SetConsensusMinerMinPower(abi.NewStoragePower(2 << 30))
|
||||||
|
policy.SetSupportedProofTypes(
|
||||||
|
abi.RegisteredSealProof_StackedDrg512MiBV1,
|
||||||
|
abi.RegisteredSealProof_StackedDrg32GiBV1,
|
||||||
|
abi.RegisteredSealProof_StackedDrg64GiBV1,
|
||||||
|
)
|
||||||
|
|
||||||
getUpgradeHeight := func(ev string, def abi.ChainEpoch) abi.ChainEpoch {
|
getUpgradeHeight := func(ev string, def abi.ChainEpoch) abi.ChainEpoch {
|
||||||
hs, found := os.LookupEnv(ev)
|
hs, found := os.LookupEnv(ev)
|
||||||
if found {
|
if found {
|
||||||
@@ -89,15 +95,18 @@ func init() {
|
|||||||
UpgradeNorwegianHeight = getUpgradeHeight("LOTUS_NORWEGIAN_HEIGHT", UpgradeNorwegianHeight)
|
UpgradeNorwegianHeight = getUpgradeHeight("LOTUS_NORWEGIAN_HEIGHT", UpgradeNorwegianHeight)
|
||||||
UpgradeTurboHeight = getUpgradeHeight("LOTUS_ACTORSV4_HEIGHT", UpgradeTurboHeight)
|
UpgradeTurboHeight = getUpgradeHeight("LOTUS_ACTORSV4_HEIGHT", UpgradeTurboHeight)
|
||||||
UpgradeHyperdriveHeight = getUpgradeHeight("LOTUS_HYPERDRIVE_HEIGHT", UpgradeHyperdriveHeight)
|
UpgradeHyperdriveHeight = getUpgradeHeight("LOTUS_HYPERDRIVE_HEIGHT", UpgradeHyperdriveHeight)
|
||||||
|
UpgradeChocolateHeight = getUpgradeHeight("LOTUS_CHOCOLATE_HEIGHT", UpgradeChocolateHeight)
|
||||||
|
UpgradeOhSnapHeight = getUpgradeHeight("LOTUS_OHSNAP_HEIGHT", UpgradeOhSnapHeight)
|
||||||
|
|
||||||
BuildType |= BuildInteropnet
|
BuildType |= BuildInteropnet
|
||||||
SetAddressNetwork(address.Testnet)
|
SetAddressNetwork(address.Testnet)
|
||||||
Devnet = true
|
Devnet = true
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const BlockDelaySecs = uint64(builtin2.EpochDurationSeconds)
|
const BlockDelaySecs = uint64(5)
|
||||||
|
|
||||||
const PropagationDelaySecs = uint64(6)
|
const PropagationDelaySecs = uint64(1)
|
||||||
|
|
||||||
// BootstrapPeerThreshold is the minimum number peers we need to track for a sync worker to start
|
// BootstrapPeerThreshold is the minimum number peers we need to track for a sync worker to start
|
||||||
const BootstrapPeerThreshold = 2
|
const BootstrapPeerThreshold = 2
|
||||||
|
|||||||
+13
-3
@@ -7,6 +7,8 @@ import (
|
|||||||
"math"
|
"math"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
|
"github.com/filecoin-project/go-state-types/network"
|
||||||
|
|
||||||
"github.com/filecoin-project/go-address"
|
"github.com/filecoin-project/go-address"
|
||||||
"github.com/filecoin-project/go-state-types/abi"
|
"github.com/filecoin-project/go-state-types/abi"
|
||||||
builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin"
|
builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin"
|
||||||
@@ -17,6 +19,8 @@ var DrandSchedule = map[abi.ChainEpoch]DrandEnum{
|
|||||||
UpgradeSmokeHeight: DrandMainnet,
|
UpgradeSmokeHeight: DrandMainnet,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const GenesisNetworkVersion = network.Version0
|
||||||
|
|
||||||
const BootstrappersFile = "mainnet.pi"
|
const BootstrappersFile = "mainnet.pi"
|
||||||
const GenesisFile = "mainnet.car"
|
const GenesisFile = "mainnet.car"
|
||||||
|
|
||||||
@@ -58,15 +62,21 @@ const UpgradeNorwegianHeight = 665280
|
|||||||
const UpgradeTurboHeight = 712320
|
const UpgradeTurboHeight = 712320
|
||||||
|
|
||||||
// 2021-06-30T22:00:00Z
|
// 2021-06-30T22:00:00Z
|
||||||
var UpgradeHyperdriveHeight = abi.ChainEpoch(892800)
|
const UpgradeHyperdriveHeight = 892800
|
||||||
|
|
||||||
|
// 2021-10-26T13:30:00Z
|
||||||
|
const UpgradeChocolateHeight = 1231620
|
||||||
|
|
||||||
|
// 2022-03-01T15:00:00Z
|
||||||
|
var UpgradeOhSnapHeight = abi.ChainEpoch(1594680)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
if os.Getenv("LOTUS_USE_TEST_ADDRESSES") != "1" {
|
if os.Getenv("LOTUS_USE_TEST_ADDRESSES") != "1" {
|
||||||
SetAddressNetwork(address.Mainnet)
|
SetAddressNetwork(address.Mainnet)
|
||||||
}
|
}
|
||||||
|
|
||||||
if os.Getenv("LOTUS_DISABLE_HYPERDRIVE") == "1" {
|
if os.Getenv("LOTUS_DISABLE_SNAPDEALS") == "1" {
|
||||||
UpgradeHyperdriveHeight = math.MaxInt64
|
UpgradeOhSnapHeight = math.MaxInt64
|
||||||
}
|
}
|
||||||
|
|
||||||
Devnet = false
|
Devnet = false
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ package build
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/filecoin-project/go-state-types/abi"
|
"github.com/filecoin-project/go-state-types/abi"
|
||||||
|
"github.com/filecoin-project/go-state-types/network"
|
||||||
"github.com/filecoin-project/lotus/chain/actors/policy"
|
"github.com/filecoin-project/lotus/chain/actors/policy"
|
||||||
"github.com/ipfs/go-cid"
|
"github.com/ipfs/go-cid"
|
||||||
|
|
||||||
@@ -15,6 +16,8 @@ var DrandSchedule = map[abi.ChainEpoch]DrandEnum{
|
|||||||
0: DrandMainnet,
|
0: DrandMainnet,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const GenesisNetworkVersion = network.Version0
|
||||||
|
|
||||||
const BootstrappersFile = "nerpanet.pi"
|
const BootstrappersFile = "nerpanet.pi"
|
||||||
const GenesisFile = "nerpanet.car"
|
const GenesisFile = "nerpanet.car"
|
||||||
|
|
||||||
@@ -45,6 +48,8 @@ const UpgradeNorwegianHeight = 201000
|
|||||||
const UpgradeTurboHeight = 203000
|
const UpgradeTurboHeight = 203000
|
||||||
const UpgradeHyperdriveHeight = 379178
|
const UpgradeHyperdriveHeight = 379178
|
||||||
|
|
||||||
|
const UpgradeChocolateHeight = 999999999
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
// Minimum block production power is set to 4 TiB
|
// Minimum block production power is set to 4 TiB
|
||||||
// Rationale is to discourage small-scale miners from trying to take over the network
|
// Rationale is to discourage small-scale miners from trying to take over the network
|
||||||
@@ -69,6 +74,7 @@ func init() {
|
|||||||
Devnet = false
|
Devnet = false
|
||||||
|
|
||||||
BuildType = BuildNerpanet
|
BuildType = BuildNerpanet
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const BlockDelaySecs = uint64(builtin2.EpochDurationSeconds)
|
const BlockDelaySecs = uint64(builtin2.EpochDurationSeconds)
|
||||||
|
|||||||
@@ -13,6 +13,17 @@ import (
|
|||||||
|
|
||||||
func BlocksTopic(netName dtypes.NetworkName) string { return "/fil/blocks/" + string(netName) }
|
func BlocksTopic(netName dtypes.NetworkName) string { return "/fil/blocks/" + string(netName) }
|
||||||
func MessagesTopic(netName dtypes.NetworkName) string { return "/fil/msgs/" + string(netName) }
|
func MessagesTopic(netName dtypes.NetworkName) string { return "/fil/msgs/" + string(netName) }
|
||||||
|
func IndexerIngestTopic(netName dtypes.NetworkName) string {
|
||||||
|
|
||||||
|
nn := string(netName)
|
||||||
|
// The network name testnetnet is here for historical reasons.
|
||||||
|
// Going forward we aim to use the name `mainnet` where possible.
|
||||||
|
if nn == "testnetnet" {
|
||||||
|
nn = "mainnet"
|
||||||
|
}
|
||||||
|
|
||||||
|
return "/indexer/ingest/" + nn
|
||||||
|
}
|
||||||
func DhtProtocolName(netName dtypes.NetworkName) protocol.ID {
|
func DhtProtocolName(netName dtypes.NetworkName) protocol.ID {
|
||||||
return protocol.ID("/fil/kad/" + string(netName))
|
return protocol.ID("/fil/kad/" + string(netName))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,7 +26,17 @@ const UnixfsLinksPerLevel = 1024
|
|||||||
// Consensus / Network
|
// Consensus / Network
|
||||||
|
|
||||||
const AllowableClockDriftSecs = uint64(1)
|
const AllowableClockDriftSecs = uint64(1)
|
||||||
const NewestNetworkVersion = network.Version13
|
|
||||||
|
// TODO: This is still terrible...What's the impact of updating this before mainnet actually upgrades
|
||||||
|
/* inline-gen template
|
||||||
|
|
||||||
|
const NewestNetworkVersion = network.Version{{.latestNetworkVersion}}
|
||||||
|
|
||||||
|
/* inline-gen start */
|
||||||
|
|
||||||
|
const NewestNetworkVersion = network.Version15
|
||||||
|
|
||||||
|
/* inline-gen end */
|
||||||
|
|
||||||
// Epochs
|
// Epochs
|
||||||
const ForkLengthThreshold = Finality
|
const ForkLengthThreshold = Finality
|
||||||
|
|||||||
@@ -98,13 +98,17 @@ var (
|
|||||||
UpgradeNorwegianHeight abi.ChainEpoch = -13
|
UpgradeNorwegianHeight abi.ChainEpoch = -13
|
||||||
UpgradeTurboHeight abi.ChainEpoch = -14
|
UpgradeTurboHeight abi.ChainEpoch = -14
|
||||||
UpgradeHyperdriveHeight abi.ChainEpoch = -15
|
UpgradeHyperdriveHeight abi.ChainEpoch = -15
|
||||||
|
UpgradeChocolateHeight abi.ChainEpoch = -16
|
||||||
|
UpgradeOhSnapHeight abi.ChainEpoch = -17
|
||||||
|
|
||||||
DrandSchedule = map[abi.ChainEpoch]DrandEnum{
|
DrandSchedule = map[abi.ChainEpoch]DrandEnum{
|
||||||
0: DrandMainnet,
|
0: DrandMainnet,
|
||||||
}
|
}
|
||||||
|
|
||||||
NewestNetworkVersion = network.Version11
|
GenesisNetworkVersion = network.Version0
|
||||||
ActorUpgradeNetworkVersion = network.Version4
|
|
||||||
|
NewestNetworkVersion = network.Version15
|
||||||
|
ActorUpgradeNetworkVersion = network.Version15
|
||||||
|
|
||||||
Devnet = true
|
Devnet = true
|
||||||
ZeroAddress = MustParseAddress("f3yaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaby2smx7a")
|
ZeroAddress = MustParseAddress("f3yaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaby2smx7a")
|
||||||
|
|||||||
@@ -1,4 +1,54 @@
|
|||||||
{
|
{
|
||||||
|
"v28-empty-sector-update-merkletree-poseidon_hasher-8-0-0-61fa69f38b9cc771ba27b670124714b4ea77fbeae05e377fb859c4a43b73a30c.params": {
|
||||||
|
"cid": "Qma5WL6abSqYg9uUQAZ3EHS286bsNsha7oAGsJBD48Bq2q",
|
||||||
|
"digest": "c3ad7bb549470b82ad52ed070aebb4f4",
|
||||||
|
"sector_size": 536870912
|
||||||
|
},
|
||||||
|
"v28-empty-sector-update-merkletree-poseidon_hasher-8-0-0-61fa69f38b9cc771ba27b670124714b4ea77fbeae05e377fb859c4a43b73a30c.vk": {
|
||||||
|
"cid": "QmUa7f9JtJMsqJJ3s3ZXk6WyF4xJLE8FiqYskZGgk8GCDv",
|
||||||
|
"digest": "994c5b7d450ca9da348c910689f2dc7f",
|
||||||
|
"sector_size": 536870912
|
||||||
|
},
|
||||||
|
"v28-empty-sector-update-merkletree-poseidon_hasher-8-0-0-92180959e1918d26350b8e6cfe217bbdd0a2d8de51ebec269078b364b715ad63.params": {
|
||||||
|
"cid": "QmQiT4qBGodrVNEgVTDXxBNDdPbaD8Ag7Sx3ZTq1zHX79S",
|
||||||
|
"digest": "5aedd2cf3e5c0a15623d56a1b43110ad",
|
||||||
|
"sector_size": 8388608
|
||||||
|
},
|
||||||
|
"v28-empty-sector-update-merkletree-poseidon_hasher-8-0-0-92180959e1918d26350b8e6cfe217bbdd0a2d8de51ebec269078b364b715ad63.vk": {
|
||||||
|
"cid": "QmdcpKUQvHM8RFRVKbk1yHfEqMcBzhtFWKRp9SNEmWq37i",
|
||||||
|
"digest": "abd80269054d391a734febdac0d2e687",
|
||||||
|
"sector_size": 8388608
|
||||||
|
},
|
||||||
|
"v28-empty-sector-update-merkletree-poseidon_hasher-8-0-0-fb9e095bebdd77511c0269b967b4d87ba8b8a525edaa0e165de23ba454510194.params": {
|
||||||
|
"cid": "QmYM6Hg7mjmvA3ZHTsqkss1fkdyDju5dDmLiBZGJ5pz9y9",
|
||||||
|
"digest": "311f92a3e75036ced01b1c0025f1fa0c",
|
||||||
|
"sector_size": 2048
|
||||||
|
},
|
||||||
|
"v28-empty-sector-update-merkletree-poseidon_hasher-8-0-0-fb9e095bebdd77511c0269b967b4d87ba8b8a525edaa0e165de23ba454510194.vk": {
|
||||||
|
"cid": "QmaQsTLL3nc5dw6wAvaioJSBfd1jhQrA2o6ucFf7XeV74P",
|
||||||
|
"digest": "eadad9784969890d30f2749708c79771",
|
||||||
|
"sector_size": 2048
|
||||||
|
},
|
||||||
|
"v28-empty-sector-update-merkletree-poseidon_hasher-8-8-0-3b7f44a9362e3985369454947bc94022e118211e49fd672d52bec1cbfd599d18.params": {
|
||||||
|
"cid": "QmNPc75iEfcahCwNKdqnWLtxnjspUGGR4iscjiz3wP3RtS",
|
||||||
|
"digest": "1b3cfd761a961543f9eb273e435a06a2",
|
||||||
|
"sector_size": 34359738368
|
||||||
|
},
|
||||||
|
"v28-empty-sector-update-merkletree-poseidon_hasher-8-8-0-3b7f44a9362e3985369454947bc94022e118211e49fd672d52bec1cbfd599d18.vk": {
|
||||||
|
"cid": "QmdFFUe1gcz9MMHc6YW8aoV48w4ckvcERjt7PkydQAMfCN",
|
||||||
|
"digest": "3a6941983754737fde880d29c7094905",
|
||||||
|
"sector_size": 34359738368
|
||||||
|
},
|
||||||
|
"v28-empty-sector-update-merkletree-poseidon_hasher-8-8-2-102e1444a7e9a97ebf1e3d6855dcc77e66c011ea66f936d9b2c508f87f2f83a7.params": {
|
||||||
|
"cid": "QmUB6xTVjzBQGuDNeyJMrrJ1byk58vhPm8eY2Lv9pgwanp",
|
||||||
|
"digest": "1a392e7b759fb18e036c7559b5ece816",
|
||||||
|
"sector_size": 68719476736
|
||||||
|
},
|
||||||
|
"v28-empty-sector-update-merkletree-poseidon_hasher-8-8-2-102e1444a7e9a97ebf1e3d6855dcc77e66c011ea66f936d9b2c508f87f2f83a7.vk": {
|
||||||
|
"cid": "Qmd794Jty7k26XJ8Eg4NDEks65Qk8G4GVfGkwqvymv8HAg",
|
||||||
|
"digest": "80e366df2f1011953c2d01c7b7c9ee8e",
|
||||||
|
"sector_size": 68719476736
|
||||||
|
},
|
||||||
"v28-proof-of-spacetime-fallback-merkletree-poseidon_hasher-8-0-0-0170db1f394b35d995252228ee359194b13199d259380541dc529fb0099096b0.params": {
|
"v28-proof-of-spacetime-fallback-merkletree-poseidon_hasher-8-0-0-0170db1f394b35d995252228ee359194b13199d259380541dc529fb0099096b0.params": {
|
||||||
"cid": "QmVxjFRyhmyQaZEtCh7nk2abc7LhFkzhnRX4rcHqCCpikR",
|
"cid": "QmVxjFRyhmyQaZEtCh7nk2abc7LhFkzhnRX4rcHqCCpikR",
|
||||||
"digest": "7610b9f82bfc88405b7a832b651ce2f6",
|
"digest": "7610b9f82bfc88405b7a832b651ce2f6",
|
||||||
|
|||||||
+3
-6
@@ -12,11 +12,10 @@ const (
|
|||||||
BuildDebug = 0x3
|
BuildDebug = 0x3
|
||||||
BuildCalibnet = 0x4
|
BuildCalibnet = 0x4
|
||||||
BuildInteropnet = 0x5
|
BuildInteropnet = 0x5
|
||||||
BuildNerpanet = 0x6
|
|
||||||
BuildButterflynet = 0x7
|
BuildButterflynet = 0x7
|
||||||
)
|
)
|
||||||
|
|
||||||
func buildType() string {
|
func BuildTypeString() string {
|
||||||
switch BuildType {
|
switch BuildType {
|
||||||
case BuildDefault:
|
case BuildDefault:
|
||||||
return ""
|
return ""
|
||||||
@@ -30,8 +29,6 @@ func buildType() string {
|
|||||||
return "+calibnet"
|
return "+calibnet"
|
||||||
case BuildInteropnet:
|
case BuildInteropnet:
|
||||||
return "+interopnet"
|
return "+interopnet"
|
||||||
case BuildNerpanet:
|
|
||||||
return "+nerpanet"
|
|
||||||
case BuildButterflynet:
|
case BuildButterflynet:
|
||||||
return "+butterflynet"
|
return "+butterflynet"
|
||||||
default:
|
default:
|
||||||
@@ -40,12 +37,12 @@ func buildType() string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// BuildVersion is the local build version
|
// BuildVersion is the local build version
|
||||||
const BuildVersion = "1.11.3"
|
const BuildVersion = "1.15.2-dev"
|
||||||
|
|
||||||
func UserVersion() string {
|
func UserVersion() string {
|
||||||
if os.Getenv("LOTUS_VERSION_IGNORE_COMMIT") == "1" {
|
if os.Getenv("LOTUS_VERSION_IGNORE_COMMIT") == "1" {
|
||||||
return BuildVersion
|
return BuildVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
return BuildVersion + buildType() + CurrentCommit
|
return BuildVersion + BuildTypeString() + CurrentCommit
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
//stm: #unit
|
||||||
package adt
|
package adt
|
||||||
|
|
||||||
import (
|
import (
|
||||||
@@ -44,6 +45,7 @@ func TestDiffAdtArray(t *testing.T) {
|
|||||||
|
|
||||||
changes := new(TestDiffArray)
|
changes := new(TestDiffArray)
|
||||||
|
|
||||||
|
//stm: @CHAIN_ADT_ARRAY_DIFF_001
|
||||||
assert.NoError(t, DiffAdtArray(arrA, arrB, changes))
|
assert.NoError(t, DiffAdtArray(arrA, arrB, changes))
|
||||||
assert.NotNil(t, changes)
|
assert.NotNil(t, changes)
|
||||||
|
|
||||||
@@ -98,6 +100,7 @@ func TestDiffAdtMap(t *testing.T) {
|
|||||||
|
|
||||||
changes := new(TestDiffMap)
|
changes := new(TestDiffMap)
|
||||||
|
|
||||||
|
//stm: @CHAIN_ADT_MAP_DIFF_001
|
||||||
assert.NoError(t, DiffAdtMap(mapA, mapB, changes))
|
assert.NoError(t, DiffAdtMap(mapA, mapB, changes))
|
||||||
assert.NotNil(t, changes)
|
assert.NotNil(t, changes)
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
//stm: #unit
|
||||||
package aerrors_test
|
package aerrors_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
@@ -11,6 +12,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func TestFatalError(t *testing.T) {
|
func TestFatalError(t *testing.T) {
|
||||||
|
//stm: @OTHER_IMPLEMENTATION_ACTOR_ERRORS_001
|
||||||
e1 := xerrors.New("out of disk space")
|
e1 := xerrors.New("out of disk space")
|
||||||
e2 := xerrors.Errorf("could not put node: %w", e1)
|
e2 := xerrors.Errorf("could not put node: %w", e1)
|
||||||
e3 := xerrors.Errorf("could not save head: %w", e2)
|
e3 := xerrors.Errorf("could not save head: %w", e2)
|
||||||
@@ -24,6 +26,7 @@ func TestFatalError(t *testing.T) {
|
|||||||
assert.True(t, IsFatal(aw4), "should be fatal")
|
assert.True(t, IsFatal(aw4), "should be fatal")
|
||||||
}
|
}
|
||||||
func TestAbsorbeError(t *testing.T) {
|
func TestAbsorbeError(t *testing.T) {
|
||||||
|
//stm: @OTHER_IMPLEMENTATION_ACTOR_ERRORS_001
|
||||||
e1 := xerrors.New("EOF")
|
e1 := xerrors.New("EOF")
|
||||||
e2 := xerrors.Errorf("could not decode: %w", e1)
|
e2 := xerrors.Errorf("could not decode: %w", e1)
|
||||||
ae := Absorb(e2, 35, "failed to decode CBOR")
|
ae := Absorb(e2, 35, "failed to decode CBOR")
|
||||||
|
|||||||
@@ -21,6 +21,10 @@ import (
|
|||||||
builtin4 "github.com/filecoin-project/specs-actors/v4/actors/builtin"
|
builtin4 "github.com/filecoin-project/specs-actors/v4/actors/builtin"
|
||||||
|
|
||||||
builtin5 "github.com/filecoin-project/specs-actors/v5/actors/builtin"
|
builtin5 "github.com/filecoin-project/specs-actors/v5/actors/builtin"
|
||||||
|
|
||||||
|
builtin6 "github.com/filecoin-project/specs-actors/v6/actors/builtin"
|
||||||
|
|
||||||
|
builtin7 "github.com/filecoin-project/specs-actors/v7/actors/builtin"
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
@@ -44,6 +48,14 @@ func init() {
|
|||||||
builtin.RegisterActorState(builtin5.AccountActorCodeID, func(store adt.Store, root cid.Cid) (cbor.Marshaler, error) {
|
builtin.RegisterActorState(builtin5.AccountActorCodeID, func(store adt.Store, root cid.Cid) (cbor.Marshaler, error) {
|
||||||
return load5(store, root)
|
return load5(store, root)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
builtin.RegisterActorState(builtin6.AccountActorCodeID, func(store adt.Store, root cid.Cid) (cbor.Marshaler, error) {
|
||||||
|
return load6(store, root)
|
||||||
|
})
|
||||||
|
|
||||||
|
builtin.RegisterActorState(builtin7.AccountActorCodeID, func(store adt.Store, root cid.Cid) (cbor.Marshaler, error) {
|
||||||
|
return load7(store, root)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
var Methods = builtin4.MethodsAccount
|
var Methods = builtin4.MethodsAccount
|
||||||
@@ -66,6 +78,12 @@ func Load(store adt.Store, act *types.Actor) (State, error) {
|
|||||||
case builtin5.AccountActorCodeID:
|
case builtin5.AccountActorCodeID:
|
||||||
return load5(store, act.Head)
|
return load5(store, act.Head)
|
||||||
|
|
||||||
|
case builtin6.AccountActorCodeID:
|
||||||
|
return load6(store, act.Head)
|
||||||
|
|
||||||
|
case builtin7.AccountActorCodeID:
|
||||||
|
return load7(store, act.Head)
|
||||||
|
|
||||||
}
|
}
|
||||||
return nil, xerrors.Errorf("unknown actor code %s", act.Code)
|
return nil, xerrors.Errorf("unknown actor code %s", act.Code)
|
||||||
}
|
}
|
||||||
@@ -88,6 +106,12 @@ func MakeState(store adt.Store, av actors.Version, addr address.Address) (State,
|
|||||||
case actors.Version5:
|
case actors.Version5:
|
||||||
return make5(store, addr)
|
return make5(store, addr)
|
||||||
|
|
||||||
|
case actors.Version6:
|
||||||
|
return make6(store, addr)
|
||||||
|
|
||||||
|
case actors.Version7:
|
||||||
|
return make7(store, addr)
|
||||||
|
|
||||||
}
|
}
|
||||||
return nil, xerrors.Errorf("unknown actor version %d", av)
|
return nil, xerrors.Errorf("unknown actor version %d", av)
|
||||||
}
|
}
|
||||||
@@ -110,6 +134,12 @@ func GetActorCodeID(av actors.Version) (cid.Cid, error) {
|
|||||||
case actors.Version5:
|
case actors.Version5:
|
||||||
return builtin5.AccountActorCodeID, nil
|
return builtin5.AccountActorCodeID, nil
|
||||||
|
|
||||||
|
case actors.Version6:
|
||||||
|
return builtin6.AccountActorCodeID, nil
|
||||||
|
|
||||||
|
case actors.Version7:
|
||||||
|
return builtin7.AccountActorCodeID, nil
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return cid.Undef, xerrors.Errorf("unknown actor version %d", av)
|
return cid.Undef, xerrors.Errorf("unknown actor version %d", av)
|
||||||
|
|||||||
@@ -0,0 +1,40 @@
|
|||||||
|
package account
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/filecoin-project/go-address"
|
||||||
|
"github.com/ipfs/go-cid"
|
||||||
|
|
||||||
|
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||||
|
|
||||||
|
account6 "github.com/filecoin-project/specs-actors/v6/actors/builtin/account"
|
||||||
|
)
|
||||||
|
|
||||||
|
var _ State = (*state6)(nil)
|
||||||
|
|
||||||
|
func load6(store adt.Store, root cid.Cid) (State, error) {
|
||||||
|
out := state6{store: store}
|
||||||
|
err := store.Get(store.Context(), root, &out)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return &out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func make6(store adt.Store, addr address.Address) (State, error) {
|
||||||
|
out := state6{store: store}
|
||||||
|
out.State = account6.State{Address: addr}
|
||||||
|
return &out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
type state6 struct {
|
||||||
|
account6.State
|
||||||
|
store adt.Store
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *state6) PubkeyAddress() (address.Address, error) {
|
||||||
|
return s.Address, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *state6) GetState() interface{} {
|
||||||
|
return &s.State
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
package account
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/filecoin-project/go-address"
|
||||||
|
"github.com/ipfs/go-cid"
|
||||||
|
|
||||||
|
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||||
|
|
||||||
|
account7 "github.com/filecoin-project/specs-actors/v7/actors/builtin/account"
|
||||||
|
)
|
||||||
|
|
||||||
|
var _ State = (*state7)(nil)
|
||||||
|
|
||||||
|
func load7(store adt.Store, root cid.Cid) (State, error) {
|
||||||
|
out := state7{store: store}
|
||||||
|
err := store.Get(store.Context(), root, &out)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return &out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func make7(store adt.Store, addr address.Address) (State, error) {
|
||||||
|
out := state7{store: store}
|
||||||
|
out.State = account7.State{Address: addr}
|
||||||
|
return &out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
type state7 struct {
|
||||||
|
account7.State
|
||||||
|
store adt.Store
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *state7) PubkeyAddress() (address.Address, error) {
|
||||||
|
return s.Address, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *state7) GetState() interface{} {
|
||||||
|
return &s.State
|
||||||
|
}
|
||||||
@@ -20,46 +20,53 @@ import (
|
|||||||
builtin5 "github.com/filecoin-project/specs-actors/v5/actors/builtin"
|
builtin5 "github.com/filecoin-project/specs-actors/v5/actors/builtin"
|
||||||
smoothing5 "github.com/filecoin-project/specs-actors/v5/actors/util/smoothing"
|
smoothing5 "github.com/filecoin-project/specs-actors/v5/actors/util/smoothing"
|
||||||
|
|
||||||
|
builtin6 "github.com/filecoin-project/specs-actors/v6/actors/builtin"
|
||||||
|
smoothing6 "github.com/filecoin-project/specs-actors/v6/actors/util/smoothing"
|
||||||
|
|
||||||
|
builtin7 "github.com/filecoin-project/specs-actors/v7/actors/builtin"
|
||||||
|
smoothing7 "github.com/filecoin-project/specs-actors/v7/actors/util/smoothing"
|
||||||
|
|
||||||
"github.com/filecoin-project/go-state-types/abi"
|
"github.com/filecoin-project/go-state-types/abi"
|
||||||
"github.com/filecoin-project/go-state-types/cbor"
|
"github.com/filecoin-project/go-state-types/cbor"
|
||||||
|
|
||||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||||
"github.com/filecoin-project/lotus/chain/types"
|
"github.com/filecoin-project/lotus/chain/types"
|
||||||
|
|
||||||
miner5 "github.com/filecoin-project/specs-actors/v5/actors/builtin/miner"
|
miner7 "github.com/filecoin-project/specs-actors/v7/actors/builtin/miner"
|
||||||
proof5 "github.com/filecoin-project/specs-actors/v5/actors/runtime/proof"
|
proof7 "github.com/filecoin-project/specs-actors/v7/actors/runtime/proof"
|
||||||
)
|
)
|
||||||
|
|
||||||
var SystemActorAddr = builtin5.SystemActorAddr
|
var SystemActorAddr = builtin7.SystemActorAddr
|
||||||
var BurntFundsActorAddr = builtin5.BurntFundsActorAddr
|
var BurntFundsActorAddr = builtin7.BurntFundsActorAddr
|
||||||
var CronActorAddr = builtin5.CronActorAddr
|
var CronActorAddr = builtin7.CronActorAddr
|
||||||
var SaftAddress = makeAddress("t0122")
|
var SaftAddress = makeAddress("t0122")
|
||||||
var ReserveAddress = makeAddress("t090")
|
var ReserveAddress = makeAddress("t090")
|
||||||
var RootVerifierAddress = makeAddress("t080")
|
var RootVerifierAddress = makeAddress("t080")
|
||||||
|
|
||||||
var (
|
var (
|
||||||
ExpectedLeadersPerEpoch = builtin5.ExpectedLeadersPerEpoch
|
ExpectedLeadersPerEpoch = builtin7.ExpectedLeadersPerEpoch
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
EpochDurationSeconds = builtin5.EpochDurationSeconds
|
EpochDurationSeconds = builtin7.EpochDurationSeconds
|
||||||
EpochsInDay = builtin5.EpochsInDay
|
EpochsInDay = builtin7.EpochsInDay
|
||||||
SecondsInDay = builtin5.SecondsInDay
|
SecondsInDay = builtin7.SecondsInDay
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
MethodSend = builtin5.MethodSend
|
MethodSend = builtin7.MethodSend
|
||||||
MethodConstructor = builtin5.MethodConstructor
|
MethodConstructor = builtin7.MethodConstructor
|
||||||
)
|
)
|
||||||
|
|
||||||
// These are all just type aliases across actor versions. In the future, that might change
|
// These are all just type aliases across actor versions. In the future, that might change
|
||||||
// and we might need to do something fancier.
|
// and we might need to do something fancier.
|
||||||
type SectorInfo = proof5.SectorInfo
|
type SectorInfo = proof7.SectorInfo
|
||||||
type PoStProof = proof5.PoStProof
|
type ExtendedSectorInfo = proof7.ExtendedSectorInfo
|
||||||
|
type PoStProof = proof7.PoStProof
|
||||||
type FilterEstimate = smoothing0.FilterEstimate
|
type FilterEstimate = smoothing0.FilterEstimate
|
||||||
|
|
||||||
func QAPowerForWeight(size abi.SectorSize, duration abi.ChainEpoch, dealWeight, verifiedWeight abi.DealWeight) abi.StoragePower {
|
func QAPowerForWeight(size abi.SectorSize, duration abi.ChainEpoch, dealWeight, verifiedWeight abi.DealWeight) abi.StoragePower {
|
||||||
return miner5.QAPowerForWeight(size, duration, dealWeight, verifiedWeight)
|
return miner7.QAPowerForWeight(size, duration, dealWeight, verifiedWeight)
|
||||||
}
|
}
|
||||||
|
|
||||||
func FromV0FilterEstimate(v0 smoothing0.FilterEstimate) FilterEstimate {
|
func FromV0FilterEstimate(v0 smoothing0.FilterEstimate) FilterEstimate {
|
||||||
@@ -92,6 +99,18 @@ func FromV5FilterEstimate(v5 smoothing5.FilterEstimate) FilterEstimate {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func FromV6FilterEstimate(v6 smoothing6.FilterEstimate) FilterEstimate {
|
||||||
|
|
||||||
|
return (FilterEstimate)(v6)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
func FromV7FilterEstimate(v7 smoothing7.FilterEstimate) FilterEstimate {
|
||||||
|
|
||||||
|
return (FilterEstimate)(v7)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
type ActorStateLoader func(store adt.Store, root cid.Cid) (cbor.Marshaler, error)
|
type ActorStateLoader func(store adt.Store, root cid.Cid) (cbor.Marshaler, error)
|
||||||
|
|
||||||
var ActorStateLoaders = make(map[cid.Cid]ActorStateLoader)
|
var ActorStateLoaders = make(map[cid.Cid]ActorStateLoader)
|
||||||
@@ -126,6 +145,12 @@ func ActorNameByCode(c cid.Cid) string {
|
|||||||
case builtin5.IsBuiltinActor(c):
|
case builtin5.IsBuiltinActor(c):
|
||||||
return builtin5.ActorNameByCode(c)
|
return builtin5.ActorNameByCode(c)
|
||||||
|
|
||||||
|
case builtin6.IsBuiltinActor(c):
|
||||||
|
return builtin6.ActorNameByCode(c)
|
||||||
|
|
||||||
|
case builtin7.IsBuiltinActor(c):
|
||||||
|
return builtin7.ActorNameByCode(c)
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return "<unknown>"
|
return "<unknown>"
|
||||||
}
|
}
|
||||||
@@ -153,6 +178,14 @@ func IsBuiltinActor(c cid.Cid) bool {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if builtin6.IsBuiltinActor(c) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
if builtin7.IsBuiltinActor(c) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -178,6 +211,14 @@ func IsAccountActor(c cid.Cid) bool {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if c == builtin6.AccountActorCodeID {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
if c == builtin7.AccountActorCodeID {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -203,6 +244,14 @@ func IsStorageMinerActor(c cid.Cid) bool {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if c == builtin6.StorageMinerActorCodeID {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
if c == builtin7.StorageMinerActorCodeID {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -228,6 +277,14 @@ func IsMultisigActor(c cid.Cid) bool {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if c == builtin6.MultisigActorCodeID {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
if c == builtin7.MultisigActorCodeID {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -253,6 +310,14 @@ func IsPaymentChannelActor(c cid.Cid) bool {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if c == builtin6.PaymentChannelActorCodeID {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
if c == builtin7.PaymentChannelActorCodeID {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ const (
|
|||||||
// These are all just type aliases across actor versions. In the future, that might change
|
// These are all just type aliases across actor versions. In the future, that might change
|
||||||
// and we might need to do something fancier.
|
// and we might need to do something fancier.
|
||||||
type SectorInfo = proof{{.latestVersion}}.SectorInfo
|
type SectorInfo = proof{{.latestVersion}}.SectorInfo
|
||||||
|
type ExtendedSectorInfo = proof{{.latestVersion}}.ExtendedSectorInfo
|
||||||
type PoStProof = proof{{.latestVersion}}.PoStProof
|
type PoStProof = proof{{.latestVersion}}.PoStProof
|
||||||
type FilterEstimate = smoothing0.FilterEstimate
|
type FilterEstimate = smoothing0.FilterEstimate
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,10 @@ import (
|
|||||||
builtin4 "github.com/filecoin-project/specs-actors/v4/actors/builtin"
|
builtin4 "github.com/filecoin-project/specs-actors/v4/actors/builtin"
|
||||||
|
|
||||||
builtin5 "github.com/filecoin-project/specs-actors/v5/actors/builtin"
|
builtin5 "github.com/filecoin-project/specs-actors/v5/actors/builtin"
|
||||||
|
|
||||||
|
builtin6 "github.com/filecoin-project/specs-actors/v6/actors/builtin"
|
||||||
|
|
||||||
|
builtin7 "github.com/filecoin-project/specs-actors/v7/actors/builtin"
|
||||||
)
|
)
|
||||||
|
|
||||||
func MakeState(store adt.Store, av actors.Version) (State, error) {
|
func MakeState(store adt.Store, av actors.Version) (State, error) {
|
||||||
@@ -35,6 +39,12 @@ func MakeState(store adt.Store, av actors.Version) (State, error) {
|
|||||||
case actors.Version5:
|
case actors.Version5:
|
||||||
return make5(store)
|
return make5(store)
|
||||||
|
|
||||||
|
case actors.Version6:
|
||||||
|
return make6(store)
|
||||||
|
|
||||||
|
case actors.Version7:
|
||||||
|
return make7(store)
|
||||||
|
|
||||||
}
|
}
|
||||||
return nil, xerrors.Errorf("unknown actor version %d", av)
|
return nil, xerrors.Errorf("unknown actor version %d", av)
|
||||||
}
|
}
|
||||||
@@ -57,14 +67,20 @@ func GetActorCodeID(av actors.Version) (cid.Cid, error) {
|
|||||||
case actors.Version5:
|
case actors.Version5:
|
||||||
return builtin5.CronActorCodeID, nil
|
return builtin5.CronActorCodeID, nil
|
||||||
|
|
||||||
|
case actors.Version6:
|
||||||
|
return builtin6.CronActorCodeID, nil
|
||||||
|
|
||||||
|
case actors.Version7:
|
||||||
|
return builtin7.CronActorCodeID, nil
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return cid.Undef, xerrors.Errorf("unknown actor version %d", av)
|
return cid.Undef, xerrors.Errorf("unknown actor version %d", av)
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
Address = builtin5.CronActorAddr
|
Address = builtin7.CronActorAddr
|
||||||
Methods = builtin5.MethodsCron
|
Methods = builtin7.MethodsCron
|
||||||
)
|
)
|
||||||
|
|
||||||
type State interface {
|
type State interface {
|
||||||
|
|||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package cron
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/ipfs/go-cid"
|
||||||
|
|
||||||
|
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||||
|
|
||||||
|
cron6 "github.com/filecoin-project/specs-actors/v6/actors/builtin/cron"
|
||||||
|
)
|
||||||
|
|
||||||
|
var _ State = (*state6)(nil)
|
||||||
|
|
||||||
|
func load6(store adt.Store, root cid.Cid) (State, error) {
|
||||||
|
out := state6{store: store}
|
||||||
|
err := store.Get(store.Context(), root, &out)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return &out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func make6(store adt.Store) (State, error) {
|
||||||
|
out := state6{store: store}
|
||||||
|
out.State = *cron6.ConstructState(cron6.BuiltInEntries())
|
||||||
|
return &out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
type state6 struct {
|
||||||
|
cron6.State
|
||||||
|
store adt.Store
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *state6) GetState() interface{} {
|
||||||
|
return &s.State
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package cron
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/ipfs/go-cid"
|
||||||
|
|
||||||
|
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||||
|
|
||||||
|
cron7 "github.com/filecoin-project/specs-actors/v7/actors/builtin/cron"
|
||||||
|
)
|
||||||
|
|
||||||
|
var _ State = (*state7)(nil)
|
||||||
|
|
||||||
|
func load7(store adt.Store, root cid.Cid) (State, error) {
|
||||||
|
out := state7{store: store}
|
||||||
|
err := store.Get(store.Context(), root, &out)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return &out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func make7(store adt.Store) (State, error) {
|
||||||
|
out := state7{store: store}
|
||||||
|
out.State = *cron7.ConstructState(cron7.BuiltInEntries())
|
||||||
|
return &out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
type state7 struct {
|
||||||
|
cron7.State
|
||||||
|
store adt.Store
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *state7) GetState() interface{} {
|
||||||
|
return &s.State
|
||||||
|
}
|
||||||
@@ -23,6 +23,10 @@ import (
|
|||||||
builtin4 "github.com/filecoin-project/specs-actors/v4/actors/builtin"
|
builtin4 "github.com/filecoin-project/specs-actors/v4/actors/builtin"
|
||||||
|
|
||||||
builtin5 "github.com/filecoin-project/specs-actors/v5/actors/builtin"
|
builtin5 "github.com/filecoin-project/specs-actors/v5/actors/builtin"
|
||||||
|
|
||||||
|
builtin6 "github.com/filecoin-project/specs-actors/v6/actors/builtin"
|
||||||
|
|
||||||
|
builtin7 "github.com/filecoin-project/specs-actors/v7/actors/builtin"
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
@@ -46,11 +50,19 @@ func init() {
|
|||||||
builtin.RegisterActorState(builtin5.InitActorCodeID, func(store adt.Store, root cid.Cid) (cbor.Marshaler, error) {
|
builtin.RegisterActorState(builtin5.InitActorCodeID, func(store adt.Store, root cid.Cid) (cbor.Marshaler, error) {
|
||||||
return load5(store, root)
|
return load5(store, root)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
builtin.RegisterActorState(builtin6.InitActorCodeID, func(store adt.Store, root cid.Cid) (cbor.Marshaler, error) {
|
||||||
|
return load6(store, root)
|
||||||
|
})
|
||||||
|
|
||||||
|
builtin.RegisterActorState(builtin7.InitActorCodeID, func(store adt.Store, root cid.Cid) (cbor.Marshaler, error) {
|
||||||
|
return load7(store, root)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
Address = builtin5.InitActorAddr
|
Address = builtin7.InitActorAddr
|
||||||
Methods = builtin5.MethodsInit
|
Methods = builtin7.MethodsInit
|
||||||
)
|
)
|
||||||
|
|
||||||
func Load(store adt.Store, act *types.Actor) (State, error) {
|
func Load(store adt.Store, act *types.Actor) (State, error) {
|
||||||
@@ -71,6 +83,12 @@ func Load(store adt.Store, act *types.Actor) (State, error) {
|
|||||||
case builtin5.InitActorCodeID:
|
case builtin5.InitActorCodeID:
|
||||||
return load5(store, act.Head)
|
return load5(store, act.Head)
|
||||||
|
|
||||||
|
case builtin6.InitActorCodeID:
|
||||||
|
return load6(store, act.Head)
|
||||||
|
|
||||||
|
case builtin7.InitActorCodeID:
|
||||||
|
return load7(store, act.Head)
|
||||||
|
|
||||||
}
|
}
|
||||||
return nil, xerrors.Errorf("unknown actor code %s", act.Code)
|
return nil, xerrors.Errorf("unknown actor code %s", act.Code)
|
||||||
}
|
}
|
||||||
@@ -93,6 +111,12 @@ func MakeState(store adt.Store, av actors.Version, networkName string) (State, e
|
|||||||
case actors.Version5:
|
case actors.Version5:
|
||||||
return make5(store, networkName)
|
return make5(store, networkName)
|
||||||
|
|
||||||
|
case actors.Version6:
|
||||||
|
return make6(store, networkName)
|
||||||
|
|
||||||
|
case actors.Version7:
|
||||||
|
return make7(store, networkName)
|
||||||
|
|
||||||
}
|
}
|
||||||
return nil, xerrors.Errorf("unknown actor version %d", av)
|
return nil, xerrors.Errorf("unknown actor version %d", av)
|
||||||
}
|
}
|
||||||
@@ -115,6 +139,12 @@ func GetActorCodeID(av actors.Version) (cid.Cid, error) {
|
|||||||
case actors.Version5:
|
case actors.Version5:
|
||||||
return builtin5.InitActorCodeID, nil
|
return builtin5.InitActorCodeID, nil
|
||||||
|
|
||||||
|
case actors.Version6:
|
||||||
|
return builtin6.InitActorCodeID, nil
|
||||||
|
|
||||||
|
case actors.Version7:
|
||||||
|
return builtin7.InitActorCodeID, nil
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return cid.Undef, xerrors.Errorf("unknown actor version %d", av)
|
return cid.Undef, xerrors.Errorf("unknown actor version %d", av)
|
||||||
|
|||||||
@@ -0,0 +1,114 @@
|
|||||||
|
package init
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/filecoin-project/go-address"
|
||||||
|
"github.com/filecoin-project/go-state-types/abi"
|
||||||
|
"github.com/ipfs/go-cid"
|
||||||
|
cbg "github.com/whyrusleeping/cbor-gen"
|
||||||
|
"golang.org/x/xerrors"
|
||||||
|
|
||||||
|
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||||
|
"github.com/filecoin-project/lotus/node/modules/dtypes"
|
||||||
|
|
||||||
|
builtin6 "github.com/filecoin-project/specs-actors/v6/actors/builtin"
|
||||||
|
|
||||||
|
init6 "github.com/filecoin-project/specs-actors/v6/actors/builtin/init"
|
||||||
|
adt6 "github.com/filecoin-project/specs-actors/v6/actors/util/adt"
|
||||||
|
)
|
||||||
|
|
||||||
|
var _ State = (*state6)(nil)
|
||||||
|
|
||||||
|
func load6(store adt.Store, root cid.Cid) (State, error) {
|
||||||
|
out := state6{store: store}
|
||||||
|
err := store.Get(store.Context(), root, &out)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return &out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func make6(store adt.Store, networkName string) (State, error) {
|
||||||
|
out := state6{store: store}
|
||||||
|
|
||||||
|
s, err := init6.ConstructState(store, networkName)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
out.State = *s
|
||||||
|
|
||||||
|
return &out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
type state6 struct {
|
||||||
|
init6.State
|
||||||
|
store adt.Store
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *state6) ResolveAddress(address address.Address) (address.Address, bool, error) {
|
||||||
|
return s.State.ResolveAddress(s.store, address)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *state6) MapAddressToNewID(address address.Address) (address.Address, error) {
|
||||||
|
return s.State.MapAddressToNewID(s.store, address)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *state6) ForEachActor(cb func(id abi.ActorID, address address.Address) error) error {
|
||||||
|
addrs, err := adt6.AsMap(s.store, s.State.AddressMap, builtin6.DefaultHamtBitwidth)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
var actorID cbg.CborInt
|
||||||
|
return addrs.ForEach(&actorID, func(key string) error {
|
||||||
|
addr, err := address.NewFromBytes([]byte(key))
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return cb(abi.ActorID(actorID), addr)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *state6) NetworkName() (dtypes.NetworkName, error) {
|
||||||
|
return dtypes.NetworkName(s.State.NetworkName), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *state6) SetNetworkName(name string) error {
|
||||||
|
s.State.NetworkName = name
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *state6) SetNextID(id abi.ActorID) error {
|
||||||
|
s.State.NextID = id
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *state6) Remove(addrs ...address.Address) (err error) {
|
||||||
|
m, err := adt6.AsMap(s.store, s.State.AddressMap, builtin6.DefaultHamtBitwidth)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
for _, addr := range addrs {
|
||||||
|
if err = m.Delete(abi.AddrKey(addr)); err != nil {
|
||||||
|
return xerrors.Errorf("failed to delete entry for address: %s; err: %w", addr, err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
amr, err := m.Root()
|
||||||
|
if err != nil {
|
||||||
|
return xerrors.Errorf("failed to get address map root: %w", err)
|
||||||
|
}
|
||||||
|
s.State.AddressMap = amr
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *state6) SetAddressMap(mcid cid.Cid) error {
|
||||||
|
s.State.AddressMap = mcid
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *state6) AddressMap() (adt.Map, error) {
|
||||||
|
return adt6.AsMap(s.store, s.State.AddressMap, builtin6.DefaultHamtBitwidth)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *state6) GetState() interface{} {
|
||||||
|
return &s.State
|
||||||
|
}
|
||||||
@@ -0,0 +1,114 @@
|
|||||||
|
package init
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/filecoin-project/go-address"
|
||||||
|
"github.com/filecoin-project/go-state-types/abi"
|
||||||
|
"github.com/ipfs/go-cid"
|
||||||
|
cbg "github.com/whyrusleeping/cbor-gen"
|
||||||
|
"golang.org/x/xerrors"
|
||||||
|
|
||||||
|
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||||
|
"github.com/filecoin-project/lotus/node/modules/dtypes"
|
||||||
|
|
||||||
|
builtin7 "github.com/filecoin-project/specs-actors/v7/actors/builtin"
|
||||||
|
|
||||||
|
init7 "github.com/filecoin-project/specs-actors/v7/actors/builtin/init"
|
||||||
|
adt7 "github.com/filecoin-project/specs-actors/v7/actors/util/adt"
|
||||||
|
)
|
||||||
|
|
||||||
|
var _ State = (*state7)(nil)
|
||||||
|
|
||||||
|
func load7(store adt.Store, root cid.Cid) (State, error) {
|
||||||
|
out := state7{store: store}
|
||||||
|
err := store.Get(store.Context(), root, &out)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return &out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func make7(store adt.Store, networkName string) (State, error) {
|
||||||
|
out := state7{store: store}
|
||||||
|
|
||||||
|
s, err := init7.ConstructState(store, networkName)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
out.State = *s
|
||||||
|
|
||||||
|
return &out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
type state7 struct {
|
||||||
|
init7.State
|
||||||
|
store adt.Store
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *state7) ResolveAddress(address address.Address) (address.Address, bool, error) {
|
||||||
|
return s.State.ResolveAddress(s.store, address)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *state7) MapAddressToNewID(address address.Address) (address.Address, error) {
|
||||||
|
return s.State.MapAddressToNewID(s.store, address)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *state7) ForEachActor(cb func(id abi.ActorID, address address.Address) error) error {
|
||||||
|
addrs, err := adt7.AsMap(s.store, s.State.AddressMap, builtin7.DefaultHamtBitwidth)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
var actorID cbg.CborInt
|
||||||
|
return addrs.ForEach(&actorID, func(key string) error {
|
||||||
|
addr, err := address.NewFromBytes([]byte(key))
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return cb(abi.ActorID(actorID), addr)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *state7) NetworkName() (dtypes.NetworkName, error) {
|
||||||
|
return dtypes.NetworkName(s.State.NetworkName), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *state7) SetNetworkName(name string) error {
|
||||||
|
s.State.NetworkName = name
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *state7) SetNextID(id abi.ActorID) error {
|
||||||
|
s.State.NextID = id
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *state7) Remove(addrs ...address.Address) (err error) {
|
||||||
|
m, err := adt7.AsMap(s.store, s.State.AddressMap, builtin7.DefaultHamtBitwidth)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
for _, addr := range addrs {
|
||||||
|
if err = m.Delete(abi.AddrKey(addr)); err != nil {
|
||||||
|
return xerrors.Errorf("failed to delete entry for address: %s; err: %w", addr, err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
amr, err := m.Root()
|
||||||
|
if err != nil {
|
||||||
|
return xerrors.Errorf("failed to get address map root: %w", err)
|
||||||
|
}
|
||||||
|
s.State.AddressMap = amr
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *state7) SetAddressMap(mcid cid.Cid) error {
|
||||||
|
s.State.AddressMap = mcid
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *state7) AddressMap() (adt.Map, error) {
|
||||||
|
return adt7.AsMap(s.store, s.State.AddressMap, builtin7.DefaultHamtBitwidth)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *state7) GetState() interface{} {
|
||||||
|
return &s.State
|
||||||
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
package market
|
package market
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"github.com/filecoin-project/go-state-types/network"
|
||||||
"golang.org/x/xerrors"
|
"golang.org/x/xerrors"
|
||||||
|
|
||||||
"github.com/filecoin-project/go-address"
|
"github.com/filecoin-project/go-address"
|
||||||
@@ -103,7 +104,28 @@ type DealProposals interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type PublishStorageDealsParams = market0.PublishStorageDealsParams
|
type PublishStorageDealsParams = market0.PublishStorageDealsParams
|
||||||
type PublishStorageDealsReturn = market0.PublishStorageDealsReturn
|
|
||||||
|
type PublishStorageDealsReturn interface {
|
||||||
|
DealIDs() ([]abi.DealID, error)
|
||||||
|
// Note that this index is based on the batch of deals that were published, NOT the DealID
|
||||||
|
IsDealValid(index uint64) (bool, error)
|
||||||
|
}
|
||||||
|
|
||||||
|
func DecodePublishStorageDealsReturn(b []byte, nv network.Version) (PublishStorageDealsReturn, error) {
|
||||||
|
av, err := actors.VersionForNetwork(nv)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
switch av {
|
||||||
|
{{range .versions}}
|
||||||
|
case actors.Version{{.}}:
|
||||||
|
return decodePublishStorageDealsReturn{{.}}(b)
|
||||||
|
{{end}}
|
||||||
|
}
|
||||||
|
return nil, xerrors.Errorf("unknown actor version %d", av)
|
||||||
|
}
|
||||||
|
|
||||||
type VerifyDealsForActivationParams = market0.VerifyDealsForActivationParams
|
type VerifyDealsForActivationParams = market0.VerifyDealsForActivationParams
|
||||||
type WithdrawBalanceParams = market0.WithdrawBalanceParams
|
type WithdrawBalanceParams = market0.WithdrawBalanceParams
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package market
|
package market
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"github.com/filecoin-project/go-state-types/network"
|
||||||
"golang.org/x/xerrors"
|
"golang.org/x/xerrors"
|
||||||
|
|
||||||
"github.com/filecoin-project/go-address"
|
"github.com/filecoin-project/go-address"
|
||||||
@@ -22,6 +23,10 @@ import (
|
|||||||
|
|
||||||
builtin5 "github.com/filecoin-project/specs-actors/v5/actors/builtin"
|
builtin5 "github.com/filecoin-project/specs-actors/v5/actors/builtin"
|
||||||
|
|
||||||
|
builtin6 "github.com/filecoin-project/specs-actors/v6/actors/builtin"
|
||||||
|
|
||||||
|
builtin7 "github.com/filecoin-project/specs-actors/v7/actors/builtin"
|
||||||
|
|
||||||
"github.com/filecoin-project/lotus/chain/actors"
|
"github.com/filecoin-project/lotus/chain/actors"
|
||||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||||
"github.com/filecoin-project/lotus/chain/actors/builtin"
|
"github.com/filecoin-project/lotus/chain/actors/builtin"
|
||||||
@@ -49,11 +54,19 @@ func init() {
|
|||||||
builtin.RegisterActorState(builtin5.StorageMarketActorCodeID, func(store adt.Store, root cid.Cid) (cbor.Marshaler, error) {
|
builtin.RegisterActorState(builtin5.StorageMarketActorCodeID, func(store adt.Store, root cid.Cid) (cbor.Marshaler, error) {
|
||||||
return load5(store, root)
|
return load5(store, root)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
builtin.RegisterActorState(builtin6.StorageMarketActorCodeID, func(store adt.Store, root cid.Cid) (cbor.Marshaler, error) {
|
||||||
|
return load6(store, root)
|
||||||
|
})
|
||||||
|
|
||||||
|
builtin.RegisterActorState(builtin7.StorageMarketActorCodeID, func(store adt.Store, root cid.Cid) (cbor.Marshaler, error) {
|
||||||
|
return load7(store, root)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
Address = builtin5.StorageMarketActorAddr
|
Address = builtin7.StorageMarketActorAddr
|
||||||
Methods = builtin5.MethodsMarket
|
Methods = builtin7.MethodsMarket
|
||||||
)
|
)
|
||||||
|
|
||||||
func Load(store adt.Store, act *types.Actor) (State, error) {
|
func Load(store adt.Store, act *types.Actor) (State, error) {
|
||||||
@@ -74,6 +87,12 @@ func Load(store adt.Store, act *types.Actor) (State, error) {
|
|||||||
case builtin5.StorageMarketActorCodeID:
|
case builtin5.StorageMarketActorCodeID:
|
||||||
return load5(store, act.Head)
|
return load5(store, act.Head)
|
||||||
|
|
||||||
|
case builtin6.StorageMarketActorCodeID:
|
||||||
|
return load6(store, act.Head)
|
||||||
|
|
||||||
|
case builtin7.StorageMarketActorCodeID:
|
||||||
|
return load7(store, act.Head)
|
||||||
|
|
||||||
}
|
}
|
||||||
return nil, xerrors.Errorf("unknown actor code %s", act.Code)
|
return nil, xerrors.Errorf("unknown actor code %s", act.Code)
|
||||||
}
|
}
|
||||||
@@ -96,6 +115,12 @@ func MakeState(store adt.Store, av actors.Version) (State, error) {
|
|||||||
case actors.Version5:
|
case actors.Version5:
|
||||||
return make5(store)
|
return make5(store)
|
||||||
|
|
||||||
|
case actors.Version6:
|
||||||
|
return make6(store)
|
||||||
|
|
||||||
|
case actors.Version7:
|
||||||
|
return make7(store)
|
||||||
|
|
||||||
}
|
}
|
||||||
return nil, xerrors.Errorf("unknown actor version %d", av)
|
return nil, xerrors.Errorf("unknown actor version %d", av)
|
||||||
}
|
}
|
||||||
@@ -118,6 +143,12 @@ func GetActorCodeID(av actors.Version) (cid.Cid, error) {
|
|||||||
case actors.Version5:
|
case actors.Version5:
|
||||||
return builtin5.StorageMarketActorCodeID, nil
|
return builtin5.StorageMarketActorCodeID, nil
|
||||||
|
|
||||||
|
case actors.Version6:
|
||||||
|
return builtin6.StorageMarketActorCodeID, nil
|
||||||
|
|
||||||
|
case actors.Version7:
|
||||||
|
return builtin7.StorageMarketActorCodeID, nil
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return cid.Undef, xerrors.Errorf("unknown actor version %d", av)
|
return cid.Undef, xerrors.Errorf("unknown actor version %d", av)
|
||||||
@@ -162,7 +193,46 @@ type DealProposals interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type PublishStorageDealsParams = market0.PublishStorageDealsParams
|
type PublishStorageDealsParams = market0.PublishStorageDealsParams
|
||||||
type PublishStorageDealsReturn = market0.PublishStorageDealsReturn
|
|
||||||
|
type PublishStorageDealsReturn interface {
|
||||||
|
DealIDs() ([]abi.DealID, error)
|
||||||
|
// Note that this index is based on the batch of deals that were published, NOT the DealID
|
||||||
|
IsDealValid(index uint64) (bool, error)
|
||||||
|
}
|
||||||
|
|
||||||
|
func DecodePublishStorageDealsReturn(b []byte, nv network.Version) (PublishStorageDealsReturn, error) {
|
||||||
|
av, err := actors.VersionForNetwork(nv)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
switch av {
|
||||||
|
|
||||||
|
case actors.Version0:
|
||||||
|
return decodePublishStorageDealsReturn0(b)
|
||||||
|
|
||||||
|
case actors.Version2:
|
||||||
|
return decodePublishStorageDealsReturn2(b)
|
||||||
|
|
||||||
|
case actors.Version3:
|
||||||
|
return decodePublishStorageDealsReturn3(b)
|
||||||
|
|
||||||
|
case actors.Version4:
|
||||||
|
return decodePublishStorageDealsReturn4(b)
|
||||||
|
|
||||||
|
case actors.Version5:
|
||||||
|
return decodePublishStorageDealsReturn5(b)
|
||||||
|
|
||||||
|
case actors.Version6:
|
||||||
|
return decodePublishStorageDealsReturn6(b)
|
||||||
|
|
||||||
|
case actors.Version7:
|
||||||
|
return decodePublishStorageDealsReturn7(b)
|
||||||
|
|
||||||
|
}
|
||||||
|
return nil, xerrors.Errorf("unknown actor version %d", av)
|
||||||
|
}
|
||||||
|
|
||||||
type VerifyDealsForActivationParams = market0.VerifyDealsForActivationParams
|
type VerifyDealsForActivationParams = market0.VerifyDealsForActivationParams
|
||||||
type WithdrawBalanceParams = market0.WithdrawBalanceParams
|
type WithdrawBalanceParams = market0.WithdrawBalanceParams
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user