Compare commits
679
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
01254ab320 | ||
|
|
ed735a3427 | ||
|
|
3b9783db68 | ||
|
|
83d796f34d | ||
|
|
b3890d59f0 | ||
|
|
23bd1b2cdf | ||
|
|
a0027031cd | ||
|
|
42a16546c1 | ||
|
|
83d7db88cf | ||
|
|
73ea687e9e | ||
|
|
e684248f48 | ||
|
|
824da5ea51 | ||
|
|
69b7594aec | ||
|
|
6638ed4c30 | ||
|
|
6a6d6714ad | ||
|
|
5d55e3d537 | ||
|
|
eabb2d1916 | ||
|
|
5d0a01abfc | ||
|
|
cd6c0c2ad3 | ||
|
|
17cd28028f | ||
|
|
4815c73bb4 | ||
|
|
7f864d0f10 | ||
|
|
781f92402a | ||
|
|
ea823558de | ||
|
|
820013a31e | ||
|
|
550d3888ca | ||
|
|
e122d113c7 | ||
|
|
a43231b95a | ||
|
|
eb9c3420e4 | ||
|
|
a0aa9ad845 | ||
|
|
a7a30732f1 | ||
|
|
1ced322310 | ||
|
|
e860a052e7 | ||
|
|
f44ad2682a | ||
|
|
b7ee05e60a | ||
|
|
9e1794f290 | ||
|
|
3465f3aba3 | ||
|
|
ed091b6d49 | ||
|
|
5a67bb0f69 | ||
|
|
5624c71084 | ||
|
|
82ead268bd | ||
|
|
b0c8dd5454 | ||
|
|
9254085bd4 | ||
|
|
ca3282cb43 | ||
|
|
b3adf6f09c | ||
|
|
35791682aa | ||
|
|
14e37adc95 | ||
|
|
4b7f141230 | ||
|
|
55dd92fb53 | ||
|
|
69fae9dc52 | ||
|
|
cda21546c4 | ||
|
|
2b8aaf7261 | ||
|
|
1d821eda57 | ||
|
|
ddc9425c07 | ||
|
|
d4d5ce3021 | ||
|
|
2d07131f29 | ||
|
|
dda9ac31c6 | ||
|
|
d32ed4440d | ||
|
|
7dcb11b8c0 | ||
|
|
131831ca61 | ||
|
|
b6a7e0553e | ||
|
|
3f712c376a | ||
|
|
64ed93b728 | ||
|
|
bec1dc47ce | ||
|
|
801c670edd | ||
|
|
64d62f1f7e | ||
|
|
3c4792d3e9 | ||
|
|
d2fe574af3 | ||
|
|
41e325e822 | ||
|
|
87d1e8ddfd | ||
|
|
339692cde5 | ||
|
|
5c0f2c8ae6 | ||
|
|
fbefd617a2 | ||
|
|
0e5e5f49df | ||
|
|
81cacd76a7 | ||
|
|
0c789b06dc | ||
|
|
8212b2c5d9 | ||
|
|
7ff86efba2 | ||
|
|
91e69644c2 | ||
|
|
89531e33a1 | ||
|
|
e857498914 | ||
|
|
37fdcbf197 | ||
|
|
93f3b49235 | ||
|
|
eb84bf2ebd | ||
|
|
1b4849b05e | ||
|
|
2f6a383023 | ||
|
|
782011b572 | ||
|
|
bf6f9799e6 | ||
|
|
6f25476709 | ||
|
|
a7e8f5aa17 | ||
|
|
c095d101a1 | ||
|
|
0c4863c58e | ||
|
|
352c23748e | ||
|
|
cec9425c83 | ||
|
|
130ef04ca5 | ||
|
|
2e59d0129d | ||
|
|
ff02a666bd | ||
|
|
869f6abcd6 | ||
|
|
64709dd587 | ||
|
|
8cbbee3a87 | ||
|
|
04894350b7 | ||
|
|
5b3a6e89ff | ||
|
|
c95ad7229f | ||
|
|
4d1ee38930 | ||
|
|
970aa299a2 | ||
|
|
2c1cf42aa0 | ||
|
|
a476816f40 | ||
|
|
e59edfdd0c | ||
|
|
860298d65b | ||
|
|
2a5e36c542 | ||
|
|
dbeec2900b | ||
|
|
041af452ac | ||
|
|
160281bc53 | ||
|
|
4a40eb5af9 | ||
|
|
ce1658f347 | ||
|
|
4469d0c819 | ||
|
|
775a94a239 | ||
|
|
e11f03a1fc | ||
|
|
8d0558bd75 | ||
|
|
7de6d93e26 | ||
|
|
92ef099f5a | ||
|
|
1b3d7c9054 | ||
|
|
73e86679d0 | ||
|
|
de65d8c3b4 | ||
|
|
40d75d17d4 | ||
|
|
7ea661bf87 | ||
|
|
3cfd1fed31 | ||
|
|
c5b5a99603 | ||
|
|
4fa04abb8c | ||
|
|
a081f8d92d | ||
|
|
30e7f89662 | ||
|
|
c159290868 | ||
|
|
966f6816eb | ||
|
|
7bf9ce2f2f | ||
|
|
06279b5f1a | ||
|
|
cd8a6b5a7a | ||
|
|
8127473bab | ||
|
|
3e2df74e8b | ||
|
|
6924a3d5f2 | ||
|
|
bb0e3a6cb0 | ||
|
|
8323ff77b6 | ||
|
|
ef4a44cd06 | ||
|
|
8d0f33f2e1 | ||
|
|
8d1ebf7abb | ||
|
|
354719327b | ||
|
|
e87bb5db6a | ||
|
|
ddbcf1fc61 | ||
|
|
c2f0bd3c62 | ||
|
|
2c3df5f187 | ||
|
|
24474042f8 | ||
|
|
4c6598e861 | ||
|
|
2b847a98ae | ||
|
|
c07c87c131 | ||
|
|
eab4d4b464 | ||
|
|
496799f867 | ||
|
|
5e7f5029d8 | ||
|
|
b32e5e916b | ||
|
|
199f48d16a | ||
|
|
cd5b6e30fa | ||
|
|
23239c0393 | ||
|
|
d0c97e07f9 | ||
|
|
f7c610ee23 | ||
|
|
e717d51069 | ||
|
|
89bca05a8d | ||
|
|
c3d91ddf80 | ||
|
|
6fecccdf26 | ||
|
|
40aafbaea6 | ||
|
|
ca21235a4f | ||
|
|
e49a9b790b | ||
|
|
3c61b3d841 | ||
|
|
9be120a04e | ||
|
|
c0a00f48ce | ||
|
|
d39b9a8d83 | ||
|
|
811bb58c5a | ||
|
|
a694bb898d | ||
|
|
45392a2696 | ||
|
|
91daae2e36 | ||
|
|
23eee4b3df | ||
|
|
cd2a998980 | ||
|
|
125272a526 | ||
|
|
e7b4242b1c | ||
|
|
243d18d812 | ||
|
|
67a7ed0ac5 | ||
|
|
a7fb84ef3b | ||
|
|
3c2fcce2c3 | ||
|
|
f6805f2794 | ||
|
|
3b23ba0520 | ||
|
|
b2b20e469f | ||
|
|
8cca9b1970 | ||
|
|
ee11018780 | ||
|
|
93417fca7d | ||
|
|
86e1144b65 | ||
|
|
dbbbab4f8a | ||
|
|
31c8460116 | ||
|
|
ccb2e44e36 | ||
|
|
d949b6c8ef | ||
|
|
daf452a180 | ||
|
|
e9ece8eb3f | ||
|
|
5981495740 | ||
|
|
314b417446 | ||
|
|
5c0c4d64e2 | ||
|
|
31301e2b9d | ||
|
|
6360107d53 | ||
|
|
eee73eed59 | ||
|
|
60bf397569 | ||
|
|
06f6b2885a | ||
|
|
5eccdaaab7 | ||
|
|
221e7952ab | ||
|
|
30283e60f5 | ||
|
|
46a85fc11e | ||
|
|
b4be759b2c | ||
|
|
56d30d3e0c | ||
|
|
05c7d86d55 | ||
|
|
e1dfccb542 | ||
|
|
5d65d9f7c8 | ||
|
|
8a8fb56bf4 | ||
|
|
68b280b695 | ||
|
|
30d339842e | ||
|
|
515a2dba8f | ||
|
|
37b807278a | ||
|
|
a803021eef | ||
|
|
14f597d391 | ||
|
|
7be42d9935 | ||
|
|
70bf990294 | ||
|
|
7b6f109401 | ||
|
|
26d07fd987 | ||
|
|
da8bda3248 | ||
|
|
de9ee7b334 | ||
|
|
37d94a3c91 | ||
|
|
98730b90a3 | ||
|
|
73f6402ade | ||
|
|
74f300290e | ||
|
|
33a05d33a9 | ||
|
|
f0867a9615 | ||
|
|
03f412404a | ||
|
|
c69b579201 | ||
|
|
d6178993c2 | ||
|
|
9da58c5f6a | ||
|
|
ddc46fc059 | ||
|
|
fbcd4c7a6f | ||
|
|
1814187578 | ||
|
|
10d77f1f0c | ||
|
|
b4dae335e1 | ||
|
|
7ba14f706c | ||
|
|
0a06445e82 | ||
|
|
8218109045 | ||
|
|
e0a52da4f7 | ||
|
|
830a9482e7 | ||
|
|
c6c7d87a56 | ||
|
|
6050d04c7c | ||
|
|
24e68feb59 | ||
|
|
c057ce10d1 | ||
|
|
e1a3ef4266 | ||
|
|
f22a0f9ec0 | ||
|
|
5fb69281d8 | ||
|
|
b9750087ce | ||
|
|
8282484f65 | ||
|
|
26a780a198 | ||
|
|
518dc962ee | ||
|
|
abdaae7ece | ||
|
|
f4931c6098 | ||
|
|
5efa364d50 | ||
|
|
c1f1d3d093 | ||
|
|
304fa02d59 | ||
|
|
e75e864070 | ||
|
|
3184eb9f4d | ||
|
|
767a53f8c3 | ||
|
|
962e37e893 | ||
|
|
d8f1380ec9 | ||
|
|
4fcc9a1b09 | ||
|
|
0b5e40f455 | ||
|
|
0de1b84f9a | ||
|
|
23378f8710 | ||
|
|
1740dcb90a | ||
|
|
b83824b28b | ||
|
|
8ab23cbd5c | ||
|
|
27e99ff84f | ||
|
|
b5d3487ce6 | ||
|
|
de1df6b2fe | ||
|
|
ca9ad49ba8 | ||
|
|
a8f97b5849 | ||
|
|
89418a5c34 | ||
|
|
f9a5c17c5a | ||
|
|
b7ca80265c | ||
|
|
78899be05d | ||
|
|
85be0aad1b | ||
|
|
0b49f34e01 | ||
|
|
65df0b81d9 | ||
|
|
c7fdfb00bb | ||
|
|
baef8c0c27 | ||
|
|
cfe201450c | ||
|
|
2478814e5a | ||
|
|
69db877335 | ||
|
|
7184c9a529 | ||
|
|
0869bea026 | ||
|
|
abf4957e18 | ||
|
|
514c756570 | ||
|
|
7020892631 | ||
|
|
662f7526c9 | ||
|
|
8863bdbfc0 | ||
|
|
704833cd29 | ||
|
|
19ec0ef25d | ||
|
|
7036636fcf | ||
|
|
57198a2fba | ||
|
|
002bdbf03a | ||
|
|
33f190c9ce | ||
|
|
4cfc73e17e | ||
|
|
e793d7e128 | ||
|
|
3702d4be27 | ||
|
|
415b506a85 | ||
|
|
d6618c75a0 | ||
|
|
3ab625fa4c | ||
|
|
17e1fcb615 | ||
|
|
94d9dee0dd | ||
|
|
8d0b28bda4 | ||
|
|
4d5e850aa9 | ||
|
|
ece51c5372 | ||
|
|
f0673daaad | ||
|
|
88f8c7d166 | ||
|
|
6c0c111847 | ||
|
|
f9a4a400da | ||
|
|
562d4e0f85 | ||
|
|
43436f7bc8 | ||
|
|
04bb539502 | ||
|
|
779e923854 | ||
|
|
0295d22742 | ||
|
|
f80d10f3be | ||
|
|
b29a182da7 | ||
|
|
53ca3b64e1 | ||
|
|
31d193702b | ||
|
|
7c9ce49362 | ||
|
|
a2d90625d2 | ||
|
|
d7c52f8adf | ||
|
|
48c54605ae | ||
|
|
1aed631fe5 | ||
|
|
30ed272aa9 | ||
|
|
a50a20b5a7 | ||
|
|
1162b02e60 | ||
|
|
5b1800556b | ||
|
|
825cdb8db9 | ||
|
|
6c40d363f5 | ||
|
|
bd9e8c7663 | ||
|
|
52d5d57460 | ||
|
|
ea4f599233 | ||
|
|
3eb007776a | ||
|
|
2be9452ced | ||
|
|
efad692353 | ||
|
|
357da15e5c | ||
|
|
cc328689e1 | ||
|
|
d044e30e12 | ||
|
|
ff987e0b9d | ||
|
|
cc294496ab | ||
|
|
ed0b4b0bfa | ||
|
|
eb9aa039bb | ||
|
|
bab500bec5 | ||
|
|
1c8880ed2c | ||
|
|
bc32eec051 | ||
|
|
f017d43aae | ||
|
|
0def6cb9e1 | ||
|
|
a7dc3f519b | ||
|
|
f273a440f0 | ||
|
|
295bf03e4d | ||
|
|
270f962489 | ||
|
|
2d93697fe3 | ||
|
|
688e8f3c09 | ||
|
|
090c655422 | ||
|
|
75f00e92f5 | ||
|
|
1366901ded | ||
|
|
8ea00a3fc0 | ||
|
|
48ffb15901 | ||
|
|
e0d2b9526e | ||
|
|
5f5bd31f58 | ||
|
|
5ceaeafa6e | ||
|
|
b60d795a5d | ||
|
|
2410cf3d84 | ||
|
|
36a8d9716e | ||
|
|
3e5037d196 | ||
|
|
34dfc78f57 | ||
|
|
042601129d | ||
|
|
a3a3fefb1c | ||
|
|
942f05ad6a | ||
|
|
adaa02fd26 | ||
|
|
eb7fc47290 | ||
|
|
7e1c55cdf9 | ||
|
|
995caaaace | ||
|
|
959b62a2df | ||
|
|
eb894b0dd2 | ||
|
|
1922e76349 | ||
|
|
d1fd3f56a7 | ||
|
|
e2e2cd87ff | ||
|
|
beb3369c76 | ||
|
|
4bd039902c | ||
|
|
77615e9583 | ||
|
|
49d6c07280 | ||
|
|
0db46dfeaa | ||
|
|
534e43e1d3 | ||
|
|
c5e3ca3855 | ||
|
|
cede67bfdd | ||
|
|
2690b69831 | ||
|
|
1866eebe06 | ||
|
|
65de3e7f6c | ||
|
|
1c1d8e0626 | ||
|
|
30ed847531 | ||
|
|
6bd2d89e30 | ||
|
|
507b835a9c | ||
|
|
395c772222 | ||
|
|
07e4024e3b | ||
|
|
f28bd054ef | ||
|
|
5f62227f53 | ||
|
|
dec2b312af | ||
|
|
3b1964c507 | ||
|
|
0ac8708396 | ||
|
|
93f1fac76b | ||
|
|
1f7c89d5d8 | ||
|
|
1643ec4fe9 | ||
|
|
508c06092d | ||
|
|
54f312139f | ||
|
|
19593eda3b | ||
|
|
cd5829ae42 | ||
|
|
8562798940 | ||
|
|
0f6da17cd1 | ||
|
|
60d09579be | ||
|
|
7163fe61a0 | ||
|
|
124fe26492 | ||
|
|
339b7db2b7 | ||
|
|
77613b57a9 | ||
|
|
c35e7691bd | ||
|
|
12554baed4 | ||
|
|
73e7c42b7e | ||
|
|
2c9ea8c46b | ||
|
|
fcf69e7b82 | ||
|
|
5d6e9ec65b | ||
|
|
752ce9e590 | ||
|
|
e8b902b42f | ||
|
|
9ee57937b4 | ||
|
|
8f121ab0ec | ||
|
|
45a65c5d9e | ||
|
|
36cb76a322 | ||
|
|
3e72a088df | ||
|
|
aba27d930b | ||
|
|
44e42bfec8 | ||
|
|
1dbfb3bea9 | ||
|
|
c9ac0020d7 | ||
|
|
71913521f9 | ||
|
|
a375d532f6 | ||
|
|
34022f3844 | ||
|
|
ad00d5987d | ||
|
|
a8547ed840 | ||
|
|
ddede202a8 | ||
|
|
10b07ecd20 | ||
|
|
17d72f02a1 | ||
|
|
5e3112fa95 | ||
|
|
f26d19ed7d | ||
|
|
c3fb3301ab | ||
|
|
7712fc044e | ||
|
|
efa57bbd1f | ||
|
|
cdd5420e0c | ||
|
|
770608aef1 | ||
|
|
08a5950863 | ||
|
|
a9ae38a1ce | ||
|
|
13a4602806 | ||
|
|
3370847f3e | ||
|
|
06f8637485 | ||
|
|
5bdcc7d7e0 | ||
|
|
db5082552d | ||
|
|
dcf6f64143 | ||
|
|
372dd2ced9 | ||
|
|
0c8828514e | ||
|
|
0a4b49d3b3 | ||
|
|
84470e9c64 | ||
|
|
88142d246c | ||
|
|
98c861e3c9 | ||
|
|
42a79d52a2 | ||
|
|
563dc8e59a | ||
|
|
02a6176bd0 | ||
|
|
cc7055774d | ||
|
|
d540f7af72 | ||
|
|
239274cb1d | ||
|
|
fe6c25353c | ||
|
|
aca9496437 | ||
|
|
ce3c6472fb | ||
|
|
787bcef130 | ||
|
|
cf92776c64 | ||
|
|
1fc94e33b2 | ||
|
|
137f494619 | ||
|
|
df7e2a884b | ||
|
|
ac57797904 | ||
|
|
3c8aa18f70 | ||
|
|
0f4019cbb7 | ||
|
|
c3f2f12cb2 | ||
|
|
656a33863f | ||
|
|
0dcad9cc18 | ||
|
|
6bef1aeb82 | ||
|
|
3cd563622e | ||
|
|
66f88773c0 | ||
|
|
3ecb1fd5d9 | ||
|
|
7900479e9c | ||
|
|
731da455d4 | ||
|
|
b5791d4442 | ||
|
|
af7e301867 | ||
|
|
681c255bc5 | ||
|
|
8a30448fa7 | ||
|
|
fa6389a7e7 | ||
|
|
0c099dfbd0 | ||
|
|
fd40280300 | ||
|
|
5a48c3a921 | ||
|
|
68b6190c12 | ||
|
|
e2f4c70b70 | ||
|
|
7518854625 | ||
|
|
d1c0b8b0c9 | ||
|
|
0a2429b467 | ||
|
|
e37c54f38e | ||
|
|
4043923e56 | ||
|
|
76c10807d6 | ||
|
|
20698a7843 | ||
|
|
a4c24985e8 | ||
|
|
b26ac2bd0e | ||
|
|
c34ade9ffb | ||
|
|
5f0489ace0 | ||
|
|
96ee416b96 | ||
|
|
80133aaa79 | ||
|
|
6de4e3d4cd | ||
|
|
f652dd3436 | ||
|
|
9f98d0ae4a | ||
|
|
f369d99138 | ||
|
|
7e7e88e330 | ||
|
|
20bf46f309 | ||
|
|
f378c6d3ee | ||
|
|
b88307f875 | ||
|
|
255ff1a4b7 | ||
|
|
696659d6bc | ||
|
|
8a16e1ca7d | ||
|
|
39dee1410b | ||
|
|
c715254d54 | ||
|
|
d1f3ab5dec | ||
|
|
0fa74a7712 | ||
|
|
e69cc545b3 | ||
|
|
68f3e4483f | ||
|
|
e1ef1b759e | ||
|
|
1bd0f55945 | ||
|
|
a40381a700 | ||
|
|
9a34f5803c | ||
|
|
913478b21e | ||
|
|
2b3fad1261 | ||
|
|
bba2ee92bd | ||
|
|
c4aece4ab4 | ||
|
|
e74e56947b | ||
|
|
ce0b8149e9 | ||
|
|
5915d4ac6a | ||
|
|
940505569c | ||
|
|
8c46d00ee7 | ||
|
|
cc57f732d2 | ||
|
|
f410da2a0a | ||
|
|
cb39ce66bc | ||
|
|
eb0d52a249 | ||
|
|
2804c2ca99 | ||
|
|
71614bd639 | ||
|
|
78187ab8d1 | ||
|
|
6b4cc44060 | ||
|
|
61742f5d5a | ||
|
|
c330641866 | ||
|
|
33019ee496 | ||
|
|
b40b7cc40e | ||
|
|
17bcf91910 | ||
|
|
f04b5f2963 | ||
|
|
6ff99568cf | ||
|
|
0a220a3efb | ||
|
|
0bc3e26090 | ||
|
|
257bc70c2e | ||
|
|
6c1651cb3d | ||
|
|
01efb3b1a7 | ||
|
|
2ad3a117f1 | ||
|
|
e19c5bfcd7 | ||
|
|
f9ae5c0cb3 | ||
|
|
ac82366b9e | ||
|
|
b493855195 | ||
|
|
4bb8865e2f | ||
|
|
9c25aea327 | ||
|
|
cc5e96b23f | ||
|
|
0095d93686 | ||
|
|
1da3e2c711 | ||
|
|
73468e706e | ||
|
|
4894e0b18d | ||
|
|
f155b3003b | ||
|
|
4974b6874e | ||
|
|
1fac7981a4 | ||
|
|
b244277ff2 | ||
|
|
0c6f3ee19c | ||
|
|
12752c6970 | ||
|
|
39c38c44a3 | ||
|
|
f0944030b7 | ||
|
|
7eb7edb950 | ||
|
|
6a88a94a8b | ||
|
|
7e86f7196e | ||
|
|
eeeb33c9ac | ||
|
|
b8e412884b | ||
|
|
4d2691a2e1 | ||
|
|
3ce467a25f | ||
|
|
0710342317 | ||
|
|
d95f24b9d2 | ||
|
|
c456836ad5 | ||
|
|
be418e77f9 | ||
|
|
21a1f3a34d | ||
|
|
ebd34f1884 | ||
|
|
ba2596e318 | ||
|
|
d0af0eff9f | ||
|
|
d502eeba2b | ||
|
|
064c3d473c | ||
|
|
5a42083abd | ||
|
|
54cb55a7ae | ||
|
|
a709a0a682 | ||
|
|
029610fb40 | ||
|
|
1646edf513 | ||
|
|
e2781ea0f2 | ||
|
|
555ff81cbf | ||
|
|
003df89edf | ||
|
|
bfc2cc3aa3 | ||
|
|
eeab118a05 | ||
|
|
04458ea12b | ||
|
|
c951e348b4 | ||
|
|
2a988d453c | ||
|
|
b8b33c4f06 | ||
|
|
f2fa2f5067 | ||
|
|
001de1a915 | ||
|
|
f0f0fe38a3 | ||
|
|
2498da742d | ||
|
|
ad684ed0ea | ||
|
|
0d7d02da35 | ||
|
|
b78892934b | ||
|
|
c50b63c5f6 | ||
|
|
b0ff3dfb90 | ||
|
|
b2dbe8dfef | ||
|
|
9436b15528 | ||
|
|
d6e6bfbb5a | ||
|
|
3fbf765605 | ||
|
|
8e75a8d12d | ||
|
|
450d4b256a | ||
|
|
595e29186e | ||
|
|
c070f253ac | ||
|
|
46447ef55c | ||
|
|
6861705354 | ||
|
|
7d0f5dd4f9 | ||
|
|
cd499e3ab8 | ||
|
|
7244ff9e14 | ||
|
|
3c252e1d87 | ||
|
|
84896f4790 | ||
|
|
d4cbb0803b | ||
|
|
ff244fba6c | ||
|
|
49a4c06a88 | ||
|
|
361dc55dfd | ||
|
|
2ed2ee1da7 | ||
|
|
58876aefa3 | ||
|
|
77b123b02f | ||
|
|
114cb4e0d5 | ||
|
|
4a1b211876 | ||
|
|
d78f1e4eee | ||
|
|
5e14892ef8 | ||
|
|
9e4c8881b6 | ||
|
|
b8ba5274e2 | ||
|
|
aa4adb0dfd | ||
|
|
62a393bf12 | ||
|
|
a440339548 | ||
|
|
3c15314ed5 | ||
|
|
d3cec2f0d1 | ||
|
|
1158a928ec | ||
|
|
1bd2cbbef6 | ||
|
|
a9d757f3a0 | ||
|
|
9a854e9ab7 | ||
|
|
2cef55a4f6 | ||
|
|
5ea1502b02 | ||
|
|
99c6ef564e | ||
|
|
39e3ddb0ed | ||
|
|
defdea7b49 | ||
|
|
d249eb3f93 | ||
|
|
668c33fdcd | ||
|
|
7f26ce614b | ||
|
|
ada499ef14 | ||
|
|
6240729ee4 | ||
|
|
8f95cd4149 |
+65
-102
@@ -1,23 +1,32 @@
|
||||
version: 2.1
|
||||
orbs:
|
||||
go: gotest/tools@0.0.13
|
||||
aws-cli: circleci/aws-cli@1.3.2
|
||||
packer: salaxander/packer@0.0.3
|
||||
|
||||
executors:
|
||||
golang:
|
||||
docker:
|
||||
- image: circleci/golang:1.16.4
|
||||
- image: cimg/go:1.17.9
|
||||
resource_class: 2xlarge
|
||||
ubuntu:
|
||||
docker:
|
||||
- image: ubuntu:20.04
|
||||
packer:
|
||||
description: |
|
||||
The HashiCorp provided Packer container
|
||||
parameters:
|
||||
packer-version:
|
||||
type: string
|
||||
default: "1.8"
|
||||
docker:
|
||||
- image: hashicorp/packer:<< parameters.packer-version >>
|
||||
|
||||
|
||||
commands:
|
||||
install-deps:
|
||||
steps:
|
||||
- go/install-ssh
|
||||
- go/install: {package: git}
|
||||
- run: |
|
||||
sudo apt update
|
||||
sudo apt install python-is-python3
|
||||
prepare:
|
||||
parameters:
|
||||
linux:
|
||||
@@ -58,14 +67,14 @@ commands:
|
||||
- run: |
|
||||
apt update
|
||||
apt install -y wget
|
||||
wget https://github.com/ipfs/go-ipfs/releases/download/v0.4.22/go-ipfs_v0.4.22_linux-amd64.tar.gz
|
||||
wget https://github.com/ipfs/go-ipfs/releases/download/v0.4.22/go-ipfs_v0.4.22_linux-amd64.tar.gz.sha512
|
||||
if [ "$(sha512sum go-ipfs_v0.4.22_linux-amd64.tar.gz)" != "$(cat go-ipfs_v0.4.22_linux-amd64.tar.gz.sha512)" ]
|
||||
wget https://github.com/ipfs/go-ipfs/releases/download/v0.12.2/go-ipfs_v0.12.2_linux-amd64.tar.gz
|
||||
wget https://github.com/ipfs/go-ipfs/releases/download/v0.12.2/go-ipfs_v0.12.2_linux-amd64.tar.gz.sha512
|
||||
if [ "$(sha512sum go-ipfs_v0.12.2_linux-amd64.tar.gz)" != "$(cat go-ipfs_v0.12.2_linux-amd64.tar.gz.sha512)" ]
|
||||
then
|
||||
echo "ipfs failed checksum check"
|
||||
exit 1
|
||||
fi
|
||||
tar -xf go-ipfs_v0.4.22_linux-amd64.tar.gz
|
||||
tar -xf go-ipfs_v0.12.2_linux-amd64.tar.gz
|
||||
mv go-ipfs/ipfs /usr/local/bin/ipfs
|
||||
chmod +x /usr/local/bin/ipfs
|
||||
git_fetch_all_tags:
|
||||
@@ -74,6 +83,25 @@ commands:
|
||||
name: fetch all tags
|
||||
command: |
|
||||
git fetch --all
|
||||
packer_build:
|
||||
description: "Run a packer build"
|
||||
parameters:
|
||||
template:
|
||||
description: |
|
||||
The name of the packer template file
|
||||
type: string
|
||||
default: packer.json
|
||||
args:
|
||||
description: |
|
||||
Arguments to pass to the packer build command
|
||||
type: string
|
||||
default: ""
|
||||
|
||||
steps:
|
||||
- run:
|
||||
name: "Run a packer build"
|
||||
command: packer build << parameters.args >> << parameters.template >>
|
||||
no_output_timeout: 30m
|
||||
|
||||
jobs:
|
||||
mod-tidy-check:
|
||||
@@ -81,8 +109,12 @@ jobs:
|
||||
steps:
|
||||
- install-deps
|
||||
- prepare
|
||||
- go/mod-tidy-check
|
||||
|
||||
- run: go mod tidy -v
|
||||
- run:
|
||||
name: Check git diff
|
||||
command: |
|
||||
git --no-pager diff go.mod go.sum
|
||||
git --no-pager diff --quiet go.mod go.sum
|
||||
build-all:
|
||||
executor: golang
|
||||
steps:
|
||||
@@ -159,14 +191,12 @@ jobs:
|
||||
command: make deps lotus
|
||||
no_output_timeout: 30m
|
||||
- download-params
|
||||
- go/install-gotestsum:
|
||||
gobin: $HOME/.local/bin
|
||||
version: 0.5.2
|
||||
- run:
|
||||
name: go test
|
||||
environment:
|
||||
TEST_RUSTPROOFS_LOGS: << parameters.proofs-log-test >>
|
||||
SKIP_CONFORMANCE: "1"
|
||||
LOTUS_SRC_DIR: /home/circleci/project
|
||||
command: |
|
||||
mkdir -p /tmp/test-reports/<< parameters.suite >>
|
||||
mkdir -p /tmp/test-artifacts
|
||||
@@ -186,8 +216,6 @@ jobs:
|
||||
- when:
|
||||
condition: << parameters.codecov-upload >>
|
||||
steps:
|
||||
- go/install: {package: bash}
|
||||
- go/install: {package: curl}
|
||||
- run:
|
||||
shell: /bin/bash -eo pipefail
|
||||
command: |
|
||||
@@ -195,7 +223,7 @@ jobs:
|
||||
|
||||
test-conformance:
|
||||
description: |
|
||||
Run tests using a corpus of interoperable test vectors for Filecoin
|
||||
Run tests using a corpus of interoperable test vectors for Filecoin
|
||||
implementations to test their correctness and compliance with the Filecoin
|
||||
specifications.
|
||||
parameters:
|
||||
@@ -226,9 +254,6 @@ jobs:
|
||||
cd extern/test-vectors
|
||||
git fetch
|
||||
git checkout origin/<< parameters.vectors-branch >>
|
||||
- go/install-gotestsum:
|
||||
gobin: $HOME/.local/bin
|
||||
version: 0.5.2
|
||||
- run:
|
||||
name: install statediff globally
|
||||
command: |
|
||||
@@ -341,8 +366,8 @@ jobs:
|
||||
- run:
|
||||
name: Install go
|
||||
command: |
|
||||
curl -O https://dl.google.com/go/go1.16.4.darwin-amd64.pkg && \
|
||||
sudo installer -pkg go1.16.4.darwin-amd64.pkg -target /
|
||||
curl -O https://dl.google.com/go/go1.17.9.darwin-amd64.pkg && \
|
||||
sudo installer -pkg go1.17.9.darwin-amd64.pkg -target /
|
||||
- run:
|
||||
name: Install pkg-config
|
||||
command: HOMEBREW_NO_AUTO_UPDATE=1 brew install pkg-config
|
||||
@@ -363,7 +388,6 @@ jobs:
|
||||
- restore_cache:
|
||||
name: restore cargo cache
|
||||
key: v3-go-deps-{{ arch }}-{{ checksum "~/go/src/github.com/filecoin-project/lotus/go.sum" }}
|
||||
- install-deps
|
||||
- run:
|
||||
command: make build
|
||||
no_output_timeout: 30m
|
||||
@@ -483,9 +507,6 @@ jobs:
|
||||
executor:
|
||||
type: executor
|
||||
default: golang
|
||||
golangci-lint-version:
|
||||
type: string
|
||||
default: 1.27.0
|
||||
concurrency:
|
||||
type: string
|
||||
default: '2'
|
||||
@@ -504,13 +525,10 @@ jobs:
|
||||
- run:
|
||||
command: make deps
|
||||
no_output_timeout: 30m
|
||||
- go/install-golangci-lint:
|
||||
gobin: $HOME/.local/bin
|
||||
version: << parameters.golangci-lint-version >>
|
||||
- run:
|
||||
name: Lint
|
||||
command: |
|
||||
$HOME/.local/bin/golangci-lint run -v --timeout 2m \
|
||||
golangci-lint run -v --timeout 2m \
|
||||
--concurrency << parameters.concurrency >> << parameters.args >>
|
||||
lint-all:
|
||||
<<: *lint
|
||||
@@ -685,52 +703,15 @@ jobs:
|
||||
docker push $<<parameters.account-url>>/<<parameters.repo>>:${tag}
|
||||
done
|
||||
|
||||
publish-packer-mainnet:
|
||||
description: build and push AWS IAM and DigitalOcean droplet.
|
||||
executor:
|
||||
name: packer/default
|
||||
packer-version: 1.6.6
|
||||
steps:
|
||||
- checkout
|
||||
- attach_workspace:
|
||||
at: "."
|
||||
- packer/build:
|
||||
template: tools/packer/lotus.pkr.hcl
|
||||
args: "-var ci_workspace_bins=./linux -var lotus_network=mainnet -var git_tag=$CIRCLE_TAG"
|
||||
publish-packer-calibrationnet:
|
||||
description: build and push AWS IAM and DigitalOcean droplet.
|
||||
executor:
|
||||
name: packer/default
|
||||
packer-version: 1.6.6
|
||||
steps:
|
||||
- checkout
|
||||
- attach_workspace:
|
||||
at: "."
|
||||
- packer/build:
|
||||
template: tools/packer/lotus.pkr.hcl
|
||||
args: "-var ci_workspace_bins=./linux-calibrationnet -var lotus_network=calibrationnet -var git_tag=$CIRCLE_TAG"
|
||||
publish-packer-butterflynet:
|
||||
description: build and push AWS IAM and DigitalOcean droplet.
|
||||
executor:
|
||||
name: packer/default
|
||||
packer-version: 1.6.6
|
||||
steps:
|
||||
- checkout
|
||||
- attach_workspace:
|
||||
at: "."
|
||||
- packer/build:
|
||||
template: tools/packer/lotus.pkr.hcl
|
||||
args: "-var ci_workspace_bins=./linux-butterflynet -var lotus_network=butterflynet -var git_tag=$CIRCLE_TAG"
|
||||
publish-packer-snap:
|
||||
description: build packer image with snap. mainnet only.
|
||||
executor:
|
||||
name: packer/default
|
||||
packer-version: 1.6.6
|
||||
name: packer
|
||||
steps:
|
||||
- checkout
|
||||
- attach_workspace:
|
||||
at: "."
|
||||
- packer/build:
|
||||
- packer_build:
|
||||
template: tools/packer/lotus-snap.pkr.hcl
|
||||
publish-dockerhub:
|
||||
description: publish to dockerhub
|
||||
@@ -822,6 +803,11 @@ workflows:
|
||||
suite: itest-deals_concurrent
|
||||
target: "./itests/deals_concurrent_test.go"
|
||||
|
||||
- test:
|
||||
name: test-itest-deals_invalid_utf8_label
|
||||
suite: itest-deals_invalid_utf8_label
|
||||
target: "./itests/deals_invalid_utf8_label_test.go"
|
||||
|
||||
- test:
|
||||
name: test-itest-deals_max_staging_deals
|
||||
suite: itest-deals_max_staging_deals
|
||||
@@ -882,6 +868,16 @@ workflows:
|
||||
suite: itest-get_messages_in_ts
|
||||
target: "./itests/get_messages_in_ts_test.go"
|
||||
|
||||
- test:
|
||||
name: test-itest-lite_migration
|
||||
suite: itest-lite_migration
|
||||
target: "./itests/lite_migration_test.go"
|
||||
|
||||
- test:
|
||||
name: test-itest-lookup_robust_address
|
||||
suite: itest-lookup_robust_address
|
||||
target: "./itests/lookup_robust_address_test.go"
|
||||
|
||||
- test:
|
||||
name: test-itest-mempool
|
||||
suite: itest-mempool
|
||||
@@ -1032,9 +1028,6 @@ workflows:
|
||||
- build-lotus-soup
|
||||
- build-macos:
|
||||
filters:
|
||||
branches:
|
||||
ignore:
|
||||
- /.*/
|
||||
tags:
|
||||
only:
|
||||
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
|
||||
@@ -1070,36 +1063,6 @@ workflows:
|
||||
repo: lotus-test
|
||||
tag: '${CIRCLE_SHA1:0:8}'
|
||||
target: lotus-test
|
||||
- publish-packer-mainnet:
|
||||
requires:
|
||||
- build-all
|
||||
filters:
|
||||
branches:
|
||||
ignore:
|
||||
- /.*/
|
||||
tags:
|
||||
only:
|
||||
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
|
||||
- publish-packer-calibrationnet:
|
||||
requires:
|
||||
- build-ntwk-calibration
|
||||
filters:
|
||||
branches:
|
||||
ignore:
|
||||
- /.*/
|
||||
tags:
|
||||
only:
|
||||
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
|
||||
- publish-packer-butterflynet:
|
||||
requires:
|
||||
- build-ntwk-butterfly
|
||||
filters:
|
||||
branches:
|
||||
ignore:
|
||||
- /.*/
|
||||
tags:
|
||||
only:
|
||||
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
|
||||
- publish-snapcraft:
|
||||
name: publish-snapcraft-stable
|
||||
channel: stable
|
||||
|
||||
+50
-102
@@ -1,23 +1,32 @@
|
||||
version: 2.1
|
||||
orbs:
|
||||
go: gotest/tools@0.0.13
|
||||
aws-cli: circleci/aws-cli@1.3.2
|
||||
packer: salaxander/packer@0.0.3
|
||||
|
||||
executors:
|
||||
golang:
|
||||
docker:
|
||||
- image: circleci/golang:1.16.4
|
||||
- image: cimg/go:1.17.9
|
||||
resource_class: 2xlarge
|
||||
ubuntu:
|
||||
docker:
|
||||
- image: ubuntu:20.04
|
||||
packer:
|
||||
description: |
|
||||
The HashiCorp provided Packer container
|
||||
parameters:
|
||||
packer-version:
|
||||
type: string
|
||||
default: "1.8"
|
||||
docker:
|
||||
- image: hashicorp/packer:<< parameters.packer-version >>
|
||||
|
||||
|
||||
commands:
|
||||
install-deps:
|
||||
steps:
|
||||
- go/install-ssh
|
||||
- go/install: {package: git}
|
||||
- run: |
|
||||
sudo apt update
|
||||
sudo apt install python-is-python3
|
||||
prepare:
|
||||
parameters:
|
||||
linux:
|
||||
@@ -58,14 +67,14 @@ commands:
|
||||
- run: |
|
||||
apt update
|
||||
apt install -y wget
|
||||
wget https://github.com/ipfs/go-ipfs/releases/download/v0.4.22/go-ipfs_v0.4.22_linux-amd64.tar.gz
|
||||
wget https://github.com/ipfs/go-ipfs/releases/download/v0.4.22/go-ipfs_v0.4.22_linux-amd64.tar.gz.sha512
|
||||
if [ "$(sha512sum go-ipfs_v0.4.22_linux-amd64.tar.gz)" != "$(cat go-ipfs_v0.4.22_linux-amd64.tar.gz.sha512)" ]
|
||||
wget https://github.com/ipfs/go-ipfs/releases/download/v0.12.2/go-ipfs_v0.12.2_linux-amd64.tar.gz
|
||||
wget https://github.com/ipfs/go-ipfs/releases/download/v0.12.2/go-ipfs_v0.12.2_linux-amd64.tar.gz.sha512
|
||||
if [ "$(sha512sum go-ipfs_v0.12.2_linux-amd64.tar.gz)" != "$(cat go-ipfs_v0.12.2_linux-amd64.tar.gz.sha512)" ]
|
||||
then
|
||||
echo "ipfs failed checksum check"
|
||||
exit 1
|
||||
fi
|
||||
tar -xf go-ipfs_v0.4.22_linux-amd64.tar.gz
|
||||
tar -xf go-ipfs_v0.12.2_linux-amd64.tar.gz
|
||||
mv go-ipfs/ipfs /usr/local/bin/ipfs
|
||||
chmod +x /usr/local/bin/ipfs
|
||||
git_fetch_all_tags:
|
||||
@@ -74,6 +83,25 @@ commands:
|
||||
name: fetch all tags
|
||||
command: |
|
||||
git fetch --all
|
||||
packer_build:
|
||||
description: "Run a packer build"
|
||||
parameters:
|
||||
template:
|
||||
description: |
|
||||
The name of the packer template file
|
||||
type: string
|
||||
default: packer.json
|
||||
args:
|
||||
description: |
|
||||
Arguments to pass to the packer build command
|
||||
type: string
|
||||
default: ""
|
||||
|
||||
steps:
|
||||
- run:
|
||||
name: "Run a packer build"
|
||||
command: packer build << parameters.args >> << parameters.template >>
|
||||
no_output_timeout: 30m
|
||||
|
||||
jobs:
|
||||
mod-tidy-check:
|
||||
@@ -81,8 +109,12 @@ jobs:
|
||||
steps:
|
||||
- install-deps
|
||||
- prepare
|
||||
- go/mod-tidy-check
|
||||
|
||||
- run: go mod tidy -v
|
||||
- run:
|
||||
name: Check git diff
|
||||
command: |
|
||||
git --no-pager diff go.mod go.sum
|
||||
git --no-pager diff --quiet go.mod go.sum
|
||||
build-all:
|
||||
executor: golang
|
||||
steps:
|
||||
@@ -159,14 +191,12 @@ jobs:
|
||||
command: make deps lotus
|
||||
no_output_timeout: 30m
|
||||
- download-params
|
||||
- go/install-gotestsum:
|
||||
gobin: $HOME/.local/bin
|
||||
version: 0.5.2
|
||||
- run:
|
||||
name: go test
|
||||
environment:
|
||||
TEST_RUSTPROOFS_LOGS: << parameters.proofs-log-test >>
|
||||
SKIP_CONFORMANCE: "1"
|
||||
LOTUS_SRC_DIR: /home/circleci/project
|
||||
command: |
|
||||
mkdir -p /tmp/test-reports/<< parameters.suite >>
|
||||
mkdir -p /tmp/test-artifacts
|
||||
@@ -186,8 +216,6 @@ jobs:
|
||||
- when:
|
||||
condition: << parameters.codecov-upload >>
|
||||
steps:
|
||||
- go/install: {package: bash}
|
||||
- go/install: {package: curl}
|
||||
- run:
|
||||
shell: /bin/bash -eo pipefail
|
||||
command: |
|
||||
@@ -195,7 +223,7 @@ jobs:
|
||||
|
||||
test-conformance:
|
||||
description: |
|
||||
Run tests using a corpus of interoperable test vectors for Filecoin
|
||||
Run tests using a corpus of interoperable test vectors for Filecoin
|
||||
implementations to test their correctness and compliance with the Filecoin
|
||||
specifications.
|
||||
parameters:
|
||||
@@ -226,9 +254,6 @@ jobs:
|
||||
cd extern/test-vectors
|
||||
git fetch
|
||||
git checkout origin/<< parameters.vectors-branch >>
|
||||
- go/install-gotestsum:
|
||||
gobin: $HOME/.local/bin
|
||||
version: 0.5.2
|
||||
- run:
|
||||
name: install statediff globally
|
||||
command: |
|
||||
@@ -341,8 +366,8 @@ jobs:
|
||||
- run:
|
||||
name: Install go
|
||||
command: |
|
||||
curl -O https://dl.google.com/go/go1.16.4.darwin-amd64.pkg && \
|
||||
sudo installer -pkg go1.16.4.darwin-amd64.pkg -target /
|
||||
curl -O https://dl.google.com/go/go1.17.9.darwin-amd64.pkg && \
|
||||
sudo installer -pkg go1.17.9.darwin-amd64.pkg -target /
|
||||
- run:
|
||||
name: Install pkg-config
|
||||
command: HOMEBREW_NO_AUTO_UPDATE=1 brew install pkg-config
|
||||
@@ -363,7 +388,6 @@ jobs:
|
||||
- restore_cache:
|
||||
name: restore cargo cache
|
||||
key: v3-go-deps-{{ arch }}-{{ checksum "~/go/src/github.com/filecoin-project/lotus/go.sum" }}
|
||||
- install-deps
|
||||
- run:
|
||||
command: make build
|
||||
no_output_timeout: 30m
|
||||
@@ -483,9 +507,6 @@ jobs:
|
||||
executor:
|
||||
type: executor
|
||||
default: golang
|
||||
golangci-lint-version:
|
||||
type: string
|
||||
default: 1.27.0
|
||||
concurrency:
|
||||
type: string
|
||||
default: '2'
|
||||
@@ -504,13 +525,10 @@ jobs:
|
||||
- run:
|
||||
command: make deps
|
||||
no_output_timeout: 30m
|
||||
- go/install-golangci-lint:
|
||||
gobin: $HOME/.local/bin
|
||||
version: << parameters.golangci-lint-version >>
|
||||
- run:
|
||||
name: Lint
|
||||
command: |
|
||||
$HOME/.local/bin/golangci-lint run -v --timeout 2m \
|
||||
golangci-lint run -v --timeout 2m \
|
||||
--concurrency << parameters.concurrency >> << parameters.args >>
|
||||
lint-all:
|
||||
<<: *lint
|
||||
@@ -685,52 +703,15 @@ jobs:
|
||||
docker push $<<parameters.account-url>>/<<parameters.repo>>:${tag}
|
||||
done
|
||||
|
||||
publish-packer-mainnet:
|
||||
description: build and push AWS IAM and DigitalOcean droplet.
|
||||
executor:
|
||||
name: packer/default
|
||||
packer-version: 1.6.6
|
||||
steps:
|
||||
- checkout
|
||||
- attach_workspace:
|
||||
at: "."
|
||||
- packer/build:
|
||||
template: tools/packer/lotus.pkr.hcl
|
||||
args: "-var ci_workspace_bins=./linux -var lotus_network=mainnet -var git_tag=$CIRCLE_TAG"
|
||||
publish-packer-calibrationnet:
|
||||
description: build and push AWS IAM and DigitalOcean droplet.
|
||||
executor:
|
||||
name: packer/default
|
||||
packer-version: 1.6.6
|
||||
steps:
|
||||
- checkout
|
||||
- attach_workspace:
|
||||
at: "."
|
||||
- packer/build:
|
||||
template: tools/packer/lotus.pkr.hcl
|
||||
args: "-var ci_workspace_bins=./linux-calibrationnet -var lotus_network=calibrationnet -var git_tag=$CIRCLE_TAG"
|
||||
publish-packer-butterflynet:
|
||||
description: build and push AWS IAM and DigitalOcean droplet.
|
||||
executor:
|
||||
name: packer/default
|
||||
packer-version: 1.6.6
|
||||
steps:
|
||||
- checkout
|
||||
- attach_workspace:
|
||||
at: "."
|
||||
- packer/build:
|
||||
template: tools/packer/lotus.pkr.hcl
|
||||
args: "-var ci_workspace_bins=./linux-butterflynet -var lotus_network=butterflynet -var git_tag=$CIRCLE_TAG"
|
||||
publish-packer-snap:
|
||||
description: build packer image with snap. mainnet only.
|
||||
executor:
|
||||
name: packer/default
|
||||
packer-version: 1.6.6
|
||||
name: packer
|
||||
steps:
|
||||
- checkout
|
||||
- attach_workspace:
|
||||
at: "."
|
||||
- packer/build:
|
||||
- packer_build:
|
||||
template: tools/packer/lotus-snap.pkr.hcl
|
||||
publish-dockerhub:
|
||||
description: publish to dockerhub
|
||||
@@ -837,9 +818,6 @@ workflows:
|
||||
- build-lotus-soup
|
||||
- build-macos:
|
||||
filters:
|
||||
branches:
|
||||
ignore:
|
||||
- /.*/
|
||||
tags:
|
||||
only:
|
||||
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
|
||||
@@ -875,36 +853,6 @@ workflows:
|
||||
repo: lotus-test
|
||||
tag: '${CIRCLE_SHA1:0:8}'
|
||||
target: lotus-test
|
||||
- publish-packer-mainnet:
|
||||
requires:
|
||||
- build-all
|
||||
filters:
|
||||
branches:
|
||||
ignore:
|
||||
- /.*/
|
||||
tags:
|
||||
only:
|
||||
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
|
||||
- publish-packer-calibrationnet:
|
||||
requires:
|
||||
- build-ntwk-calibration
|
||||
filters:
|
||||
branches:
|
||||
ignore:
|
||||
- /.*/
|
||||
tags:
|
||||
only:
|
||||
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
|
||||
- publish-packer-butterflynet:
|
||||
requires:
|
||||
- build-ntwk-butterfly
|
||||
filters:
|
||||
branches:
|
||||
ignore:
|
||||
- /.*/
|
||||
tags:
|
||||
only:
|
||||
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
|
||||
- publish-snapcraft:
|
||||
name: publish-snapcraft-stable
|
||||
channel: stable
|
||||
|
||||
+5
-4
@@ -17,6 +17,7 @@ coverage:
|
||||
status:
|
||||
patch: off
|
||||
project:
|
||||
threshold: 1%
|
||||
tools-and-tests:
|
||||
target: auto
|
||||
threshold: 1%
|
||||
@@ -34,27 +35,27 @@ coverage:
|
||||
markets:
|
||||
target: auto
|
||||
threshold: 1%
|
||||
informational: false
|
||||
informational: true
|
||||
paths:
|
||||
- "markets"
|
||||
- "paychmgr"
|
||||
miner:
|
||||
target: auto
|
||||
threshold: 1.5%
|
||||
informational: false
|
||||
informational: true
|
||||
paths:
|
||||
- "miner"
|
||||
- "storage"
|
||||
chain:
|
||||
target: auto
|
||||
threshold: 1%
|
||||
informational: false
|
||||
informational: true
|
||||
paths:
|
||||
- "chain"
|
||||
node:
|
||||
target: auto
|
||||
threshold: 1%
|
||||
informational: false
|
||||
informational: true
|
||||
paths:
|
||||
- "node"
|
||||
- "blockstore"
|
||||
|
||||
@@ -37,7 +37,7 @@ jobs:
|
||||
|
||||
- uses: actions/setup-go@v1
|
||||
with:
|
||||
go-version: '1.16.4'
|
||||
go-version: '1.17.9'
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
|
||||
@@ -48,3 +48,6 @@ bin/ipget
|
||||
bin/tmp/*
|
||||
.idea
|
||||
scratchpad
|
||||
|
||||
build/builtin-actors/v*
|
||||
build/builtin-actors/*.car
|
||||
|
||||
+5
-2
@@ -25,7 +25,7 @@ skip-dirs:
|
||||
|
||||
issues:
|
||||
exclude:
|
||||
- "func name will be used as test\\.Test.* by other packages, and that stutters; consider calling this"
|
||||
- "by other packages, and that stutters; consider calling this"
|
||||
- "Potential file inclusion via variable"
|
||||
- "should have( a package)? comment"
|
||||
- "Error return value of `logging.SetLogLevel` is not checked"
|
||||
@@ -37,6 +37,9 @@ issues:
|
||||
- "string .* has .* occurrences, make it a constant"
|
||||
- "a blank import should be only in a main or test package, or have a comment justifying it"
|
||||
- "package comment should be of the form"
|
||||
- "Potential hardcoded credentials"
|
||||
- "Use of weak random number generator"
|
||||
- "xerrors.* is deprecated"
|
||||
|
||||
exclude-use-default: false
|
||||
exclude-rules:
|
||||
@@ -51,7 +54,7 @@ issues:
|
||||
- path: build/params_.*\.go
|
||||
linters:
|
||||
- golint
|
||||
|
||||
|
||||
- path: api/apistruct/struct.go
|
||||
linters:
|
||||
- golint
|
||||
|
||||
+456
@@ -1,5 +1,461 @@
|
||||
# Lotus changelog
|
||||
|
||||
# 1.16.0 / 2022-06-24
|
||||
|
||||
|
||||
This is a MANDATORY release of Lotus that introduces [Filecoin network v16,
|
||||
codenamed the Skyr upgrade](https://github.com/filecoin-project/community/discussions/74?sort=new#discussioncomment-2392151).
|
||||
|
||||
The network is scheduled to upgrade to nv16 at epoch 1960320, on July 6th at 2022-07-06T14: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, market and worker(s).
|
||||
|
||||
Your lotus node will switch from the Legacy VM (that depended on go-based specs-actors) to Filecoin Virtual Machine FVM (that uses Rust-based builtin-actors) atomically upon the upgrade.
|
||||
|
||||
The Skyr upgrade introduces the following FIPs, enhancements and bug fixes, delivered in [built-actors v8](https://github.com/filecoin-project/builtin-actors/releases/tag/v8.0.0) and [ref-fvm v1.0.0](https://github.com/filecoin-project/ref-fvm/releases/tag/fvm%40v1.0.0):,
|
||||
|
||||
- [FIP-0030](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0030.md)
|
||||
- [FIP-0031](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0031.md)
|
||||
- [FIP-0032](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0032.md))
|
||||
- [FIP-0027](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0027.md)
|
||||
- [Bug fix for the ProveReplicaUpdates method](https://github.com/filecoin-project/builtin-actors/pull/138)
|
||||
- [New proofs version for SnarkPack](https://github.com/filecoin-project/builtin-actors/pull/474/commits/3027c365f516e1cba6f156d4fb9dbd8c893d5b62)
|
||||
|
||||
|
||||
## 🆕 Things you may wanna know
|
||||
|
||||
### Actor Code CIDs
|
||||
|
||||
As stated in [FIP-0031](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0031.md)- [structure of the code cid](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0031.md#structure-of-code-cids), system actors' code CIDs will be real content-addressing
|
||||
|
||||
For lotus users, we are making the change minimal for you. This means the `CODE` output when you run `lotus state get-actor` will now be the actual CID that represents the executable code for the actor, followed by wrapped synthetic id like the ones you've got before, i.e `fil/8/system`.
|
||||
|
||||
Moreover, this also means that in the future, whenever the actor code changes, the CID changes accordingly, and a network upgrade is needed for the network participants to have consensus over what executable code we should use for each system actor.
|
||||
|
||||
### Built-in actor bundles
|
||||
|
||||
As the network introduces FVM, it's also switching from spec-actor (written in GoLang) to [built-in actor](https://github.com/filecoin-project/builtin-actors) (written in rust), in which the latter comes with[ importable bundles](https://github.com/filecoin-project/builtin-actors#importable-bundle). This means, like filecoin proof parameters, node operators now also need to fetch the actor bundles according to the network versions for the nodes to remain operational.
|
||||
|
||||
Bundles for all networks(mainnet, calibnet, and etc) are included in the lotus source tree (`build/actors/`) and embedded on build. Lotus verifies that the bundle CIDs are the right ones upon build & upgrade against the values in `build/builtin_actors_gen.go`, according to the network you are building. You may also check the bundle manifest CID matches the bundle gen-ed values by running `lotus state actor-cids --network-version 16`.
|
||||
|
||||
The manifest CID & full list of actor code CIDs for nv16 using v8.0.0 is:
|
||||
|
||||
```
|
||||
"_manifest": "bafy2bzacebogjbpiemi7npzxchgcjjki3tfxon4ims55obfyfleqntteljsea"
|
||||
"account": "bafk2bzacedudbf7fc5va57t3tmo63snmt3en4iaidv4vo3qlyacbxaa6hlx6y"
|
||||
"cron": "bafk2bzacecqb3eolfurehny6yp7tgmapib4ocazo5ilkopjce2c7wc2bcec62"
|
||||
"init": "bafk2bzaceaipvjhoxmtofsnv3aj6gj5ida4afdrxa4ewku2hfipdlxpaektlw"
|
||||
"multisig": "bafk2bzacebhldfjuy4o5v7amrhp5p2gzv2qo5275jut4adnbyp56fxkwy5fag"
|
||||
"paymentchannel": "bafk2bzacebalad3f72wyk7qyilvfjijcwubdspytnyzlrhvn73254gqis44rq"
|
||||
"reward": "bafk2bzacecwzzxlgjiavnc3545cqqil3cmq4hgpvfp2crguxy2pl5ybusfsbe"
|
||||
"storagemarket": "bafk2bzacediohrxkp2fbsl4yj4jlupjdkgsiwqb4zuezvinhdo2j5hrxco62q"
|
||||
"storageminer": "bafk2bzacecgnynvd3tene3bvqoknuspit56canij5bpra6wl4mrq2mxxwriyu"
|
||||
"storagepower": "bafk2bzacebjvqva6ppvysn5xpmiqcdfelwbbcxmghx5ww6hr37cgred6dyrpm"
|
||||
"system": "bafk2bzacedwq5uppsw7vp55zpj7jdieizirmldceehu6wvombw3ixq2tcq57w"
|
||||
"verifiedregistry": "bafk2bzaceb3zbkjz3auizmoln2unmxep7dyfcmsre64vnqfhdyh7rkqfoxlw4"
|
||||
```
|
||||
|
||||
All bundles are also available at https://github.com/filecoin-project/builtin-actors/releases, thus you can also manually download the bundles and place them in the right path.
|
||||
|
||||
Note: use customized bundle will risk you to lose sync with the network!
|
||||
|
||||
To get Code CIDs:
|
||||
- api:`StateActorCodeCIDs`
|
||||
- cli: `lotus state actor-cids`
|
||||
- cli: `lotus-shed cid inspect-bundle`
|
||||
|
||||
### Execution Trace
|
||||
|
||||
For developers that are dependent on lotus execution trace, you will need to enable `LOTUS_VM_ENABLE_TRACING` envvar to get the exact execution trace response as before. Without the envvar enabled, `Subcall` details, Duration` and `GasCharges` fields will be missing from the new FVM trace.
|
||||
|
||||
### Deal Proposal Migration
|
||||
|
||||
All deal proposals with non-utf8 string as the label in the metadata store will perform a light migration to new format as defined in [v1.1.1](https://github.com/filecoin-project/go-fil-markets/pull/721).
|
||||
|
||||
## Others
|
||||
- Resource manager is now only enabled by default on full daemon node. You can enable it manually for other nodes by setting env var `LOTUS_RCMGR` to `1`.
|
||||
- Fix: drand: calculation of round from Filecoin epochs ([filecoin-project/lotus#8606](https://github.com/filecoin-project/lotus/pull/8606))
|
||||
|
||||
## Dependency Update
|
||||
- chore: deps: update to go-libp2p v0.19.4 ([filecoin-project/lotus#8801](https://github.com/filecoin-project/lotus/pull/8801))
|
||||
- github.com/filecoin-project/go-fil-markets (v1.20.1 -> v1.20.1-v16-2):
|
||||
- github.com/filecoin-project/go-legs (v0.3.7 -> v0.3.10):
|
||||
- github.com/filecoin-project/go-state-types (v0.1.8 -> v0.1.10):
|
||||
- github.com/filecoin-project/specs-storage (v0.2.4 -> v0.4.1):
|
||||
|
||||
## Contributors
|
||||
|
||||
| Contributor | Commits | Lines ± | Files Changed |
|
||||
|-------------|---------|---------|---------------|
|
||||
| @geoff-vball | 37 | +10565/-8454 | 150 |
|
||||
| @arajasek | 33 | +7964/-6340 | 473 |
|
||||
| @arajasek | 37 | +6220/-6976 | 457 |
|
||||
| @vyzo | 135 | +7287/-5380 | 546 |
|
||||
| @ZenGround0 | 19 | +5958/-2920 | 226 |
|
||||
| @stebalien | 18 | +1566/-1101 | 116 |
|
||||
| Alex | 5 | +323/-2304 | 32 |
|
||||
| @zenground0 | 9 | +583/-358 | 56 |
|
||||
| @jennijuju | 5 | +853/-27 | 19 |
|
||||
| @jennijuju | 24 | +392/-201 | 60 |
|
||||
| Marco Munizaga | 3 | +236/-83 | 5 |
|
||||
| @raulk| 9 | +93/-15 | 15 |
|
||||
| @travisperson | 3 | +37/-37 | 12 |
|
||||
| @Kubuxu | 1 | +41/-5 | 1 |
|
||||
| @koalacxr | 1 | +29/-13 | 3 |
|
||||
| @gammazero | 2 | +18/-10 | 4 |
|
||||
| Peter Rabbitson | 1 | +5/-3 | 1 |
|
||||
| Steve Loeppky | 1 | +6/-0 | 1 |
|
||||
| @masih | 1 | +3/-3 | 2 |
|
||||
| @magik6k | 1 | +4/-0 | 1 |
|
||||
| @jennijuju | 1 | +2/-2 | 1 |
|
||||
| tian zhou | 1 | +1/-1 | 1 |
|
||||
|
||||
# 1.15.3 / 2022-05-31
|
||||
|
||||
This is an optional release of lotus that include new APIs, some improvements and bug fixes.
|
||||
|
||||
## New Features
|
||||
- feat: api: add StateGetNetworkParams api ([filecoin-project/lotus#8546](https://github.com/filecoin-project/lotus/pull/8546))
|
||||
- feat: api: Implement StateLookupRobustAddress ([filecoin-project/lotus#8486](https://github.com/filecoin-project/lotus/pull/8486))
|
||||
- sealing: DataCid on workers ([filecoin-project/lotus#8557](https://github.com/filecoin-project/lotus/pull/8557))
|
||||
- feat: FVM: Support exectraces ([filecoin-project/lotus#8514](https://github.com/filecoin-project/lotus/pull/8514))
|
||||
|
||||
## Improvements
|
||||
- ux: wallet: update delete usage ([filecoin-project/lotus#8442](https://github.com/filecoin-project/lotus/pull/8442))
|
||||
- chore: config: default-disable kvlog ([filecoin-project/lotus#8477](https://github.com/filecoin-project/lotus/pull/8477))
|
||||
- chore: cli: Alias cli commands for uniformity ([filecoin-project/lotus#8587](https://github.com/filecoin-project/lotus/pull/8587))
|
||||
|
||||
## Bug Fixes
|
||||
- fix: Make deal making logs much less noisy ([filecoin-project/lotus#8622](https://github.com/filecoin-project/lotus/pull/8622))
|
||||
- fix: mpool: avoid deadlock on unsubscribe ([filecoin-project/lotus#8635](https://github.com/filecoin-project/lotus/pull/8635))
|
||||
- fix: update StatApplied when fvm apply message ([filecoin-project/lotus#8545](https://github.com/filecoin-project/lotus/pull/8545))
|
||||
- fix: ci: build macos and linux assets on tagged releases ([filecoin-project/lotus#8597](https://github.com/filecoin-project/lotus/pull/8597))
|
||||
- fix: Clean up vanilla proof fetching errors for proper display ([filecoin-project/lotus#8564](https://github.com/filecoin-project/lotus/pull/8564))
|
||||
- fix: Make markets logger less noisy when doing retrievals ([filecoin-project/lotus#8604](https://github.com/filecoin-project/lotus/pull/8604))
|
||||
- fix: test: Fix flaky TestGatewayWalletMsig ([filecoin-project/lotus#8601](https://github.com/filecoin-project/lotus/pull/8601))
|
||||
- fix: lotus-wallet: correct network in version ([filecoin-project/lotus#8563](https://github.com/filecoin-project/lotus/pull/8563))
|
||||
- fix: worker: Download proofs if PRU2 is enabled ([filecoin-project/lotus#8555](https://github.com/filecoin-project/lotus/pull/8555))
|
||||
- fix: ux: update `lotus-wallet run` description ([filecoin-project/lotus#8528](https://github.com/filecoin-project/lotus/pull/8528))
|
||||
- fix: market: Infer index provider topic from network name by default ([filecoin-project/lotus#8526](https://github.com/filecoin-project/lotus/pull/8526))
|
||||
- fix: storiface: Make FSOverhead numbers more accurate ([filecoin-project/lotus#8481](https://github.com/filecoin-project/lotus/pull/8481))
|
||||
- fix: node: fix comment for IndexProvider ([filecoin-project/lotus#8480](https://github.com/filecoin-project/lotus/pull/8480))
|
||||
- fix: sealing: fail to add expired precommits to a batch ([filecoin-project/lotus#8479](https://github.com/filecoin-project/lotus/pull/8479))
|
||||
- fix:sealing:check index out of bounds against correct param length not return length ([filecoin-project/lotus#8475](https://github.com/filecoin-project/lotus/pull/8475))
|
||||
- fix: sealing: Finalize snap sectors before submitting proofs ([filecoin-project/lotus#8582](https://github.com/filecoin-project/lotus/pull/8582))
|
||||
- chore: fix lint issue ([filecoin-project/lotus#8531](https://github.com/filecoin-project/lotus/pull/8531))
|
||||
- feat: vm: add actor error backtraces to FVM ([filecoin-project/lotus#8524](https://github.com/filecoin-project/lotus/pull/8524))
|
||||
|
||||
## Dependency Updates
|
||||
- github.com/filecoin-project/specs-storage (v0.2.2 -> v0.2.3-0.20220426183226-1a0a63c5990f):
|
||||
- deps: update go-libp2p@v0.19 ([filecoin-project/lotus#8511](https://github.com/filecoin-project/lotus/pull/8511))
|
||||
- chore: deps: Use tagged version of specs-storage #8764
|
||||
|
||||
## Others
|
||||
- chore: merge releases back into master ([filecoin-project/lotus#8638](https://github.com/filecoin-project/lotus/pull/8638))
|
||||
- chore:ci:make codecov quiet ([filecoin-project/lotus#8600](https://github.com/filecoin-project/lotus/pull/8600))
|
||||
- chore: version: bump the version to v1.15.3-dev ([filecoin-project/lotus#8473](https://github.com/filecoin-project/lotus/pull/8473))
|
||||
- chore: .gitignore: ignore built in actor bundles ([filecoin-project/lotus#8590](https://github.com/filecoin-project/lotus/pull/8590))
|
||||
- ci: deps: macos build deps ([filecoin-project/lotus#8581](https://github.com/filecoin-project/lotus/pull/8581))
|
||||
- chore:chore:chore remove the wrong TODO ([filecoin-project/lotus#8586](https://github.com/filecoin-project/lotus/pull/8586))
|
||||
- add 1475 bootstrapper ([filecoin-project/lotus#8495](https://github.com/filecoin-project/lotus/pull/8495))
|
||||
- Bump version for xtools ([filecoin-project/lotus#8494](https://github.com/filecoin-project/lotus/pull/8494))
|
||||
- chore: bundle: remove wrongly committed bundle cars #8763
|
||||
## Contributors
|
||||
|
||||
| Contributor | Commits | Lines ± | Files Changed |
|
||||
|-------------|---------|---------|---------------|
|
||||
| @stebalien | 4 | +607/-95 | 19 |
|
||||
| @magik6k | 9 | +550/-37 | 43 |
|
||||
| @geoff-vball | 5 | +279/-219 | 27 |
|
||||
| @simlecode | 1 | +306/-39 | 20 |
|
||||
| @arajasek | 1 | +256/-34 | 10 |
|
||||
| @zenground0 | 11 | +214/-66 | 31 |
|
||||
| @arajasek | 2 | +149/-99 | 8 |
|
||||
| @vyzo | 3 | +125/-81 | 4 |
|
||||
| @Masih| 1 | +134/-15 | 7 |
|
||||
| @travisperson | 3 | +24/-32 | 6 |
|
||||
| @Rjan | 6 | +16/-16 | 9 |
|
||||
| @jennijuju | 3 | +9/-8 | 15 |
|
||||
| Rob Quist | 3 | +12/-4 | 3 |
|
||||
| @Icarus9913 | 1 | +3/-3 | 3 |
|
||||
| @swift-mx | 1 | +3/-0 | 1 |
|
||||
| @Phi-rjan | 1 | +1/-1 | 1 |
|
||||
| @lifei | 1 | +1/-0 | 1 |
|
||||
|
||||
|
||||
# 1.15.2 / 2022-05-06
|
||||
|
||||
This is a highly recommended feature lotus release v1.15.2. This feature release introduces many new features and for SPs, including PoSt workers, sealing scheduler, snap deal queue and so on.
|
||||
|
||||
Note: You need to be using go v1.17.9&up from this release onwards.
|
||||
|
||||
## Highlights
|
||||
### ❣️❣️❣️ PoSt Workers ❣️❣️❣️
|
||||
‼️️Attention - the long-awaited yet highly requested PoSt workers, they are here! And they come in as a combo: you may setup PoSt workers for both winningPoSt or/and windowPoSt worker. You can also setup any number of PoSt workers as long as you have the hardware resources!
|
||||
For more details and learn how to set it up, see the docs [here](https://lotus.filecoin.io/storage-providers/seal-workers/post-workers/). You can also find early result of the PoSt workers performance by the community [here](https://github.com/filecoin-project/lotus/discussions/8375).
|
||||
- feat: PoSt workers ([filecoin-project/lotus#7971](https://github.com/filecoin-project/lotus/pull/7971))
|
||||
- feat: storage: Parallel proving checks ([filecoin-project/lotus#8391](https://github.com/filecoin-project/lotus/pull/8391))
|
||||
- adjust `ParallelCheckLimit` according to your resource setup to get pre-post checkers run faster!
|
||||
|
||||
In addition, we also added some handy toolings:
|
||||
- feat: miner: API/CLI to compute window-post ([filecoin-project/lotus#8389](https://github.com/filecoin-project/lotus/pull/8389))
|
||||
- run `lotus-miner proving compute window-post` to manually trigger a full windowPoSt computation for a specific deadline for full sanity checks.
|
||||
- feat: miner cli: Separate proving workers command ([filecoin-project/lotus#8379](https://github.com/filecoin-project/lotus/pull/8379))
|
||||
- run `lotus-miner proving workers` to list all the PoSt workers that's attached
|
||||
- feat: miner cli: proving check --faulty, faults in storage list sectors ([filecoin-project/lotus#8349](https://github.com/filecoin-project/lotus/pull/8349))
|
||||
- run `lotus-miner proving check --faulty` to identify the sectors that might be bad.
|
||||
|
||||
### 🔥🔥🔥 Sealing Scheduler Enhancement 🔥🔥🔥
|
||||
|
||||
Have you ever got a couple workers but only a few of them are super packed, while the rest are idling waiting for jobs? Now the task can be distributed more evenly with:
|
||||
- feat: sched: Improve worker assigning logic ([filecoin-project/lotus#8447](https://github.com/filecoin-project/lotus/pull/8447))
|
||||
|
||||
### 🌟🌟🌟 Snap Deal Enhancements 🌟🌟🌟
|
||||
|
||||
The Filecoin Network introduced Snap Deal with the network v15 OhSnap upgrade, and lotus shipped v1.14.0 with basic snappy support for SP to use this feature. Since then, we have received good ux feedbacks and bug reports from the community, and we are introducing a couple enhancement for SPs to better leverage this feature.
|
||||
|
||||
- feat: sealing: Sector upgrade queue ([filecoin-project/lotus#8330](https://github.com/filecoin-project/lotus/pull/8330))
|
||||
- Snap up CCs to be ready for deals automatically, learn more [here](https://lotus.filecoin.io/storage-providers/operate/snap-deals/#snap-deal-queue)
|
||||
- feat: sealing: More SnapDeals config knobs ([filecoin-project/lotus#8343](https://github.com/filecoin-project/lotus/pull/8343))
|
||||
- SPs can now set `PreferNewSectorsForDeals` and `MaxUpgradingSectors` to better manage their sealing/dealing pipeline.
|
||||
- feat: config: Move MakeNewSectorForDeals config into the Sealing sectoin ([filecoin-project/lotus#8378](https://github.com/filecoin-project/lotus/pull/8378))
|
||||
- fix: sealing: Release unsealed sector files after snapdeals abort ([filecoin-project/lotus#8438](https://github.com/filecoin-project/lotus/pull/8438))
|
||||
- fix: sealing: always do cooldown in handleSubmitReplicaUpdateFailed ([filecoin-project/lotus#8353](https://github.com/filecoin-project/lotus/pull/8353))
|
||||
- fix: storagefsm: Fix error loop on bad event ([filecoin-project/lotus#8338](https://github.com/filecoin-project/lotus/pull/8338))
|
||||
- fix: sealing: Remove sector copies from workers after snapdeals ([filecoin-project/lotus#8329](https://github.com/filecoin-project/lotus/pull/8329))
|
||||
|
||||
## New Features
|
||||
- enable rcmgr by default ([filecoin-project/lotus#8470](https://github.com/filecoin-project/lotus/pull/8470))
|
||||
- feat: cli: lotus client list-asks --protocols ([filecoin-project/lotus#8464](https://github.com/filecoin-project/lotus/pull/8464))
|
||||
- feat: shed: Multi-file vlog2car ([filecoin-project/lotus#8426](https://github.com/filecoin-project/lotus/pull/8426))
|
||||
- feat: worker: check fd limit on startup ([filecoin-project/lotus#8390](https://github.com/filecoin-project/lotus/pull/8390))
|
||||
- feat: lotus-shed: add command to compute state over a range of tipsets. ([filecoin-project/lotus#8371](https://github.com/filecoin-project/lotus/pull/8371))
|
||||
- feat: cli/net: implement 'net ping' command ([filecoin-project/lotus#8357](https://github.com/filecoin-project/lotus/pull/8357))
|
||||
- feat: stmgr: call: use a buffered concurrent-access blockstore ([filecoin-project/lotus#8358](https://github.com/filecoin-project/lotus/pull/8358))
|
||||
- feat: infra/ci: add `lotus-test` image as CI build step ([filecoin-project/lotus#7956](https://github.com/filecoin-project/lotus/pull/7956))
|
||||
- feat: multisig: lotus-sheed miner-multisig change-worker command. ([filecoin-project/lotus#8281](https://github.com/filecoin-project/lotus/pull/8281))
|
||||
- feat: Add additional test annotations (#8272) ([filecoin-project/lotus#8272](https://github.com/filecoin-project/lotus/pull/8272))
|
||||
|
||||
## Improvements
|
||||
- Revert appimage removal ([filecoin-project/lotus#8439](https://github.com/filecoin-project/lotus/pull/8439))
|
||||
- sealing: Don't panic in ReleaseUnsealed with no ranges ([filecoin-project/lotus#8461](https://github.com/filecoin-project/lotus/pull/8461))
|
||||
- testkit: give up on waiting for the RPC server to shutdown after 1s ([filecoin-project/lotus#8450](https://github.com/filecoin-project/lotus/pull/8450))
|
||||
- chore: events: implement event observer deregister method ([filecoin-project/lotus#8441](https://github.com/filecoin-project/lotus/pull/8441))
|
||||
- Thread safe piecereader ([filecoin-project/lotus#8397](https://github.com/filecoin-project/lotus/pull/8397))
|
||||
- VM: Refactor pricelist to be based on network versions ([filecoin-project/lotus#8369](https://github.com/filecoin-project/lotus/pull/8369))
|
||||
- --max-piece-size in set-ask is no longer required ([filecoin-project/lotus#8361](https://github.com/filecoin-project/lotus/pull/8361))
|
||||
- refactor: convert RepoType from int to interface ([filecoin-project/lotus#8086](https://github.com/filecoin-project/lotus/pull/8086))
|
||||
- Shed: fix error message ([filecoin-project/lotus#8340](https://github.com/filecoin-project/lotus/pull/8340))
|
||||
|
||||
## Bug Fixes
|
||||
- fix: FVM: add finality check for consensus faults ([filecoin-project/lotus#8452](https://github.com/filecoin-project/lotus/pull/8452))
|
||||
- fix: market: Reuse the market `PubSub` in index provider ([filecoin-project/lotus#8443](https://github.com/filecoin-project/lotus/pull/8443))
|
||||
- fix: market: set all index provider options based on lotus config ([filecoin-project/lotus#8444](https://github.com/filecoin-project/lotus/pull/8444))
|
||||
- release worker tracker lock when call cb func ([filecoin-project/lotus#8206](https://github.com/filecoin-project/lotus/pull/8206))
|
||||
- fix: node: Fix market node startup ([filecoin-project/lotus#8425](https://github.com/filecoin-project/lotus/pull/8425))
|
||||
- fix: sealing: Fix PR1 worker selection ([filecoin-project/lotus#8420](https://github.com/filecoin-project/lotus/pull/8420))
|
||||
- fix: go: make Go 1.18 builds work ([filecoin-project/lotus#8410](https://github.com/filecoin-project/lotus/pull/8410))
|
||||
- fix: sealing: Added error checking ([filecoin-project/lotus#8404](https://github.com/filecoin-project/lotus/pull/8404))
|
||||
- fix: ux: Change Propose-worker msg ([filecoin-project/lotus#8384](https://github.com/filecoin-project/lotus/pull/8384))
|
||||
- fix: miner: dead loop on removing sector ([filecoin-project/lotus#8386](https://github.com/filecoin-project/lotus/pull/8386))
|
||||
- fix: worker: Fix default value handling ([filecoin-project/lotus#8380](https://github.com/filecoin-project/lotus/pull/8380))
|
||||
- Revert "Update params for interopnet for fvm" ([filecoin-project/lotus#8374](https://github.com/filecoin-project/lotus/pull/8374))
|
||||
- fix: cli: Reset miner/ask lists in interactive deal 'miner' step (#8155) ([filecoin-project/lotus#8155](https://github.com/filecoin-project/lotus/pull/8155))
|
||||
- fix:snapup: Rename error message ([filecoin-project/lotus#8370](https://github.com/filecoin-project/lotus/pull/8370))
|
||||
- fix: multisig: Print "waiting for confirmation.." ([filecoin-project/lotus#8368](https://github.com/filecoin-project/lotus/pull/8368))
|
||||
- fix: lotus-wallet: pass correct repo type to repo.Init ([filecoin-project/lotus#8356](https://github.com/filecoin-project/lotus/pull/8356))
|
||||
- fix: avoid racy memstores when estimating gas ([filecoin-project/lotus#8351](https://github.com/filecoin-project/lotus/pull/8351))
|
||||
- fix: itests: Don't hang on exit in MineBlocksMustPost ([filecoin-project/lotus#8345](https://github.com/filecoin-project/lotus/pull/8345))
|
||||
- fix: miner cli: Estimate deal weight in sector list when upgrading ([filecoin-project/lotus#8336](https://github.com/filecoin-project/lotus/pull/8336))
|
||||
- fix: sealing: FinalizeSector doesn't need sealed replica access ([filecoin-project/lotus#8337](https://github.com/filecoin-project/lotus/pull/8337))
|
||||
- fix: cli: add ArgsUsage field to clientGetDealCmd ([filecoin-project/lotus#8241](https://github.com/filecoin-project/lotus/pull/8241))
|
||||
- fix: market: Infer index provider topic from network name by default #8533
|
||||
- fix: deps: Update to FFI with logger bump #8588
|
||||
- fix: sealing: Finalize snap sectors before submitting proofs #8588
|
||||
|
||||
## Dependency Updates
|
||||
- deps: update go-libp2p@v0.19 #8533
|
||||
- deps: ffi: update ffi that includes the log fix #8577
|
||||
- deps: ffi: pull ffi that includes the latest fvm ([filecoin-project/lotus#8424](https://github.com/filecoin-project/lotus/pull/8424))
|
||||
- Update to go-log 2.5.1 ([filecoin-project/lotus#8422](https://github.com/filecoin-project/lotus/pull/8422))
|
||||
- chore(deps): update go-data-transfer with fixes (master edition) ([filecoin-project/lotus#8411](https://github.com/filecoin-project/lotus/pull/8411))
|
||||
- deps: update ffi with actor v7.1.0 and fvm that uses the bundle that includes the new manifest ([filecoin-project/lotus#8402](https://github.com/filecoin-project/lotus/pull/8402))
|
||||
- Update to specs-storage v0.2.2 ([filecoin-project/lotus#8400](https://github.com/filecoin-project/lotus/pull/8400))
|
||||
- chore: ffi: the latest fvm release ([filecoin-project/lotus#8381](https://github.com/filecoin-project/lotus/pull/8381))
|
||||
- Update params for interopnet for fvm ([filecoin-project/lotus#8119](https://github.com/filecoin-project/lotus/pull/8119))
|
||||
- github.com/filecoin-project/specs-storage (v0.2.0 -> v0.2.2):
|
||||
- ci: deps: macos build deps #8588
|
||||
|
||||
## Others
|
||||
- chore: merge releases back to master ([filecoin-project/lotus#8468](https://github.com/filecoin-project/lotus/pull/8468))
|
||||
- Packer publish copy orb ([filecoin-project/lotus#8413](https://github.com/filecoin-project/lotus/pull/8413))
|
||||
- chore: Remove temp gomock reflect file ([filecoin-project/lotus#8372](https://github.com/filecoin-project/lotus/pull/8372))
|
||||
- chore: FVM: log when fvm is used ([filecoin-project/lotus#8363](https://github.com/filecoin-project/lotus/pull/8363))
|
||||
- lib: extract unixfs filestore into lib ([filecoin-project/lotus#8354](https://github.com/filecoin-project/lotus/pull/8354))
|
||||
- test: use `T.TempDir` to create temporary test directory ([filecoin-project/lotus#8295](https://github.com/filecoin-project/lotus/pull/8295))
|
||||
- Update Dockerfile.lotus
|
||||
- chore:sealing:remove endpoint from cli ([filecoin-project/lotus#8215](https://github.com/filecoin-project/lotus/pull/8215))
|
||||
- chore: build: bump the master version to v1.15.2-dev ([filecoin-project/lotus#8322](https://github.com/filecoin-project/lotus/pull/8322))
|
||||
- chore: fix lint issue #8533
|
||||
|
||||
## Contributors
|
||||
|
||||
| Contributor | Commits | Lines ± | Files Changed |
|
||||
|-------------|---------|---------|---------------|
|
||||
| @magik6k | 95 | +5147/-2922 | 401 |
|
||||
| @mz-sirius | 3 | +1789/-546 | 48 |
|
||||
| @nonsense | 11 | +777/-567 | 121 |
|
||||
| @arajasek | 11 | +336/-231 | 28 |
|
||||
| Darko Brdareski | 1 | +463/-13 | 95 |
|
||||
| @coryschwartz | 11 | +147/-217 | 13 |
|
||||
| spark8899 | 2 | +300/-0 | 2 |
|
||||
| @zenground0 | 2 | +6/-193 | 7 |
|
||||
| Eng Zer Jun | 1 | +31/-158 | 11 |
|
||||
| Kevin Li | 2 | +174/-0 | 14 |
|
||||
| @arajasek | 5 | +85/-86 | 18 |
|
||||
| @jennijuju | 1 | +0/-119 | 3 |
|
||||
| @jennijuju | 1 | +0/-98 | 6 |
|
||||
| @raulk | 1 | +60/-1 | 1 |
|
||||
| @frrist | 1 | +56/-0 | 2 |
|
||||
| @vyzo | 3 | +18/-16 | 5 |
|
||||
| @Masih | 3 | +29/-4 | 3 |
|
||||
| @jennijuju | 4 | +18/-11 | 11 |
|
||||
| @hannahhoward | 1 | +13/-10 | 2 |
|
||||
| @dirkmc | 1 | +21/-1 | 1 |
|
||||
| koalacxr | 1 | +10/-11 | 4 |
|
||||
| Aarsh Shah | 1 | +19/-1 | 1 |
|
||||
| @Rjan | 6 | +10/-8 | 7 |
|
||||
| @zl | 1 | +7/-1 | 1 |
|
||||
| KAYUII | 1 | +3/-2 | 1 |
|
||||
| @simlecode | 1 | +4/-0 | 1 |
|
||||
| @dirkmc | 1 | +1/-3 | 1 |
|
||||
| Jerry | 1 | +3/-0 | 1 |
|
||||
| @steblian | 1 | +1/-1 | 1 |
|
||||
| Geoff Stuart | 1 | +1/-0 | 1 |
|
||||
| Florian Ruen | 1 | +0/-1 | 1 |
|
||||
|
||||
# 1.15.1 / 2022-04-07
|
||||
|
||||
This is a *HIGHLY recommended* feature release v1.15.1, especially for node operators and storage providers who want to be a part of the content addressing network of Filecoin and IPFS.
|
||||
This feature release introduces Index Provider, GraphSync v2, and many other latest functionalities, improvements and bug fixes. More importantly, node operator can now enable the FVM(experimental) to sync mainnet!!
|
||||
|
||||
## Highlights
|
||||
|
||||
### 🔥🔥🔥 FVM (Experimental) 🔥🔥🔥
|
||||
- feat: fvm: FVM integration ([filecoin-project/lotus#8332](https://github.com/filecoin-project/lotus/pull/8332))
|
||||
The lotus team is excited to announce the launch of experimental non-programmable FVM on mainnet. By enabling `"LOTUS_USE_FVM_EXPERIMENTAL=1` envvar, the lotus daemon will be running the [WASM-compiled built-in actors](https://github.com/filecoin-project/builtin-actors) that is compatible with the existing chain(Network v15 OhSnap). If you are trying it out and having any questions or feedbacks, please leave a comment [here](https://github.com/filecoin-project/lotus/discussions/8334)!
|
||||
- chore: FVM: log when fvm is used([filecoin-project/lotus#8363](https://github.com/filecoin-project/lotus/pull/8363))
|
||||
- chore: ffi: the latest fvm release([filecoin-project/lotus#8382](https://github.com/filecoin-project/lotus/pull/8382))
|
||||
|
||||
### 🌟🌟🌟 Index Provider (Production Ready!) 🌟🌟🌟
|
||||
- feat: markets: Integrate index ingest protocol and retrieve by any CID ([filecoin-project/lotus#7313](https://github.com/filecoin-project/lotus/pull/7313))
|
||||
|
||||
More and more useful data is being stored on Filecoin via deals made by clients to Storage Providers. The goal is that this content is discoverable when people need them. To achieve that goal, one of the projects [the Bedrock team](https://www.notion.so/pl-strflt/Bedrock-2e956d5d8143432080a1d84435ccf0ff) is working on is building an Indexer Ecosystem, a project that's focus on content addressing on Filecoin, then potentially have interoperability with IPFS in the future and eventually serve the retrieval market. The Indexer Ecosystem high level architecture overview diagram can be found [here](https://github.com/filecoin-project/storetheindex/blob/main/doc/indexer_ecosys.png) and a detailed write up about can be found [here](https://www.notion.so/pl-strflt/Introducing-Indexer-to-SP-90bf296794174a8281c121d4ce6747a0).
|
||||
|
||||
That being said, with this release, lotus Storage Providers can easily become an Index Provider and serve the Indexer Content Addressing System. Index Providers generate advertisements from the deals made by a storage provider and announces the data to the indexer nodes for further processing:
|
||||
- To learn more about *what is an Index Provider and how to be an Index Provider*, read it [here](https://lotus.filecoin.io/storage-providers/operate/index-provider/) in lotus docuementation.
|
||||
- An [one-off migration](https://lotus.filecoin.io/storage-providers/operate/index-provider/#first-time-migration) is needed in order for a Storage Provider to become an Index Provider and announce the proper formatted index. It's *highly recommended* for all Index Provider to do a [force bulk initialization](https://lotus.filecoin.io/storage-providers/configure/dagstore/#forcing-bulk-initialization) to enable index announcement on all existing deals.
|
||||
- Note that the Initialization places IO workload on your storage system. SP should set a proper `concurrency` based on your hardware or can stop/start initialization at their wish/convenience as proving deadlines approach and elapse, to avoid IOPS starvation or competition with window PoSt.
|
||||
- After the first one-time migration, being an Index Provider barely puts any extra usage on SP's market system.
|
||||
- You can find the testing result by SPX fellows [here](https://github.com/filecoin-project/lotus/discussions/8087).
|
||||
|
||||
We recommend all Storage Providers that are serving deals in the Filecoin network to become a Index Provider, make the data you are storing discoverable for the retrieval market and retrieval clients!
|
||||
- If you have any questions about becoming an index provider, or the indexer system in general, leave a comment [here](https://github.com/filecoin-project/lotus/discussions/8341).
|
||||
- Follow the indexer project at https://github.com/filecoin-project/go-indexer-core.
|
||||
- If you have any feature request or bug reports of running an index provider, create an issue in https://github.com/filecoin-project/index-provider.
|
||||
- You may also join the #storetheindex channel in the Filecoin Slack to engage with the team & the community!
|
||||
|
||||
### ❗️❗️❗️ Dag Migration For New CAR index format in DagStore ❗️❗️❗️
|
||||
The index provider leverages the latest CARv2 indexing format `MultihashIndexSorted`, which stores the multihash code as well as the digest of all CIDs in a CAR file. Thus, all Storage Providers SHOULD perform an one-off DAG mirgation to regenerate DagStore CARv2 indices. You have to do it to become an index provider, failing to do so may also impact your future deal making.
|
||||
Follow the instruction [here](https://lotus.filecoin.io/storage-providers/operate/index-provider/) to perform the migration.
|
||||
|
||||
## New Features
|
||||
- feat: sealing: Sector upgrade queue ([filecoin-project/lotus#8333](https://github.com/filecoin-project/lotus/pull/8333))
|
||||
- see more details in docs: [here](https://lotus.filecoin.io/storage-providers/operate/snap-deals/#snap-deal-queue)
|
||||
- feat: market utils: Support unixfsnode in TraverseDag ([filecoin-project/lotus#8168](https://github.com/filecoin-project/lotus/pull/8168))
|
||||
- feat: config: enable indexer providing by default ([filecoin-project/lotus#8314](https://github.com/filecoin-project/lotus/pull/8314))
|
||||
- feat: api: Make ClientCalcCommP multithreaded ([filecoin-project/lotus#8276](https://github.com/filecoin-project/lotus/pull/8276))
|
||||
- feat: config: Persistent subsystem log level config ([filecoin-project/lotus#8283](https://github.com/filecoin-project/lotus/pull/8283))
|
||||
- feat: shed: blockstore/vlog to car export cmds ([filecoin-project/lotus#8265](https://github.com/filecoin-project/lotus/pull/8265))
|
||||
- feat: shed: ItestD ([filecoin-project/lotus#8290](https://github.com/filecoin-project/lotus/pull/8290))
|
||||
- feat: Make add piece idempotent ([filecoin-project/lotus#8160](https://github.com/filecoin-project/lotus/pull/8160))
|
||||
- feat: paychmgr: Support paych funding (a.k.a. fast paid retrieval) ([filecoin-project/lotus#7883](https://github.com/filecoin-project/lotus/pull/7883))
|
||||
- feat: ci: packer snap ([filecoin-project/lotus#7819](https://github.com/filecoin-project/lotus/pull/7819))
|
||||
- feat: #6147: Include worker name in sealing errors ([filecoin-project/lotus#7844](https://github.com/filecoin-project/lotus/pull/7844))
|
||||
- Feat: cli: Remove verified data cap ([filecoin-project/lotus#8175](https://github.com/filecoin-project/lotus/pull/8175))
|
||||
- feat: gateway: add MsigGetVestingSchedule to gateway api ([filecoin-project/lotus#8104](https://github.com/filecoin-project/lotus/pull/8104))
|
||||
- feat: itests: add itests ensemble mocknet getter ([filecoin-project/lotus#8157](https://github.com/filecoin-project/lotus/pull/8157))
|
||||
- feat: lotus-miner sectors list --initial-pledge ([filecoin-project/lotus#8098](https://github.com/filecoin-project/lotus/pull/8098))
|
||||
- Resource Manager Metrics ([filecoin-project/lotus#8089](https://github.com/filecoin-project/lotus/pull/8089))
|
||||
- feat: cli: set current network version from params ([filecoin-project/lotus#8111](https://github.com/filecoin-project/lotus/pull/8111))
|
||||
- feat: Snapdeals support in `storage find` CLI ([filecoin-project/lotus#8130](https://github.com/filecoin-project/lotus/pull/8130))
|
||||
|
||||
## Improvements
|
||||
- improve resource manager integration ([filecoin-project/lotus#8318](https://github.com/filecoin-project/lotus/pull/8318))
|
||||
- add check manual-stateless-deal with interactive deal making ([filecoin-project/lotus#7560](https://github.com/filecoin-project/lotus/pull/7560))
|
||||
- test: cli: adding wallet tests ([filecoin-project/lotus#8079](https://github.com/filecoin-project/lotus/pull/8079))
|
||||
- test: chain: unit tests for the syncer & sync manager ([filecoin-project/lotus#8072](https://github.com/filecoin-project/lotus/pull/8072))
|
||||
- test: cli: unit tests for sync related commands ([filecoin-project/lotus#8080](https://github.com/filecoin-project/lotus/pull/8080))
|
||||
- misc: wallet: wallet tests with annotations for system test matrix ([filecoin-project/lotus#7928](https://github.com/filecoin-project/lotus/pull/7928))
|
||||
- test: Cli: add mempool tests ([filecoin-project/lotus#8162](https://github.com/filecoin-project/lotus/pull/8162))
|
||||
- add a state-tree diff command to lotus shed ([filecoin-project/lotus#8081](https://github.com/filecoin-project/lotus/pull/8081))
|
||||
- test: mempool: Add unit and integration tests ([filecoin-project/lotus#8017](https://github.com/filecoin-project/lotus/pull/8017))
|
||||
- splistore cold object reification redux ([filecoin-project/lotus#8029](https://github.com/filecoin-project/lotus/pull/8029))
|
||||
- test: cli: chain category unit tests ([filecoin-project/lotus#8048](https://github.com/filecoin-project/lotus/pull/8048))
|
||||
- feat: config: Move MakeNewSectorForDeals config into the Sealing section([filecoin-project/lotus#8382](https://github.com/filecoin-project/lotus/pull/8382))
|
||||
|
||||
## Bug Fixes
|
||||
- fix: FVM: add finality check for consensus faults #8452
|
||||
- fix: market: Reuse the market PubSub in index provider #8451
|
||||
- fix: market: set all index provider options based on lotus config #8444
|
||||
- fix: sealing: Fix PR1 worker selection (#8421)
|
||||
- fix: miner: dead loop on removing sector (#8421)
|
||||
- fix: sealing: Remove sector copies from workers after snapdeals ([filecoin-project/lotus#8331](https://github.com/filecoin-project/lotus/pull/8331))
|
||||
- fix: storagefsm: Fix error loop on bad event ([filecoin-project/lotus#8339](https://github.com/filecoin-project/lotus/pull/8339))
|
||||
- fix: sealing: FinalizeSector doesn't need sealed replica access ([filecoin-project/lotus#8339](https://github.com/filecoin-project/lotus/pull/8339))
|
||||
- fix: sealing: always do cooldown in handleSubmitReplicaUpdateFailed ([filecoin-project/lotus#8353](https://github.com/filecoin-project/lotus/pull/8353))
|
||||
- fix: storage cli: Output primary sector status correctly ([filecoin-project/lotus#8320](https://github.com/filecoin-project/lotus/pull/8320))
|
||||
- fix: sealing fsm: Handle inputLk correctly ([filecoin-project/lotus#8291](https://github.com/filecoin-project/lotus/pull/8291))
|
||||
- fix: piece provider: Don't log CIDs as binary ([filecoin-project/lotus#8287](https://github.com/filecoin-project/lotus/pull/8287))
|
||||
- fix:sealing:Log instead of error normal shutdown of state machine ([filecoin-project/lotus#8232](https://github.com/filecoin-project/lotus/pull/8232))
|
||||
- fix:sealing:Handle finalize replica update failures in fsm ([filecoin-project/lotus#8229](https://github.com/filecoin-project/lotus/pull/8229))
|
||||
- ci: appimage: re-install appimage CI ([filecoin-project/lotus#7943](https://github.com/filecoin-project/lotus/pull/7943))
|
||||
- fix: sealing: PRU insufficient collateral ([filecoin-project/lotus#8219](https://github.com/filecoin-project/lotus/pull/8219))
|
||||
- fix: shed: diff command ([filecoin-project/lotus#8202](https://github.com/filecoin-project/lotus/pull/8202))
|
||||
- Make `--lite` option visible in the lotus daemon help text ([filecoin-project/lotus#8207](https://github.com/filecoin-project/lotus/pull/8207))
|
||||
- fix:sealing:Less verbose sector manager logging ([filecoin-project/lotus#8213](https://github.com/filecoin-project/lotus/pull/8213))
|
||||
- avoid panic ([filecoin-project/lotus#8205](https://github.com/filecoin-project/lotus/pull/8205))
|
||||
- A package is vulnerable to Exposure of Sensitive Information ([filecoin-project/lotus#8204](https://github.com/filecoin-project/lotus/pull/8204))
|
||||
- fix: sealing: add flag usage ([filecoin-project/lotus#8190](https://github.com/filecoin-project/lotus/pull/8190))
|
||||
- Fix the epoch used for gas in the message pool & validation ([filecoin-project/lotus#8163](https://github.com/filecoin-project/lotus/pull/8163))
|
||||
- fix:sealing:really-do-it flag for abort upgrade ([filecoin-project/lotus#8181](https://github.com/filecoin-project/lotus/pull/8181))
|
||||
- fix:proving:post check sector handles snap deals replica faults ([filecoin-project/lotus#8177](https://github.com/filecoin-project/lotus/pull/8177))
|
||||
- fix: client: calculate commps for pieces bigger than 32GB ([filecoin-project/lotus#8179](https://github.com/filecoin-project/lotus/pull/8179))
|
||||
- fix:cli:Continue instead of return error if no valid value is filled ([filecoin-project/lotus#8131](https://github.com/filecoin-project/lotus/pull/8131))
|
||||
- fix: limit reification sizes ([filecoin-project/lotus#8149](https://github.com/filecoin-project/lotus/pull/8149))
|
||||
- fix: state: Allow lotus-miner info to complete without admin permission ([filecoin-project/lotus#8057](https://github.com/filecoin-project/lotus/pull/8057))
|
||||
- fix:paychan:deflake integration test ([filecoin-project/lotus#8088](https://github.com/filecoin-project/lotus/pull/8088))
|
||||
- fix: worker: allow enable/disabling ReplicaUpdate tasks ([filecoin-project/lotus#8090](https://github.com/filecoin-project/lotus/pull/8090))
|
||||
- don't fail reification on missing references ([filecoin-project/lotus#8128](https://github.com/filecoin-project/lotus/pull/8128))
|
||||
- sealer: fix error message ([filecoin-project/lotus#8121](https://github.com/filecoin-project/lotus/pull/8121))
|
||||
- don't track peer ids in rcmgr metrics ([filecoin-project/lotus#8099](https://github.com/filecoin-project/lotus/pull/8099))
|
||||
- temporarily disable reification ([filecoin-project/lotus#8132](https://github.com/filecoin-project/lotus/pull/8132))
|
||||
- [Describe]: when excute cmd "lotus-bench sealing" without "benchmark-… ([filecoin-project/lotus#8173](https://github.com/filecoin-project/lotus/pull/8173))
|
||||
|
||||
## Dependency Updates
|
||||
- deps: update go-libp2p and go-libp2p-resource-manager ([filecoin-project/lotus#8289](https://github.com/filecoin-project/lotus/pull/8289))
|
||||
- feat(deps): update to graphsync v0.13.0 with 2.0 protocol ([filecoin-project/lotus#8273](https://github.com/filecoin-project/lotus/pull/8273))
|
||||
- dep: actor: get v7 ([filecoin-project/lotus#8194](https://github.com/filecoin-project/lotus/pull/8194))
|
||||
- deps: update go-libp2p to v0.18 release ([filecoin-project/lotus#8355](https://github.com/filecoin-project/lotus/pull/8355))
|
||||
- github.com/filecoin-project/go-data-transfer (v1.14.1 -> v1.15.0):
|
||||
- github.com/filecoin-project/go-fil-markets (v1.19.2 -> v1.20.1):
|
||||
- deps: update go-libp2p to v0.18.0-rc5 ([filecoin-project/lotus#8169](https://github.com/filecoin-project/lotus/pull/8169))
|
||||
|
||||
## Others
|
||||
- chore: build: backport releases ([filecoin-project/lotus#8192](https://github.com/filecoin-project/lotus/pull/8192))
|
||||
- feat: build: bump the version to v1.15.1-dev ([filecoin-project/lotus#8073](https://github.com/filecoin-project/lotus/pull/8073))
|
||||
- makefile: add make jen ([filecoin-project/lotus#8122](https://github.com/filecoin-project/lotus/pull/8122))
|
||||
- chore: Merge releases into master ([filecoin-project/lotus#8156](https://github.com/filecoin-project/lotus/pull/8156))
|
||||
- chore: ci: disable publish-packer #8451
|
||||
|
||||
# 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.
|
||||
|
||||
+2
-1
@@ -1,4 +1,4 @@
|
||||
FROM golang:1.16.4 AS builder-deps
|
||||
FROM golang:1.17.9-buster AS builder-deps
|
||||
MAINTAINER Lotus Development Team
|
||||
|
||||
RUN apt-get update && apt-get install -y ca-certificates build-essential clang ocl-icd-opencl-dev ocl-icd-libopencl1 jq libhwloc-dev
|
||||
@@ -253,3 +253,4 @@ EXPOSE 1234
|
||||
EXPOSE 2345
|
||||
EXPOSE 3456
|
||||
EXPOSE 1777
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ GOCC?=go
|
||||
GOVERSION:=$(shell $(GOCC) version | tr ' ' '\n' | grep go1 | sed 's/^go//' | awk -F. '{printf "%d%03d%03d", $$1, $$2, $$3}')
|
||||
ifeq ($(shell expr $(GOVERSION) \< 1016000), 1)
|
||||
$(warning Your Golang version is go$(shell expr $(GOVERSION) / 1000000).$(shell expr $(GOVERSION) % 1000000 / 1000).$(shell expr $(GOVERSION) % 1000))
|
||||
$(error Update Golang to version to at least 1.16.0)
|
||||
$(error Update Golang to version to at least 1.17.9)
|
||||
endif
|
||||
|
||||
# git modules that need to be loaded
|
||||
@@ -64,7 +64,7 @@ CLEAN+=build/.update-modules
|
||||
deps: $(BUILD_DEPS)
|
||||
.PHONY: deps
|
||||
|
||||
build-devnets: build lotus-seed lotus-shed lotus-wallet lotus-gateway
|
||||
build-devnets: build lotus-seed lotus-shed lotus-wallet lotus-gateway lotus-fountain lotus-stats
|
||||
.PHONY: build-devnets
|
||||
|
||||
debug: GOFLAGS+=-tags=debug
|
||||
@@ -169,7 +169,7 @@ BINS+=lotus-fountain
|
||||
|
||||
lotus-bench:
|
||||
rm -f lotus-bench
|
||||
$(GOCC) build -o lotus-bench ./cmd/lotus-bench
|
||||
$(GOCC) build $(GOFLAGS) -o lotus-bench ./cmd/lotus-bench
|
||||
.PHONY: lotus-bench
|
||||
BINS+=lotus-bench
|
||||
|
||||
@@ -193,7 +193,7 @@ BINS+=lotus-health
|
||||
|
||||
lotus-wallet:
|
||||
rm -f lotus-wallet
|
||||
$(GOCC) build -o lotus-wallet ./cmd/lotus-wallet
|
||||
$(GOCC) build $(GOFLAGS) -o lotus-wallet ./cmd/lotus-wallet
|
||||
.PHONY: lotus-wallet
|
||||
BINS+=lotus-wallet
|
||||
|
||||
@@ -295,6 +295,12 @@ actors-gen:
|
||||
$(GOCC) run ./chain/actors/agen
|
||||
$(GOCC) fmt ./...
|
||||
|
||||
bundle-gen:
|
||||
$(GOCC) run ./gen/bundle
|
||||
$(GOCC) fmt ./build/...
|
||||
.PHONY: bundle-gen
|
||||
|
||||
|
||||
api-gen:
|
||||
$(GOCC) run ./gen/api
|
||||
goimports -w api
|
||||
@@ -341,7 +347,7 @@ docsgen-openrpc-worker: 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 bundle-gen
|
||||
@echo ">>> IF YOU'VE MODIFIED THE CLI OR CONFIG, REMEMBER TO ALSO MAKE docsgen-cli"
|
||||
.PHONY: gen
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<a href="https://circleci.com/gh/filecoin-project/lotus"><img src="https://circleci.com/gh/filecoin-project/lotus.svg?style=svg"></a>
|
||||
<a href="https://codecov.io/gh/filecoin-project/lotus"><img src="https://codecov.io/gh/filecoin-project/lotus/branch/master/graph/badge.svg"></a>
|
||||
<a href="https://goreportcard.com/report/github.com/filecoin-project/lotus"><img src="https://goreportcard.com/badge/github.com/filecoin-project/lotus" /></a>
|
||||
<a href=""><img src="https://img.shields.io/badge/golang-%3E%3D1.16-blue.svg" /></a>
|
||||
<a href=""><img src="https://img.shields.io/badge/golang-%3E%3D1.17-blue.svg" /></a>
|
||||
<br>
|
||||
</p>
|
||||
|
||||
@@ -71,10 +71,10 @@ For other distributions you can find the required dependencies [here.](https://d
|
||||
|
||||
#### Go
|
||||
|
||||
To build Lotus, you need a working installation of [Go 1.16.4 or higher](https://golang.org/dl/):
|
||||
To build Lotus, you need a working installation of [Go 1.17.9 or higher](https://golang.org/dl/):
|
||||
|
||||
```bash
|
||||
wget -c https://golang.org/dl/go1.16.4.linux-amd64.tar.gz -O - | sudo tar -xz -C /usr/local
|
||||
wget -c https://golang.org/dl/go1.17.9.linux-amd64.tar.gz -O - | sudo tar -xz -C /usr/local
|
||||
```
|
||||
|
||||
**TIP:**
|
||||
|
||||
+35
-17
@@ -6,6 +6,9 @@ import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
abinetwork "github.com/filecoin-project/go-state-types/network"
|
||||
|
||||
blocks "github.com/ipfs/go-block-format"
|
||||
"github.com/ipfs/go-cid"
|
||||
"github.com/libp2p/go-libp2p-core/peer"
|
||||
|
||||
@@ -20,11 +23,12 @@ import (
|
||||
"github.com/filecoin-project/go-fil-markets/retrievalmarket"
|
||||
"github.com/filecoin-project/go-fil-markets/storagemarket"
|
||||
|
||||
"github.com/filecoin-project/go-state-types/builtin/v8/market"
|
||||
"github.com/filecoin-project/go-state-types/builtin/v8/miner"
|
||||
"github.com/filecoin-project/go-state-types/builtin/v8/paych"
|
||||
apitypes "github.com/filecoin-project/lotus/api/types"
|
||||
"github.com/filecoin-project/lotus/chain/actors/builtin"
|
||||
"github.com/filecoin-project/lotus/chain/actors/builtin/market"
|
||||
"github.com/filecoin-project/lotus/chain/actors/builtin/miner"
|
||||
"github.com/filecoin-project/lotus/chain/actors/builtin/paych"
|
||||
lminer "github.com/filecoin-project/lotus/chain/actors/builtin/miner"
|
||||
"github.com/filecoin-project/lotus/chain/actors/builtin/power"
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
"github.com/filecoin-project/lotus/node/modules/dtypes"
|
||||
@@ -37,6 +41,7 @@ import (
|
||||
type ChainIO interface {
|
||||
ChainReadObj(context.Context, cid.Cid) ([]byte, error)
|
||||
ChainHasObj(context.Context, cid.Cid) (bool, error)
|
||||
ChainPutObj(context.Context, blocks.Block) error
|
||||
}
|
||||
|
||||
const LookbackNoLimit = abi.ChainEpoch(-1)
|
||||
@@ -122,6 +127,9 @@ type FullNode interface {
|
||||
// ChainHasObj checks if a given CID exists in the chain blockstore.
|
||||
ChainHasObj(context.Context, cid.Cid) (bool, error) //perm:read
|
||||
|
||||
// ChainPutObj puts a given object into the block store
|
||||
ChainPutObj(context.Context, blocks.Block) error //perm:admin
|
||||
|
||||
// ChainStatObj returns statistics about the graph referenced by 'obj'.
|
||||
// If 'base' is also specified, then the returned stat will be a diff
|
||||
// between the two objects.
|
||||
@@ -170,14 +178,6 @@ type FullNode interface {
|
||||
// ChainBlockstoreInfo returns some basic information about the blockstore
|
||||
ChainBlockstoreInfo(context.Context) (map[string]interface{}, error) //perm:read
|
||||
|
||||
// MethodGroup: Beacon
|
||||
// The Beacon method group contains methods for interacting with the random beacon (DRAND)
|
||||
|
||||
// BeaconGetEntry returns the beacon entry for the given filecoin epoch. If
|
||||
// the entry has not yet been produced, the call will block until the entry
|
||||
// becomes available
|
||||
BeaconGetEntry(ctx context.Context, epoch abi.ChainEpoch) (*types.BeaconEntry, error) //perm:read
|
||||
|
||||
// GasEstimateFeeCap estimates gas fee cap
|
||||
GasEstimateFeeCap(context.Context, *types.Message, int64, types.TipSetKey) (types.BigInt, error) //perm:read
|
||||
|
||||
@@ -360,7 +360,7 @@ type FullNode interface {
|
||||
// ClientGetRetrievalUpdates returns status of updated retrieval deals
|
||||
ClientGetRetrievalUpdates(ctx context.Context) (<-chan RetrievalInfo, error) //perm:write
|
||||
// ClientQueryAsk returns a signed StorageAsk from the specified miner.
|
||||
ClientQueryAsk(ctx context.Context, p peer.ID, miner address.Address) (*storagemarket.StorageAsk, error) //perm:read
|
||||
ClientQueryAsk(ctx context.Context, p peer.ID, miner address.Address) (*StorageAsk, error) //perm:read
|
||||
// ClientCalcCommP calculates the CommP and data size of the specified CID
|
||||
ClientDealPieceCID(ctx context.Context, root cid.Cid) (DataCIDSize, error) //perm:read
|
||||
// ClientCalcCommP calculates the CommP for a specified file
|
||||
@@ -443,7 +443,7 @@ type FullNode interface {
|
||||
// StateMinerPower returns the power of the indicated miner
|
||||
StateMinerPower(context.Context, address.Address, types.TipSetKey) (*MinerPower, error) //perm:read
|
||||
// StateMinerInfo returns info about the indicated miner
|
||||
StateMinerInfo(context.Context, address.Address, types.TipSetKey) (miner.MinerInfo, error) //perm:read
|
||||
StateMinerInfo(context.Context, address.Address, types.TipSetKey) (MinerInfo, error) //perm:read
|
||||
// StateMinerDeadlines returns all the proving deadlines for the given miner
|
||||
StateMinerDeadlines(context.Context, address.Address, types.TipSetKey) ([]Deadline, error) //perm:read
|
||||
// StateMinerPartitions returns all partitions in the specified deadline
|
||||
@@ -469,9 +469,9 @@ type FullNode interface {
|
||||
// expiration epoch
|
||||
StateSectorGetInfo(context.Context, address.Address, abi.SectorNumber, types.TipSetKey) (*miner.SectorOnChainInfo, error) //perm:read
|
||||
// StateSectorExpiration returns epoch at which given sector will expire
|
||||
StateSectorExpiration(context.Context, address.Address, abi.SectorNumber, types.TipSetKey) (*miner.SectorExpiration, error) //perm:read
|
||||
StateSectorExpiration(context.Context, address.Address, abi.SectorNumber, types.TipSetKey) (*lminer.SectorExpiration, error) //perm:read
|
||||
// StateSectorPartition finds deadline/partition with the specified sector
|
||||
StateSectorPartition(ctx context.Context, maddr address.Address, sectorNumber abi.SectorNumber, tok types.TipSetKey) (*miner.SectorLocation, error) //perm:read
|
||||
StateSectorPartition(ctx context.Context, maddr address.Address, sectorNumber abi.SectorNumber, tok types.TipSetKey) (*lminer.SectorLocation, error) //perm:read
|
||||
// StateSearchMsg looks back up to limit epochs in the chain for a message, and returns its receipt and the tipset where it was executed
|
||||
//
|
||||
// NOTE: If a replacing message is found on chain, this method will return
|
||||
@@ -517,13 +517,15 @@ type FullNode interface {
|
||||
// StateMarketParticipants returns the Escrow and Locked balances of every participant in the Storage Market
|
||||
StateMarketParticipants(context.Context, types.TipSetKey) (map[string]MarketBalance, error) //perm:read
|
||||
// StateMarketDeals returns information about every deal in the Storage Market
|
||||
StateMarketDeals(context.Context, types.TipSetKey) (map[string]MarketDeal, error) //perm:read
|
||||
StateMarketDeals(context.Context, types.TipSetKey) (map[string]*MarketDeal, error) //perm:read
|
||||
// StateMarketStorageDeal returns information about the indicated deal
|
||||
StateMarketStorageDeal(context.Context, abi.DealID, types.TipSetKey) (*MarketDeal, error) //perm:read
|
||||
// StateLookupID retrieves the ID address of the given address
|
||||
StateLookupID(context.Context, address.Address, types.TipSetKey) (address.Address, error) //perm:read
|
||||
// StateAccountKey returns the public key address of the given ID address
|
||||
// StateAccountKey returns the public key address of the given ID address for secp and bls accounts
|
||||
StateAccountKey(context.Context, address.Address, types.TipSetKey) (address.Address, error) //perm:read
|
||||
// StateLookupRobustAddress returns the public key address of the given ID address for non-account addresses (multisig, miners etc)
|
||||
StateLookupRobustAddress(context.Context, address.Address, types.TipSetKey) (address.Address, error) //perm:read
|
||||
// StateChangedActors returns all the actors whose states change between the two given state CIDs
|
||||
// TODO: Should this take tipset keys instead?
|
||||
StateChangedActors(context.Context, cid.Cid, cid.Cid) (map[string]types.Actor, error) //perm:read
|
||||
@@ -584,12 +586,22 @@ type FullNode interface {
|
||||
StateVMCirculatingSupplyInternal(context.Context, types.TipSetKey) (CirculatingSupply, error) //perm:read
|
||||
// StateNetworkVersion returns the network version at the given tipset
|
||||
StateNetworkVersion(context.Context, types.TipSetKey) (apitypes.NetworkVersion, error) //perm:read
|
||||
// StateActorCodeCIDs returns the CIDs of all the builtin actors for the given network version
|
||||
StateActorCodeCIDs(context.Context, abinetwork.Version) (map[string]cid.Cid, 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
|
||||
|
||||
// StateGetBeaconEntry returns the beacon entry for the given filecoin epoch. If
|
||||
// the entry has not yet been produced, the call will block until the entry
|
||||
// becomes available
|
||||
StateGetBeaconEntry(ctx context.Context, epoch abi.ChainEpoch) (*types.BeaconEntry, error) //perm:read
|
||||
|
||||
// StateGetNetworkParams return current network params
|
||||
StateGetNetworkParams(ctx context.Context) (*NetworkParams, error) //perm:read
|
||||
|
||||
// MethodGroup: Msig
|
||||
// The Msig methods are used to interact with multisig wallets on the
|
||||
// filecoin network
|
||||
@@ -728,6 +740,12 @@ type FullNode interface {
|
||||
CreateBackup(ctx context.Context, fpath string) error //perm:admin
|
||||
}
|
||||
|
||||
type StorageAsk struct {
|
||||
Response *storagemarket.StorageAsk
|
||||
|
||||
DealProtocols []string
|
||||
}
|
||||
|
||||
type FileRef struct {
|
||||
Path string
|
||||
IsCAR bool
|
||||
|
||||
+4
-2
@@ -3,14 +3,15 @@ package api
|
||||
import (
|
||||
"context"
|
||||
|
||||
blocks "github.com/ipfs/go-block-format"
|
||||
"github.com/ipfs/go-cid"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
"github.com/filecoin-project/go-state-types/dline"
|
||||
|
||||
"github.com/filecoin-project/go-state-types/builtin/v8/miner"
|
||||
apitypes "github.com/filecoin-project/lotus/api/types"
|
||||
"github.com/filecoin-project/lotus/chain/actors/builtin/miner"
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
)
|
||||
|
||||
@@ -30,6 +31,7 @@ import (
|
||||
|
||||
type Gateway interface {
|
||||
ChainHasObj(context.Context, cid.Cid) (bool, error)
|
||||
ChainPutObj(context.Context, blocks.Block) error
|
||||
ChainHead(ctx context.Context) (*types.TipSet, error)
|
||||
ChainGetParentMessages(context.Context, cid.Cid) ([]Message, error)
|
||||
ChainGetParentReceipts(context.Context, cid.Cid) ([]*types.MessageReceipt, error)
|
||||
@@ -56,7 +58,7 @@ type Gateway interface {
|
||||
StateLookupID(ctx context.Context, addr address.Address, tsk types.TipSetKey) (address.Address, error)
|
||||
StateMarketBalance(ctx context.Context, addr address.Address, tsk types.TipSetKey) (MarketBalance, error)
|
||||
StateMarketStorageDeal(ctx context.Context, dealId abi.DealID, tsk types.TipSetKey) (*MarketDeal, error)
|
||||
StateMinerInfo(ctx context.Context, actor address.Address, tsk types.TipSetKey) (miner.MinerInfo, error)
|
||||
StateMinerInfo(ctx context.Context, actor address.Address, tsk types.TipSetKey) (MinerInfo, error)
|
||||
StateMinerProvingDeadline(ctx context.Context, addr address.Address, tsk types.TipSetKey) (*dline.Info, error)
|
||||
StateMinerPower(context.Context, address.Address, types.TipSetKey) (*MinerPower, error)
|
||||
StateNetworkVersion(context.Context, types.TipSetKey) (apitypes.NetworkVersion, error)
|
||||
|
||||
+9
-3
@@ -5,6 +5,7 @@ import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"github.com/filecoin-project/go-state-types/builtin/v8/miner"
|
||||
"github.com/filecoin-project/lotus/chain/actors/builtin"
|
||||
|
||||
"github.com/google/uuid"
|
||||
@@ -14,8 +15,8 @@ import (
|
||||
"github.com/filecoin-project/go-address"
|
||||
datatransfer "github.com/filecoin-project/go-data-transfer"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
"github.com/filecoin-project/go-state-types/builtin/v8/market"
|
||||
abinetwork "github.com/filecoin-project/go-state-types/network"
|
||||
"github.com/filecoin-project/specs-actors/v2/actors/builtin/market"
|
||||
"github.com/filecoin-project/specs-storage/storage"
|
||||
|
||||
"github.com/filecoin-project/go-fil-markets/piecestore"
|
||||
@@ -51,6 +52,10 @@ type StorageMiner interface {
|
||||
|
||||
MiningBase(context.Context) (*types.TipSet, error) //perm:read
|
||||
|
||||
ComputeWindowPoSt(ctx context.Context, dlIdx uint64, tsk types.TipSetKey) ([]miner.SubmitWindowedPoStParams, error) //perm:admin
|
||||
|
||||
ComputeDataCid(ctx context.Context, pieceSize abi.UnpaddedPieceSize, pieceData storage.Data) (abi.PieceInfo, error) //perm:admin
|
||||
|
||||
// Temp api for testing
|
||||
PledgeSector(context.Context) (abi.SectorID, error) //perm:write
|
||||
|
||||
@@ -121,6 +126,7 @@ type StorageMiner interface {
|
||||
WorkerJobs(context.Context) (map[uuid.UUID][]storiface.WorkerJob, error) //perm:admin
|
||||
|
||||
//storiface.WorkerReturn
|
||||
ReturnDataCid(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
|
||||
ReturnSealPreCommit2(ctx context.Context, callID storiface.CallID, sealed storage.SectorCids, err *storiface.CallError) error //perm:admin retry:true
|
||||
@@ -159,7 +165,7 @@ type StorageMiner interface {
|
||||
StorageStat(ctx context.Context, id storiface.ID) (fsutil.FsStat, error) //perm:admin
|
||||
|
||||
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
|
||||
MarketListRetrievalDeals(ctx context.Context) ([]retrievalmarket.ProviderDealState, error) //perm:read
|
||||
MarketGetDealUpdates(ctx context.Context) (<-chan storagemarket.MinerDeal, error) //perm:read
|
||||
MarketListIncompleteDeals(ctx context.Context) ([]storagemarket.MinerDeal, error) //perm:read
|
||||
@@ -236,7 +242,7 @@ type StorageMiner interface {
|
||||
RuntimeSubsystems(ctx context.Context) (MinerSubsystems, error) //perm:read
|
||||
|
||||
DealsImportData(ctx context.Context, dealPropCid cid.Cid, file string) error //perm:admin
|
||||
DealsList(ctx context.Context) ([]MarketDeal, error) //perm:admin
|
||||
DealsList(ctx context.Context) ([]*MarketDeal, error) //perm:admin
|
||||
DealsConsiderOnlineStorageDeals(context.Context) (bool, error) //perm:admin
|
||||
DealsSetConsiderOnlineStorageDeals(context.Context, bool) error //perm:admin
|
||||
DealsConsiderOnlineRetrievalDeals(context.Context) (bool, error) //perm:admin
|
||||
|
||||
+3
-2
@@ -3,12 +3,12 @@ package api
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/filecoin-project/go-state-types/proof"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/ipfs/go-cid"
|
||||
|
||||
"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/storiface"
|
||||
"github.com/filecoin-project/specs-storage/storage"
|
||||
@@ -34,6 +34,7 @@ type Worker interface {
|
||||
Info(context.Context) (storiface.WorkerInfo, error) //perm:admin
|
||||
|
||||
// storiface.WorkerCalls
|
||||
DataCid(ctx context.Context, pieceSize abi.UnpaddedPieceSize, pieceData storage.Data) (storiface.CallID, error) //perm:admin
|
||||
AddPiece(ctx context.Context, sector storage.SectorRef, pieceSizes []abi.UnpaddedPieceSize, newPieceSize abi.UnpaddedPieceSize, pieceData storage.Data) (storiface.CallID, error) //perm:admin
|
||||
SealPreCommit1(ctx context.Context, sector storage.SectorRef, ticket abi.SealRandomness, pieces []abi.PieceInfo) (storiface.CallID, error) //perm:admin
|
||||
SealPreCommit2(ctx context.Context, sector storage.SectorRef, pc1o storage.PreCommit1Out) (storiface.CallID, error) //perm:admin
|
||||
|
||||
+170
-128
@@ -9,8 +9,8 @@ import (
|
||||
"sort"
|
||||
|
||||
abi "github.com/filecoin-project/go-state-types/abi"
|
||||
market "github.com/filecoin-project/specs-actors/actors/builtin/market"
|
||||
paych "github.com/filecoin-project/specs-actors/actors/builtin/paych"
|
||||
market "github.com/filecoin-project/go-state-types/builtin/v8/market"
|
||||
paych "github.com/filecoin-project/go-state-types/builtin/v8/paych"
|
||||
cid "github.com/ipfs/go-cid"
|
||||
cbg "github.com/whyrusleeping/cbor-gen"
|
||||
xerrors "golang.org/x/xerrors"
|
||||
@@ -26,25 +26,26 @@ func (t *PaymentInfo) MarshalCBOR(w io.Writer) error {
|
||||
_, err := w.Write(cbg.CborNull)
|
||||
return err
|
||||
}
|
||||
if _, err := w.Write([]byte{163}); err != nil {
|
||||
|
||||
cw := cbg.NewCborWriter(w)
|
||||
|
||||
if _, err := cw.Write([]byte{163}); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
scratch := make([]byte, 9)
|
||||
|
||||
// t.Channel (address.Address) (struct)
|
||||
if len("Channel") > cbg.MaxLength {
|
||||
return xerrors.Errorf("Value in field \"Channel\" was too long")
|
||||
}
|
||||
|
||||
if err := cbg.WriteMajorTypeHeaderBuf(scratch, w, cbg.MajTextString, uint64(len("Channel"))); err != nil {
|
||||
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("Channel"))); err != nil {
|
||||
return err
|
||||
}
|
||||
if _, err := io.WriteString(w, string("Channel")); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := t.Channel.MarshalCBOR(w); err != nil {
|
||||
if err := t.Channel.MarshalCBOR(cw); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -53,14 +54,14 @@ func (t *PaymentInfo) MarshalCBOR(w io.Writer) error {
|
||||
return xerrors.Errorf("Value in field \"WaitSentinel\" was too long")
|
||||
}
|
||||
|
||||
if err := cbg.WriteMajorTypeHeaderBuf(scratch, w, cbg.MajTextString, uint64(len("WaitSentinel"))); err != nil {
|
||||
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("WaitSentinel"))); err != nil {
|
||||
return err
|
||||
}
|
||||
if _, err := io.WriteString(w, string("WaitSentinel")); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := cbg.WriteCidBuf(scratch, w, t.WaitSentinel); err != nil {
|
||||
if err := cbg.WriteCid(cw, t.WaitSentinel); err != nil {
|
||||
return xerrors.Errorf("failed to write cid field t.WaitSentinel: %w", err)
|
||||
}
|
||||
|
||||
@@ -69,7 +70,7 @@ func (t *PaymentInfo) MarshalCBOR(w io.Writer) error {
|
||||
return xerrors.Errorf("Value in field \"Vouchers\" was too long")
|
||||
}
|
||||
|
||||
if err := cbg.WriteMajorTypeHeaderBuf(scratch, w, cbg.MajTextString, uint64(len("Vouchers"))); err != nil {
|
||||
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("Vouchers"))); err != nil {
|
||||
return err
|
||||
}
|
||||
if _, err := io.WriteString(w, string("Vouchers")); err != nil {
|
||||
@@ -80,27 +81,32 @@ func (t *PaymentInfo) MarshalCBOR(w io.Writer) error {
|
||||
return xerrors.Errorf("Slice value in field t.Vouchers was too long")
|
||||
}
|
||||
|
||||
if err := cbg.WriteMajorTypeHeaderBuf(scratch, w, cbg.MajArray, uint64(len(t.Vouchers))); err != nil {
|
||||
if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.Vouchers))); err != nil {
|
||||
return err
|
||||
}
|
||||
for _, v := range t.Vouchers {
|
||||
if err := v.MarshalCBOR(w); err != nil {
|
||||
if err := v.MarshalCBOR(cw); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (t *PaymentInfo) UnmarshalCBOR(r io.Reader) error {
|
||||
func (t *PaymentInfo) UnmarshalCBOR(r io.Reader) (err error) {
|
||||
*t = PaymentInfo{}
|
||||
|
||||
br := cbg.GetPeeker(r)
|
||||
scratch := make([]byte, 8)
|
||||
cr := cbg.NewCborReader(r)
|
||||
|
||||
maj, extra, err := cbg.CborReadHeaderBuf(br, scratch)
|
||||
maj, extra, err := cr.ReadHeader()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer func() {
|
||||
if err == io.EOF {
|
||||
err = io.ErrUnexpectedEOF
|
||||
}
|
||||
}()
|
||||
|
||||
if maj != cbg.MajMap {
|
||||
return fmt.Errorf("cbor input should be of type map")
|
||||
}
|
||||
@@ -115,7 +121,7 @@ func (t *PaymentInfo) UnmarshalCBOR(r io.Reader) error {
|
||||
for i := uint64(0); i < n; i++ {
|
||||
|
||||
{
|
||||
sval, err := cbg.ReadStringBuf(br, scratch)
|
||||
sval, err := cbg.ReadString(cr)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -129,7 +135,7 @@ func (t *PaymentInfo) UnmarshalCBOR(r io.Reader) error {
|
||||
|
||||
{
|
||||
|
||||
if err := t.Channel.UnmarshalCBOR(br); err != nil {
|
||||
if err := t.Channel.UnmarshalCBOR(cr); err != nil {
|
||||
return xerrors.Errorf("unmarshaling t.Channel: %w", err)
|
||||
}
|
||||
|
||||
@@ -139,7 +145,7 @@ func (t *PaymentInfo) UnmarshalCBOR(r io.Reader) error {
|
||||
|
||||
{
|
||||
|
||||
c, err := cbg.ReadCid(br)
|
||||
c, err := cbg.ReadCid(cr)
|
||||
if err != nil {
|
||||
return xerrors.Errorf("failed to read cid field t.WaitSentinel: %w", err)
|
||||
}
|
||||
@@ -150,7 +156,7 @@ func (t *PaymentInfo) UnmarshalCBOR(r io.Reader) error {
|
||||
// t.Vouchers ([]*paych.SignedVoucher) (slice)
|
||||
case "Vouchers":
|
||||
|
||||
maj, extra, err = cbg.CborReadHeaderBuf(br, scratch)
|
||||
maj, extra, err = cr.ReadHeader()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -170,7 +176,7 @@ func (t *PaymentInfo) UnmarshalCBOR(r io.Reader) error {
|
||||
for i := 0; i < int(extra); i++ {
|
||||
|
||||
var v paych.SignedVoucher
|
||||
if err := v.UnmarshalCBOR(br); err != nil {
|
||||
if err := v.UnmarshalCBOR(cr); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -190,25 +196,26 @@ func (t *SealedRef) MarshalCBOR(w io.Writer) error {
|
||||
_, err := w.Write(cbg.CborNull)
|
||||
return err
|
||||
}
|
||||
if _, err := w.Write([]byte{163}); err != nil {
|
||||
|
||||
cw := cbg.NewCborWriter(w)
|
||||
|
||||
if _, err := cw.Write([]byte{163}); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
scratch := make([]byte, 9)
|
||||
|
||||
// t.SectorID (abi.SectorNumber) (uint64)
|
||||
if len("SectorID") > cbg.MaxLength {
|
||||
return xerrors.Errorf("Value in field \"SectorID\" was too long")
|
||||
}
|
||||
|
||||
if err := cbg.WriteMajorTypeHeaderBuf(scratch, w, cbg.MajTextString, uint64(len("SectorID"))); err != nil {
|
||||
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("SectorID"))); err != nil {
|
||||
return err
|
||||
}
|
||||
if _, err := io.WriteString(w, string("SectorID")); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := cbg.WriteMajorTypeHeaderBuf(scratch, w, cbg.MajUnsignedInt, uint64(t.SectorID)); err != nil {
|
||||
if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.SectorID)); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -217,14 +224,14 @@ func (t *SealedRef) MarshalCBOR(w io.Writer) error {
|
||||
return xerrors.Errorf("Value in field \"Offset\" was too long")
|
||||
}
|
||||
|
||||
if err := cbg.WriteMajorTypeHeaderBuf(scratch, w, cbg.MajTextString, uint64(len("Offset"))); err != nil {
|
||||
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("Offset"))); err != nil {
|
||||
return err
|
||||
}
|
||||
if _, err := io.WriteString(w, string("Offset")); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := cbg.WriteMajorTypeHeaderBuf(scratch, w, cbg.MajUnsignedInt, uint64(t.Offset)); err != nil {
|
||||
if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.Offset)); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -233,30 +240,35 @@ func (t *SealedRef) MarshalCBOR(w io.Writer) error {
|
||||
return xerrors.Errorf("Value in field \"Size\" was too long")
|
||||
}
|
||||
|
||||
if err := cbg.WriteMajorTypeHeaderBuf(scratch, w, cbg.MajTextString, uint64(len("Size"))); err != nil {
|
||||
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("Size"))); err != nil {
|
||||
return err
|
||||
}
|
||||
if _, err := io.WriteString(w, string("Size")); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := cbg.WriteMajorTypeHeaderBuf(scratch, w, cbg.MajUnsignedInt, uint64(t.Size)); err != nil {
|
||||
if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.Size)); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (t *SealedRef) UnmarshalCBOR(r io.Reader) error {
|
||||
func (t *SealedRef) UnmarshalCBOR(r io.Reader) (err error) {
|
||||
*t = SealedRef{}
|
||||
|
||||
br := cbg.GetPeeker(r)
|
||||
scratch := make([]byte, 8)
|
||||
cr := cbg.NewCborReader(r)
|
||||
|
||||
maj, extra, err := cbg.CborReadHeaderBuf(br, scratch)
|
||||
maj, extra, err := cr.ReadHeader()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer func() {
|
||||
if err == io.EOF {
|
||||
err = io.ErrUnexpectedEOF
|
||||
}
|
||||
}()
|
||||
|
||||
if maj != cbg.MajMap {
|
||||
return fmt.Errorf("cbor input should be of type map")
|
||||
}
|
||||
@@ -271,7 +283,7 @@ func (t *SealedRef) UnmarshalCBOR(r io.Reader) error {
|
||||
for i := uint64(0); i < n; i++ {
|
||||
|
||||
{
|
||||
sval, err := cbg.ReadStringBuf(br, scratch)
|
||||
sval, err := cbg.ReadString(cr)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -285,7 +297,7 @@ func (t *SealedRef) UnmarshalCBOR(r io.Reader) error {
|
||||
|
||||
{
|
||||
|
||||
maj, extra, err = cbg.CborReadHeaderBuf(br, scratch)
|
||||
maj, extra, err = cr.ReadHeader()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -300,7 +312,7 @@ func (t *SealedRef) UnmarshalCBOR(r io.Reader) error {
|
||||
|
||||
{
|
||||
|
||||
maj, extra, err = cbg.CborReadHeaderBuf(br, scratch)
|
||||
maj, extra, err = cr.ReadHeader()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -315,7 +327,7 @@ func (t *SealedRef) UnmarshalCBOR(r io.Reader) error {
|
||||
|
||||
{
|
||||
|
||||
maj, extra, err = cbg.CborReadHeaderBuf(br, scratch)
|
||||
maj, extra, err = cr.ReadHeader()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -339,18 +351,19 @@ func (t *SealedRefs) MarshalCBOR(w io.Writer) error {
|
||||
_, err := w.Write(cbg.CborNull)
|
||||
return err
|
||||
}
|
||||
if _, err := w.Write([]byte{161}); err != nil {
|
||||
|
||||
cw := cbg.NewCborWriter(w)
|
||||
|
||||
if _, err := cw.Write([]byte{161}); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
scratch := make([]byte, 9)
|
||||
|
||||
// t.Refs ([]api.SealedRef) (slice)
|
||||
if len("Refs") > cbg.MaxLength {
|
||||
return xerrors.Errorf("Value in field \"Refs\" was too long")
|
||||
}
|
||||
|
||||
if err := cbg.WriteMajorTypeHeaderBuf(scratch, w, cbg.MajTextString, uint64(len("Refs"))); err != nil {
|
||||
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("Refs"))); err != nil {
|
||||
return err
|
||||
}
|
||||
if _, err := io.WriteString(w, string("Refs")); err != nil {
|
||||
@@ -361,27 +374,32 @@ func (t *SealedRefs) MarshalCBOR(w io.Writer) error {
|
||||
return xerrors.Errorf("Slice value in field t.Refs was too long")
|
||||
}
|
||||
|
||||
if err := cbg.WriteMajorTypeHeaderBuf(scratch, w, cbg.MajArray, uint64(len(t.Refs))); err != nil {
|
||||
if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.Refs))); err != nil {
|
||||
return err
|
||||
}
|
||||
for _, v := range t.Refs {
|
||||
if err := v.MarshalCBOR(w); err != nil {
|
||||
if err := v.MarshalCBOR(cw); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (t *SealedRefs) UnmarshalCBOR(r io.Reader) error {
|
||||
func (t *SealedRefs) UnmarshalCBOR(r io.Reader) (err error) {
|
||||
*t = SealedRefs{}
|
||||
|
||||
br := cbg.GetPeeker(r)
|
||||
scratch := make([]byte, 8)
|
||||
cr := cbg.NewCborReader(r)
|
||||
|
||||
maj, extra, err := cbg.CborReadHeaderBuf(br, scratch)
|
||||
maj, extra, err := cr.ReadHeader()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer func() {
|
||||
if err == io.EOF {
|
||||
err = io.ErrUnexpectedEOF
|
||||
}
|
||||
}()
|
||||
|
||||
if maj != cbg.MajMap {
|
||||
return fmt.Errorf("cbor input should be of type map")
|
||||
}
|
||||
@@ -396,7 +414,7 @@ func (t *SealedRefs) UnmarshalCBOR(r io.Reader) error {
|
||||
for i := uint64(0); i < n; i++ {
|
||||
|
||||
{
|
||||
sval, err := cbg.ReadStringBuf(br, scratch)
|
||||
sval, err := cbg.ReadString(cr)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -408,7 +426,7 @@ func (t *SealedRefs) UnmarshalCBOR(r io.Reader) error {
|
||||
// t.Refs ([]api.SealedRef) (slice)
|
||||
case "Refs":
|
||||
|
||||
maj, extra, err = cbg.CborReadHeaderBuf(br, scratch)
|
||||
maj, extra, err = cr.ReadHeader()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -428,7 +446,7 @@ func (t *SealedRefs) UnmarshalCBOR(r io.Reader) error {
|
||||
for i := 0; i < int(extra); i++ {
|
||||
|
||||
var v SealedRef
|
||||
if err := v.UnmarshalCBOR(br); err != nil {
|
||||
if err := v.UnmarshalCBOR(cr); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -448,18 +466,19 @@ func (t *SealTicket) MarshalCBOR(w io.Writer) error {
|
||||
_, err := w.Write(cbg.CborNull)
|
||||
return err
|
||||
}
|
||||
if _, err := w.Write([]byte{162}); err != nil {
|
||||
|
||||
cw := cbg.NewCborWriter(w)
|
||||
|
||||
if _, err := cw.Write([]byte{162}); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
scratch := make([]byte, 9)
|
||||
|
||||
// t.Value (abi.SealRandomness) (slice)
|
||||
if len("Value") > cbg.MaxLength {
|
||||
return xerrors.Errorf("Value in field \"Value\" was too long")
|
||||
}
|
||||
|
||||
if err := cbg.WriteMajorTypeHeaderBuf(scratch, w, cbg.MajTextString, uint64(len("Value"))); err != nil {
|
||||
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("Value"))); err != nil {
|
||||
return err
|
||||
}
|
||||
if _, err := io.WriteString(w, string("Value")); err != nil {
|
||||
@@ -470,11 +489,11 @@ func (t *SealTicket) MarshalCBOR(w io.Writer) error {
|
||||
return xerrors.Errorf("Byte array in field t.Value was too long")
|
||||
}
|
||||
|
||||
if err := cbg.WriteMajorTypeHeaderBuf(scratch, w, cbg.MajByteString, uint64(len(t.Value))); err != nil {
|
||||
if err := cw.WriteMajorTypeHeader(cbg.MajByteString, uint64(len(t.Value))); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if _, err := w.Write(t.Value[:]); err != nil {
|
||||
if _, err := cw.Write(t.Value[:]); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -483,7 +502,7 @@ func (t *SealTicket) MarshalCBOR(w io.Writer) error {
|
||||
return xerrors.Errorf("Value in field \"Epoch\" was too long")
|
||||
}
|
||||
|
||||
if err := cbg.WriteMajorTypeHeaderBuf(scratch, w, cbg.MajTextString, uint64(len("Epoch"))); err != nil {
|
||||
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("Epoch"))); err != nil {
|
||||
return err
|
||||
}
|
||||
if _, err := io.WriteString(w, string("Epoch")); err != nil {
|
||||
@@ -491,27 +510,32 @@ func (t *SealTicket) MarshalCBOR(w io.Writer) error {
|
||||
}
|
||||
|
||||
if t.Epoch >= 0 {
|
||||
if err := cbg.WriteMajorTypeHeaderBuf(scratch, w, cbg.MajUnsignedInt, uint64(t.Epoch)); err != nil {
|
||||
if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.Epoch)); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
if err := cbg.WriteMajorTypeHeaderBuf(scratch, w, cbg.MajNegativeInt, uint64(-t.Epoch-1)); err != nil {
|
||||
if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-t.Epoch-1)); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (t *SealTicket) UnmarshalCBOR(r io.Reader) error {
|
||||
func (t *SealTicket) UnmarshalCBOR(r io.Reader) (err error) {
|
||||
*t = SealTicket{}
|
||||
|
||||
br := cbg.GetPeeker(r)
|
||||
scratch := make([]byte, 8)
|
||||
cr := cbg.NewCborReader(r)
|
||||
|
||||
maj, extra, err := cbg.CborReadHeaderBuf(br, scratch)
|
||||
maj, extra, err := cr.ReadHeader()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer func() {
|
||||
if err == io.EOF {
|
||||
err = io.ErrUnexpectedEOF
|
||||
}
|
||||
}()
|
||||
|
||||
if maj != cbg.MajMap {
|
||||
return fmt.Errorf("cbor input should be of type map")
|
||||
}
|
||||
@@ -526,7 +550,7 @@ func (t *SealTicket) UnmarshalCBOR(r io.Reader) error {
|
||||
for i := uint64(0); i < n; i++ {
|
||||
|
||||
{
|
||||
sval, err := cbg.ReadStringBuf(br, scratch)
|
||||
sval, err := cbg.ReadString(cr)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -538,7 +562,7 @@ func (t *SealTicket) UnmarshalCBOR(r io.Reader) error {
|
||||
// t.Value (abi.SealRandomness) (slice)
|
||||
case "Value":
|
||||
|
||||
maj, extra, err = cbg.CborReadHeaderBuf(br, scratch)
|
||||
maj, extra, err = cr.ReadHeader()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -554,13 +578,13 @@ func (t *SealTicket) UnmarshalCBOR(r io.Reader) error {
|
||||
t.Value = make([]uint8, extra)
|
||||
}
|
||||
|
||||
if _, err := io.ReadFull(br, t.Value[:]); err != nil {
|
||||
if _, err := io.ReadFull(cr, t.Value[:]); err != nil {
|
||||
return err
|
||||
}
|
||||
// t.Epoch (abi.ChainEpoch) (int64)
|
||||
case "Epoch":
|
||||
{
|
||||
maj, extra, err := cbg.CborReadHeaderBuf(br, scratch)
|
||||
maj, extra, err := cr.ReadHeader()
|
||||
var extraI int64
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -597,18 +621,19 @@ func (t *SealSeed) MarshalCBOR(w io.Writer) error {
|
||||
_, err := w.Write(cbg.CborNull)
|
||||
return err
|
||||
}
|
||||
if _, err := w.Write([]byte{162}); err != nil {
|
||||
|
||||
cw := cbg.NewCborWriter(w)
|
||||
|
||||
if _, err := cw.Write([]byte{162}); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
scratch := make([]byte, 9)
|
||||
|
||||
// t.Value (abi.InteractiveSealRandomness) (slice)
|
||||
if len("Value") > cbg.MaxLength {
|
||||
return xerrors.Errorf("Value in field \"Value\" was too long")
|
||||
}
|
||||
|
||||
if err := cbg.WriteMajorTypeHeaderBuf(scratch, w, cbg.MajTextString, uint64(len("Value"))); err != nil {
|
||||
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("Value"))); err != nil {
|
||||
return err
|
||||
}
|
||||
if _, err := io.WriteString(w, string("Value")); err != nil {
|
||||
@@ -619,11 +644,11 @@ func (t *SealSeed) MarshalCBOR(w io.Writer) error {
|
||||
return xerrors.Errorf("Byte array in field t.Value was too long")
|
||||
}
|
||||
|
||||
if err := cbg.WriteMajorTypeHeaderBuf(scratch, w, cbg.MajByteString, uint64(len(t.Value))); err != nil {
|
||||
if err := cw.WriteMajorTypeHeader(cbg.MajByteString, uint64(len(t.Value))); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if _, err := w.Write(t.Value[:]); err != nil {
|
||||
if _, err := cw.Write(t.Value[:]); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -632,7 +657,7 @@ func (t *SealSeed) MarshalCBOR(w io.Writer) error {
|
||||
return xerrors.Errorf("Value in field \"Epoch\" was too long")
|
||||
}
|
||||
|
||||
if err := cbg.WriteMajorTypeHeaderBuf(scratch, w, cbg.MajTextString, uint64(len("Epoch"))); err != nil {
|
||||
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("Epoch"))); err != nil {
|
||||
return err
|
||||
}
|
||||
if _, err := io.WriteString(w, string("Epoch")); err != nil {
|
||||
@@ -640,27 +665,32 @@ func (t *SealSeed) MarshalCBOR(w io.Writer) error {
|
||||
}
|
||||
|
||||
if t.Epoch >= 0 {
|
||||
if err := cbg.WriteMajorTypeHeaderBuf(scratch, w, cbg.MajUnsignedInt, uint64(t.Epoch)); err != nil {
|
||||
if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.Epoch)); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
if err := cbg.WriteMajorTypeHeaderBuf(scratch, w, cbg.MajNegativeInt, uint64(-t.Epoch-1)); err != nil {
|
||||
if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-t.Epoch-1)); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (t *SealSeed) UnmarshalCBOR(r io.Reader) error {
|
||||
func (t *SealSeed) UnmarshalCBOR(r io.Reader) (err error) {
|
||||
*t = SealSeed{}
|
||||
|
||||
br := cbg.GetPeeker(r)
|
||||
scratch := make([]byte, 8)
|
||||
cr := cbg.NewCborReader(r)
|
||||
|
||||
maj, extra, err := cbg.CborReadHeaderBuf(br, scratch)
|
||||
maj, extra, err := cr.ReadHeader()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer func() {
|
||||
if err == io.EOF {
|
||||
err = io.ErrUnexpectedEOF
|
||||
}
|
||||
}()
|
||||
|
||||
if maj != cbg.MajMap {
|
||||
return fmt.Errorf("cbor input should be of type map")
|
||||
}
|
||||
@@ -675,7 +705,7 @@ func (t *SealSeed) UnmarshalCBOR(r io.Reader) error {
|
||||
for i := uint64(0); i < n; i++ {
|
||||
|
||||
{
|
||||
sval, err := cbg.ReadStringBuf(br, scratch)
|
||||
sval, err := cbg.ReadString(cr)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -687,7 +717,7 @@ func (t *SealSeed) UnmarshalCBOR(r io.Reader) error {
|
||||
// t.Value (abi.InteractiveSealRandomness) (slice)
|
||||
case "Value":
|
||||
|
||||
maj, extra, err = cbg.CborReadHeaderBuf(br, scratch)
|
||||
maj, extra, err = cr.ReadHeader()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -703,13 +733,13 @@ func (t *SealSeed) UnmarshalCBOR(r io.Reader) error {
|
||||
t.Value = make([]uint8, extra)
|
||||
}
|
||||
|
||||
if _, err := io.ReadFull(br, t.Value[:]); err != nil {
|
||||
if _, err := io.ReadFull(cr, t.Value[:]); err != nil {
|
||||
return err
|
||||
}
|
||||
// t.Epoch (abi.ChainEpoch) (int64)
|
||||
case "Epoch":
|
||||
{
|
||||
maj, extra, err := cbg.CborReadHeaderBuf(br, scratch)
|
||||
maj, extra, err := cr.ReadHeader()
|
||||
var extraI int64
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -746,18 +776,19 @@ func (t *PieceDealInfo) MarshalCBOR(w io.Writer) error {
|
||||
_, err := w.Write(cbg.CborNull)
|
||||
return err
|
||||
}
|
||||
if _, err := w.Write([]byte{165}); err != nil {
|
||||
|
||||
cw := cbg.NewCborWriter(w)
|
||||
|
||||
if _, err := cw.Write([]byte{165}); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
scratch := make([]byte, 9)
|
||||
|
||||
// t.PublishCid (cid.Cid) (struct)
|
||||
if len("PublishCid") > cbg.MaxLength {
|
||||
return xerrors.Errorf("Value in field \"PublishCid\" was too long")
|
||||
}
|
||||
|
||||
if err := cbg.WriteMajorTypeHeaderBuf(scratch, w, cbg.MajTextString, uint64(len("PublishCid"))); err != nil {
|
||||
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("PublishCid"))); err != nil {
|
||||
return err
|
||||
}
|
||||
if _, err := io.WriteString(w, string("PublishCid")); err != nil {
|
||||
@@ -765,11 +796,11 @@ func (t *PieceDealInfo) MarshalCBOR(w io.Writer) error {
|
||||
}
|
||||
|
||||
if t.PublishCid == nil {
|
||||
if _, err := w.Write(cbg.CborNull); err != nil {
|
||||
if _, err := cw.Write(cbg.CborNull); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
if err := cbg.WriteCidBuf(scratch, w, *t.PublishCid); err != nil {
|
||||
if err := cbg.WriteCid(cw, *t.PublishCid); err != nil {
|
||||
return xerrors.Errorf("failed to write cid field t.PublishCid: %w", err)
|
||||
}
|
||||
}
|
||||
@@ -779,14 +810,14 @@ func (t *PieceDealInfo) MarshalCBOR(w io.Writer) error {
|
||||
return xerrors.Errorf("Value in field \"DealID\" was too long")
|
||||
}
|
||||
|
||||
if err := cbg.WriteMajorTypeHeaderBuf(scratch, w, cbg.MajTextString, uint64(len("DealID"))); err != nil {
|
||||
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("DealID"))); err != nil {
|
||||
return err
|
||||
}
|
||||
if _, err := io.WriteString(w, string("DealID")); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := cbg.WriteMajorTypeHeaderBuf(scratch, w, cbg.MajUnsignedInt, uint64(t.DealID)); err != nil {
|
||||
if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.DealID)); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -795,14 +826,14 @@ func (t *PieceDealInfo) MarshalCBOR(w io.Writer) error {
|
||||
return xerrors.Errorf("Value in field \"DealProposal\" was too long")
|
||||
}
|
||||
|
||||
if err := cbg.WriteMajorTypeHeaderBuf(scratch, w, cbg.MajTextString, uint64(len("DealProposal"))); err != nil {
|
||||
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("DealProposal"))); err != nil {
|
||||
return err
|
||||
}
|
||||
if _, err := io.WriteString(w, string("DealProposal")); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := t.DealProposal.MarshalCBOR(w); err != nil {
|
||||
if err := t.DealProposal.MarshalCBOR(cw); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -811,14 +842,14 @@ func (t *PieceDealInfo) MarshalCBOR(w io.Writer) error {
|
||||
return xerrors.Errorf("Value in field \"DealSchedule\" was too long")
|
||||
}
|
||||
|
||||
if err := cbg.WriteMajorTypeHeaderBuf(scratch, w, cbg.MajTextString, uint64(len("DealSchedule"))); err != nil {
|
||||
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("DealSchedule"))); err != nil {
|
||||
return err
|
||||
}
|
||||
if _, err := io.WriteString(w, string("DealSchedule")); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := t.DealSchedule.MarshalCBOR(w); err != nil {
|
||||
if err := t.DealSchedule.MarshalCBOR(cw); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -827,7 +858,7 @@ func (t *PieceDealInfo) MarshalCBOR(w io.Writer) error {
|
||||
return xerrors.Errorf("Value in field \"KeepUnsealed\" was too long")
|
||||
}
|
||||
|
||||
if err := cbg.WriteMajorTypeHeaderBuf(scratch, w, cbg.MajTextString, uint64(len("KeepUnsealed"))); err != nil {
|
||||
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("KeepUnsealed"))); err != nil {
|
||||
return err
|
||||
}
|
||||
if _, err := io.WriteString(w, string("KeepUnsealed")); err != nil {
|
||||
@@ -840,16 +871,21 @@ func (t *PieceDealInfo) MarshalCBOR(w io.Writer) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (t *PieceDealInfo) UnmarshalCBOR(r io.Reader) error {
|
||||
func (t *PieceDealInfo) UnmarshalCBOR(r io.Reader) (err error) {
|
||||
*t = PieceDealInfo{}
|
||||
|
||||
br := cbg.GetPeeker(r)
|
||||
scratch := make([]byte, 8)
|
||||
cr := cbg.NewCborReader(r)
|
||||
|
||||
maj, extra, err := cbg.CborReadHeaderBuf(br, scratch)
|
||||
maj, extra, err := cr.ReadHeader()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer func() {
|
||||
if err == io.EOF {
|
||||
err = io.ErrUnexpectedEOF
|
||||
}
|
||||
}()
|
||||
|
||||
if maj != cbg.MajMap {
|
||||
return fmt.Errorf("cbor input should be of type map")
|
||||
}
|
||||
@@ -864,7 +900,7 @@ func (t *PieceDealInfo) UnmarshalCBOR(r io.Reader) error {
|
||||
for i := uint64(0); i < n; i++ {
|
||||
|
||||
{
|
||||
sval, err := cbg.ReadStringBuf(br, scratch)
|
||||
sval, err := cbg.ReadString(cr)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -878,16 +914,16 @@ func (t *PieceDealInfo) UnmarshalCBOR(r io.Reader) error {
|
||||
|
||||
{
|
||||
|
||||
b, err := br.ReadByte()
|
||||
b, err := cr.ReadByte()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if b != cbg.CborNull[0] {
|
||||
if err := br.UnreadByte(); err != nil {
|
||||
if err := cr.UnreadByte(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
c, err := cbg.ReadCid(br)
|
||||
c, err := cbg.ReadCid(cr)
|
||||
if err != nil {
|
||||
return xerrors.Errorf("failed to read cid field t.PublishCid: %w", err)
|
||||
}
|
||||
@@ -901,7 +937,7 @@ func (t *PieceDealInfo) UnmarshalCBOR(r io.Reader) error {
|
||||
|
||||
{
|
||||
|
||||
maj, extra, err = cbg.CborReadHeaderBuf(br, scratch)
|
||||
maj, extra, err = cr.ReadHeader()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -916,16 +952,16 @@ func (t *PieceDealInfo) UnmarshalCBOR(r io.Reader) error {
|
||||
|
||||
{
|
||||
|
||||
b, err := br.ReadByte()
|
||||
b, err := cr.ReadByte()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if b != cbg.CborNull[0] {
|
||||
if err := br.UnreadByte(); err != nil {
|
||||
if err := cr.UnreadByte(); err != nil {
|
||||
return err
|
||||
}
|
||||
t.DealProposal = new(market.DealProposal)
|
||||
if err := t.DealProposal.UnmarshalCBOR(br); err != nil {
|
||||
if err := t.DealProposal.UnmarshalCBOR(cr); err != nil {
|
||||
return xerrors.Errorf("unmarshaling t.DealProposal pointer: %w", err)
|
||||
}
|
||||
}
|
||||
@@ -936,7 +972,7 @@ func (t *PieceDealInfo) UnmarshalCBOR(r io.Reader) error {
|
||||
|
||||
{
|
||||
|
||||
if err := t.DealSchedule.UnmarshalCBOR(br); err != nil {
|
||||
if err := t.DealSchedule.UnmarshalCBOR(cr); err != nil {
|
||||
return xerrors.Errorf("unmarshaling t.DealSchedule: %w", err)
|
||||
}
|
||||
|
||||
@@ -944,7 +980,7 @@ func (t *PieceDealInfo) UnmarshalCBOR(r io.Reader) error {
|
||||
// t.KeepUnsealed (bool) (bool)
|
||||
case "KeepUnsealed":
|
||||
|
||||
maj, extra, err = cbg.CborReadHeaderBuf(br, scratch)
|
||||
maj, extra, err = cr.ReadHeader()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -973,18 +1009,19 @@ func (t *DealSchedule) MarshalCBOR(w io.Writer) error {
|
||||
_, err := w.Write(cbg.CborNull)
|
||||
return err
|
||||
}
|
||||
if _, err := w.Write([]byte{162}); err != nil {
|
||||
|
||||
cw := cbg.NewCborWriter(w)
|
||||
|
||||
if _, err := cw.Write([]byte{162}); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
scratch := make([]byte, 9)
|
||||
|
||||
// t.StartEpoch (abi.ChainEpoch) (int64)
|
||||
if len("StartEpoch") > cbg.MaxLength {
|
||||
return xerrors.Errorf("Value in field \"StartEpoch\" was too long")
|
||||
}
|
||||
|
||||
if err := cbg.WriteMajorTypeHeaderBuf(scratch, w, cbg.MajTextString, uint64(len("StartEpoch"))); err != nil {
|
||||
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("StartEpoch"))); err != nil {
|
||||
return err
|
||||
}
|
||||
if _, err := io.WriteString(w, string("StartEpoch")); err != nil {
|
||||
@@ -992,11 +1029,11 @@ func (t *DealSchedule) MarshalCBOR(w io.Writer) error {
|
||||
}
|
||||
|
||||
if t.StartEpoch >= 0 {
|
||||
if err := cbg.WriteMajorTypeHeaderBuf(scratch, w, cbg.MajUnsignedInt, uint64(t.StartEpoch)); err != nil {
|
||||
if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.StartEpoch)); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
if err := cbg.WriteMajorTypeHeaderBuf(scratch, w, cbg.MajNegativeInt, uint64(-t.StartEpoch-1)); err != nil {
|
||||
if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-t.StartEpoch-1)); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
@@ -1006,7 +1043,7 @@ func (t *DealSchedule) MarshalCBOR(w io.Writer) error {
|
||||
return xerrors.Errorf("Value in field \"EndEpoch\" was too long")
|
||||
}
|
||||
|
||||
if err := cbg.WriteMajorTypeHeaderBuf(scratch, w, cbg.MajTextString, uint64(len("EndEpoch"))); err != nil {
|
||||
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("EndEpoch"))); err != nil {
|
||||
return err
|
||||
}
|
||||
if _, err := io.WriteString(w, string("EndEpoch")); err != nil {
|
||||
@@ -1014,27 +1051,32 @@ func (t *DealSchedule) MarshalCBOR(w io.Writer) error {
|
||||
}
|
||||
|
||||
if t.EndEpoch >= 0 {
|
||||
if err := cbg.WriteMajorTypeHeaderBuf(scratch, w, cbg.MajUnsignedInt, uint64(t.EndEpoch)); err != nil {
|
||||
if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.EndEpoch)); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
if err := cbg.WriteMajorTypeHeaderBuf(scratch, w, cbg.MajNegativeInt, uint64(-t.EndEpoch-1)); err != nil {
|
||||
if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-t.EndEpoch-1)); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (t *DealSchedule) UnmarshalCBOR(r io.Reader) error {
|
||||
func (t *DealSchedule) UnmarshalCBOR(r io.Reader) (err error) {
|
||||
*t = DealSchedule{}
|
||||
|
||||
br := cbg.GetPeeker(r)
|
||||
scratch := make([]byte, 8)
|
||||
cr := cbg.NewCborReader(r)
|
||||
|
||||
maj, extra, err := cbg.CborReadHeaderBuf(br, scratch)
|
||||
maj, extra, err := cr.ReadHeader()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer func() {
|
||||
if err == io.EOF {
|
||||
err = io.ErrUnexpectedEOF
|
||||
}
|
||||
}()
|
||||
|
||||
if maj != cbg.MajMap {
|
||||
return fmt.Errorf("cbor input should be of type map")
|
||||
}
|
||||
@@ -1049,7 +1091,7 @@ func (t *DealSchedule) UnmarshalCBOR(r io.Reader) error {
|
||||
for i := uint64(0); i < n; i++ {
|
||||
|
||||
{
|
||||
sval, err := cbg.ReadStringBuf(br, scratch)
|
||||
sval, err := cbg.ReadString(cr)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -1061,7 +1103,7 @@ func (t *DealSchedule) UnmarshalCBOR(r io.Reader) error {
|
||||
// t.StartEpoch (abi.ChainEpoch) (int64)
|
||||
case "StartEpoch":
|
||||
{
|
||||
maj, extra, err := cbg.CborReadHeaderBuf(br, scratch)
|
||||
maj, extra, err := cr.ReadHeader()
|
||||
var extraI int64
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -1087,7 +1129,7 @@ func (t *DealSchedule) UnmarshalCBOR(r io.Reader) error {
|
||||
// t.EndEpoch (abi.ChainEpoch) (int64)
|
||||
case "EndEpoch":
|
||||
{
|
||||
maj, extra, err := cbg.CborReadHeaderBuf(br, scratch)
|
||||
maj, extra, err := cr.ReadHeader()
|
||||
var extraI int64
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
@@ -28,6 +28,7 @@ import (
|
||||
filestore "github.com/filecoin-project/go-fil-markets/filestore"
|
||||
"github.com/filecoin-project/go-fil-markets/retrievalmarket"
|
||||
"github.com/filecoin-project/go-jsonrpc/auth"
|
||||
blocks "github.com/ipfs/go-block-format"
|
||||
textselector "github.com/ipld/go-ipld-selector-text-lite"
|
||||
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
@@ -95,6 +96,9 @@ func init() {
|
||||
apiSelExample := api.Selector("Links/21/Hash/Links/42/Hash")
|
||||
clientEvent := retrievalmarket.ClientEventDealAccepted
|
||||
|
||||
block := blocks.Block(&blocks.BasicBlock{})
|
||||
ExampleValues[reflect.TypeOf(&block).Elem()] = block
|
||||
|
||||
addExample(bitfield.NewFromSet([]uint64{5}))
|
||||
addExample(abi.RegisteredSealProof_StackedDrg32GiBV1_1)
|
||||
addExample(abi.RegisteredPoStProof_StackedDrgWindow32GiBV1)
|
||||
@@ -146,6 +150,10 @@ func init() {
|
||||
addExample(map[string]api.MarketDeal{
|
||||
"t026363": ExampleValue("init", reflect.TypeOf(api.MarketDeal{}), nil).(api.MarketDeal),
|
||||
})
|
||||
addExample(map[string]*api.MarketDeal{
|
||||
"t026363": ExampleValue("init", reflect.TypeOf(&api.MarketDeal{}), nil).(*api.MarketDeal),
|
||||
})
|
||||
|
||||
addExample(map[string]api.MarketBalance{
|
||||
"t026363": ExampleValue("init", reflect.TypeOf(api.MarketBalance{}), nil).(api.MarketBalance),
|
||||
})
|
||||
@@ -188,6 +196,7 @@ func init() {
|
||||
addExample(&si)
|
||||
addExample(retrievalmarket.DealID(5))
|
||||
addExample(abi.ActorID(1000))
|
||||
addExample(map[string]cid.Cid{})
|
||||
addExample(map[string][]api.SealedRef{
|
||||
"98000": {
|
||||
api.SealedRef{
|
||||
|
||||
+90
-31
@@ -14,24 +14,24 @@ import (
|
||||
bitfield "github.com/filecoin-project/go-bitfield"
|
||||
datatransfer "github.com/filecoin-project/go-data-transfer"
|
||||
retrievalmarket "github.com/filecoin-project/go-fil-markets/retrievalmarket"
|
||||
storagemarket "github.com/filecoin-project/go-fil-markets/storagemarket"
|
||||
auth "github.com/filecoin-project/go-jsonrpc/auth"
|
||||
abi "github.com/filecoin-project/go-state-types/abi"
|
||||
big "github.com/filecoin-project/go-state-types/big"
|
||||
miner "github.com/filecoin-project/go-state-types/builtin/v8/miner"
|
||||
paych "github.com/filecoin-project/go-state-types/builtin/v8/paych"
|
||||
crypto "github.com/filecoin-project/go-state-types/crypto"
|
||||
dline "github.com/filecoin-project/go-state-types/dline"
|
||||
network "github.com/filecoin-project/go-state-types/network"
|
||||
api "github.com/filecoin-project/lotus/api"
|
||||
apitypes "github.com/filecoin-project/lotus/api/types"
|
||||
miner "github.com/filecoin-project/lotus/chain/actors/builtin/miner"
|
||||
miner0 "github.com/filecoin-project/lotus/chain/actors/builtin/miner"
|
||||
types "github.com/filecoin-project/lotus/chain/types"
|
||||
alerting "github.com/filecoin-project/lotus/journal/alerting"
|
||||
dtypes "github.com/filecoin-project/lotus/node/modules/dtypes"
|
||||
imports "github.com/filecoin-project/lotus/node/repo/imports"
|
||||
miner0 "github.com/filecoin-project/specs-actors/actors/builtin/miner"
|
||||
paych "github.com/filecoin-project/specs-actors/actors/builtin/paych"
|
||||
gomock "github.com/golang/mock/gomock"
|
||||
uuid "github.com/google/uuid"
|
||||
blocks "github.com/ipfs/go-block-format"
|
||||
cid "github.com/ipfs/go-cid"
|
||||
metrics "github.com/libp2p/go-libp2p-core/metrics"
|
||||
network0 "github.com/libp2p/go-libp2p-core/network"
|
||||
@@ -92,21 +92,6 @@ func (mr *MockFullNodeMockRecorder) AuthVerify(arg0, arg1 interface{}) *gomock.C
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AuthVerify", reflect.TypeOf((*MockFullNode)(nil).AuthVerify), arg0, arg1)
|
||||
}
|
||||
|
||||
// BeaconGetEntry mocks base method.
|
||||
func (m *MockFullNode) BeaconGetEntry(arg0 context.Context, arg1 abi.ChainEpoch) (*types.BeaconEntry, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "BeaconGetEntry", arg0, arg1)
|
||||
ret0, _ := ret[0].(*types.BeaconEntry)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// BeaconGetEntry indicates an expected call of BeaconGetEntry.
|
||||
func (mr *MockFullNodeMockRecorder) BeaconGetEntry(arg0, arg1 interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BeaconGetEntry", reflect.TypeOf((*MockFullNode)(nil).BeaconGetEntry), arg0, arg1)
|
||||
}
|
||||
|
||||
// ChainBlockstoreInfo mocks base method.
|
||||
func (m *MockFullNode) ChainBlockstoreInfo(arg0 context.Context) (map[string]interface{}, error) {
|
||||
m.ctrl.T.Helper()
|
||||
@@ -390,6 +375,20 @@ func (mr *MockFullNodeMockRecorder) ChainNotify(arg0 interface{}) *gomock.Call {
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ChainNotify", reflect.TypeOf((*MockFullNode)(nil).ChainNotify), arg0)
|
||||
}
|
||||
|
||||
// ChainPutObj mocks base method.
|
||||
func (m *MockFullNode) ChainPutObj(arg0 context.Context, arg1 blocks.Block) error {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "ChainPutObj", arg0, arg1)
|
||||
ret0, _ := ret[0].(error)
|
||||
return ret0
|
||||
}
|
||||
|
||||
// ChainPutObj indicates an expected call of ChainPutObj.
|
||||
func (mr *MockFullNodeMockRecorder) ChainPutObj(arg0, arg1 interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ChainPutObj", reflect.TypeOf((*MockFullNode)(nil).ChainPutObj), arg0, arg1)
|
||||
}
|
||||
|
||||
// ChainReadObj mocks base method.
|
||||
func (m *MockFullNode) ChainReadObj(arg0 context.Context, arg1 cid.Cid) ([]byte, error) {
|
||||
m.ctrl.T.Helper()
|
||||
@@ -746,10 +745,10 @@ func (mr *MockFullNodeMockRecorder) ClientMinerQueryOffer(arg0, arg1, arg2, arg3
|
||||
}
|
||||
|
||||
// ClientQueryAsk mocks base method.
|
||||
func (m *MockFullNode) ClientQueryAsk(arg0 context.Context, arg1 peer.ID, arg2 address.Address) (*storagemarket.StorageAsk, error) {
|
||||
func (m *MockFullNode) ClientQueryAsk(arg0 context.Context, arg1 peer.ID, arg2 address.Address) (*api.StorageAsk, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "ClientQueryAsk", arg0, arg1, arg2)
|
||||
ret0, _ := ret[0].(*storagemarket.StorageAsk)
|
||||
ret0, _ := ret[0].(*api.StorageAsk)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
@@ -2272,6 +2271,21 @@ func (mr *MockFullNodeMockRecorder) StateAccountKey(arg0, arg1, arg2 interface{}
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateAccountKey", reflect.TypeOf((*MockFullNode)(nil).StateAccountKey), arg0, arg1, arg2)
|
||||
}
|
||||
|
||||
// StateActorCodeCIDs mocks base method.
|
||||
func (m *MockFullNode) StateActorCodeCIDs(arg0 context.Context, arg1 network.Version) (map[string]cid.Cid, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "StateActorCodeCIDs", arg0, arg1)
|
||||
ret0, _ := ret[0].(map[string]cid.Cid)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// StateActorCodeCIDs indicates an expected call of StateActorCodeCIDs.
|
||||
func (mr *MockFullNodeMockRecorder) StateActorCodeCIDs(arg0, arg1 interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateActorCodeCIDs", reflect.TypeOf((*MockFullNode)(nil).StateActorCodeCIDs), arg0, arg1)
|
||||
}
|
||||
|
||||
// StateAllMinerFaults mocks base method.
|
||||
func (m *MockFullNode) StateAllMinerFaults(arg0 context.Context, arg1 abi.ChainEpoch, arg2 types.TipSetKey) ([]*api.Fault, error) {
|
||||
m.ctrl.T.Helper()
|
||||
@@ -2407,6 +2421,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)
|
||||
}
|
||||
|
||||
// StateGetBeaconEntry mocks base method.
|
||||
func (m *MockFullNode) StateGetBeaconEntry(arg0 context.Context, arg1 abi.ChainEpoch) (*types.BeaconEntry, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "StateGetBeaconEntry", arg0, arg1)
|
||||
ret0, _ := ret[0].(*types.BeaconEntry)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// StateGetBeaconEntry indicates an expected call of StateGetBeaconEntry.
|
||||
func (mr *MockFullNodeMockRecorder) StateGetBeaconEntry(arg0, arg1 interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateGetBeaconEntry", reflect.TypeOf((*MockFullNode)(nil).StateGetBeaconEntry), arg0, arg1)
|
||||
}
|
||||
|
||||
// StateGetNetworkParams mocks base method.
|
||||
func (m *MockFullNode) StateGetNetworkParams(arg0 context.Context) (*api.NetworkParams, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "StateGetNetworkParams", arg0)
|
||||
ret0, _ := ret[0].(*api.NetworkParams)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// StateGetNetworkParams indicates an expected call of StateGetNetworkParams.
|
||||
func (mr *MockFullNodeMockRecorder) StateGetNetworkParams(arg0 interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateGetNetworkParams", reflect.TypeOf((*MockFullNode)(nil).StateGetNetworkParams), arg0)
|
||||
}
|
||||
|
||||
// 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()
|
||||
@@ -2497,6 +2541,21 @@ func (mr *MockFullNodeMockRecorder) StateLookupID(arg0, arg1, arg2 interface{})
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateLookupID", reflect.TypeOf((*MockFullNode)(nil).StateLookupID), arg0, arg1, arg2)
|
||||
}
|
||||
|
||||
// StateLookupRobustAddress mocks base method.
|
||||
func (m *MockFullNode) StateLookupRobustAddress(arg0 context.Context, arg1 address.Address, arg2 types.TipSetKey) (address.Address, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "StateLookupRobustAddress", arg0, arg1, arg2)
|
||||
ret0, _ := ret[0].(address.Address)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// StateLookupRobustAddress indicates an expected call of StateLookupRobustAddress.
|
||||
func (mr *MockFullNodeMockRecorder) StateLookupRobustAddress(arg0, arg1, arg2 interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateLookupRobustAddress", reflect.TypeOf((*MockFullNode)(nil).StateLookupRobustAddress), arg0, arg1, arg2)
|
||||
}
|
||||
|
||||
// StateMarketBalance mocks base method.
|
||||
func (m *MockFullNode) StateMarketBalance(arg0 context.Context, arg1 address.Address, arg2 types.TipSetKey) (api.MarketBalance, error) {
|
||||
m.ctrl.T.Helper()
|
||||
@@ -2513,10 +2572,10 @@ func (mr *MockFullNodeMockRecorder) StateMarketBalance(arg0, arg1, arg2 interfac
|
||||
}
|
||||
|
||||
// StateMarketDeals mocks base method.
|
||||
func (m *MockFullNode) StateMarketDeals(arg0 context.Context, arg1 types.TipSetKey) (map[string]api.MarketDeal, error) {
|
||||
func (m *MockFullNode) StateMarketDeals(arg0 context.Context, arg1 types.TipSetKey) (map[string]*api.MarketDeal, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "StateMarketDeals", arg0, arg1)
|
||||
ret0, _ := ret[0].(map[string]api.MarketDeal)
|
||||
ret0, _ := ret[0].(map[string]*api.MarketDeal)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
@@ -2618,10 +2677,10 @@ func (mr *MockFullNodeMockRecorder) StateMinerFaults(arg0, arg1, arg2 interface{
|
||||
}
|
||||
|
||||
// StateMinerInfo mocks base method.
|
||||
func (m *MockFullNode) StateMinerInfo(arg0 context.Context, arg1 address.Address, arg2 types.TipSetKey) (miner.MinerInfo, error) {
|
||||
func (m *MockFullNode) StateMinerInfo(arg0 context.Context, arg1 address.Address, arg2 types.TipSetKey) (api.MinerInfo, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "StateMinerInfo", arg0, arg1, arg2)
|
||||
ret0, _ := ret[0].(miner.MinerInfo)
|
||||
ret0, _ := ret[0].(api.MinerInfo)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
@@ -2633,7 +2692,7 @@ func (mr *MockFullNodeMockRecorder) StateMinerInfo(arg0, arg1, arg2 interface{})
|
||||
}
|
||||
|
||||
// StateMinerInitialPledgeCollateral mocks base method.
|
||||
func (m *MockFullNode) StateMinerInitialPledgeCollateral(arg0 context.Context, arg1 address.Address, arg2 miner0.SectorPreCommitInfo, arg3 types.TipSetKey) (big.Int, error) {
|
||||
func (m *MockFullNode) StateMinerInitialPledgeCollateral(arg0 context.Context, arg1 address.Address, arg2 miner.SectorPreCommitInfo, arg3 types.TipSetKey) (big.Int, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "StateMinerInitialPledgeCollateral", arg0, arg1, arg2, arg3)
|
||||
ret0, _ := ret[0].(big.Int)
|
||||
@@ -2678,7 +2737,7 @@ func (mr *MockFullNodeMockRecorder) StateMinerPower(arg0, arg1, arg2 interface{}
|
||||
}
|
||||
|
||||
// StateMinerPreCommitDepositForPower mocks base method.
|
||||
func (m *MockFullNode) StateMinerPreCommitDepositForPower(arg0 context.Context, arg1 address.Address, arg2 miner0.SectorPreCommitInfo, arg3 types.TipSetKey) (big.Int, error) {
|
||||
func (m *MockFullNode) StateMinerPreCommitDepositForPower(arg0 context.Context, arg1 address.Address, arg2 miner.SectorPreCommitInfo, arg3 types.TipSetKey) (big.Int, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "StateMinerPreCommitDepositForPower", arg0, arg1, arg2, arg3)
|
||||
ret0, _ := ret[0].(big.Int)
|
||||
@@ -2843,10 +2902,10 @@ func (mr *MockFullNodeMockRecorder) StateSearchMsg(arg0, arg1, arg2, arg3, arg4
|
||||
}
|
||||
|
||||
// StateSectorExpiration mocks base method.
|
||||
func (m *MockFullNode) StateSectorExpiration(arg0 context.Context, arg1 address.Address, arg2 abi.SectorNumber, arg3 types.TipSetKey) (*miner.SectorExpiration, error) {
|
||||
func (m *MockFullNode) StateSectorExpiration(arg0 context.Context, arg1 address.Address, arg2 abi.SectorNumber, arg3 types.TipSetKey) (*miner0.SectorExpiration, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "StateSectorExpiration", arg0, arg1, arg2, arg3)
|
||||
ret0, _ := ret[0].(*miner.SectorExpiration)
|
||||
ret0, _ := ret[0].(*miner0.SectorExpiration)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
@@ -2873,10 +2932,10 @@ func (mr *MockFullNodeMockRecorder) StateSectorGetInfo(arg0, arg1, arg2, arg3 in
|
||||
}
|
||||
|
||||
// StateSectorPartition mocks base method.
|
||||
func (m *MockFullNode) StateSectorPartition(arg0 context.Context, arg1 address.Address, arg2 abi.SectorNumber, arg3 types.TipSetKey) (*miner.SectorLocation, error) {
|
||||
func (m *MockFullNode) StateSectorPartition(arg0 context.Context, arg1 address.Address, arg2 abi.SectorNumber, arg3 types.TipSetKey) (*miner0.SectorLocation, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "StateSectorPartition", arg0, arg1, arg2, arg3)
|
||||
ret0, _ := ret[0].(*miner.SectorLocation)
|
||||
ret0, _ := ret[0].(*miner0.SectorLocation)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
+182
-50
@@ -15,13 +15,15 @@ import (
|
||||
"github.com/filecoin-project/go-fil-markets/storagemarket"
|
||||
"github.com/filecoin-project/go-jsonrpc/auth"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
"github.com/filecoin-project/go-state-types/builtin/v8/miner"
|
||||
"github.com/filecoin-project/go-state-types/builtin/v8/paych"
|
||||
"github.com/filecoin-project/go-state-types/crypto"
|
||||
"github.com/filecoin-project/go-state-types/dline"
|
||||
abinetwork "github.com/filecoin-project/go-state-types/network"
|
||||
"github.com/filecoin-project/go-state-types/proof"
|
||||
apitypes "github.com/filecoin-project/lotus/api/types"
|
||||
"github.com/filecoin-project/lotus/chain/actors/builtin"
|
||||
"github.com/filecoin-project/lotus/chain/actors/builtin/miner"
|
||||
"github.com/filecoin-project/lotus/chain/actors/builtin/paych"
|
||||
lminer "github.com/filecoin-project/lotus/chain/actors/builtin/miner"
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
"github.com/filecoin-project/lotus/extern/sector-storage/fsutil"
|
||||
"github.com/filecoin-project/lotus/extern/sector-storage/sealtasks"
|
||||
@@ -30,9 +32,9 @@ import (
|
||||
"github.com/filecoin-project/lotus/journal/alerting"
|
||||
"github.com/filecoin-project/lotus/node/modules/dtypes"
|
||||
"github.com/filecoin-project/lotus/node/repo/imports"
|
||||
"github.com/filecoin-project/specs-actors/v5/actors/runtime/proof"
|
||||
"github.com/filecoin-project/specs-storage/storage"
|
||||
"github.com/google/uuid"
|
||||
blocks "github.com/ipfs/go-block-format"
|
||||
"github.com/ipfs/go-cid"
|
||||
metrics "github.com/libp2p/go-libp2p-core/metrics"
|
||||
"github.com/libp2p/go-libp2p-core/network"
|
||||
@@ -47,6 +49,8 @@ type ChainIOStruct struct {
|
||||
Internal struct {
|
||||
ChainHasObj func(p0 context.Context, p1 cid.Cid) (bool, error) ``
|
||||
|
||||
ChainPutObj func(p0 context.Context, p1 blocks.Block) error ``
|
||||
|
||||
ChainReadObj func(p0 context.Context, p1 cid.Cid) ([]byte, error) ``
|
||||
}
|
||||
}
|
||||
@@ -102,8 +106,6 @@ type FullNodeStruct struct {
|
||||
NetStruct
|
||||
|
||||
Internal struct {
|
||||
BeaconGetEntry func(p0 context.Context, p1 abi.ChainEpoch) (*types.BeaconEntry, error) `perm:"read"`
|
||||
|
||||
ChainBlockstoreInfo func(p0 context.Context) (map[string]interface{}, error) `perm:"read"`
|
||||
|
||||
ChainCheckBlockstore func(p0 context.Context) error `perm:"admin"`
|
||||
@@ -142,6 +144,8 @@ type FullNodeStruct struct {
|
||||
|
||||
ChainNotify func(p0 context.Context) (<-chan []*HeadChange, error) `perm:"read"`
|
||||
|
||||
ChainPutObj func(p0 context.Context, p1 blocks.Block) error `perm:"admin"`
|
||||
|
||||
ChainReadObj func(p0 context.Context, p1 cid.Cid) ([]byte, error) `perm:"read"`
|
||||
|
||||
ChainSetHead func(p0 context.Context, p1 types.TipSetKey) error `perm:"admin"`
|
||||
@@ -190,7 +194,7 @@ type FullNodeStruct struct {
|
||||
|
||||
ClientMinerQueryOffer func(p0 context.Context, p1 address.Address, p2 cid.Cid, p3 *cid.Cid) (QueryOffer, error) `perm:"read"`
|
||||
|
||||
ClientQueryAsk func(p0 context.Context, p1 peer.ID, p2 address.Address) (*storagemarket.StorageAsk, error) `perm:"read"`
|
||||
ClientQueryAsk func(p0 context.Context, p1 peer.ID, p2 address.Address) (*StorageAsk, error) `perm:"read"`
|
||||
|
||||
ClientRemoveImport func(p0 context.Context, p1 imports.ID) error `perm:"admin"`
|
||||
|
||||
@@ -334,6 +338,8 @@ type FullNodeStruct struct {
|
||||
|
||||
StateAccountKey func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (address.Address, error) `perm:"read"`
|
||||
|
||||
StateActorCodeCIDs func(p0 context.Context, p1 abinetwork.Version) (map[string]cid.Cid, error) `perm:"read"`
|
||||
|
||||
StateAllMinerFaults func(p0 context.Context, p1 abi.ChainEpoch, p2 types.TipSetKey) ([]*Fault, error) `perm:"read"`
|
||||
|
||||
StateCall func(p0 context.Context, p1 *types.Message, p2 types.TipSetKey) (*InvocResult, error) `perm:"read"`
|
||||
@@ -352,6 +358,10 @@ type FullNodeStruct struct {
|
||||
|
||||
StateGetActor func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*types.Actor, error) `perm:"read"`
|
||||
|
||||
StateGetBeaconEntry func(p0 context.Context, p1 abi.ChainEpoch) (*types.BeaconEntry, error) `perm:"read"`
|
||||
|
||||
StateGetNetworkParams func(p0 context.Context) (*NetworkParams, 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"`
|
||||
@@ -364,9 +374,11 @@ type FullNodeStruct struct {
|
||||
|
||||
StateLookupID func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (address.Address, error) `perm:"read"`
|
||||
|
||||
StateLookupRobustAddress func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (address.Address, error) `perm:"read"`
|
||||
|
||||
StateMarketBalance func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (MarketBalance, error) `perm:"read"`
|
||||
|
||||
StateMarketDeals func(p0 context.Context, p1 types.TipSetKey) (map[string]MarketDeal, error) `perm:"read"`
|
||||
StateMarketDeals func(p0 context.Context, p1 types.TipSetKey) (map[string]*MarketDeal, error) `perm:"read"`
|
||||
|
||||
StateMarketParticipants func(p0 context.Context, p1 types.TipSetKey) (map[string]MarketBalance, error) `perm:"read"`
|
||||
|
||||
@@ -380,7 +392,7 @@ type FullNodeStruct struct {
|
||||
|
||||
StateMinerFaults func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (bitfield.BitField, error) `perm:"read"`
|
||||
|
||||
StateMinerInfo func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (miner.MinerInfo, error) `perm:"read"`
|
||||
StateMinerInfo func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (MinerInfo, error) `perm:"read"`
|
||||
|
||||
StateMinerInitialPledgeCollateral func(p0 context.Context, p1 address.Address, p2 miner.SectorPreCommitInfo, p3 types.TipSetKey) (types.BigInt, error) `perm:"read"`
|
||||
|
||||
@@ -410,11 +422,11 @@ type FullNodeStruct struct {
|
||||
|
||||
StateSearchMsg func(p0 context.Context, p1 types.TipSetKey, p2 cid.Cid, p3 abi.ChainEpoch, p4 bool) (*MsgLookup, error) `perm:"read"`
|
||||
|
||||
StateSectorExpiration func(p0 context.Context, p1 address.Address, p2 abi.SectorNumber, p3 types.TipSetKey) (*miner.SectorExpiration, error) `perm:"read"`
|
||||
StateSectorExpiration func(p0 context.Context, p1 address.Address, p2 abi.SectorNumber, p3 types.TipSetKey) (*lminer.SectorExpiration, error) `perm:"read"`
|
||||
|
||||
StateSectorGetInfo func(p0 context.Context, p1 address.Address, p2 abi.SectorNumber, p3 types.TipSetKey) (*miner.SectorOnChainInfo, error) `perm:"read"`
|
||||
|
||||
StateSectorPartition func(p0 context.Context, p1 address.Address, p2 abi.SectorNumber, p3 types.TipSetKey) (*miner.SectorLocation, error) `perm:"read"`
|
||||
StateSectorPartition func(p0 context.Context, p1 address.Address, p2 abi.SectorNumber, p3 types.TipSetKey) (*lminer.SectorLocation, error) `perm:"read"`
|
||||
|
||||
StateSectorPreCommitInfo func(p0 context.Context, p1 address.Address, p2 abi.SectorNumber, p3 types.TipSetKey) (miner.SectorPreCommitOnChainInfo, error) `perm:"read"`
|
||||
|
||||
@@ -506,6 +518,8 @@ type GatewayStruct struct {
|
||||
|
||||
ChainNotify func(p0 context.Context) (<-chan []*HeadChange, error) ``
|
||||
|
||||
ChainPutObj func(p0 context.Context, p1 blocks.Block) error ``
|
||||
|
||||
ChainReadObj func(p0 context.Context, p1 cid.Cid) ([]byte, error) ``
|
||||
|
||||
GasEstimateMessageGas func(p0 context.Context, p1 *types.Message, p2 *MessageSendSpec, p3 types.TipSetKey) (*types.Message, error) ``
|
||||
@@ -534,7 +548,7 @@ type GatewayStruct struct {
|
||||
|
||||
StateMarketStorageDeal func(p0 context.Context, p1 abi.DealID, p2 types.TipSetKey) (*MarketDeal, error) ``
|
||||
|
||||
StateMinerInfo func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (miner.MinerInfo, error) ``
|
||||
StateMinerInfo func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (MinerInfo, error) ``
|
||||
|
||||
StateMinerPower func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*MinerPower, error) ``
|
||||
|
||||
@@ -639,8 +653,12 @@ type StorageMinerStruct struct {
|
||||
|
||||
CheckProvable func(p0 context.Context, p1 abi.RegisteredPoStProof, p2 []storage.SectorRef, p3 bool) (map[abi.SectorNumber]string, error) `perm:"admin"`
|
||||
|
||||
ComputeDataCid func(p0 context.Context, p1 abi.UnpaddedPieceSize, p2 storage.Data) (abi.PieceInfo, error) `perm:"admin"`
|
||||
|
||||
ComputeProof func(p0 context.Context, p1 []builtin.ExtendedSectorInfo, p2 abi.PoStRandomness, p3 abi.ChainEpoch, p4 abinetwork.Version) ([]builtin.PoStProof, error) `perm:"read"`
|
||||
|
||||
ComputeWindowPoSt func(p0 context.Context, p1 uint64, p2 types.TipSetKey) ([]miner.SubmitWindowedPoStParams, error) `perm:"admin"`
|
||||
|
||||
CreateBackup func(p0 context.Context, p1 string) error `perm:"admin"`
|
||||
|
||||
DagstoreGC func(p0 context.Context) ([]DagstoreShardResult, error) `perm:"admin"`
|
||||
@@ -669,7 +687,7 @@ type StorageMinerStruct struct {
|
||||
|
||||
DealsImportData func(p0 context.Context, p1 cid.Cid, p2 string) error `perm:"admin"`
|
||||
|
||||
DealsList func(p0 context.Context) ([]MarketDeal, error) `perm:"admin"`
|
||||
DealsList func(p0 context.Context) ([]*MarketDeal, error) `perm:"admin"`
|
||||
|
||||
DealsPieceCidBlocklist func(p0 context.Context) ([]cid.Cid, error) `perm:"admin"`
|
||||
|
||||
@@ -707,7 +725,7 @@ type StorageMinerStruct struct {
|
||||
|
||||
MarketListDataTransfers func(p0 context.Context) ([]DataTransferChannel, error) `perm:"write"`
|
||||
|
||||
MarketListDeals func(p0 context.Context) ([]MarketDeal, error) `perm:"read"`
|
||||
MarketListDeals func(p0 context.Context) ([]*MarketDeal, error) `perm:"read"`
|
||||
|
||||
MarketListIncompleteDeals func(p0 context.Context) ([]storagemarket.MinerDeal, error) `perm:"read"`
|
||||
|
||||
@@ -739,6 +757,8 @@ type StorageMinerStruct struct {
|
||||
|
||||
ReturnAddPiece func(p0 context.Context, p1 storiface.CallID, p2 abi.PieceInfo, p3 *storiface.CallError) error `perm:"admin"`
|
||||
|
||||
ReturnDataCid func(p0 context.Context, p1 storiface.CallID, p2 abi.PieceInfo, p3 *storiface.CallError) error `perm:"admin"`
|
||||
|
||||
ReturnFetch func(p0 context.Context, p1 storiface.CallID, p2 *storiface.CallError) error `perm:"admin"`
|
||||
|
||||
ReturnFinalizeReplicaUpdate func(p0 context.Context, p1 storiface.CallID, p2 *storiface.CallError) error `perm:"admin"`
|
||||
@@ -890,6 +910,8 @@ type WorkerStruct struct {
|
||||
Internal struct {
|
||||
AddPiece func(p0 context.Context, p1 storage.SectorRef, p2 []abi.UnpaddedPieceSize, p3 abi.UnpaddedPieceSize, p4 storage.Data) (storiface.CallID, error) `perm:"admin"`
|
||||
|
||||
DataCid func(p0 context.Context, p1 abi.UnpaddedPieceSize, p2 storage.Data) (storiface.CallID, error) `perm:"admin"`
|
||||
|
||||
Enabled func(p0 context.Context) (bool, error) `perm:"admin"`
|
||||
|
||||
Fetch func(p0 context.Context, p1 storage.SectorRef, p2 storiface.SectorFileType, p3 storiface.PathType, p4 storiface.AcquireMode) (storiface.CallID, error) `perm:"admin"`
|
||||
@@ -964,6 +986,17 @@ func (s *ChainIOStub) ChainHasObj(p0 context.Context, p1 cid.Cid) (bool, error)
|
||||
return false, ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *ChainIOStruct) ChainPutObj(p0 context.Context, p1 blocks.Block) error {
|
||||
if s.Internal.ChainPutObj == nil {
|
||||
return ErrNotSupported
|
||||
}
|
||||
return s.Internal.ChainPutObj(p0, p1)
|
||||
}
|
||||
|
||||
func (s *ChainIOStub) ChainPutObj(p0 context.Context, p1 blocks.Block) error {
|
||||
return ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *ChainIOStruct) ChainReadObj(p0 context.Context, p1 cid.Cid) ([]byte, error) {
|
||||
if s.Internal.ChainReadObj == nil {
|
||||
return *new([]byte), ErrNotSupported
|
||||
@@ -1085,17 +1118,6 @@ func (s *CommonStub) Version(p0 context.Context) (APIVersion, error) {
|
||||
return *new(APIVersion), ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *FullNodeStruct) BeaconGetEntry(p0 context.Context, p1 abi.ChainEpoch) (*types.BeaconEntry, error) {
|
||||
if s.Internal.BeaconGetEntry == nil {
|
||||
return nil, ErrNotSupported
|
||||
}
|
||||
return s.Internal.BeaconGetEntry(p0, p1)
|
||||
}
|
||||
|
||||
func (s *FullNodeStub) BeaconGetEntry(p0 context.Context, p1 abi.ChainEpoch) (*types.BeaconEntry, error) {
|
||||
return nil, ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *FullNodeStruct) ChainBlockstoreInfo(p0 context.Context) (map[string]interface{}, error) {
|
||||
if s.Internal.ChainBlockstoreInfo == nil {
|
||||
return *new(map[string]interface{}), ErrNotSupported
|
||||
@@ -1305,6 +1327,17 @@ func (s *FullNodeStub) ChainNotify(p0 context.Context) (<-chan []*HeadChange, er
|
||||
return nil, ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *FullNodeStruct) ChainPutObj(p0 context.Context, p1 blocks.Block) error {
|
||||
if s.Internal.ChainPutObj == nil {
|
||||
return ErrNotSupported
|
||||
}
|
||||
return s.Internal.ChainPutObj(p0, p1)
|
||||
}
|
||||
|
||||
func (s *FullNodeStub) ChainPutObj(p0 context.Context, p1 blocks.Block) error {
|
||||
return ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *FullNodeStruct) ChainReadObj(p0 context.Context, p1 cid.Cid) ([]byte, error) {
|
||||
if s.Internal.ChainReadObj == nil {
|
||||
return *new([]byte), ErrNotSupported
|
||||
@@ -1569,14 +1602,14 @@ func (s *FullNodeStub) ClientMinerQueryOffer(p0 context.Context, p1 address.Addr
|
||||
return *new(QueryOffer), ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *FullNodeStruct) ClientQueryAsk(p0 context.Context, p1 peer.ID, p2 address.Address) (*storagemarket.StorageAsk, error) {
|
||||
func (s *FullNodeStruct) ClientQueryAsk(p0 context.Context, p1 peer.ID, p2 address.Address) (*StorageAsk, error) {
|
||||
if s.Internal.ClientQueryAsk == nil {
|
||||
return nil, ErrNotSupported
|
||||
}
|
||||
return s.Internal.ClientQueryAsk(p0, p1, p2)
|
||||
}
|
||||
|
||||
func (s *FullNodeStub) ClientQueryAsk(p0 context.Context, p1 peer.ID, p2 address.Address) (*storagemarket.StorageAsk, error) {
|
||||
func (s *FullNodeStub) ClientQueryAsk(p0 context.Context, p1 peer.ID, p2 address.Address) (*StorageAsk, error) {
|
||||
return nil, ErrNotSupported
|
||||
}
|
||||
|
||||
@@ -2361,6 +2394,17 @@ func (s *FullNodeStub) StateAccountKey(p0 context.Context, p1 address.Address, p
|
||||
return *new(address.Address), ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *FullNodeStruct) StateActorCodeCIDs(p0 context.Context, p1 abinetwork.Version) (map[string]cid.Cid, error) {
|
||||
if s.Internal.StateActorCodeCIDs == nil {
|
||||
return *new(map[string]cid.Cid), ErrNotSupported
|
||||
}
|
||||
return s.Internal.StateActorCodeCIDs(p0, p1)
|
||||
}
|
||||
|
||||
func (s *FullNodeStub) StateActorCodeCIDs(p0 context.Context, p1 abinetwork.Version) (map[string]cid.Cid, error) {
|
||||
return *new(map[string]cid.Cid), ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *FullNodeStruct) StateAllMinerFaults(p0 context.Context, p1 abi.ChainEpoch, p2 types.TipSetKey) ([]*Fault, error) {
|
||||
if s.Internal.StateAllMinerFaults == nil {
|
||||
return *new([]*Fault), ErrNotSupported
|
||||
@@ -2460,6 +2504,28 @@ func (s *FullNodeStub) StateGetActor(p0 context.Context, p1 address.Address, p2
|
||||
return nil, ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *FullNodeStruct) StateGetBeaconEntry(p0 context.Context, p1 abi.ChainEpoch) (*types.BeaconEntry, error) {
|
||||
if s.Internal.StateGetBeaconEntry == nil {
|
||||
return nil, ErrNotSupported
|
||||
}
|
||||
return s.Internal.StateGetBeaconEntry(p0, p1)
|
||||
}
|
||||
|
||||
func (s *FullNodeStub) StateGetBeaconEntry(p0 context.Context, p1 abi.ChainEpoch) (*types.BeaconEntry, error) {
|
||||
return nil, ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *FullNodeStruct) StateGetNetworkParams(p0 context.Context) (*NetworkParams, error) {
|
||||
if s.Internal.StateGetNetworkParams == nil {
|
||||
return nil, ErrNotSupported
|
||||
}
|
||||
return s.Internal.StateGetNetworkParams(p0)
|
||||
}
|
||||
|
||||
func (s *FullNodeStub) StateGetNetworkParams(p0 context.Context) (*NetworkParams, error) {
|
||||
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
|
||||
@@ -2526,6 +2592,17 @@ func (s *FullNodeStub) StateLookupID(p0 context.Context, p1 address.Address, p2
|
||||
return *new(address.Address), ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *FullNodeStruct) StateLookupRobustAddress(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (address.Address, error) {
|
||||
if s.Internal.StateLookupRobustAddress == nil {
|
||||
return *new(address.Address), ErrNotSupported
|
||||
}
|
||||
return s.Internal.StateLookupRobustAddress(p0, p1, p2)
|
||||
}
|
||||
|
||||
func (s *FullNodeStub) StateLookupRobustAddress(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (address.Address, error) {
|
||||
return *new(address.Address), ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *FullNodeStruct) StateMarketBalance(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (MarketBalance, error) {
|
||||
if s.Internal.StateMarketBalance == nil {
|
||||
return *new(MarketBalance), ErrNotSupported
|
||||
@@ -2537,15 +2614,15 @@ func (s *FullNodeStub) StateMarketBalance(p0 context.Context, p1 address.Address
|
||||
return *new(MarketBalance), ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *FullNodeStruct) StateMarketDeals(p0 context.Context, p1 types.TipSetKey) (map[string]MarketDeal, error) {
|
||||
func (s *FullNodeStruct) StateMarketDeals(p0 context.Context, p1 types.TipSetKey) (map[string]*MarketDeal, error) {
|
||||
if s.Internal.StateMarketDeals == nil {
|
||||
return *new(map[string]MarketDeal), ErrNotSupported
|
||||
return *new(map[string]*MarketDeal), ErrNotSupported
|
||||
}
|
||||
return s.Internal.StateMarketDeals(p0, p1)
|
||||
}
|
||||
|
||||
func (s *FullNodeStub) StateMarketDeals(p0 context.Context, p1 types.TipSetKey) (map[string]MarketDeal, error) {
|
||||
return *new(map[string]MarketDeal), ErrNotSupported
|
||||
func (s *FullNodeStub) StateMarketDeals(p0 context.Context, p1 types.TipSetKey) (map[string]*MarketDeal, error) {
|
||||
return *new(map[string]*MarketDeal), ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *FullNodeStruct) StateMarketParticipants(p0 context.Context, p1 types.TipSetKey) (map[string]MarketBalance, error) {
|
||||
@@ -2614,15 +2691,15 @@ func (s *FullNodeStub) StateMinerFaults(p0 context.Context, p1 address.Address,
|
||||
return *new(bitfield.BitField), ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *FullNodeStruct) StateMinerInfo(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (miner.MinerInfo, error) {
|
||||
func (s *FullNodeStruct) StateMinerInfo(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (MinerInfo, error) {
|
||||
if s.Internal.StateMinerInfo == nil {
|
||||
return *new(miner.MinerInfo), ErrNotSupported
|
||||
return *new(MinerInfo), ErrNotSupported
|
||||
}
|
||||
return s.Internal.StateMinerInfo(p0, p1, p2)
|
||||
}
|
||||
|
||||
func (s *FullNodeStub) StateMinerInfo(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (miner.MinerInfo, error) {
|
||||
return *new(miner.MinerInfo), ErrNotSupported
|
||||
func (s *FullNodeStub) StateMinerInfo(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (MinerInfo, error) {
|
||||
return *new(MinerInfo), ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *FullNodeStruct) StateMinerInitialPledgeCollateral(p0 context.Context, p1 address.Address, p2 miner.SectorPreCommitInfo, p3 types.TipSetKey) (types.BigInt, error) {
|
||||
@@ -2779,14 +2856,14 @@ func (s *FullNodeStub) StateSearchMsg(p0 context.Context, p1 types.TipSetKey, p2
|
||||
return nil, ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *FullNodeStruct) StateSectorExpiration(p0 context.Context, p1 address.Address, p2 abi.SectorNumber, p3 types.TipSetKey) (*miner.SectorExpiration, error) {
|
||||
func (s *FullNodeStruct) StateSectorExpiration(p0 context.Context, p1 address.Address, p2 abi.SectorNumber, p3 types.TipSetKey) (*lminer.SectorExpiration, error) {
|
||||
if s.Internal.StateSectorExpiration == nil {
|
||||
return nil, ErrNotSupported
|
||||
}
|
||||
return s.Internal.StateSectorExpiration(p0, p1, p2, p3)
|
||||
}
|
||||
|
||||
func (s *FullNodeStub) StateSectorExpiration(p0 context.Context, p1 address.Address, p2 abi.SectorNumber, p3 types.TipSetKey) (*miner.SectorExpiration, error) {
|
||||
func (s *FullNodeStub) StateSectorExpiration(p0 context.Context, p1 address.Address, p2 abi.SectorNumber, p3 types.TipSetKey) (*lminer.SectorExpiration, error) {
|
||||
return nil, ErrNotSupported
|
||||
}
|
||||
|
||||
@@ -2801,14 +2878,14 @@ func (s *FullNodeStub) StateSectorGetInfo(p0 context.Context, p1 address.Address
|
||||
return nil, ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *FullNodeStruct) StateSectorPartition(p0 context.Context, p1 address.Address, p2 abi.SectorNumber, p3 types.TipSetKey) (*miner.SectorLocation, error) {
|
||||
func (s *FullNodeStruct) StateSectorPartition(p0 context.Context, p1 address.Address, p2 abi.SectorNumber, p3 types.TipSetKey) (*lminer.SectorLocation, error) {
|
||||
if s.Internal.StateSectorPartition == nil {
|
||||
return nil, ErrNotSupported
|
||||
}
|
||||
return s.Internal.StateSectorPartition(p0, p1, p2, p3)
|
||||
}
|
||||
|
||||
func (s *FullNodeStub) StateSectorPartition(p0 context.Context, p1 address.Address, p2 abi.SectorNumber, p3 types.TipSetKey) (*miner.SectorLocation, error) {
|
||||
func (s *FullNodeStub) StateSectorPartition(p0 context.Context, p1 address.Address, p2 abi.SectorNumber, p3 types.TipSetKey) (*lminer.SectorLocation, error) {
|
||||
return nil, ErrNotSupported
|
||||
}
|
||||
|
||||
@@ -3252,6 +3329,17 @@ func (s *GatewayStub) ChainNotify(p0 context.Context) (<-chan []*HeadChange, err
|
||||
return nil, ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *GatewayStruct) ChainPutObj(p0 context.Context, p1 blocks.Block) error {
|
||||
if s.Internal.ChainPutObj == nil {
|
||||
return ErrNotSupported
|
||||
}
|
||||
return s.Internal.ChainPutObj(p0, p1)
|
||||
}
|
||||
|
||||
func (s *GatewayStub) ChainPutObj(p0 context.Context, p1 blocks.Block) error {
|
||||
return ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *GatewayStruct) ChainReadObj(p0 context.Context, p1 cid.Cid) ([]byte, error) {
|
||||
if s.Internal.ChainReadObj == nil {
|
||||
return *new([]byte), ErrNotSupported
|
||||
@@ -3406,15 +3494,15 @@ func (s *GatewayStub) StateMarketStorageDeal(p0 context.Context, p1 abi.DealID,
|
||||
return nil, ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *GatewayStruct) StateMinerInfo(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (miner.MinerInfo, error) {
|
||||
func (s *GatewayStruct) StateMinerInfo(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (MinerInfo, error) {
|
||||
if s.Internal.StateMinerInfo == nil {
|
||||
return *new(miner.MinerInfo), ErrNotSupported
|
||||
return *new(MinerInfo), ErrNotSupported
|
||||
}
|
||||
return s.Internal.StateMinerInfo(p0, p1, p2)
|
||||
}
|
||||
|
||||
func (s *GatewayStub) StateMinerInfo(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (miner.MinerInfo, error) {
|
||||
return *new(miner.MinerInfo), ErrNotSupported
|
||||
func (s *GatewayStub) StateMinerInfo(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (MinerInfo, error) {
|
||||
return *new(MinerInfo), ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *GatewayStruct) StateMinerPower(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*MinerPower, error) {
|
||||
@@ -3846,6 +3934,17 @@ func (s *StorageMinerStub) CheckProvable(p0 context.Context, p1 abi.RegisteredPo
|
||||
return *new(map[abi.SectorNumber]string), ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *StorageMinerStruct) ComputeDataCid(p0 context.Context, p1 abi.UnpaddedPieceSize, p2 storage.Data) (abi.PieceInfo, error) {
|
||||
if s.Internal.ComputeDataCid == nil {
|
||||
return *new(abi.PieceInfo), ErrNotSupported
|
||||
}
|
||||
return s.Internal.ComputeDataCid(p0, p1, p2)
|
||||
}
|
||||
|
||||
func (s *StorageMinerStub) ComputeDataCid(p0 context.Context, p1 abi.UnpaddedPieceSize, p2 storage.Data) (abi.PieceInfo, error) {
|
||||
return *new(abi.PieceInfo), ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *StorageMinerStruct) ComputeProof(p0 context.Context, p1 []builtin.ExtendedSectorInfo, p2 abi.PoStRandomness, p3 abi.ChainEpoch, p4 abinetwork.Version) ([]builtin.PoStProof, error) {
|
||||
if s.Internal.ComputeProof == nil {
|
||||
return *new([]builtin.PoStProof), ErrNotSupported
|
||||
@@ -3857,6 +3956,17 @@ func (s *StorageMinerStub) ComputeProof(p0 context.Context, p1 []builtin.Extende
|
||||
return *new([]builtin.PoStProof), ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *StorageMinerStruct) ComputeWindowPoSt(p0 context.Context, p1 uint64, p2 types.TipSetKey) ([]miner.SubmitWindowedPoStParams, error) {
|
||||
if s.Internal.ComputeWindowPoSt == nil {
|
||||
return *new([]miner.SubmitWindowedPoStParams), ErrNotSupported
|
||||
}
|
||||
return s.Internal.ComputeWindowPoSt(p0, p1, p2)
|
||||
}
|
||||
|
||||
func (s *StorageMinerStub) ComputeWindowPoSt(p0 context.Context, p1 uint64, p2 types.TipSetKey) ([]miner.SubmitWindowedPoStParams, error) {
|
||||
return *new([]miner.SubmitWindowedPoStParams), ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *StorageMinerStruct) CreateBackup(p0 context.Context, p1 string) error {
|
||||
if s.Internal.CreateBackup == nil {
|
||||
return ErrNotSupported
|
||||
@@ -4011,15 +4121,15 @@ func (s *StorageMinerStub) DealsImportData(p0 context.Context, p1 cid.Cid, p2 st
|
||||
return ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *StorageMinerStruct) DealsList(p0 context.Context) ([]MarketDeal, error) {
|
||||
func (s *StorageMinerStruct) DealsList(p0 context.Context) ([]*MarketDeal, error) {
|
||||
if s.Internal.DealsList == nil {
|
||||
return *new([]MarketDeal), ErrNotSupported
|
||||
return *new([]*MarketDeal), ErrNotSupported
|
||||
}
|
||||
return s.Internal.DealsList(p0)
|
||||
}
|
||||
|
||||
func (s *StorageMinerStub) DealsList(p0 context.Context) ([]MarketDeal, error) {
|
||||
return *new([]MarketDeal), ErrNotSupported
|
||||
func (s *StorageMinerStub) DealsList(p0 context.Context) ([]*MarketDeal, error) {
|
||||
return *new([]*MarketDeal), ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *StorageMinerStruct) DealsPieceCidBlocklist(p0 context.Context) ([]cid.Cid, error) {
|
||||
@@ -4220,15 +4330,15 @@ func (s *StorageMinerStub) MarketListDataTransfers(p0 context.Context) ([]DataTr
|
||||
return *new([]DataTransferChannel), ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *StorageMinerStruct) MarketListDeals(p0 context.Context) ([]MarketDeal, error) {
|
||||
func (s *StorageMinerStruct) MarketListDeals(p0 context.Context) ([]*MarketDeal, error) {
|
||||
if s.Internal.MarketListDeals == nil {
|
||||
return *new([]MarketDeal), ErrNotSupported
|
||||
return *new([]*MarketDeal), ErrNotSupported
|
||||
}
|
||||
return s.Internal.MarketListDeals(p0)
|
||||
}
|
||||
|
||||
func (s *StorageMinerStub) MarketListDeals(p0 context.Context) ([]MarketDeal, error) {
|
||||
return *new([]MarketDeal), ErrNotSupported
|
||||
func (s *StorageMinerStub) MarketListDeals(p0 context.Context) ([]*MarketDeal, error) {
|
||||
return *new([]*MarketDeal), ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *StorageMinerStruct) MarketListIncompleteDeals(p0 context.Context) ([]storagemarket.MinerDeal, error) {
|
||||
@@ -4396,6 +4506,17 @@ func (s *StorageMinerStub) ReturnAddPiece(p0 context.Context, p1 storiface.CallI
|
||||
return ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *StorageMinerStruct) ReturnDataCid(p0 context.Context, p1 storiface.CallID, p2 abi.PieceInfo, p3 *storiface.CallError) error {
|
||||
if s.Internal.ReturnDataCid == nil {
|
||||
return ErrNotSupported
|
||||
}
|
||||
return s.Internal.ReturnDataCid(p0, p1, p2, p3)
|
||||
}
|
||||
|
||||
func (s *StorageMinerStub) ReturnDataCid(p0 context.Context, p1 storiface.CallID, p2 abi.PieceInfo, p3 *storiface.CallError) error {
|
||||
return ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *StorageMinerStruct) ReturnFetch(p0 context.Context, p1 storiface.CallID, p2 *storiface.CallError) error {
|
||||
if s.Internal.ReturnFetch == nil {
|
||||
return ErrNotSupported
|
||||
@@ -5133,6 +5254,17 @@ func (s *WorkerStub) AddPiece(p0 context.Context, p1 storage.SectorRef, p2 []abi
|
||||
return *new(storiface.CallID), ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *WorkerStruct) DataCid(p0 context.Context, p1 abi.UnpaddedPieceSize, p2 storage.Data) (storiface.CallID, error) {
|
||||
if s.Internal.DataCid == nil {
|
||||
return *new(storiface.CallID), ErrNotSupported
|
||||
}
|
||||
return s.Internal.DataCid(p0, p1, p2)
|
||||
}
|
||||
|
||||
func (s *WorkerStub) DataCid(p0 context.Context, p1 abi.UnpaddedPieceSize, p2 storage.Data) (storiface.CallID, error) {
|
||||
return *new(storiface.CallID), ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *WorkerStruct) Enabled(p0 context.Context) (bool, error) {
|
||||
if s.Internal.Enabled == nil {
|
||||
return false, ErrNotSupported
|
||||
|
||||
+49
-2
@@ -5,12 +5,15 @@ import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
|
||||
"github.com/libp2p/go-libp2p-core/network"
|
||||
|
||||
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/lotus/chain/types"
|
||||
"github.com/filecoin-project/lotus/node/modules/dtypes"
|
||||
"github.com/ipfs/go-cid"
|
||||
"github.com/ipfs/go-graphsync"
|
||||
|
||||
@@ -19,8 +22,6 @@ import (
|
||||
ma "github.com/multiformats/go-multiaddr"
|
||||
)
|
||||
|
||||
// TODO: check if this exists anywhere else
|
||||
|
||||
type MultiaddrSlice []ma.Multiaddr
|
||||
|
||||
func (m *MultiaddrSlice) UnmarshalJSON(raw []byte) (err error) {
|
||||
@@ -286,3 +287,49 @@ type ExportRef struct {
|
||||
FromLocalCAR string // if specified, get data from a local CARv2 file.
|
||||
DealID retrievalmarket.DealID
|
||||
}
|
||||
|
||||
type MinerInfo struct {
|
||||
Owner address.Address // Must be an ID-address.
|
||||
Worker address.Address // Must be an ID-address.
|
||||
NewWorker address.Address // Must be an ID-address.
|
||||
ControlAddresses []address.Address // Must be an ID-addresses.
|
||||
WorkerChangeEpoch abi.ChainEpoch
|
||||
PeerId *peer.ID
|
||||
Multiaddrs []abi.Multiaddrs
|
||||
WindowPoStProofType abi.RegisteredPoStProof
|
||||
SectorSize abi.SectorSize
|
||||
WindowPoStPartitionSectors uint64
|
||||
ConsensusFaultElapsed abi.ChainEpoch
|
||||
}
|
||||
|
||||
type NetworkParams struct {
|
||||
NetworkName dtypes.NetworkName
|
||||
BlockDelaySecs uint64
|
||||
ConsensusMinerMinPower abi.StoragePower
|
||||
SupportedProofTypes []abi.RegisteredSealProof
|
||||
PreCommitChallengeDelay abi.ChainEpoch
|
||||
ForkUpgradeParams ForkUpgradeParams
|
||||
}
|
||||
|
||||
type ForkUpgradeParams struct {
|
||||
UpgradeSmokeHeight abi.ChainEpoch
|
||||
UpgradeBreezeHeight abi.ChainEpoch
|
||||
UpgradeIgnitionHeight abi.ChainEpoch
|
||||
UpgradeLiftoffHeight abi.ChainEpoch
|
||||
UpgradeAssemblyHeight abi.ChainEpoch
|
||||
UpgradeRefuelHeight abi.ChainEpoch
|
||||
UpgradeTapeHeight abi.ChainEpoch
|
||||
UpgradeKumquatHeight abi.ChainEpoch
|
||||
UpgradePriceListOopsHeight abi.ChainEpoch
|
||||
BreezeGasTampingDuration abi.ChainEpoch
|
||||
UpgradeCalicoHeight abi.ChainEpoch
|
||||
UpgradePersianHeight abi.ChainEpoch
|
||||
UpgradeOrangeHeight abi.ChainEpoch
|
||||
UpgradeClausHeight abi.ChainEpoch
|
||||
UpgradeTrustHeight abi.ChainEpoch
|
||||
UpgradeNorwegianHeight abi.ChainEpoch
|
||||
UpgradeTurboHeight abi.ChainEpoch
|
||||
UpgradeHyperdriveHeight abi.ChainEpoch
|
||||
UpgradeChocolateHeight abi.ChainEpoch
|
||||
UpgradeOhSnapHeight abi.ChainEpoch
|
||||
}
|
||||
|
||||
+18
-6
@@ -3,6 +3,8 @@ package v0api
|
||||
import (
|
||||
"context"
|
||||
|
||||
abinetwork "github.com/filecoin-project/go-state-types/network"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-bitfield"
|
||||
datatransfer "github.com/filecoin-project/go-data-transfer"
|
||||
@@ -11,14 +13,16 @@ import (
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
"github.com/filecoin-project/go-state-types/crypto"
|
||||
"github.com/filecoin-project/go-state-types/dline"
|
||||
blocks "github.com/ipfs/go-block-format"
|
||||
"github.com/ipfs/go-cid"
|
||||
textselector "github.com/ipld/go-ipld-selector-text-lite"
|
||||
"github.com/libp2p/go-libp2p-core/peer"
|
||||
|
||||
"github.com/filecoin-project/go-state-types/builtin/v8/miner"
|
||||
"github.com/filecoin-project/go-state-types/builtin/v8/paych"
|
||||
"github.com/filecoin-project/lotus/api"
|
||||
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/paych"
|
||||
lminer "github.com/filecoin-project/lotus/chain/actors/builtin/miner"
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
marketevents "github.com/filecoin-project/lotus/markets/loggers"
|
||||
"github.com/filecoin-project/lotus/node/modules/dtypes"
|
||||
@@ -109,6 +113,9 @@ type FullNode interface {
|
||||
// ChainDeleteObj deletes node referenced by the given CID
|
||||
ChainDeleteObj(context.Context, cid.Cid) error //perm:admin
|
||||
|
||||
// ChainPutObj puts and object into the blockstore
|
||||
ChainPutObj(context.Context, blocks.Block) error
|
||||
|
||||
// ChainHasObj checks if a given CID exists in the chain blockstore.
|
||||
ChainHasObj(context.Context, cid.Cid) (bool, error) //perm:read
|
||||
|
||||
@@ -416,7 +423,7 @@ type FullNode interface {
|
||||
// StateMinerPower returns the power of the indicated miner
|
||||
StateMinerPower(context.Context, address.Address, types.TipSetKey) (*api.MinerPower, error) //perm:read
|
||||
// StateMinerInfo returns info about the indicated miner
|
||||
StateMinerInfo(context.Context, address.Address, types.TipSetKey) (miner.MinerInfo, error) //perm:read
|
||||
StateMinerInfo(context.Context, address.Address, types.TipSetKey) (api.MinerInfo, error) //perm:read
|
||||
// StateMinerDeadlines returns all the proving deadlines for the given miner
|
||||
StateMinerDeadlines(context.Context, address.Address, types.TipSetKey) ([]api.Deadline, error) //perm:read
|
||||
// StateMinerPartitions returns all partitions in the specified deadline
|
||||
@@ -442,9 +449,9 @@ type FullNode interface {
|
||||
// expiration epoch
|
||||
StateSectorGetInfo(context.Context, address.Address, abi.SectorNumber, types.TipSetKey) (*miner.SectorOnChainInfo, error) //perm:read
|
||||
// StateSectorExpiration returns epoch at which given sector will expire
|
||||
StateSectorExpiration(context.Context, address.Address, abi.SectorNumber, types.TipSetKey) (*miner.SectorExpiration, error) //perm:read
|
||||
StateSectorExpiration(context.Context, address.Address, abi.SectorNumber, types.TipSetKey) (*lminer.SectorExpiration, error) //perm:read
|
||||
// StateSectorPartition finds deadline/partition with the specified sector
|
||||
StateSectorPartition(ctx context.Context, maddr address.Address, sectorNumber abi.SectorNumber, tok types.TipSetKey) (*miner.SectorLocation, error) //perm:read
|
||||
StateSectorPartition(ctx context.Context, maddr address.Address, sectorNumber abi.SectorNumber, tok types.TipSetKey) (*lminer.SectorLocation, error) //perm:read
|
||||
// StateSearchMsg searches for a message in the chain, and returns its receipt and the tipset where it was executed
|
||||
//
|
||||
// NOTE: If a replacing message is found on chain, this method will return
|
||||
@@ -521,7 +528,7 @@ type FullNode interface {
|
||||
// StateMarketParticipants returns the Escrow and Locked balances of every participant in the Storage Market
|
||||
StateMarketParticipants(context.Context, types.TipSetKey) (map[string]api.MarketBalance, error) //perm:read
|
||||
// StateMarketDeals returns information about every deal in the Storage Market
|
||||
StateMarketDeals(context.Context, types.TipSetKey) (map[string]api.MarketDeal, error) //perm:read
|
||||
StateMarketDeals(context.Context, types.TipSetKey) (map[string]*api.MarketDeal, error) //perm:read
|
||||
// StateMarketStorageDeal returns information about the indicated deal
|
||||
StateMarketStorageDeal(context.Context, abi.DealID, types.TipSetKey) (*api.MarketDeal, error) //perm:read
|
||||
// StateLookupID retrieves the ID address of the given address
|
||||
@@ -598,12 +605,17 @@ type FullNode interface {
|
||||
StateVMCirculatingSupplyInternal(context.Context, types.TipSetKey) (api.CirculatingSupply, error) //perm:read
|
||||
// StateNetworkVersion returns the network version at the given tipset
|
||||
StateNetworkVersion(context.Context, types.TipSetKey) (apitypes.NetworkVersion, error) //perm:read
|
||||
// StateActorCodeCIDs returns the CIDs of all the builtin actors for the given network version
|
||||
StateActorCodeCIDs(context.Context, abinetwork.Version) (map[string]cid.Cid, 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
|
||||
|
||||
// StateGetNetworkParams return current network params
|
||||
StateGetNetworkParams(ctx context.Context) (*api.NetworkParams, error) //perm:read
|
||||
|
||||
// MethodGroup: Msig
|
||||
// The Msig methods are used to interact with multisig wallets on the
|
||||
// filecoin network
|
||||
|
||||
@@ -3,6 +3,7 @@ package v0api
|
||||
import (
|
||||
"context"
|
||||
|
||||
blocks "github.com/ipfs/go-block-format"
|
||||
"github.com/ipfs/go-cid"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
@@ -10,8 +11,8 @@ import (
|
||||
"github.com/filecoin-project/go-state-types/dline"
|
||||
abinetwork "github.com/filecoin-project/go-state-types/network"
|
||||
|
||||
"github.com/filecoin-project/go-state-types/builtin/v8/miner"
|
||||
"github.com/filecoin-project/lotus/api"
|
||||
"github.com/filecoin-project/lotus/chain/actors/builtin/miner"
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
)
|
||||
|
||||
@@ -34,6 +35,7 @@ import (
|
||||
|
||||
type Gateway interface {
|
||||
ChainHasObj(context.Context, cid.Cid) (bool, error)
|
||||
ChainPutObj(context.Context, blocks.Block) error
|
||||
ChainHead(ctx context.Context) (*types.TipSet, error)
|
||||
ChainGetBlockMessages(context.Context, cid.Cid) (*api.BlockMessages, error)
|
||||
ChainGetMessage(ctx context.Context, mc cid.Cid) (*types.Message, error)
|
||||
@@ -54,7 +56,7 @@ type Gateway interface {
|
||||
StateLookupID(ctx context.Context, addr address.Address, tsk types.TipSetKey) (address.Address, error)
|
||||
StateMarketBalance(ctx context.Context, addr address.Address, tsk types.TipSetKey) (api.MarketBalance, error)
|
||||
StateMarketStorageDeal(ctx context.Context, dealId abi.DealID, tsk types.TipSetKey) (*api.MarketDeal, error)
|
||||
StateMinerInfo(ctx context.Context, actor address.Address, tsk types.TipSetKey) (miner.MinerInfo, error)
|
||||
StateMinerInfo(ctx context.Context, actor address.Address, tsk types.TipSetKey) (api.MinerInfo, error)
|
||||
StateMinerProvingDeadline(ctx context.Context, addr address.Address, tsk types.TipSetKey) (*dline.Info, error)
|
||||
StateMinerPower(context.Context, address.Address, types.TipSetKey) (*api.MinerPower, error)
|
||||
StateNetworkVersion(context.Context, types.TipSetKey) (abinetwork.Version, error)
|
||||
|
||||
+77
-23
@@ -11,17 +11,19 @@ import (
|
||||
"github.com/filecoin-project/go-fil-markets/retrievalmarket"
|
||||
"github.com/filecoin-project/go-fil-markets/storagemarket"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
"github.com/filecoin-project/go-state-types/builtin/v8/miner"
|
||||
"github.com/filecoin-project/go-state-types/builtin/v8/paych"
|
||||
"github.com/filecoin-project/go-state-types/crypto"
|
||||
"github.com/filecoin-project/go-state-types/dline"
|
||||
abinetwork "github.com/filecoin-project/go-state-types/network"
|
||||
"github.com/filecoin-project/lotus/api"
|
||||
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/paych"
|
||||
lminer "github.com/filecoin-project/lotus/chain/actors/builtin/miner"
|
||||
"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/repo/imports"
|
||||
blocks "github.com/ipfs/go-block-format"
|
||||
"github.com/ipfs/go-cid"
|
||||
"github.com/libp2p/go-libp2p-core/peer"
|
||||
"golang.org/x/xerrors"
|
||||
@@ -73,6 +75,8 @@ type FullNodeStruct struct {
|
||||
|
||||
ChainNotify func(p0 context.Context) (<-chan []*api.HeadChange, error) `perm:"read"`
|
||||
|
||||
ChainPutObj func(p0 context.Context, p1 blocks.Block) error ``
|
||||
|
||||
ChainReadObj func(p0 context.Context, p1 cid.Cid) ([]byte, error) `perm:"read"`
|
||||
|
||||
ChainSetHead func(p0 context.Context, p1 types.TipSetKey) error `perm:"admin"`
|
||||
@@ -251,6 +255,8 @@ type FullNodeStruct struct {
|
||||
|
||||
StateAccountKey func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (address.Address, error) `perm:"read"`
|
||||
|
||||
StateActorCodeCIDs func(p0 context.Context, p1 abinetwork.Version) (map[string]cid.Cid, error) `perm:"read"`
|
||||
|
||||
StateAllMinerFaults func(p0 context.Context, p1 abi.ChainEpoch, p2 types.TipSetKey) ([]*api.Fault, error) `perm:"read"`
|
||||
|
||||
StateCall func(p0 context.Context, p1 *types.Message, p2 types.TipSetKey) (*api.InvocResult, error) `perm:"read"`
|
||||
@@ -267,6 +273,8 @@ type FullNodeStruct struct {
|
||||
|
||||
StateGetActor func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*types.Actor, error) `perm:"read"`
|
||||
|
||||
StateGetNetworkParams func(p0 context.Context) (*api.NetworkParams, 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"`
|
||||
@@ -283,7 +291,7 @@ type FullNodeStruct struct {
|
||||
|
||||
StateMarketBalance func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (api.MarketBalance, error) `perm:"read"`
|
||||
|
||||
StateMarketDeals func(p0 context.Context, p1 types.TipSetKey) (map[string]api.MarketDeal, error) `perm:"read"`
|
||||
StateMarketDeals func(p0 context.Context, p1 types.TipSetKey) (map[string]*api.MarketDeal, error) `perm:"read"`
|
||||
|
||||
StateMarketParticipants func(p0 context.Context, p1 types.TipSetKey) (map[string]api.MarketBalance, error) `perm:"read"`
|
||||
|
||||
@@ -297,7 +305,7 @@ type FullNodeStruct struct {
|
||||
|
||||
StateMinerFaults func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (bitfield.BitField, error) `perm:"read"`
|
||||
|
||||
StateMinerInfo func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (miner.MinerInfo, error) `perm:"read"`
|
||||
StateMinerInfo func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (api.MinerInfo, error) `perm:"read"`
|
||||
|
||||
StateMinerInitialPledgeCollateral func(p0 context.Context, p1 address.Address, p2 miner.SectorPreCommitInfo, p3 types.TipSetKey) (types.BigInt, error) `perm:"read"`
|
||||
|
||||
@@ -329,11 +337,11 @@ type FullNodeStruct struct {
|
||||
|
||||
StateSearchMsgLimited func(p0 context.Context, p1 cid.Cid, p2 abi.ChainEpoch) (*api.MsgLookup, error) `perm:"read"`
|
||||
|
||||
StateSectorExpiration func(p0 context.Context, p1 address.Address, p2 abi.SectorNumber, p3 types.TipSetKey) (*miner.SectorExpiration, error) `perm:"read"`
|
||||
StateSectorExpiration func(p0 context.Context, p1 address.Address, p2 abi.SectorNumber, p3 types.TipSetKey) (*lminer.SectorExpiration, error) `perm:"read"`
|
||||
|
||||
StateSectorGetInfo func(p0 context.Context, p1 address.Address, p2 abi.SectorNumber, p3 types.TipSetKey) (*miner.SectorOnChainInfo, error) `perm:"read"`
|
||||
|
||||
StateSectorPartition func(p0 context.Context, p1 address.Address, p2 abi.SectorNumber, p3 types.TipSetKey) (*miner.SectorLocation, error) `perm:"read"`
|
||||
StateSectorPartition func(p0 context.Context, p1 address.Address, p2 abi.SectorNumber, p3 types.TipSetKey) (*lminer.SectorLocation, error) `perm:"read"`
|
||||
|
||||
StateSectorPreCommitInfo func(p0 context.Context, p1 address.Address, p2 abi.SectorNumber, p3 types.TipSetKey) (miner.SectorPreCommitOnChainInfo, error) `perm:"read"`
|
||||
|
||||
@@ -417,6 +425,8 @@ type GatewayStruct struct {
|
||||
|
||||
ChainNotify func(p0 context.Context) (<-chan []*api.HeadChange, error) ``
|
||||
|
||||
ChainPutObj func(p0 context.Context, p1 blocks.Block) error ``
|
||||
|
||||
ChainReadObj func(p0 context.Context, p1 cid.Cid) ([]byte, error) ``
|
||||
|
||||
GasEstimateMessageGas func(p0 context.Context, p1 *types.Message, p2 *api.MessageSendSpec, p3 types.TipSetKey) (*types.Message, error) ``
|
||||
@@ -445,7 +455,7 @@ type GatewayStruct struct {
|
||||
|
||||
StateMarketStorageDeal func(p0 context.Context, p1 abi.DealID, p2 types.TipSetKey) (*api.MarketDeal, error) ``
|
||||
|
||||
StateMinerInfo func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (miner.MinerInfo, error) ``
|
||||
StateMinerInfo func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (api.MinerInfo, error) ``
|
||||
|
||||
StateMinerPower func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*api.MinerPower, error) ``
|
||||
|
||||
@@ -679,6 +689,17 @@ func (s *FullNodeStub) ChainNotify(p0 context.Context) (<-chan []*api.HeadChange
|
||||
return nil, ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *FullNodeStruct) ChainPutObj(p0 context.Context, p1 blocks.Block) error {
|
||||
if s.Internal.ChainPutObj == nil {
|
||||
return ErrNotSupported
|
||||
}
|
||||
return s.Internal.ChainPutObj(p0, p1)
|
||||
}
|
||||
|
||||
func (s *FullNodeStub) ChainPutObj(p0 context.Context, p1 blocks.Block) error {
|
||||
return ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *FullNodeStruct) ChainReadObj(p0 context.Context, p1 cid.Cid) ([]byte, error) {
|
||||
if s.Internal.ChainReadObj == nil {
|
||||
return *new([]byte), ErrNotSupported
|
||||
@@ -1658,6 +1679,17 @@ func (s *FullNodeStub) StateAccountKey(p0 context.Context, p1 address.Address, p
|
||||
return *new(address.Address), ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *FullNodeStruct) StateActorCodeCIDs(p0 context.Context, p1 abinetwork.Version) (map[string]cid.Cid, error) {
|
||||
if s.Internal.StateActorCodeCIDs == nil {
|
||||
return *new(map[string]cid.Cid), ErrNotSupported
|
||||
}
|
||||
return s.Internal.StateActorCodeCIDs(p0, p1)
|
||||
}
|
||||
|
||||
func (s *FullNodeStub) StateActorCodeCIDs(p0 context.Context, p1 abinetwork.Version) (map[string]cid.Cid, error) {
|
||||
return *new(map[string]cid.Cid), ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *FullNodeStruct) StateAllMinerFaults(p0 context.Context, p1 abi.ChainEpoch, p2 types.TipSetKey) ([]*api.Fault, error) {
|
||||
if s.Internal.StateAllMinerFaults == nil {
|
||||
return *new([]*api.Fault), ErrNotSupported
|
||||
@@ -1746,6 +1778,17 @@ func (s *FullNodeStub) StateGetActor(p0 context.Context, p1 address.Address, p2
|
||||
return nil, ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *FullNodeStruct) StateGetNetworkParams(p0 context.Context) (*api.NetworkParams, error) {
|
||||
if s.Internal.StateGetNetworkParams == nil {
|
||||
return nil, ErrNotSupported
|
||||
}
|
||||
return s.Internal.StateGetNetworkParams(p0)
|
||||
}
|
||||
|
||||
func (s *FullNodeStub) StateGetNetworkParams(p0 context.Context) (*api.NetworkParams, error) {
|
||||
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
|
||||
@@ -1834,15 +1877,15 @@ func (s *FullNodeStub) StateMarketBalance(p0 context.Context, p1 address.Address
|
||||
return *new(api.MarketBalance), ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *FullNodeStruct) StateMarketDeals(p0 context.Context, p1 types.TipSetKey) (map[string]api.MarketDeal, error) {
|
||||
func (s *FullNodeStruct) StateMarketDeals(p0 context.Context, p1 types.TipSetKey) (map[string]*api.MarketDeal, error) {
|
||||
if s.Internal.StateMarketDeals == nil {
|
||||
return *new(map[string]api.MarketDeal), ErrNotSupported
|
||||
return *new(map[string]*api.MarketDeal), ErrNotSupported
|
||||
}
|
||||
return s.Internal.StateMarketDeals(p0, p1)
|
||||
}
|
||||
|
||||
func (s *FullNodeStub) StateMarketDeals(p0 context.Context, p1 types.TipSetKey) (map[string]api.MarketDeal, error) {
|
||||
return *new(map[string]api.MarketDeal), ErrNotSupported
|
||||
func (s *FullNodeStub) StateMarketDeals(p0 context.Context, p1 types.TipSetKey) (map[string]*api.MarketDeal, error) {
|
||||
return *new(map[string]*api.MarketDeal), ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *FullNodeStruct) StateMarketParticipants(p0 context.Context, p1 types.TipSetKey) (map[string]api.MarketBalance, error) {
|
||||
@@ -1911,15 +1954,15 @@ func (s *FullNodeStub) StateMinerFaults(p0 context.Context, p1 address.Address,
|
||||
return *new(bitfield.BitField), ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *FullNodeStruct) StateMinerInfo(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (miner.MinerInfo, error) {
|
||||
func (s *FullNodeStruct) StateMinerInfo(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (api.MinerInfo, error) {
|
||||
if s.Internal.StateMinerInfo == nil {
|
||||
return *new(miner.MinerInfo), ErrNotSupported
|
||||
return *new(api.MinerInfo), ErrNotSupported
|
||||
}
|
||||
return s.Internal.StateMinerInfo(p0, p1, p2)
|
||||
}
|
||||
|
||||
func (s *FullNodeStub) StateMinerInfo(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (miner.MinerInfo, error) {
|
||||
return *new(miner.MinerInfo), ErrNotSupported
|
||||
func (s *FullNodeStub) StateMinerInfo(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (api.MinerInfo, error) {
|
||||
return *new(api.MinerInfo), ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *FullNodeStruct) StateMinerInitialPledgeCollateral(p0 context.Context, p1 address.Address, p2 miner.SectorPreCommitInfo, p3 types.TipSetKey) (types.BigInt, error) {
|
||||
@@ -2087,14 +2130,14 @@ func (s *FullNodeStub) StateSearchMsgLimited(p0 context.Context, p1 cid.Cid, p2
|
||||
return nil, ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *FullNodeStruct) StateSectorExpiration(p0 context.Context, p1 address.Address, p2 abi.SectorNumber, p3 types.TipSetKey) (*miner.SectorExpiration, error) {
|
||||
func (s *FullNodeStruct) StateSectorExpiration(p0 context.Context, p1 address.Address, p2 abi.SectorNumber, p3 types.TipSetKey) (*lminer.SectorExpiration, error) {
|
||||
if s.Internal.StateSectorExpiration == nil {
|
||||
return nil, ErrNotSupported
|
||||
}
|
||||
return s.Internal.StateSectorExpiration(p0, p1, p2, p3)
|
||||
}
|
||||
|
||||
func (s *FullNodeStub) StateSectorExpiration(p0 context.Context, p1 address.Address, p2 abi.SectorNumber, p3 types.TipSetKey) (*miner.SectorExpiration, error) {
|
||||
func (s *FullNodeStub) StateSectorExpiration(p0 context.Context, p1 address.Address, p2 abi.SectorNumber, p3 types.TipSetKey) (*lminer.SectorExpiration, error) {
|
||||
return nil, ErrNotSupported
|
||||
}
|
||||
|
||||
@@ -2109,14 +2152,14 @@ func (s *FullNodeStub) StateSectorGetInfo(p0 context.Context, p1 address.Address
|
||||
return nil, ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *FullNodeStruct) StateSectorPartition(p0 context.Context, p1 address.Address, p2 abi.SectorNumber, p3 types.TipSetKey) (*miner.SectorLocation, error) {
|
||||
func (s *FullNodeStruct) StateSectorPartition(p0 context.Context, p1 address.Address, p2 abi.SectorNumber, p3 types.TipSetKey) (*lminer.SectorLocation, error) {
|
||||
if s.Internal.StateSectorPartition == nil {
|
||||
return nil, ErrNotSupported
|
||||
}
|
||||
return s.Internal.StateSectorPartition(p0, p1, p2, p3)
|
||||
}
|
||||
|
||||
func (s *FullNodeStub) StateSectorPartition(p0 context.Context, p1 address.Address, p2 abi.SectorNumber, p3 types.TipSetKey) (*miner.SectorLocation, error) {
|
||||
func (s *FullNodeStub) StateSectorPartition(p0 context.Context, p1 address.Address, p2 abi.SectorNumber, p3 types.TipSetKey) (*lminer.SectorLocation, error) {
|
||||
return nil, ErrNotSupported
|
||||
}
|
||||
|
||||
@@ -2516,6 +2559,17 @@ func (s *GatewayStub) ChainNotify(p0 context.Context) (<-chan []*api.HeadChange,
|
||||
return nil, ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *GatewayStruct) ChainPutObj(p0 context.Context, p1 blocks.Block) error {
|
||||
if s.Internal.ChainPutObj == nil {
|
||||
return ErrNotSupported
|
||||
}
|
||||
return s.Internal.ChainPutObj(p0, p1)
|
||||
}
|
||||
|
||||
func (s *GatewayStub) ChainPutObj(p0 context.Context, p1 blocks.Block) error {
|
||||
return ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *GatewayStruct) ChainReadObj(p0 context.Context, p1 cid.Cid) ([]byte, error) {
|
||||
if s.Internal.ChainReadObj == nil {
|
||||
return *new([]byte), ErrNotSupported
|
||||
@@ -2670,15 +2724,15 @@ func (s *GatewayStub) StateMarketStorageDeal(p0 context.Context, p1 abi.DealID,
|
||||
return nil, ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *GatewayStruct) StateMinerInfo(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (miner.MinerInfo, error) {
|
||||
func (s *GatewayStruct) StateMinerInfo(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (api.MinerInfo, error) {
|
||||
if s.Internal.StateMinerInfo == nil {
|
||||
return *new(miner.MinerInfo), ErrNotSupported
|
||||
return *new(api.MinerInfo), ErrNotSupported
|
||||
}
|
||||
return s.Internal.StateMinerInfo(p0, p1, p2)
|
||||
}
|
||||
|
||||
func (s *GatewayStub) StateMinerInfo(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (miner.MinerInfo, error) {
|
||||
return *new(miner.MinerInfo), ErrNotSupported
|
||||
func (s *GatewayStub) StateMinerInfo(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (api.MinerInfo, error) {
|
||||
return *new(api.MinerInfo), ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *GatewayStruct) StateMinerPower(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*api.MinerPower, error) {
|
||||
|
||||
@@ -17,22 +17,23 @@ import (
|
||||
auth "github.com/filecoin-project/go-jsonrpc/auth"
|
||||
abi "github.com/filecoin-project/go-state-types/abi"
|
||||
big "github.com/filecoin-project/go-state-types/big"
|
||||
miner "github.com/filecoin-project/go-state-types/builtin/v8/miner"
|
||||
paych "github.com/filecoin-project/go-state-types/builtin/v8/paych"
|
||||
crypto "github.com/filecoin-project/go-state-types/crypto"
|
||||
dline "github.com/filecoin-project/go-state-types/dline"
|
||||
network "github.com/filecoin-project/go-state-types/network"
|
||||
api "github.com/filecoin-project/lotus/api"
|
||||
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"
|
||||
miner0 "github.com/filecoin-project/lotus/chain/actors/builtin/miner"
|
||||
types "github.com/filecoin-project/lotus/chain/types"
|
||||
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"
|
||||
imports "github.com/filecoin-project/lotus/node/repo/imports"
|
||||
miner0 "github.com/filecoin-project/specs-actors/actors/builtin/miner"
|
||||
paych "github.com/filecoin-project/specs-actors/actors/builtin/paych"
|
||||
gomock "github.com/golang/mock/gomock"
|
||||
uuid "github.com/google/uuid"
|
||||
blocks "github.com/ipfs/go-block-format"
|
||||
cid "github.com/ipfs/go-cid"
|
||||
metrics "github.com/libp2p/go-libp2p-core/metrics"
|
||||
network0 "github.com/libp2p/go-libp2p-core/network"
|
||||
@@ -377,6 +378,20 @@ func (mr *MockFullNodeMockRecorder) ChainNotify(arg0 interface{}) *gomock.Call {
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ChainNotify", reflect.TypeOf((*MockFullNode)(nil).ChainNotify), arg0)
|
||||
}
|
||||
|
||||
// ChainPutObj mocks base method.
|
||||
func (m *MockFullNode) ChainPutObj(arg0 context.Context, arg1 blocks.Block) error {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "ChainPutObj", arg0, arg1)
|
||||
ret0, _ := ret[0].(error)
|
||||
return ret0
|
||||
}
|
||||
|
||||
// ChainPutObj indicates an expected call of ChainPutObj.
|
||||
func (mr *MockFullNodeMockRecorder) ChainPutObj(arg0, arg1 interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ChainPutObj", reflect.TypeOf((*MockFullNode)(nil).ChainPutObj), arg0, arg1)
|
||||
}
|
||||
|
||||
// ChainReadObj mocks base method.
|
||||
func (m *MockFullNode) ChainReadObj(arg0 context.Context, arg1 cid.Cid) ([]byte, error) {
|
||||
m.ctrl.T.Helper()
|
||||
@@ -2155,6 +2170,21 @@ func (mr *MockFullNodeMockRecorder) StateAccountKey(arg0, arg1, arg2 interface{}
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateAccountKey", reflect.TypeOf((*MockFullNode)(nil).StateAccountKey), arg0, arg1, arg2)
|
||||
}
|
||||
|
||||
// StateActorCodeCIDs mocks base method.
|
||||
func (m *MockFullNode) StateActorCodeCIDs(arg0 context.Context, arg1 network.Version) (map[string]cid.Cid, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "StateActorCodeCIDs", arg0, arg1)
|
||||
ret0, _ := ret[0].(map[string]cid.Cid)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// StateActorCodeCIDs indicates an expected call of StateActorCodeCIDs.
|
||||
func (mr *MockFullNodeMockRecorder) StateActorCodeCIDs(arg0, arg1 interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateActorCodeCIDs", reflect.TypeOf((*MockFullNode)(nil).StateActorCodeCIDs), arg0, arg1)
|
||||
}
|
||||
|
||||
// StateAllMinerFaults mocks base method.
|
||||
func (m *MockFullNode) StateAllMinerFaults(arg0 context.Context, arg1 abi.ChainEpoch, arg2 types.TipSetKey) ([]*api.Fault, error) {
|
||||
m.ctrl.T.Helper()
|
||||
@@ -2275,6 +2305,21 @@ func (mr *MockFullNodeMockRecorder) StateGetActor(arg0, arg1, arg2 interface{})
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateGetActor", reflect.TypeOf((*MockFullNode)(nil).StateGetActor), arg0, arg1, arg2)
|
||||
}
|
||||
|
||||
// StateGetNetworkParams mocks base method.
|
||||
func (m *MockFullNode) StateGetNetworkParams(arg0 context.Context) (*api.NetworkParams, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "StateGetNetworkParams", arg0)
|
||||
ret0, _ := ret[0].(*api.NetworkParams)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// StateGetNetworkParams indicates an expected call of StateGetNetworkParams.
|
||||
func (mr *MockFullNodeMockRecorder) StateGetNetworkParams(arg0 interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateGetNetworkParams", reflect.TypeOf((*MockFullNode)(nil).StateGetNetworkParams), arg0)
|
||||
}
|
||||
|
||||
// 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()
|
||||
@@ -2396,10 +2441,10 @@ func (mr *MockFullNodeMockRecorder) StateMarketBalance(arg0, arg1, arg2 interfac
|
||||
}
|
||||
|
||||
// StateMarketDeals mocks base method.
|
||||
func (m *MockFullNode) StateMarketDeals(arg0 context.Context, arg1 types.TipSetKey) (map[string]api.MarketDeal, error) {
|
||||
func (m *MockFullNode) StateMarketDeals(arg0 context.Context, arg1 types.TipSetKey) (map[string]*api.MarketDeal, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "StateMarketDeals", arg0, arg1)
|
||||
ret0, _ := ret[0].(map[string]api.MarketDeal)
|
||||
ret0, _ := ret[0].(map[string]*api.MarketDeal)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
@@ -2501,10 +2546,10 @@ func (mr *MockFullNodeMockRecorder) StateMinerFaults(arg0, arg1, arg2 interface{
|
||||
}
|
||||
|
||||
// StateMinerInfo mocks base method.
|
||||
func (m *MockFullNode) StateMinerInfo(arg0 context.Context, arg1 address.Address, arg2 types.TipSetKey) (miner.MinerInfo, error) {
|
||||
func (m *MockFullNode) StateMinerInfo(arg0 context.Context, arg1 address.Address, arg2 types.TipSetKey) (api.MinerInfo, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "StateMinerInfo", arg0, arg1, arg2)
|
||||
ret0, _ := ret[0].(miner.MinerInfo)
|
||||
ret0, _ := ret[0].(api.MinerInfo)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
@@ -2516,7 +2561,7 @@ func (mr *MockFullNodeMockRecorder) StateMinerInfo(arg0, arg1, arg2 interface{})
|
||||
}
|
||||
|
||||
// StateMinerInitialPledgeCollateral mocks base method.
|
||||
func (m *MockFullNode) StateMinerInitialPledgeCollateral(arg0 context.Context, arg1 address.Address, arg2 miner0.SectorPreCommitInfo, arg3 types.TipSetKey) (big.Int, error) {
|
||||
func (m *MockFullNode) StateMinerInitialPledgeCollateral(arg0 context.Context, arg1 address.Address, arg2 miner.SectorPreCommitInfo, arg3 types.TipSetKey) (big.Int, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "StateMinerInitialPledgeCollateral", arg0, arg1, arg2, arg3)
|
||||
ret0, _ := ret[0].(big.Int)
|
||||
@@ -2561,7 +2606,7 @@ func (mr *MockFullNodeMockRecorder) StateMinerPower(arg0, arg1, arg2 interface{}
|
||||
}
|
||||
|
||||
// StateMinerPreCommitDepositForPower mocks base method.
|
||||
func (m *MockFullNode) StateMinerPreCommitDepositForPower(arg0 context.Context, arg1 address.Address, arg2 miner0.SectorPreCommitInfo, arg3 types.TipSetKey) (big.Int, error) {
|
||||
func (m *MockFullNode) StateMinerPreCommitDepositForPower(arg0 context.Context, arg1 address.Address, arg2 miner.SectorPreCommitInfo, arg3 types.TipSetKey) (big.Int, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "StateMinerPreCommitDepositForPower", arg0, arg1, arg2, arg3)
|
||||
ret0, _ := ret[0].(big.Int)
|
||||
@@ -2741,10 +2786,10 @@ func (mr *MockFullNodeMockRecorder) StateSearchMsgLimited(arg0, arg1, arg2 inter
|
||||
}
|
||||
|
||||
// StateSectorExpiration mocks base method.
|
||||
func (m *MockFullNode) StateSectorExpiration(arg0 context.Context, arg1 address.Address, arg2 abi.SectorNumber, arg3 types.TipSetKey) (*miner.SectorExpiration, error) {
|
||||
func (m *MockFullNode) StateSectorExpiration(arg0 context.Context, arg1 address.Address, arg2 abi.SectorNumber, arg3 types.TipSetKey) (*miner0.SectorExpiration, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "StateSectorExpiration", arg0, arg1, arg2, arg3)
|
||||
ret0, _ := ret[0].(*miner.SectorExpiration)
|
||||
ret0, _ := ret[0].(*miner0.SectorExpiration)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
@@ -2771,10 +2816,10 @@ func (mr *MockFullNodeMockRecorder) StateSectorGetInfo(arg0, arg1, arg2, arg3 in
|
||||
}
|
||||
|
||||
// StateSectorPartition mocks base method.
|
||||
func (m *MockFullNode) StateSectorPartition(arg0 context.Context, arg1 address.Address, arg2 abi.SectorNumber, arg3 types.TipSetKey) (*miner.SectorLocation, error) {
|
||||
func (m *MockFullNode) StateSectorPartition(arg0 context.Context, arg1 address.Address, arg2 abi.SectorNumber, arg3 types.TipSetKey) (*miner0.SectorLocation, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "StateSectorPartition", arg0, arg1, arg2, arg3)
|
||||
ret0, _ := ret[0].(*miner.SectorLocation)
|
||||
ret0, _ := ret[0].(*miner0.SectorLocation)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
@@ -3,6 +3,9 @@ package v0api
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/filecoin-project/go-fil-markets/storagemarket"
|
||||
"github.com/libp2p/go-libp2p-core/peer"
|
||||
|
||||
"github.com/filecoin-project/go-fil-markets/retrievalmarket"
|
||||
"github.com/filecoin-project/go-state-types/big"
|
||||
"github.com/filecoin-project/go-state-types/crypto"
|
||||
@@ -341,4 +344,16 @@ func (w *WrapperV1Full) PaychGet(ctx context.Context, from, to address.Address,
|
||||
return w.FullNode.PaychFund(ctx, from, to, amt)
|
||||
}
|
||||
|
||||
func (w *WrapperV1Full) ClientQueryAsk(ctx context.Context, p peer.ID, miner address.Address) (*storagemarket.StorageAsk, error) {
|
||||
a, err := w.FullNode.ClientQueryAsk(ctx, p, miner)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return a.Response, nil
|
||||
}
|
||||
|
||||
func (w *WrapperV1Full) BeaconGetEntry(ctx context.Context, epoch abi.ChainEpoch) (*types.BeaconEntry, error) {
|
||||
return w.StateGetBeaconEntry(ctx, epoch)
|
||||
}
|
||||
|
||||
var _ FullNode = &WrapperV1Full{}
|
||||
|
||||
+11
-4
@@ -11,6 +11,7 @@ import (
|
||||
type ChainIO interface {
|
||||
ChainReadObj(context.Context, cid.Cid) ([]byte, error)
|
||||
ChainHasObj(context.Context, cid.Cid) (bool, error)
|
||||
ChainPutObj(context.Context, blocks.Block) error
|
||||
}
|
||||
|
||||
type apiBlockstore struct {
|
||||
@@ -49,12 +50,18 @@ func (a *apiBlockstore) GetSize(ctx context.Context, c cid.Cid) (int, error) {
|
||||
return len(bb), nil
|
||||
}
|
||||
|
||||
func (a *apiBlockstore) Put(context.Context, blocks.Block) error {
|
||||
return xerrors.New("not supported")
|
||||
func (a *apiBlockstore) Put(ctx context.Context, block blocks.Block) error {
|
||||
return a.api.ChainPutObj(ctx, block)
|
||||
}
|
||||
|
||||
func (a *apiBlockstore) PutMany(context.Context, []blocks.Block) error {
|
||||
return xerrors.New("not supported")
|
||||
func (a *apiBlockstore) PutMany(ctx context.Context, blocks []blocks.Block) error {
|
||||
for _, block := range blocks {
|
||||
err := a.api.ChainPutObj(ctx, block)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (a *apiBlockstore) AllKeysChan(ctx context.Context) (<-chan cid.Cid, error) {
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
# Bundles
|
||||
|
||||
This directory includes the actors bundles for each release. Each actor bundle is a zstd compressed
|
||||
tarfile containing one bundle per network type. These tarfiles are subsequently embedded in the
|
||||
lotus binary.
|
||||
|
||||
## Updating
|
||||
|
||||
To update, run the `./pack.sh` script. For example, the following will pack the [builtin actors release](https://github.com/filecoin-project/builtin-actors/releases) `dev/20220602` into the `v8` tarfile.
|
||||
|
||||
```bash
|
||||
./pack.sh v8 dev/20220602
|
||||
```
|
||||
|
||||
This will:
|
||||
|
||||
1. Download the actors bundles and pack them into the appropriate tarfile (`$VERSION.tar.zst`).
|
||||
2. Run `make bundle-gen` in the top-level directory to regenerate the bundle metadata file for _all_ network versions (all `*.tar.zst` files in this directory).
|
||||
|
||||
## Overriding
|
||||
|
||||
To build a bundle, but specify a different release/tag for a specific network, append `$network=$alternative_release` on the command line. For example:
|
||||
|
||||
```bash
|
||||
./pack.sh v8 dev/20220602 mainnet=v8.0.0 calibrationnet=v8.0.0-rc.1
|
||||
```
|
||||
Executable
+55
@@ -0,0 +1,55 @@
|
||||
#!/bin/bash
|
||||
|
||||
NETWORKS=(devnet mainnet caterpillarnet butterflynet testing testing-fake-proofs calibrationnet)
|
||||
|
||||
set -e
|
||||
|
||||
if [[ $# -lt 2 ]]; then
|
||||
echo "Usage: $0 VERSION RELEASE [NETWORK=RELEASE_OVERRIDE]..." >&2
|
||||
echo "expected at least two arguments, an actors version (e.g., v8), an actors release, and any number of release overrides." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
VERSION="$1" # actors version
|
||||
RELEASE="$2" # actors release name
|
||||
RELEASE_OVERRIDES=("${@:3}")
|
||||
|
||||
echo "Downloading bundles for actors version ${VERSION} release ${RELEASE}"
|
||||
echo "With release overrides ${RELEASE_OVERRIDES[*]}"
|
||||
|
||||
TARGET_FILE="$(pwd)/${VERSION}.tar.zst"
|
||||
WORKDIR=$(mktemp -d -t "actor-bundles-${VERSION}.XXXXXXXXXX")
|
||||
trap 'rm -rf -- "$WORKDIR"' EXIT
|
||||
|
||||
encode_release() {
|
||||
jq -rn --arg release "$1" '$release | @uri'
|
||||
}
|
||||
|
||||
pushd "${WORKDIR}"
|
||||
for network in "${NETWORKS[@]}"; do
|
||||
release="$RELEASE"
|
||||
# Ideally, we'd use an associative array (map). But that's not supported on macos.
|
||||
for override in "${RELEASE_OVERRIDES[@]}"; do
|
||||
if [[ "${network}" = "${override%%=*}" ]]; then
|
||||
release="${override#*=}"
|
||||
break
|
||||
fi
|
||||
done
|
||||
encoded_release="$(encode_release "$release")"
|
||||
echo "Downloading $release for network $network."
|
||||
wget "https://github.com/filecoin-project/builtin-actors/releases/download/${encoded_release}/builtin-actors-${network}"{.car,.sha256}
|
||||
done
|
||||
|
||||
echo "Checking the checksums..."
|
||||
|
||||
sha256sum -c -- *.sha256
|
||||
|
||||
echo "Packing..."
|
||||
|
||||
rm -f -- "$TARGET_FILE"
|
||||
tar -cf "$TARGET_FILE" --use-compress-program "zstd -19" -- *.car
|
||||
popd
|
||||
|
||||
echo "Generating metadata..."
|
||||
|
||||
make -C ../../ bundle-gen
|
||||
Binary file not shown.
@@ -1,2 +1,2 @@
|
||||
/dns4/bootstrap-0.butterfly.fildev.network/tcp/1347/p2p/12D3KooWFHDtFx7CVTy4xoCDutVo1cScvSnQjDeaM8UzwVS1qwkh
|
||||
/dns4/bootstrap-1.butterfly.fildev.network/tcp/1347/p2p/12D3KooWKt8cwpkiumkT8x32c3YFxsPRwhV5J8hCYPn9mhUmcAXt
|
||||
/dns4/bootstrap-0.butterfly.fildev.network/tcp/1347/p2p/12D3KooWSUZhAY3eyoPUboJ1ZWe4dNPFWTr1EPoDjbTDSAN15uhY
|
||||
/dns4/bootstrap-1.butterfly.fildev.network/tcp/1347/p2p/12D3KooWDfvNrSRVGWAGbn3sm9C8z98W2x25qCZjaXGHXmGiH24e
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
/dns4/bootstrap-0.interop.fildev.network/tcp/1347/p2p/12D3KooWPfaWdJjpPTQp5kSqsqvauJaM4cFz5NWja7qyjx7vVfjL
|
||||
/dns4/bootstrap-1.interop.fildev.network/tcp/1347/p2p/12D3KooWS5tjcL6s4hHZ1HVRTgGKaXpKkiHfbBSJdjbzgejgJpEh
|
||||
/dns4/bootstrap-0.interop.fildev.network/tcp/1347/p2p/12D3KooWDY249nj6gxSiBTocNBnkbBBvnfPgkxq5SBUVrccjwRnr
|
||||
/dns4/bootstrap-1.interop.fildev.network/tcp/1347/p2p/12D3KooWCwFsKt4NyoJQk7vjiACXL9LznBWANXKjCebKJ7MHh3h4
|
||||
|
||||
@@ -13,3 +13,4 @@
|
||||
/dns4/node.glif.io/tcp/1235/p2p/12D3KooWBF8cpp65hp2u9LK5mh19x67ftAam84z9LsfaquTDSBpt
|
||||
/dns4/bootstrap-0.ipfsmain.cn/tcp/34721/p2p/12D3KooWQnwEGNqcM2nAcPtRR9rAX8Hrg4k9kJLCHoTR5chJfz6d
|
||||
/dns4/bootstrap-1.ipfsmain.cn/tcp/34723/p2p/12D3KooWMKxMkD5DMpSWsW7dBddKxKT7L2GgbNuckz9otxvkvByP
|
||||
/dns4/bootstarp-0.1475.io/tcp/61256/p2p/12D3KooWQjaNmbz9b1XmheQB3RWsRjKSzuRLfjeiDZHyX7Y5RcBr
|
||||
@@ -0,0 +1,263 @@
|
||||
package build
|
||||
|
||||
import (
|
||||
"archive/tar"
|
||||
"context"
|
||||
"embed"
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
"path"
|
||||
"sort"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/filecoin-project/lotus/blockstore"
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
|
||||
"github.com/DataDog/zstd"
|
||||
"github.com/ipfs/go-cid"
|
||||
cbor "github.com/ipfs/go-ipld-cbor"
|
||||
"github.com/ipld/go-car"
|
||||
"golang.org/x/xerrors"
|
||||
)
|
||||
|
||||
//go:embed actors/*.tar.zst
|
||||
var embeddedBuiltinActorReleases embed.FS
|
||||
|
||||
func init() {
|
||||
if BundleOverrides == nil {
|
||||
BundleOverrides = make(map[actors.Version]string)
|
||||
}
|
||||
for _, av := range actors.Versions {
|
||||
path := os.Getenv(fmt.Sprintf("LOTUS_BUILTIN_ACTORS_V%d_BUNDLE", av))
|
||||
if path == "" {
|
||||
continue
|
||||
}
|
||||
BundleOverrides[actors.Version(av)] = path
|
||||
}
|
||||
if err := loadManifests(NetworkBundle); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
// UseNetworkBundle switches to a different network bundle, by name.
|
||||
func UseNetworkBundle(netw string) error {
|
||||
if NetworkBundle == netw {
|
||||
return nil
|
||||
}
|
||||
if err := loadManifests(netw); err != nil {
|
||||
return err
|
||||
}
|
||||
NetworkBundle = netw
|
||||
return nil
|
||||
}
|
||||
|
||||
func loadManifests(netw string) error {
|
||||
overridden := make(map[actors.Version]struct{})
|
||||
var newMetadata []*BuiltinActorsMetadata
|
||||
// First, prefer overrides.
|
||||
for av, path := range BundleOverrides {
|
||||
root, actorCids, err := readBundleManifestFromFile(path)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
newMetadata = append(newMetadata, &BuiltinActorsMetadata{
|
||||
Network: netw,
|
||||
Version: av,
|
||||
ManifestCid: root,
|
||||
Actors: actorCids,
|
||||
})
|
||||
overridden[av] = struct{}{}
|
||||
}
|
||||
|
||||
// Then load embedded bundle metadata.
|
||||
for _, meta := range EmbeddedBuiltinActorsMetadata {
|
||||
if meta.Network != netw {
|
||||
continue
|
||||
}
|
||||
if _, ok := overridden[meta.Version]; ok {
|
||||
continue
|
||||
}
|
||||
newMetadata = append(newMetadata, meta)
|
||||
}
|
||||
|
||||
actors.ClearManifests()
|
||||
|
||||
for _, meta := range newMetadata {
|
||||
actors.RegisterManifest(meta.Version, meta.ManifestCid, meta.Actors)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
type BuiltinActorsMetadata struct {
|
||||
Network string
|
||||
Version actors.Version
|
||||
ManifestCid cid.Cid
|
||||
Actors map[string]cid.Cid
|
||||
}
|
||||
|
||||
// ReadEmbeddedBuiltinActorsMetadata reads the metadata from the embedded built-in actor bundles.
|
||||
// There should be no need to call this method as the result is cached in the
|
||||
// `EmbeddedBuiltinActorsMetadata` variable on `make gen`.
|
||||
func ReadEmbeddedBuiltinActorsMetadata() ([]*BuiltinActorsMetadata, error) {
|
||||
files, err := embeddedBuiltinActorReleases.ReadDir("actors")
|
||||
if err != nil {
|
||||
return nil, xerrors.Errorf("failed to read embedded bundle directory: %s", err)
|
||||
}
|
||||
var bundles []*BuiltinActorsMetadata
|
||||
for _, dirent := range files {
|
||||
name := dirent.Name()
|
||||
b, err := readEmbeddedBuiltinActorsMetadata(name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
bundles = append(bundles, b...)
|
||||
}
|
||||
// Sort by network, then by bundle.
|
||||
sort.Slice(bundles, func(i, j int) bool {
|
||||
if bundles[i].Network == bundles[j].Network {
|
||||
return bundles[i].Version < bundles[j].Version
|
||||
}
|
||||
return bundles[i].Network < bundles[j].Network
|
||||
})
|
||||
return bundles, nil
|
||||
}
|
||||
|
||||
func readEmbeddedBuiltinActorsMetadata(bundle string) ([]*BuiltinActorsMetadata, error) {
|
||||
const (
|
||||
archiveExt = ".tar.zst"
|
||||
bundleExt = ".car"
|
||||
bundlePrefix = "builtin-actors-"
|
||||
)
|
||||
|
||||
if !strings.HasPrefix(bundle, "v") {
|
||||
return nil, xerrors.Errorf("bundle bundle '%q' doesn't start with a 'v'", bundle)
|
||||
}
|
||||
if !strings.HasSuffix(bundle, archiveExt) {
|
||||
return nil, xerrors.Errorf("bundle bundle '%q' doesn't end with '%s'", bundle, archiveExt)
|
||||
}
|
||||
version, err := strconv.ParseInt(bundle[1:len(bundle)-len(archiveExt)], 10, 0)
|
||||
if err != nil {
|
||||
return nil, xerrors.Errorf("failed to parse actors version from bundle '%q': %s", bundle, err)
|
||||
}
|
||||
fi, err := embeddedBuiltinActorReleases.Open(fmt.Sprintf("actors/%s", bundle))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer fi.Close() //nolint
|
||||
|
||||
uncompressed := zstd.NewReader(fi)
|
||||
defer uncompressed.Close() //nolint
|
||||
|
||||
var bundles []*BuiltinActorsMetadata
|
||||
|
||||
tarReader := tar.NewReader(uncompressed)
|
||||
for {
|
||||
header, err := tarReader.Next()
|
||||
switch err {
|
||||
case io.EOF:
|
||||
return bundles, nil
|
||||
case nil:
|
||||
default:
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Read the network name from the bundle name.
|
||||
name := path.Base(header.Name)
|
||||
if !strings.HasSuffix(name, bundleExt) {
|
||||
return nil, xerrors.Errorf("expected bundle to end with .car: %s", name)
|
||||
}
|
||||
if !strings.HasPrefix(name, bundlePrefix) {
|
||||
return nil, xerrors.Errorf("expected bundle to end with .car: %s", name)
|
||||
}
|
||||
name = name[len(bundlePrefix) : len(name)-len(bundleExt)]
|
||||
|
||||
// Load the bundle.
|
||||
root, actorCids, err := readBundleManifest(tarReader)
|
||||
if err != nil {
|
||||
return nil, xerrors.Errorf("error loading builtin actors bundle: %w", err)
|
||||
}
|
||||
bundles = append(bundles, &BuiltinActorsMetadata{
|
||||
Network: name,
|
||||
Version: actors.Version(version),
|
||||
ManifestCid: root,
|
||||
Actors: actorCids,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func readBundleManifestFromFile(path string) (cid.Cid, map[string]cid.Cid, error) {
|
||||
fi, err := os.Open(path)
|
||||
if err != nil {
|
||||
return cid.Undef, nil, err
|
||||
}
|
||||
defer fi.Close() //nolint
|
||||
|
||||
return readBundleManifest(fi)
|
||||
}
|
||||
|
||||
func readBundleManifest(r io.Reader) (cid.Cid, map[string]cid.Cid, error) {
|
||||
// Load the bundle.
|
||||
bs := blockstore.NewMemory()
|
||||
hdr, err := car.LoadCar(context.Background(), bs, r)
|
||||
if err != nil {
|
||||
return cid.Undef, nil, xerrors.Errorf("error loading builtin actors bundle: %w", err)
|
||||
}
|
||||
|
||||
if len(hdr.Roots) != 1 {
|
||||
return cid.Undef, nil, xerrors.Errorf("expected one root when loading actors bundle, got %d", len(hdr.Roots))
|
||||
}
|
||||
root := hdr.Roots[0]
|
||||
actorCids, err := actors.ReadManifest(context.Background(), adt.WrapStore(context.Background(), cbor.NewCborStore(bs)), root)
|
||||
if err != nil {
|
||||
return cid.Undef, nil, err
|
||||
}
|
||||
|
||||
// Make sure we have all the actors.
|
||||
for name, c := range actorCids {
|
||||
if has, err := bs.Has(context.Background(), c); err != nil {
|
||||
return cid.Undef, nil, xerrors.Errorf("got an error when checking that the bundle has the actor %q: %w", name, err)
|
||||
} else if !has {
|
||||
return cid.Undef, nil, xerrors.Errorf("actor %q missing from bundle", name)
|
||||
}
|
||||
}
|
||||
|
||||
return root, actorCids, nil
|
||||
}
|
||||
|
||||
// GetEmbeddedBuiltinActorsBundle returns the builtin-actors bundle for the given actors version.
|
||||
func GetEmbeddedBuiltinActorsBundle(version actors.Version) ([]byte, bool) {
|
||||
fi, err := embeddedBuiltinActorReleases.Open(fmt.Sprintf("actors/v%d.tar.zst", version))
|
||||
if err != nil {
|
||||
return nil, false
|
||||
}
|
||||
defer fi.Close() //nolint
|
||||
|
||||
uncompressed := zstd.NewReader(fi)
|
||||
defer uncompressed.Close() //nolint
|
||||
|
||||
tarReader := tar.NewReader(uncompressed)
|
||||
targetFileName := fmt.Sprintf("builtin-actors-%s.car", NetworkBundle)
|
||||
for {
|
||||
header, err := tarReader.Next()
|
||||
switch err {
|
||||
case io.EOF:
|
||||
return nil, false
|
||||
case nil:
|
||||
default:
|
||||
panic(err)
|
||||
}
|
||||
if header.Name != targetFileName {
|
||||
continue
|
||||
}
|
||||
|
||||
car, err := io.ReadAll(tarReader)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return car, true
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,128 @@
|
||||
// WARNING: This file has automatically been generated
|
||||
|
||||
package build
|
||||
|
||||
import (
|
||||
"github.com/ipfs/go-cid"
|
||||
)
|
||||
|
||||
var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMetadata{{
|
||||
Network: "butterflynet",
|
||||
Version: 8,
|
||||
ManifestCid: MustParseCid("bafy2bzacedvaarfyh6q3bk4dyzux46ednlace2ckxp5nbyn6mb3da2apqn6sk"),
|
||||
Actors: map[string]cid.Cid{
|
||||
"account": MustParseCid("bafk2bzaceavzeu4gqte7o33vr4htiaapiwpfq6p26tgdkqla2baqhmiqswfso"),
|
||||
"cron": MustParseCid("bafk2bzacech35onpqxep4yox36k7sr4mj4bch54s3i4b3yyaustrbo5xwfbfs"),
|
||||
"init": MustParseCid("bafk2bzaceahxin3sf5f6ude5j6we4yeqlg66s5qe4tu7lwp26jcg7yp2ns6hi"),
|
||||
"multisig": MustParseCid("bafk2bzacectfmzjtniypgl4whm42sws5aupihqgfikwsr7p5yoq3bmqaogldi"),
|
||||
"paymentchannel": MustParseCid("bafk2bzacecbwu54ce5mjgp2pqxyj6kpn2vlgiu5wv2lj2byjiegxnn3infd5i"),
|
||||
"reward": MustParseCid("bafk2bzacecskkbhe6c4ud5jt62wg4w7j7shj6xdwoyic74s5y6pgywxxvnw72"),
|
||||
"storagemarket": MustParseCid("bafk2bzacebycxcwwm7hwhuhpasaskil2kxaqb7tins7azdvvm72rorlciuysi"),
|
||||
"storageminer": MustParseCid("bafk2bzacecgx3etor5m6lahpmjdwqnryutqe6naiurfhgsju72rd4nqssutbg"),
|
||||
"storagepower": MustParseCid("bafk2bzaceayvy6xyp5cwtngm457c5hssvihidppgq3o7gy3dlmhgor3yzujoc"),
|
||||
"system": MustParseCid("bafk2bzacec6xctjxybp7r3kkhase56o6jsaiua7ure5ttu2xfuojt4jhlsoa6"),
|
||||
"verifiedregistry": MustParseCid("bafk2bzacec2hcqlqcfacylfcrhhliwkisvh4y3adwt47xkf2gdvodwu6ccepc"),
|
||||
},
|
||||
}, {
|
||||
Network: "calibrationnet",
|
||||
Version: 8,
|
||||
ManifestCid: MustParseCid("bafy2bzacedrdn6z3z7xz7lx4wll3tlgktirhllzqxb766dxpaqp3ukxsjfsba"),
|
||||
Actors: map[string]cid.Cid{
|
||||
"account": MustParseCid("bafk2bzacecruossn66xqbeutqx5r4k2kjzgd43frmwd4qkw6haez44ubvvpxo"),
|
||||
"cron": MustParseCid("bafk2bzaceaxlezmclw5ugldhhtfgvn7yztux45scqik3ez4yhwiqhg5ssib44"),
|
||||
"init": MustParseCid("bafk2bzaceadyfilb22bcvzvnpzbg2lyg6npmperyq6es2brvzjdh5rmywc4ry"),
|
||||
"multisig": MustParseCid("bafk2bzacec66wmb4kohuzvuxsulhcgiwju7sqkldwfpmmgw7dbbwgm5l2574q"),
|
||||
"paymentchannel": MustParseCid("bafk2bzaceblot4pemhfgwb3lceellwrpgxaqkpselzbpqu32maffpopdunlha"),
|
||||
"reward": MustParseCid("bafk2bzaceayah37uvj7brl5no4gmvmqbmtndh5raywuts7h6tqbgbq2ge7dhu"),
|
||||
"storagemarket": MustParseCid("bafk2bzacebotg5coqnglzsdrqxtkqk2eq4krxt6zvds3i3vb2yejgxhexl2n6"),
|
||||
"storageminer": MustParseCid("bafk2bzacea6rabflc7kpwr6y4lzcqsnuahr4zblyq3rhzrrsfceeiw2lufrb4"),
|
||||
"storagepower": MustParseCid("bafk2bzacecpwr4mynn55bg5hrlns3osvg7sty3rca6zlai3vl52vbbjk7ulfa"),
|
||||
"system": MustParseCid("bafk2bzaceaqrkllksxv2jsfgjvmuewx5vbzrammw5mdscod6gkdr3ijih2q64"),
|
||||
"verifiedregistry": MustParseCid("bafk2bzaceaihibfu625lbtzdp3tcftscshrmbgghgrc7kzqhxn4455pycpdkm"),
|
||||
},
|
||||
}, {
|
||||
Network: "caterpillarnet",
|
||||
Version: 8,
|
||||
ManifestCid: MustParseCid("bafy2bzacecsmunz6fzhg53276cixadn6ybhcnzkgbw3la5hf342tfxsdoet26"),
|
||||
Actors: map[string]cid.Cid{
|
||||
"account": MustParseCid("bafk2bzaced6yatl4y2nmqmx2h3btk3np6oelyw2yt57elsb2nfmm33fadzt2g"),
|
||||
"cron": MustParseCid("bafk2bzacebrujytq4u7g62jbz52gio5k2s6rhruty7nt4eqq7ygitzxuee5zi"),
|
||||
"init": MustParseCid("bafk2bzacedajw5ptnwfdidv6m4rvd4c2m7dve4lhfbawygl5idkalcxbiiudu"),
|
||||
"multisig": MustParseCid("bafk2bzaceb3kh5hjh6eebb5236xp7crn2owyyo7irap6sy4ns76uc7om6pxuy"),
|
||||
"paymentchannel": MustParseCid("bafk2bzacedl5am53e4mtxpzligcycxvmkolfkhfiuavww2dq3ukgaqwowj7vw"),
|
||||
"reward": MustParseCid("bafk2bzacecbswf242j43cymj3wh7nszawwlofv6z6z4qipb5d32hpxdhxywng"),
|
||||
"storagemarket": MustParseCid("bafk2bzaceca5ersmg3zxf2cztgktq33bmfjuiqjcjlktwj52xyrpujbdsqvek"),
|
||||
"storageminer": MustParseCid("bafk2bzacedg2fqaq5udfp3h6cxhywm27dgagxtselfgkyyyunqq362eaxpdm4"),
|
||||
"storagepower": MustParseCid("bafk2bzaceb3dm2i2q323e6iozo3r6pyded645vvlpf537kga2a3hu5x7abgl4"),
|
||||
"system": MustParseCid("bafk2bzacebu47th3xerlngqavlipb6cfu2utljkxxzgadc3totogto2tmx2jc"),
|
||||
"verifiedregistry": MustParseCid("bafk2bzaceci3niq3rmbcmepgn27zvlgci6d5t4dvthx3pbmmx3wcu5elova6i"),
|
||||
},
|
||||
}, {
|
||||
Network: "devnet",
|
||||
Version: 8,
|
||||
ManifestCid: MustParseCid("bafy2bzacedq7tuibavyqxzkq4uybjj7ly22eu42mjkoehwn5d47xfunmtjm4k"),
|
||||
Actors: map[string]cid.Cid{
|
||||
"account": MustParseCid("bafk2bzacea4tlgnp7m6tlldpz3termlwxlnyq24nwd4zdzv4r6nsjuaktuuzc"),
|
||||
"cron": MustParseCid("bafk2bzacecgrlf3vg3mufwovddlbgclhpnpp3jftr46stssh3crd3pyljc37w"),
|
||||
"init": MustParseCid("bafk2bzacedarbnovmucppbjkcwsxopludrj5ttmtm7mzfqsugmxdnqevqso7o"),
|
||||
"multisig": MustParseCid("bafk2bzaced4gcxjwy6garxwfw6y5a2k4jewj4t5nzopjy4qwnimhjtnsgo3ss"),
|
||||
"paymentchannel": MustParseCid("bafk2bzaceb3isfguytt6cs4xecyoonbhhekmngfbap2msggbwyde7zch3a6w4"),
|
||||
"reward": MustParseCid("bafk2bzacedn3fkp27ys5dxn4pwqdq2atj2x6cyezxuekdorvjwi7zazirgvgy"),
|
||||
"storagemarket": MustParseCid("bafk2bzacecw57fpkqesfhi5g3nr4csy4oy7oc42wmwjuis6l7ijniolo4rt2k"),
|
||||
"storageminer": MustParseCid("bafk2bzacebze3elvppssc6v5457ukszzy6ndrg6xgaojfsqfbbtg3xfwo4rbs"),
|
||||
"storagepower": MustParseCid("bafk2bzaceb45l6zhgc34n6clz7xnvd7ek55bhw46q25umuje34t6kroix6hh6"),
|
||||
"system": MustParseCid("bafk2bzacecf7eta2stfd3cnuxzervd33imbvlaqq6b5tsho7pxmhifrybreru"),
|
||||
"verifiedregistry": MustParseCid("bafk2bzaceaajgtglewgitshgdi2nzrvq7eihjtyqj5yiamesqun2hujl3xev2"),
|
||||
},
|
||||
}, {
|
||||
Network: "mainnet",
|
||||
Version: 8,
|
||||
ManifestCid: MustParseCid("bafy2bzacebogjbpiemi7npzxchgcjjki3tfxon4ims55obfyfleqntteljsea"),
|
||||
Actors: map[string]cid.Cid{
|
||||
"account": MustParseCid("bafk2bzacedudbf7fc5va57t3tmo63snmt3en4iaidv4vo3qlyacbxaa6hlx6y"),
|
||||
"cron": MustParseCid("bafk2bzacecqb3eolfurehny6yp7tgmapib4ocazo5ilkopjce2c7wc2bcec62"),
|
||||
"init": MustParseCid("bafk2bzaceaipvjhoxmtofsnv3aj6gj5ida4afdrxa4ewku2hfipdlxpaektlw"),
|
||||
"multisig": MustParseCid("bafk2bzacebhldfjuy4o5v7amrhp5p2gzv2qo5275jut4adnbyp56fxkwy5fag"),
|
||||
"paymentchannel": MustParseCid("bafk2bzacebalad3f72wyk7qyilvfjijcwubdspytnyzlrhvn73254gqis44rq"),
|
||||
"reward": MustParseCid("bafk2bzacecwzzxlgjiavnc3545cqqil3cmq4hgpvfp2crguxy2pl5ybusfsbe"),
|
||||
"storagemarket": MustParseCid("bafk2bzacediohrxkp2fbsl4yj4jlupjdkgsiwqb4zuezvinhdo2j5hrxco62q"),
|
||||
"storageminer": MustParseCid("bafk2bzacecgnynvd3tene3bvqoknuspit56canij5bpra6wl4mrq2mxxwriyu"),
|
||||
"storagepower": MustParseCid("bafk2bzacebjvqva6ppvysn5xpmiqcdfelwbbcxmghx5ww6hr37cgred6dyrpm"),
|
||||
"system": MustParseCid("bafk2bzacedwq5uppsw7vp55zpj7jdieizirmldceehu6wvombw3ixq2tcq57w"),
|
||||
"verifiedregistry": MustParseCid("bafk2bzaceb3zbkjz3auizmoln2unmxep7dyfcmsre64vnqfhdyh7rkqfoxlw4"),
|
||||
},
|
||||
}, {
|
||||
Network: "testing",
|
||||
Version: 8,
|
||||
ManifestCid: MustParseCid("bafy2bzacedkjpqx27wgsvfxzuxfvixuxtbpt2y6yo6igcasez6gqiowron776"),
|
||||
Actors: map[string]cid.Cid{
|
||||
"account": MustParseCid("bafk2bzacebmfbtdj5vruje5auacrhhprcjdd6uclhukb7je7t2f6ozfcgqlu2"),
|
||||
"cron": MustParseCid("bafk2bzacea4gwsbeux7z4yxvpkxpco77iyxijoyqaoikofrxdewunwh3unjem"),
|
||||
"init": MustParseCid("bafk2bzacecqk6zlwein7tzy7yrrhtj4pzavrkofgpyxvvw5ktr3w4x4ml4lis"),
|
||||
"multisig": MustParseCid("bafk2bzacea5zp2g6ag5qfuro7zw6kyku2swxs57wjxncaaxbih5iqflqy4ghm"),
|
||||
"paymentchannel": MustParseCid("bafk2bzaced47dbtbygmfwnyfsp5iihzhhdmnkpuyc5nlnfgc4mkkvlsgvj2do"),
|
||||
"reward": MustParseCid("bafk2bzacecmcagk32pzdzfg7piobzqhlgla37x3g7jjzyndlz7mqdno2zulfi"),
|
||||
"storagemarket": MustParseCid("bafk2bzaceballmgd7puoixfwm65f5shi3kzreqdisowtsoufbvduwytydqotw"),
|
||||
"storageminer": MustParseCid("bafk2bzacebucngwdhxtod2gvv52adtdssafyg43znsoy4omtfkkqe2hbhvxeu"),
|
||||
"storagepower": MustParseCid("bafk2bzaceakxw5wx3rtqoarrdbzhmxkufg2kx7n34xotzxzacvvbe5iqggmsa"),
|
||||
"system": MustParseCid("bafk2bzaced6kjkbv7lrb2qwq5we2hqaxc6ztch5p52g27qtjy45zdemsk4b7m"),
|
||||
"verifiedregistry": MustParseCid("bafk2bzacectzxvtoselhnzsair5nv6k5vokvegnht6z2lfee4p3xexo4kg4m6"),
|
||||
},
|
||||
}, {
|
||||
Network: "testing-fake-proofs",
|
||||
Version: 8,
|
||||
ManifestCid: MustParseCid("bafy2bzacecd3lb5v6tzjylnhnrhexslssyaozy6hogzgpkhztoe76exbrgrug"),
|
||||
Actors: map[string]cid.Cid{
|
||||
"account": MustParseCid("bafk2bzacebmfbtdj5vruje5auacrhhprcjdd6uclhukb7je7t2f6ozfcgqlu2"),
|
||||
"cron": MustParseCid("bafk2bzacea4gwsbeux7z4yxvpkxpco77iyxijoyqaoikofrxdewunwh3unjem"),
|
||||
"init": MustParseCid("bafk2bzacebwkqd6e7gdphfzw2kdmbokdh2bly6fvzgfopxzy7quq4l67gmkks"),
|
||||
"multisig": MustParseCid("bafk2bzacea5zp2g6ag5qfuro7zw6kyku2swxs57wjxncaaxbih5iqflqy4ghm"),
|
||||
"paymentchannel": MustParseCid("bafk2bzaced47dbtbygmfwnyfsp5iihzhhdmnkpuyc5nlnfgc4mkkvlsgvj2do"),
|
||||
"reward": MustParseCid("bafk2bzacecmcagk32pzdzfg7piobzqhlgla37x3g7jjzyndlz7mqdno2zulfi"),
|
||||
"storagemarket": MustParseCid("bafk2bzacecxqgajcaednamgolc6wc3lzbjc6tz5alfrbwqez2y3c372vts6dg"),
|
||||
"storageminer": MustParseCid("bafk2bzaceaqwxllfycpq6decpsnkqjdeycpysh5acubonjae7u3wciydlkvki"),
|
||||
"storagepower": MustParseCid("bafk2bzaceddmeolsokbxgcr25cuf2skrobtmmoof3dmqfpcfp33lmw63oikvm"),
|
||||
"system": MustParseCid("bafk2bzaced6kjkbv7lrb2qwq5we2hqaxc6ztch5p52g27qtjy45zdemsk4b7m"),
|
||||
"verifiedregistry": MustParseCid("bafk2bzacectzxvtoselhnzsair5nv6k5vokvegnht6z2lfee4p3xexo4kg4m6"),
|
||||
},
|
||||
}}
|
||||
@@ -0,0 +1,33 @@
|
||||
package build_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/filecoin-project/lotus/build"
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
// Test that the embedded metadata is correct.
|
||||
func TestEmbeddedMetadata(t *testing.T) {
|
||||
metadata, err := build.ReadEmbeddedBuiltinActorsMetadata()
|
||||
require.NoError(t, err)
|
||||
|
||||
require.Equal(t, metadata, build.EmbeddedBuiltinActorsMetadata)
|
||||
}
|
||||
|
||||
// Test that we're registering the manifest correctly.
|
||||
func TestRegistration(t *testing.T) {
|
||||
manifestCid, found := actors.GetManifest(actors.Version8)
|
||||
require.True(t, found)
|
||||
require.True(t, manifestCid.Defined())
|
||||
|
||||
for _, key := range actors.GetBuiltinActorsKeys() {
|
||||
actorCid, found := actors.GetActorCodeID(actors.Version8, key)
|
||||
require.True(t, found)
|
||||
name, version, found := actors.GetActorMetaByCode(actorCid)
|
||||
require.True(t, found)
|
||||
require.Equal(t, actors.Version8, version)
|
||||
require.Equal(t, key, name)
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+20
-5
@@ -11,13 +11,18 @@ import (
|
||||
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
"github.com/filecoin-project/go-state-types/network"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/policy"
|
||||
)
|
||||
|
||||
const BootstrappersFile = ""
|
||||
const GenesisFile = ""
|
||||
|
||||
const GenesisNetworkVersion = network.Version15
|
||||
var NetworkBundle = "devnet"
|
||||
var BundleOverrides map[actors.Version]string
|
||||
|
||||
const GenesisNetworkVersion = network.Version16
|
||||
|
||||
var UpgradeBreezeHeight = abi.ChainEpoch(-1)
|
||||
|
||||
@@ -48,16 +53,25 @@ var UpgradeHyperdriveHeight = abi.ChainEpoch(-16)
|
||||
var UpgradeChocolateHeight = abi.ChainEpoch(-17)
|
||||
|
||||
var UpgradeOhSnapHeight = abi.ChainEpoch(-18)
|
||||
var UpgradeSkyrHeight = abi.ChainEpoch(-19)
|
||||
|
||||
var DrandSchedule = map[abi.ChainEpoch]DrandEnum{
|
||||
0: DrandMainnet,
|
||||
}
|
||||
|
||||
var SupportedProofTypes = []abi.RegisteredSealProof{
|
||||
abi.RegisteredSealProof_StackedDrg2KiBV1,
|
||||
abi.RegisteredSealProof_StackedDrg8MiBV1,
|
||||
}
|
||||
var ConsensusMinerMinPower = abi.NewStoragePower(2048)
|
||||
var MinVerifiedDealSize = abi.NewStoragePower(256)
|
||||
var PreCommitChallengeDelay = abi.ChainEpoch(10)
|
||||
|
||||
func init() {
|
||||
policy.SetSupportedProofTypes(abi.RegisteredSealProof_StackedDrg2KiBV1, abi.RegisteredSealProof_StackedDrg8MiBV1)
|
||||
policy.SetConsensusMinerMinPower(abi.NewStoragePower(2048))
|
||||
policy.SetMinVerifiedDealSize(abi.NewStoragePower(256))
|
||||
policy.SetPreCommitChallengeDelay(abi.ChainEpoch(10))
|
||||
policy.SetSupportedProofTypes(SupportedProofTypes...)
|
||||
policy.SetConsensusMinerMinPower(ConsensusMinerMinPower)
|
||||
policy.SetMinVerifiedDealSize(MinVerifiedDealSize)
|
||||
policy.SetPreCommitChallengeDelay(PreCommitChallengeDelay)
|
||||
|
||||
getUpgradeHeight := func(ev string, def abi.ChainEpoch) abi.ChainEpoch {
|
||||
hs, found := os.LookupEnv(ev)
|
||||
@@ -91,6 +105,7 @@ func init() {
|
||||
UpgradeHyperdriveHeight = getUpgradeHeight("LOTUS_HYPERDRIVE_HEIGHT", UpgradeHyperdriveHeight)
|
||||
UpgradeChocolateHeight = getUpgradeHeight("LOTUS_CHOCOLATE_HEIGHT", UpgradeChocolateHeight)
|
||||
UpgradeOhSnapHeight = getUpgradeHeight("LOTUS_OHSNAP_HEIGHT", UpgradeOhSnapHeight)
|
||||
UpgradeSkyrHeight = getUpgradeHeight("LOTUS_SKYR_HEIGHT", UpgradeSkyrHeight)
|
||||
|
||||
BuildType |= Build2k
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ import (
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
"github.com/filecoin-project/go-state-types/network"
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/policy"
|
||||
builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin"
|
||||
"github.com/ipfs/go-cid"
|
||||
@@ -16,7 +17,10 @@ var DrandSchedule = map[abi.ChainEpoch]DrandEnum{
|
||||
0: DrandMainnet,
|
||||
}
|
||||
|
||||
const GenesisNetworkVersion = network.Version14
|
||||
const GenesisNetworkVersion = network.Version15
|
||||
|
||||
var NetworkBundle = "butterflynet"
|
||||
var BundleOverrides map[actors.Version]string
|
||||
|
||||
const BootstrappersFile = "butterflynet.pi"
|
||||
const GenesisFile = "butterflynet.car"
|
||||
@@ -42,15 +46,24 @@ const UpgradeTurboHeight = -15
|
||||
const UpgradeHyperdriveHeight = -16
|
||||
const UpgradeChocolateHeight = -17
|
||||
|
||||
const UpgradeOhSnapHeight = 240
|
||||
const UpgradeOhSnapHeight = -18
|
||||
|
||||
const UpgradeSkyrHeight = abi.ChainEpoch(50)
|
||||
|
||||
var SupportedProofTypes = []abi.RegisteredSealProof{
|
||||
abi.RegisteredSealProof_StackedDrg512MiBV1,
|
||||
abi.RegisteredSealProof_StackedDrg32GiBV1,
|
||||
abi.RegisteredSealProof_StackedDrg64GiBV1,
|
||||
}
|
||||
var ConsensusMinerMinPower = abi.NewStoragePower(2 << 30)
|
||||
var MinVerifiedDealSize = abi.NewStoragePower(1 << 20)
|
||||
var PreCommitChallengeDelay = abi.ChainEpoch(150)
|
||||
|
||||
func init() {
|
||||
policy.SetConsensusMinerMinPower(abi.NewStoragePower(2 << 30))
|
||||
policy.SetSupportedProofTypes(
|
||||
abi.RegisteredSealProof_StackedDrg512MiBV1,
|
||||
abi.RegisteredSealProof_StackedDrg32GiBV1,
|
||||
abi.RegisteredSealProof_StackedDrg64GiBV1,
|
||||
)
|
||||
policy.SetSupportedProofTypes(SupportedProofTypes...)
|
||||
policy.SetConsensusMinerMinPower(ConsensusMinerMinPower)
|
||||
policy.SetMinVerifiedDealSize(MinVerifiedDealSize)
|
||||
policy.SetPreCommitChallengeDelay(PreCommitChallengeDelay)
|
||||
|
||||
SetAddressNetwork(address.Testnet)
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ import (
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
"github.com/filecoin-project/go-state-types/network"
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/policy"
|
||||
builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin"
|
||||
"github.com/ipfs/go-cid"
|
||||
@@ -18,6 +19,9 @@ var DrandSchedule = map[abi.ChainEpoch]DrandEnum{
|
||||
|
||||
const GenesisNetworkVersion = network.Version0
|
||||
|
||||
var NetworkBundle = "calibrationnet"
|
||||
var BundleOverrides map[actors.Version]string
|
||||
|
||||
const BootstrappersFile = "calibnet.pi"
|
||||
const GenesisFile = "calibnet.car"
|
||||
|
||||
@@ -57,12 +61,22 @@ const UpgradeChocolateHeight = 312746
|
||||
// 2022-02-10T19:23:00Z
|
||||
const UpgradeOhSnapHeight = 682006
|
||||
|
||||
// 2022-06-16T17:30:00Z
|
||||
const UpgradeSkyrHeight = 1044660
|
||||
|
||||
var SupportedProofTypes = []abi.RegisteredSealProof{
|
||||
abi.RegisteredSealProof_StackedDrg32GiBV1,
|
||||
abi.RegisteredSealProof_StackedDrg64GiBV1,
|
||||
}
|
||||
var ConsensusMinerMinPower = abi.NewStoragePower(32 << 30)
|
||||
var MinVerifiedDealSize = abi.NewStoragePower(1 << 20)
|
||||
var PreCommitChallengeDelay = abi.ChainEpoch(150)
|
||||
|
||||
func init() {
|
||||
policy.SetConsensusMinerMinPower(abi.NewStoragePower(32 << 30))
|
||||
policy.SetSupportedProofTypes(
|
||||
abi.RegisteredSealProof_StackedDrg32GiBV1,
|
||||
abi.RegisteredSealProof_StackedDrg64GiBV1,
|
||||
)
|
||||
policy.SetSupportedProofTypes(SupportedProofTypes...)
|
||||
policy.SetConsensusMinerMinPower(ConsensusMinerMinPower)
|
||||
policy.SetMinVerifiedDealSize(MinVerifiedDealSize)
|
||||
policy.SetPreCommitChallengeDelay(PreCommitChallengeDelay)
|
||||
|
||||
SetAddressNetwork(address.Testnet)
|
||||
|
||||
|
||||
+23
-15
@@ -7,14 +7,18 @@ import (
|
||||
"os"
|
||||
"strconv"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
"github.com/filecoin-project/go-state-types/network"
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/policy"
|
||||
builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin"
|
||||
"github.com/ipfs/go-cid"
|
||||
)
|
||||
|
||||
var NetworkBundle = "caterpillarnet"
|
||||
var BundleOverrides map[actors.Version]string
|
||||
|
||||
const BootstrappersFile = "interopnet.pi"
|
||||
const GenesisFile = "interopnet.car"
|
||||
|
||||
@@ -47,23 +51,26 @@ var UpgradeTurboHeight = abi.ChainEpoch(-15)
|
||||
var UpgradeHyperdriveHeight = abi.ChainEpoch(-16)
|
||||
var UpgradeChocolateHeight = abi.ChainEpoch(-17)
|
||||
var UpgradeOhSnapHeight = abi.ChainEpoch(-18)
|
||||
var UpgradeSkyrHeight = abi.ChainEpoch(100)
|
||||
|
||||
var DrandSchedule = map[abi.ChainEpoch]DrandEnum{
|
||||
0: DrandMainnet,
|
||||
}
|
||||
|
||||
var SupportedProofTypes = []abi.RegisteredSealProof{
|
||||
abi.RegisteredSealProof_StackedDrg2KiBV1,
|
||||
abi.RegisteredSealProof_StackedDrg8MiBV1,
|
||||
abi.RegisteredSealProof_StackedDrg512MiBV1,
|
||||
}
|
||||
var ConsensusMinerMinPower = abi.NewStoragePower(2048)
|
||||
var MinVerifiedDealSize = abi.NewStoragePower(256)
|
||||
var PreCommitChallengeDelay = abi.ChainEpoch(10)
|
||||
|
||||
func init() {
|
||||
policy.SetMinVerifiedDealSize(abi.NewStoragePower(256))
|
||||
policy.SetPreCommitChallengeDelay(abi.ChainEpoch(10))
|
||||
|
||||
InsecurePoStValidation = true
|
||||
|
||||
policy.SetConsensusMinerMinPower(abi.NewStoragePower(2 << 30))
|
||||
policy.SetSupportedProofTypes(
|
||||
abi.RegisteredSealProof_StackedDrg512MiBV1,
|
||||
abi.RegisteredSealProof_StackedDrg32GiBV1,
|
||||
abi.RegisteredSealProof_StackedDrg64GiBV1,
|
||||
)
|
||||
policy.SetSupportedProofTypes(SupportedProofTypes...)
|
||||
policy.SetConsensusMinerMinPower(ConsensusMinerMinPower)
|
||||
policy.SetMinVerifiedDealSize(MinVerifiedDealSize)
|
||||
policy.SetPreCommitChallengeDelay(PreCommitChallengeDelay)
|
||||
|
||||
getUpgradeHeight := func(ev string, def abi.ChainEpoch) abi.ChainEpoch {
|
||||
hs, found := os.LookupEnv(ev)
|
||||
@@ -97,6 +104,7 @@ func init() {
|
||||
UpgradeHyperdriveHeight = getUpgradeHeight("LOTUS_HYPERDRIVE_HEIGHT", UpgradeHyperdriveHeight)
|
||||
UpgradeChocolateHeight = getUpgradeHeight("LOTUS_CHOCOLATE_HEIGHT", UpgradeChocolateHeight)
|
||||
UpgradeOhSnapHeight = getUpgradeHeight("LOTUS_OHSNAP_HEIGHT", UpgradeOhSnapHeight)
|
||||
UpgradeSkyrHeight = getUpgradeHeight("LOTUS_SKYR_HEIGHT", UpgradeSkyrHeight)
|
||||
|
||||
BuildType |= BuildInteropnet
|
||||
SetAddressNetwork(address.Testnet)
|
||||
@@ -104,9 +112,9 @@ func init() {
|
||||
|
||||
}
|
||||
|
||||
const BlockDelaySecs = uint64(5)
|
||||
const BlockDelaySecs = uint64(builtin2.EpochDurationSeconds)
|
||||
|
||||
const PropagationDelaySecs = uint64(1)
|
||||
const PropagationDelaySecs = uint64(6)
|
||||
|
||||
// BootstrapPeerThreshold is the minimum number peers we need to track for a sync worker to start
|
||||
const BootstrapPeerThreshold = 2
|
||||
|
||||
+22
-5
@@ -1,5 +1,5 @@
|
||||
//go:build !debug && !2k && !testground && !calibnet && !nerpanet && !butterflynet && !interopnet
|
||||
// +build !debug,!2k,!testground,!calibnet,!nerpanet,!butterflynet,!interopnet
|
||||
//go:build !debug && !2k && !testground && !calibnet && !butterflynet && !interopnet
|
||||
// +build !debug,!2k,!testground,!calibnet,!butterflynet,!interopnet
|
||||
|
||||
package build
|
||||
|
||||
@@ -8,6 +8,7 @@ import (
|
||||
"os"
|
||||
|
||||
"github.com/filecoin-project/go-state-types/network"
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
@@ -19,6 +20,11 @@ var DrandSchedule = map[abi.ChainEpoch]DrandEnum{
|
||||
UpgradeSmokeHeight: DrandMainnet,
|
||||
}
|
||||
|
||||
var NetworkBundle = "mainnet"
|
||||
|
||||
// NOTE: DO NOT change this unless you REALLY know what you're doing. This is consensus critical.
|
||||
var BundleOverrides map[actors.Version]string
|
||||
|
||||
const GenesisNetworkVersion = network.Version0
|
||||
|
||||
const BootstrappersFile = "mainnet.pi"
|
||||
@@ -68,15 +74,26 @@ const UpgradeHyperdriveHeight = 892800
|
||||
const UpgradeChocolateHeight = 1231620
|
||||
|
||||
// 2022-03-01T15:00:00Z
|
||||
var UpgradeOhSnapHeight = abi.ChainEpoch(1594680)
|
||||
const UpgradeOhSnapHeight = 1594680
|
||||
|
||||
// 2022-07-06T14:00:00Z
|
||||
var UpgradeSkyrHeight = abi.ChainEpoch(1960320)
|
||||
|
||||
var SupportedProofTypes = []abi.RegisteredSealProof{
|
||||
abi.RegisteredSealProof_StackedDrg32GiBV1,
|
||||
abi.RegisteredSealProof_StackedDrg64GiBV1,
|
||||
}
|
||||
var ConsensusMinerMinPower = abi.NewStoragePower(10 << 40)
|
||||
var MinVerifiedDealSize = abi.NewStoragePower(1 << 20)
|
||||
var PreCommitChallengeDelay = abi.ChainEpoch(150)
|
||||
|
||||
func init() {
|
||||
if os.Getenv("LOTUS_USE_TEST_ADDRESSES") != "1" {
|
||||
SetAddressNetwork(address.Mainnet)
|
||||
}
|
||||
|
||||
if os.Getenv("LOTUS_DISABLE_SNAPDEALS") == "1" {
|
||||
UpgradeOhSnapHeight = math.MaxInt64
|
||||
if os.Getenv("LOTUS_DISABLE_SKYR") == "1" {
|
||||
UpgradeSkyrHeight = math.MaxInt64
|
||||
}
|
||||
|
||||
Devnet = false
|
||||
|
||||
@@ -1,87 +0,0 @@
|
||||
//go:build nerpanet
|
||||
// +build nerpanet
|
||||
|
||||
package build
|
||||
|
||||
import (
|
||||
"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/ipfs/go-cid"
|
||||
|
||||
builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin"
|
||||
)
|
||||
|
||||
var DrandSchedule = map[abi.ChainEpoch]DrandEnum{
|
||||
0: DrandMainnet,
|
||||
}
|
||||
|
||||
const GenesisNetworkVersion = network.Version0
|
||||
|
||||
const BootstrappersFile = "nerpanet.pi"
|
||||
const GenesisFile = "nerpanet.car"
|
||||
|
||||
const UpgradeBreezeHeight = -1
|
||||
const BreezeGasTampingDuration = 0
|
||||
|
||||
const UpgradeSmokeHeight = -1
|
||||
|
||||
const UpgradeIgnitionHeight = -2
|
||||
const UpgradeRefuelHeight = -3
|
||||
|
||||
const UpgradeLiftoffHeight = -5
|
||||
|
||||
const UpgradeAssemblyHeight = 30 // critical: the network can bootstrap from v1 only
|
||||
const UpgradeTapeHeight = 60
|
||||
|
||||
const UpgradeKumquatHeight = 90
|
||||
|
||||
const UpgradeCalicoHeight = 100
|
||||
const UpgradePersianHeight = UpgradeCalicoHeight + (builtin2.EpochsInHour * 1)
|
||||
|
||||
const UpgradeClausHeight = 250
|
||||
|
||||
const UpgradeOrangeHeight = 300
|
||||
|
||||
const UpgradeTrustHeight = 600
|
||||
const UpgradeNorwegianHeight = 201000
|
||||
const UpgradeTurboHeight = 203000
|
||||
const UpgradeHyperdriveHeight = 379178
|
||||
|
||||
const UpgradeChocolateHeight = 999999999
|
||||
|
||||
func init() {
|
||||
// Minimum block production power is set to 4 TiB
|
||||
// Rationale is to discourage small-scale miners from trying to take over the network
|
||||
// One needs to invest in ~2.3x the compute to break consensus, making it not worth it
|
||||
//
|
||||
// DOWNSIDE: the fake-seals need to be kept alive/protected, otherwise network will seize
|
||||
//
|
||||
policy.SetConsensusMinerMinPower(abi.NewStoragePower(4 << 40))
|
||||
|
||||
policy.SetSupportedProofTypes(
|
||||
abi.RegisteredSealProof_StackedDrg512MiBV1,
|
||||
abi.RegisteredSealProof_StackedDrg32GiBV1,
|
||||
abi.RegisteredSealProof_StackedDrg64GiBV1,
|
||||
)
|
||||
|
||||
// Lower the most time-consuming parts of PoRep
|
||||
policy.SetPreCommitChallengeDelay(10)
|
||||
|
||||
// TODO - make this a variable
|
||||
//miner.WPoStChallengeLookback = abi.ChainEpoch(2)
|
||||
|
||||
Devnet = false
|
||||
|
||||
BuildType = BuildNerpanet
|
||||
|
||||
}
|
||||
|
||||
const BlockDelaySecs = uint64(builtin2.EpochDurationSeconds)
|
||||
|
||||
const PropagationDelaySecs = uint64(6)
|
||||
|
||||
// BootstrapPeerThreshold is the minimum number peers we need to track for a sync worker to start
|
||||
const BootstrapPeerThreshold = 4
|
||||
|
||||
var WhitelistedBlock = cid.Undef
|
||||
@@ -34,7 +34,7 @@ const NewestNetworkVersion = network.Version{{.latestNetworkVersion}}
|
||||
|
||||
/* inline-gen start */
|
||||
|
||||
const NewestNetworkVersion = network.Version15
|
||||
const NewestNetworkVersion = network.Version16
|
||||
|
||||
/* inline-gen end */
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@ import (
|
||||
|
||||
builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/policy"
|
||||
)
|
||||
|
||||
@@ -33,6 +34,12 @@ var (
|
||||
MinimumBaseFee = int64(100)
|
||||
BlockDelaySecs = uint64(builtin2.EpochDurationSeconds)
|
||||
PropagationDelaySecs = uint64(6)
|
||||
SupportedProofTypes = []abi.RegisteredSealProof{
|
||||
abi.RegisteredSealProof_StackedDrg32GiBV1,
|
||||
abi.RegisteredSealProof_StackedDrg64GiBV1,
|
||||
}
|
||||
ConsensusMinerMinPower = abi.NewStoragePower(10 << 40)
|
||||
PreCommitChallengeDelay = abi.ChainEpoch(150)
|
||||
|
||||
AllowableClockDriftSecs = uint64(1)
|
||||
|
||||
@@ -100,12 +107,15 @@ var (
|
||||
UpgradeHyperdriveHeight abi.ChainEpoch = -15
|
||||
UpgradeChocolateHeight abi.ChainEpoch = -16
|
||||
UpgradeOhSnapHeight abi.ChainEpoch = -17
|
||||
UpgradeSkyrHeight abi.ChainEpoch = -18
|
||||
|
||||
DrandSchedule = map[abi.ChainEpoch]DrandEnum{
|
||||
0: DrandMainnet,
|
||||
}
|
||||
|
||||
GenesisNetworkVersion = network.Version0
|
||||
NetworkBundle = "devnet"
|
||||
BundleOverrides map[actors.Version]string
|
||||
|
||||
NewestNetworkVersion = network.Version15
|
||||
ActorUpgradeNetworkVersion = network.Version15
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@ func BuildTypeString() string {
|
||||
}
|
||||
|
||||
// BuildVersion is the local build version
|
||||
const BuildVersion = "1.15.2-dev"
|
||||
const BuildVersion = "1.16.0"
|
||||
|
||||
func UserVersion() string {
|
||||
if os.Getenv("LOTUS_VERSION_IGNORE_COMMIT") == "1" {
|
||||
|
||||
@@ -3,6 +3,7 @@ package main
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"go/format"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
@@ -77,7 +78,12 @@ func generateAdapters() error {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := ioutil.WriteFile(filepath.Join(actDir, fmt.Sprintf("%s.go", act)), b.Bytes(), 0666); err != nil {
|
||||
fmted, err := format.Source(b.Bytes())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := ioutil.WriteFile(filepath.Join(actDir, fmt.Sprintf("%s.go", act)), fmted, 0666); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,10 +6,8 @@ import (
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-state-types/cbor"
|
||||
"github.com/ipfs/go-cid"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
"github.com/filecoin-project/lotus/chain/actors/builtin"
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
|
||||
builtin0 "github.com/filecoin-project/specs-actors/actors/builtin"
|
||||
@@ -25,42 +23,26 @@ import (
|
||||
builtin6 "github.com/filecoin-project/specs-actors/v6/actors/builtin"
|
||||
|
||||
builtin7 "github.com/filecoin-project/specs-actors/v7/actors/builtin"
|
||||
|
||||
builtin8 "github.com/filecoin-project/go-state-types/builtin"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
||||
builtin.RegisterActorState(builtin0.AccountActorCodeID, func(store adt.Store, root cid.Cid) (cbor.Marshaler, error) {
|
||||
return load0(store, root)
|
||||
})
|
||||
|
||||
builtin.RegisterActorState(builtin2.AccountActorCodeID, func(store adt.Store, root cid.Cid) (cbor.Marshaler, error) {
|
||||
return load2(store, root)
|
||||
})
|
||||
|
||||
builtin.RegisterActorState(builtin3.AccountActorCodeID, func(store adt.Store, root cid.Cid) (cbor.Marshaler, error) {
|
||||
return load3(store, root)
|
||||
})
|
||||
|
||||
builtin.RegisterActorState(builtin4.AccountActorCodeID, func(store adt.Store, root cid.Cid) (cbor.Marshaler, error) {
|
||||
return load4(store, root)
|
||||
})
|
||||
|
||||
builtin.RegisterActorState(builtin5.AccountActorCodeID, func(store adt.Store, root cid.Cid) (cbor.Marshaler, error) {
|
||||
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 = builtin8.MethodsAccount
|
||||
|
||||
func Load(store adt.Store, act *types.Actor) (State, error) {
|
||||
if name, av, ok := actors.GetActorMetaByCode(act.Code); ok {
|
||||
if name != actors.AccountKey {
|
||||
return nil, xerrors.Errorf("actor code is not account: %s", name)
|
||||
}
|
||||
|
||||
switch av {
|
||||
|
||||
case actors.Version8:
|
||||
return load8(store, act.Head)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
switch act.Code {
|
||||
|
||||
case builtin0.AccountActorCodeID:
|
||||
@@ -85,6 +67,7 @@ func Load(store adt.Store, act *types.Actor) (State, error) {
|
||||
return load7(store, act.Head)
|
||||
|
||||
}
|
||||
|
||||
return nil, xerrors.Errorf("unknown actor code %s", act.Code)
|
||||
}
|
||||
|
||||
@@ -112,39 +95,13 @@ func MakeState(store adt.Store, av actors.Version, addr address.Address) (State,
|
||||
case actors.Version7:
|
||||
return make7(store, addr)
|
||||
|
||||
case actors.Version8:
|
||||
return make8(store, addr)
|
||||
|
||||
}
|
||||
return nil, xerrors.Errorf("unknown actor version %d", av)
|
||||
}
|
||||
|
||||
func GetActorCodeID(av actors.Version) (cid.Cid, error) {
|
||||
switch av {
|
||||
|
||||
case actors.Version0:
|
||||
return builtin0.AccountActorCodeID, nil
|
||||
|
||||
case actors.Version2:
|
||||
return builtin2.AccountActorCodeID, nil
|
||||
|
||||
case actors.Version3:
|
||||
return builtin3.AccountActorCodeID, nil
|
||||
|
||||
case actors.Version4:
|
||||
return builtin4.AccountActorCodeID, nil
|
||||
|
||||
case actors.Version5:
|
||||
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)
|
||||
}
|
||||
|
||||
type State interface {
|
||||
cbor.Marshaler
|
||||
|
||||
|
||||
@@ -6,32 +6,45 @@ import (
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-state-types/cbor"
|
||||
"github.com/ipfs/go-cid"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
"github.com/filecoin-project/lotus/chain/actors/builtin"
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
{{range .versions}}
|
||||
builtin{{.}} "github.com/filecoin-project/specs-actors{{import .}}actors/builtin"
|
||||
{{if (le . 7)}}
|
||||
builtin{{.}} "github.com/filecoin-project/specs-actors{{import .}}actors/builtin"
|
||||
{{else}}
|
||||
builtin{{.}} "github.com/filecoin-project/go-state-types/builtin"
|
||||
{{end}}
|
||||
{{end}}
|
||||
)
|
||||
|
||||
func init() {
|
||||
{{range .versions}}
|
||||
builtin.RegisterActorState(builtin{{.}}.AccountActorCodeID, func(store adt.Store, root cid.Cid) (cbor.Marshaler, error) {
|
||||
return load{{.}}(store, root)
|
||||
})
|
||||
{{end}}}
|
||||
|
||||
var Methods = builtin4.MethodsAccount
|
||||
var Methods = builtin{{.latestVersion}}.MethodsAccount
|
||||
|
||||
func Load(store adt.Store, act *types.Actor) (State, error) {
|
||||
if name, av, ok := actors.GetActorMetaByCode(act.Code); ok {
|
||||
if name != actors.AccountKey {
|
||||
return nil, xerrors.Errorf("actor code is not account: %s", name)
|
||||
}
|
||||
|
||||
switch av {
|
||||
{{range .versions}}
|
||||
{{if (ge . 8)}}
|
||||
case actors.Version{{.}}:
|
||||
return load{{.}}(store, act.Head)
|
||||
{{end}}
|
||||
{{end}}
|
||||
}
|
||||
}
|
||||
|
||||
switch act.Code {
|
||||
{{range .versions}}
|
||||
case builtin{{.}}.AccountActorCodeID:
|
||||
return load{{.}}(store, act.Head)
|
||||
{{if (le . 7)}}
|
||||
case builtin{{.}}.AccountActorCodeID:
|
||||
return load{{.}}(store, act.Head)
|
||||
{{end}}
|
||||
{{end}}
|
||||
}
|
||||
|
||||
return nil, xerrors.Errorf("unknown actor code %s", act.Code)
|
||||
}
|
||||
|
||||
@@ -45,17 +58,6 @@ func MakeState(store adt.Store, av actors.Version, addr address.Address) (State,
|
||||
return nil, xerrors.Errorf("unknown actor version %d", av)
|
||||
}
|
||||
|
||||
func GetActorCodeID(av actors.Version) (cid.Cid, error) {
|
||||
switch av {
|
||||
{{range .versions}}
|
||||
case actors.Version{{.}}:
|
||||
return builtin{{.}}.AccountActorCodeID, nil
|
||||
{{end}}
|
||||
}
|
||||
|
||||
return cid.Undef, xerrors.Errorf("unknown actor version %d", av)
|
||||
}
|
||||
|
||||
type State interface {
|
||||
cbor.Marshaler
|
||||
|
||||
|
||||
@@ -6,7 +6,11 @@ import (
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
|
||||
{{if (le .v 7)}}
|
||||
account{{.v}} "github.com/filecoin-project/specs-actors{{.import}}actors/builtin/account"
|
||||
{{else}}
|
||||
account{{.v}} "github.com/filecoin-project/go-state-types/builtin{{.import}}account"
|
||||
{{end}}
|
||||
)
|
||||
|
||||
var _ State = (*state{{.v}})(nil)
|
||||
|
||||
@@ -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"
|
||||
|
||||
account8 "github.com/filecoin-project/go-state-types/builtin/v8/account"
|
||||
)
|
||||
|
||||
var _ State = (*state8)(nil)
|
||||
|
||||
func load8(store adt.Store, root cid.Cid) (State, error) {
|
||||
out := state8{store: store}
|
||||
err := store.Get(store.Context(), root, &out)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &out, nil
|
||||
}
|
||||
|
||||
func make8(store adt.Store, addr address.Address) (State, error) {
|
||||
out := state8{store: store}
|
||||
out.State = account8.State{Address: addr}
|
||||
return &out, nil
|
||||
}
|
||||
|
||||
type state8 struct {
|
||||
account8.State
|
||||
store adt.Store
|
||||
}
|
||||
|
||||
func (s *state8) PubkeyAddress() (address.Address, error) {
|
||||
return s.Address, nil
|
||||
}
|
||||
|
||||
func (s *state8) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
+413
-84
@@ -1,133 +1,76 @@
|
||||
package builtin
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/ipfs/go-cid"
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
builtin0 "github.com/filecoin-project/specs-actors/actors/builtin"
|
||||
smoothing0 "github.com/filecoin-project/specs-actors/actors/util/smoothing"
|
||||
|
||||
builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin"
|
||||
smoothing2 "github.com/filecoin-project/specs-actors/v2/actors/util/smoothing"
|
||||
|
||||
builtin3 "github.com/filecoin-project/specs-actors/v3/actors/builtin"
|
||||
smoothing3 "github.com/filecoin-project/specs-actors/v3/actors/util/smoothing"
|
||||
|
||||
builtin4 "github.com/filecoin-project/specs-actors/v4/actors/builtin"
|
||||
smoothing4 "github.com/filecoin-project/specs-actors/v4/actors/util/smoothing"
|
||||
|
||||
builtin5 "github.com/filecoin-project/specs-actors/v5/actors/builtin"
|
||||
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"
|
||||
|
||||
builtin8 "github.com/filecoin-project/specs-actors/v8/actors/builtin"
|
||||
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
"github.com/filecoin-project/go-state-types/cbor"
|
||||
"github.com/filecoin-project/go-state-types/builtin"
|
||||
"github.com/filecoin-project/go-state-types/proof"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
|
||||
miner7 "github.com/filecoin-project/specs-actors/v7/actors/builtin/miner"
|
||||
proof7 "github.com/filecoin-project/specs-actors/v7/actors/runtime/proof"
|
||||
miner8 "github.com/filecoin-project/go-state-types/builtin/v8/miner"
|
||||
smoothingtypes "github.com/filecoin-project/go-state-types/builtin/v8/util/smoothing"
|
||||
)
|
||||
|
||||
var SystemActorAddr = builtin7.SystemActorAddr
|
||||
var BurntFundsActorAddr = builtin7.BurntFundsActorAddr
|
||||
var CronActorAddr = builtin7.CronActorAddr
|
||||
var SystemActorAddr = builtin.SystemActorAddr
|
||||
var BurntFundsActorAddr = builtin.BurntFundsActorAddr
|
||||
var CronActorAddr = builtin.CronActorAddr
|
||||
var SaftAddress = makeAddress("t0122")
|
||||
var ReserveAddress = makeAddress("t090")
|
||||
var RootVerifierAddress = makeAddress("t080")
|
||||
|
||||
var (
|
||||
ExpectedLeadersPerEpoch = builtin7.ExpectedLeadersPerEpoch
|
||||
ExpectedLeadersPerEpoch = builtin.ExpectedLeadersPerEpoch
|
||||
)
|
||||
|
||||
const (
|
||||
EpochDurationSeconds = builtin7.EpochDurationSeconds
|
||||
EpochsInDay = builtin7.EpochsInDay
|
||||
SecondsInDay = builtin7.SecondsInDay
|
||||
EpochDurationSeconds = builtin.EpochDurationSeconds
|
||||
EpochsInDay = builtin.EpochsInDay
|
||||
SecondsInDay = builtin.SecondsInDay
|
||||
)
|
||||
|
||||
const (
|
||||
MethodSend = builtin7.MethodSend
|
||||
MethodConstructor = builtin7.MethodConstructor
|
||||
MethodSend = builtin.MethodSend
|
||||
MethodConstructor = builtin.MethodConstructor
|
||||
)
|
||||
|
||||
// These are all just type aliases across actor versions. In the future, that might change
|
||||
// and we might need to do something fancier.
|
||||
type SectorInfo = proof7.SectorInfo
|
||||
type ExtendedSectorInfo = proof7.ExtendedSectorInfo
|
||||
type PoStProof = proof7.PoStProof
|
||||
type FilterEstimate = smoothing0.FilterEstimate
|
||||
type SectorInfo = proof.SectorInfo
|
||||
type ExtendedSectorInfo = proof.ExtendedSectorInfo
|
||||
type PoStProof = proof.PoStProof
|
||||
type FilterEstimate = smoothingtypes.FilterEstimate
|
||||
|
||||
func QAPowerForWeight(size abi.SectorSize, duration abi.ChainEpoch, dealWeight, verifiedWeight abi.DealWeight) abi.StoragePower {
|
||||
return miner7.QAPowerForWeight(size, duration, dealWeight, verifiedWeight)
|
||||
}
|
||||
|
||||
func FromV0FilterEstimate(v0 smoothing0.FilterEstimate) FilterEstimate {
|
||||
|
||||
return (FilterEstimate)(v0) //nolint:unconvert
|
||||
|
||||
}
|
||||
|
||||
func FromV2FilterEstimate(v2 smoothing2.FilterEstimate) FilterEstimate {
|
||||
|
||||
return (FilterEstimate)(v2)
|
||||
|
||||
}
|
||||
|
||||
func FromV3FilterEstimate(v3 smoothing3.FilterEstimate) FilterEstimate {
|
||||
|
||||
return (FilterEstimate)(v3)
|
||||
|
||||
}
|
||||
|
||||
func FromV4FilterEstimate(v4 smoothing4.FilterEstimate) FilterEstimate {
|
||||
|
||||
return (FilterEstimate)(v4)
|
||||
|
||||
}
|
||||
|
||||
func FromV5FilterEstimate(v5 smoothing5.FilterEstimate) FilterEstimate {
|
||||
|
||||
return (FilterEstimate)(v5)
|
||||
|
||||
}
|
||||
|
||||
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)
|
||||
|
||||
var ActorStateLoaders = make(map[cid.Cid]ActorStateLoader)
|
||||
|
||||
func RegisterActorState(code cid.Cid, loader ActorStateLoader) {
|
||||
ActorStateLoaders[code] = loader
|
||||
}
|
||||
|
||||
func Load(store adt.Store, act *types.Actor) (cbor.Marshaler, error) {
|
||||
loader, found := ActorStateLoaders[act.Code]
|
||||
if !found {
|
||||
return nil, xerrors.Errorf("unknown actor code %s", act.Code)
|
||||
}
|
||||
return loader(store, act.Head)
|
||||
return miner8.QAPowerForWeight(size, duration, dealWeight, verifiedWeight)
|
||||
}
|
||||
|
||||
func ActorNameByCode(c cid.Cid) string {
|
||||
if name, version, ok := actors.GetActorMetaByCode(c); ok {
|
||||
return fmt.Sprintf("fil/%d/%s", version, name)
|
||||
}
|
||||
|
||||
switch {
|
||||
|
||||
case builtin0.IsBuiltinActor(c):
|
||||
@@ -151,12 +94,19 @@ func ActorNameByCode(c cid.Cid) string {
|
||||
case builtin7.IsBuiltinActor(c):
|
||||
return builtin7.ActorNameByCode(c)
|
||||
|
||||
case builtin8.IsBuiltinActor(c):
|
||||
return builtin8.ActorNameByCode(c)
|
||||
|
||||
default:
|
||||
return "<unknown>"
|
||||
}
|
||||
}
|
||||
|
||||
func IsBuiltinActor(c cid.Cid) bool {
|
||||
_, _, ok := actors.GetActorMetaByCode(c)
|
||||
if ok {
|
||||
return true
|
||||
}
|
||||
|
||||
if builtin0.IsBuiltinActor(c) {
|
||||
return true
|
||||
@@ -189,7 +139,44 @@ func IsBuiltinActor(c cid.Cid) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func GetAccountActorCodeID(av actors.Version) (cid.Cid, error) {
|
||||
if c, ok := actors.GetActorCodeID(av, actors.AccountKey); ok {
|
||||
return c, nil
|
||||
}
|
||||
|
||||
switch av {
|
||||
|
||||
case actors.Version0:
|
||||
return builtin0.AccountActorCodeID, nil
|
||||
|
||||
case actors.Version2:
|
||||
return builtin2.AccountActorCodeID, nil
|
||||
|
||||
case actors.Version3:
|
||||
return builtin3.AccountActorCodeID, nil
|
||||
|
||||
case actors.Version4:
|
||||
return builtin4.AccountActorCodeID, nil
|
||||
|
||||
case actors.Version5:
|
||||
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)
|
||||
}
|
||||
|
||||
func IsAccountActor(c cid.Cid) bool {
|
||||
name, _, ok := actors.GetActorMetaByCode(c)
|
||||
if ok {
|
||||
return name == "account"
|
||||
}
|
||||
|
||||
if c == builtin0.AccountActorCodeID {
|
||||
return true
|
||||
@@ -222,7 +209,143 @@ func IsAccountActor(c cid.Cid) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func GetCronActorCodeID(av actors.Version) (cid.Cid, error) {
|
||||
if c, ok := actors.GetActorCodeID(av, actors.CronKey); ok {
|
||||
return c, nil
|
||||
}
|
||||
|
||||
switch av {
|
||||
|
||||
case actors.Version0:
|
||||
return builtin0.CronActorCodeID, nil
|
||||
|
||||
case actors.Version2:
|
||||
return builtin2.CronActorCodeID, nil
|
||||
|
||||
case actors.Version3:
|
||||
return builtin3.CronActorCodeID, nil
|
||||
|
||||
case actors.Version4:
|
||||
return builtin4.CronActorCodeID, nil
|
||||
|
||||
case actors.Version5:
|
||||
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)
|
||||
}
|
||||
|
||||
func GetInitActorCodeID(av actors.Version) (cid.Cid, error) {
|
||||
if c, ok := actors.GetActorCodeID(av, actors.InitKey); ok {
|
||||
return c, nil
|
||||
}
|
||||
|
||||
switch av {
|
||||
|
||||
case actors.Version0:
|
||||
return builtin0.InitActorCodeID, nil
|
||||
|
||||
case actors.Version2:
|
||||
return builtin2.InitActorCodeID, nil
|
||||
|
||||
case actors.Version3:
|
||||
return builtin3.InitActorCodeID, nil
|
||||
|
||||
case actors.Version4:
|
||||
return builtin4.InitActorCodeID, nil
|
||||
|
||||
case actors.Version5:
|
||||
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)
|
||||
}
|
||||
|
||||
func GetMarketActorCodeID(av actors.Version) (cid.Cid, error) {
|
||||
if c, ok := actors.GetActorCodeID(av, actors.MarketKey); ok {
|
||||
return c, nil
|
||||
}
|
||||
|
||||
switch av {
|
||||
|
||||
case actors.Version0:
|
||||
return builtin0.StorageMarketActorCodeID, nil
|
||||
|
||||
case actors.Version2:
|
||||
return builtin2.StorageMarketActorCodeID, nil
|
||||
|
||||
case actors.Version3:
|
||||
return builtin3.StorageMarketActorCodeID, nil
|
||||
|
||||
case actors.Version4:
|
||||
return builtin4.StorageMarketActorCodeID, nil
|
||||
|
||||
case actors.Version5:
|
||||
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)
|
||||
}
|
||||
|
||||
func GetMinerActorCodeID(av actors.Version) (cid.Cid, error) {
|
||||
if c, ok := actors.GetActorCodeID(av, actors.MinerKey); ok {
|
||||
return c, nil
|
||||
}
|
||||
|
||||
switch av {
|
||||
|
||||
case actors.Version0:
|
||||
return builtin0.StorageMinerActorCodeID, nil
|
||||
|
||||
case actors.Version2:
|
||||
return builtin2.StorageMinerActorCodeID, nil
|
||||
|
||||
case actors.Version3:
|
||||
return builtin3.StorageMinerActorCodeID, nil
|
||||
|
||||
case actors.Version4:
|
||||
return builtin4.StorageMinerActorCodeID, nil
|
||||
|
||||
case actors.Version5:
|
||||
return builtin5.StorageMinerActorCodeID, nil
|
||||
|
||||
case actors.Version6:
|
||||
return builtin6.StorageMinerActorCodeID, nil
|
||||
|
||||
case actors.Version7:
|
||||
return builtin7.StorageMinerActorCodeID, nil
|
||||
|
||||
}
|
||||
|
||||
return cid.Undef, xerrors.Errorf("unknown actor version %d", av)
|
||||
}
|
||||
|
||||
func IsStorageMinerActor(c cid.Cid) bool {
|
||||
name, _, ok := actors.GetActorMetaByCode(c)
|
||||
if ok {
|
||||
return name == actors.MinerKey
|
||||
}
|
||||
|
||||
if c == builtin0.StorageMinerActorCodeID {
|
||||
return true
|
||||
@@ -255,7 +378,44 @@ func IsStorageMinerActor(c cid.Cid) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func GetMultisigActorCodeID(av actors.Version) (cid.Cid, error) {
|
||||
if c, ok := actors.GetActorCodeID(av, actors.MultisigKey); ok {
|
||||
return c, nil
|
||||
}
|
||||
|
||||
switch av {
|
||||
|
||||
case actors.Version0:
|
||||
return builtin0.MultisigActorCodeID, nil
|
||||
|
||||
case actors.Version2:
|
||||
return builtin2.MultisigActorCodeID, nil
|
||||
|
||||
case actors.Version3:
|
||||
return builtin3.MultisigActorCodeID, nil
|
||||
|
||||
case actors.Version4:
|
||||
return builtin4.MultisigActorCodeID, nil
|
||||
|
||||
case actors.Version5:
|
||||
return builtin5.MultisigActorCodeID, nil
|
||||
|
||||
case actors.Version6:
|
||||
return builtin6.MultisigActorCodeID, nil
|
||||
|
||||
case actors.Version7:
|
||||
return builtin7.MultisigActorCodeID, nil
|
||||
|
||||
}
|
||||
|
||||
return cid.Undef, xerrors.Errorf("unknown actor version %d", av)
|
||||
}
|
||||
|
||||
func IsMultisigActor(c cid.Cid) bool {
|
||||
name, _, ok := actors.GetActorMetaByCode(c)
|
||||
if ok {
|
||||
return name == actors.MultisigKey
|
||||
}
|
||||
|
||||
if c == builtin0.MultisigActorCodeID {
|
||||
return true
|
||||
@@ -288,7 +448,44 @@ func IsMultisigActor(c cid.Cid) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func GetPaymentChannelActorCodeID(av actors.Version) (cid.Cid, error) {
|
||||
if c, ok := actors.GetActorCodeID(av, actors.PaychKey); ok {
|
||||
return c, nil
|
||||
}
|
||||
|
||||
switch av {
|
||||
|
||||
case actors.Version0:
|
||||
return builtin0.PaymentChannelActorCodeID, nil
|
||||
|
||||
case actors.Version2:
|
||||
return builtin2.PaymentChannelActorCodeID, nil
|
||||
|
||||
case actors.Version3:
|
||||
return builtin3.PaymentChannelActorCodeID, nil
|
||||
|
||||
case actors.Version4:
|
||||
return builtin4.PaymentChannelActorCodeID, nil
|
||||
|
||||
case actors.Version5:
|
||||
return builtin5.PaymentChannelActorCodeID, nil
|
||||
|
||||
case actors.Version6:
|
||||
return builtin6.PaymentChannelActorCodeID, nil
|
||||
|
||||
case actors.Version7:
|
||||
return builtin7.PaymentChannelActorCodeID, nil
|
||||
|
||||
}
|
||||
|
||||
return cid.Undef, xerrors.Errorf("unknown actor version %d", av)
|
||||
}
|
||||
|
||||
func IsPaymentChannelActor(c cid.Cid) bool {
|
||||
name, _, ok := actors.GetActorMetaByCode(c)
|
||||
if ok {
|
||||
return name == "paymentchannel"
|
||||
}
|
||||
|
||||
if c == builtin0.PaymentChannelActorCodeID {
|
||||
return true
|
||||
@@ -321,6 +518,138 @@ func IsPaymentChannelActor(c cid.Cid) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func GetPowerActorCodeID(av actors.Version) (cid.Cid, error) {
|
||||
if c, ok := actors.GetActorCodeID(av, actors.PowerKey); ok {
|
||||
return c, nil
|
||||
}
|
||||
|
||||
switch av {
|
||||
|
||||
case actors.Version0:
|
||||
return builtin0.StoragePowerActorCodeID, nil
|
||||
|
||||
case actors.Version2:
|
||||
return builtin2.StoragePowerActorCodeID, nil
|
||||
|
||||
case actors.Version3:
|
||||
return builtin3.StoragePowerActorCodeID, nil
|
||||
|
||||
case actors.Version4:
|
||||
return builtin4.StoragePowerActorCodeID, nil
|
||||
|
||||
case actors.Version5:
|
||||
return builtin5.StoragePowerActorCodeID, nil
|
||||
|
||||
case actors.Version6:
|
||||
return builtin6.StoragePowerActorCodeID, nil
|
||||
|
||||
case actors.Version7:
|
||||
return builtin7.StoragePowerActorCodeID, nil
|
||||
|
||||
}
|
||||
|
||||
return cid.Undef, xerrors.Errorf("unknown actor version %d", av)
|
||||
}
|
||||
|
||||
func GetRewardActorCodeID(av actors.Version) (cid.Cid, error) {
|
||||
if c, ok := actors.GetActorCodeID(av, actors.RewardKey); ok {
|
||||
return c, nil
|
||||
}
|
||||
|
||||
switch av {
|
||||
|
||||
case actors.Version0:
|
||||
return builtin0.RewardActorCodeID, nil
|
||||
|
||||
case actors.Version2:
|
||||
return builtin2.RewardActorCodeID, nil
|
||||
|
||||
case actors.Version3:
|
||||
return builtin3.RewardActorCodeID, nil
|
||||
|
||||
case actors.Version4:
|
||||
return builtin4.RewardActorCodeID, nil
|
||||
|
||||
case actors.Version5:
|
||||
return builtin5.RewardActorCodeID, nil
|
||||
|
||||
case actors.Version6:
|
||||
return builtin6.RewardActorCodeID, nil
|
||||
|
||||
case actors.Version7:
|
||||
return builtin7.RewardActorCodeID, nil
|
||||
|
||||
}
|
||||
|
||||
return cid.Undef, xerrors.Errorf("unknown actor version %d", av)
|
||||
}
|
||||
|
||||
func GetSystemActorCodeID(av actors.Version) (cid.Cid, error) {
|
||||
if c, ok := actors.GetActorCodeID(av, actors.SystemKey); ok {
|
||||
return c, nil
|
||||
}
|
||||
|
||||
switch av {
|
||||
|
||||
case actors.Version0:
|
||||
return builtin0.SystemActorCodeID, nil
|
||||
|
||||
case actors.Version2:
|
||||
return builtin2.SystemActorCodeID, nil
|
||||
|
||||
case actors.Version3:
|
||||
return builtin3.SystemActorCodeID, nil
|
||||
|
||||
case actors.Version4:
|
||||
return builtin4.SystemActorCodeID, nil
|
||||
|
||||
case actors.Version5:
|
||||
return builtin5.SystemActorCodeID, nil
|
||||
|
||||
case actors.Version6:
|
||||
return builtin6.SystemActorCodeID, nil
|
||||
|
||||
case actors.Version7:
|
||||
return builtin7.SystemActorCodeID, nil
|
||||
|
||||
}
|
||||
|
||||
return cid.Undef, xerrors.Errorf("unknown actor version %d", av)
|
||||
}
|
||||
|
||||
func GetVerifregActorCodeID(av actors.Version) (cid.Cid, error) {
|
||||
if c, ok := actors.GetActorCodeID(av, actors.VerifregKey); ok {
|
||||
return c, nil
|
||||
}
|
||||
|
||||
switch av {
|
||||
|
||||
case actors.Version0:
|
||||
return builtin0.VerifiedRegistryActorCodeID, nil
|
||||
|
||||
case actors.Version2:
|
||||
return builtin2.VerifiedRegistryActorCodeID, nil
|
||||
|
||||
case actors.Version3:
|
||||
return builtin3.VerifiedRegistryActorCodeID, nil
|
||||
|
||||
case actors.Version4:
|
||||
return builtin4.VerifiedRegistryActorCodeID, nil
|
||||
|
||||
case actors.Version5:
|
||||
return builtin5.VerifiedRegistryActorCodeID, nil
|
||||
|
||||
case actors.Version6:
|
||||
return builtin6.VerifiedRegistryActorCodeID, nil
|
||||
|
||||
case actors.Version7:
|
||||
return builtin7.VerifiedRegistryActorCodeID, nil
|
||||
|
||||
}
|
||||
|
||||
return cid.Undef, xerrors.Errorf("unknown actor version %d", av)
|
||||
}
|
||||
|
||||
func makeAddress(addr string) address.Address {
|
||||
ret, err := address.NewFromString(addr)
|
||||
if err != nil {
|
||||
|
||||
@@ -1,140 +1,341 @@
|
||||
package builtin
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/ipfs/go-cid"
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
{{range .versions}}
|
||||
builtin{{.}} "github.com/filecoin-project/specs-actors{{import .}}actors/builtin"
|
||||
smoothing{{.}} "github.com/filecoin-project/specs-actors{{import .}}actors/util/smoothing"
|
||||
{{end}}
|
||||
{{range .versions}}
|
||||
builtin{{.}} "github.com/filecoin-project/specs-actors{{import .}}actors/builtin"
|
||||
{{end}}
|
||||
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
"github.com/filecoin-project/go-state-types/cbor"
|
||||
"github.com/filecoin-project/go-state-types/proof"
|
||||
"github.com/filecoin-project/go-state-types/builtin"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
|
||||
miner{{.latestVersion}} "github.com/filecoin-project/specs-actors{{import .latestVersion}}actors/builtin/miner"
|
||||
proof{{.latestVersion}} "github.com/filecoin-project/specs-actors{{import .latestVersion}}actors/runtime/proof"
|
||||
miner{{.latestVersion}} "github.com/filecoin-project/go-state-types/builtin/v8/miner"
|
||||
smoothingtypes "github.com/filecoin-project/go-state-types/builtin/v8/util/smoothing"
|
||||
)
|
||||
|
||||
var SystemActorAddr = builtin{{.latestVersion}}.SystemActorAddr
|
||||
var BurntFundsActorAddr = builtin{{.latestVersion}}.BurntFundsActorAddr
|
||||
var CronActorAddr = builtin{{.latestVersion}}.CronActorAddr
|
||||
var SystemActorAddr = builtin.SystemActorAddr
|
||||
var BurntFundsActorAddr = builtin.BurntFundsActorAddr
|
||||
var CronActorAddr = builtin.CronActorAddr
|
||||
var SaftAddress = makeAddress("t0122")
|
||||
var ReserveAddress = makeAddress("t090")
|
||||
var RootVerifierAddress = makeAddress("t080")
|
||||
|
||||
var (
|
||||
ExpectedLeadersPerEpoch = builtin{{.latestVersion}}.ExpectedLeadersPerEpoch
|
||||
ExpectedLeadersPerEpoch = builtin.ExpectedLeadersPerEpoch
|
||||
)
|
||||
|
||||
const (
|
||||
EpochDurationSeconds = builtin{{.latestVersion}}.EpochDurationSeconds
|
||||
EpochsInDay = builtin{{.latestVersion}}.EpochsInDay
|
||||
SecondsInDay = builtin{{.latestVersion}}.SecondsInDay
|
||||
EpochDurationSeconds = builtin.EpochDurationSeconds
|
||||
EpochsInDay = builtin.EpochsInDay
|
||||
SecondsInDay = builtin.SecondsInDay
|
||||
)
|
||||
|
||||
const (
|
||||
MethodSend = builtin{{.latestVersion}}.MethodSend
|
||||
MethodConstructor = builtin{{.latestVersion}}.MethodConstructor
|
||||
MethodSend = builtin.MethodSend
|
||||
MethodConstructor = builtin.MethodConstructor
|
||||
)
|
||||
|
||||
// These are all just type aliases across actor versions. In the future, that might change
|
||||
// and we might need to do something fancier.
|
||||
type SectorInfo = proof{{.latestVersion}}.SectorInfo
|
||||
type ExtendedSectorInfo = proof{{.latestVersion}}.ExtendedSectorInfo
|
||||
type PoStProof = proof{{.latestVersion}}.PoStProof
|
||||
type FilterEstimate = smoothing0.FilterEstimate
|
||||
type SectorInfo = proof.SectorInfo
|
||||
type ExtendedSectorInfo = proof.ExtendedSectorInfo
|
||||
type PoStProof = proof.PoStProof
|
||||
type FilterEstimate = smoothingtypes.FilterEstimate
|
||||
|
||||
func QAPowerForWeight(size abi.SectorSize, duration abi.ChainEpoch, dealWeight, verifiedWeight abi.DealWeight) abi.StoragePower {
|
||||
return miner{{.latestVersion}}.QAPowerForWeight(size, duration, dealWeight, verifiedWeight)
|
||||
}
|
||||
|
||||
{{range .versions}}
|
||||
func FromV{{.}}FilterEstimate(v{{.}} smoothing{{.}}.FilterEstimate) FilterEstimate {
|
||||
{{if (eq . 0)}}
|
||||
return (FilterEstimate)(v{{.}}) //nolint:unconvert
|
||||
{{else}}
|
||||
return (FilterEstimate)(v{{.}})
|
||||
{{end}}
|
||||
}
|
||||
{{end}}
|
||||
|
||||
type ActorStateLoader func(store adt.Store, root cid.Cid) (cbor.Marshaler, error)
|
||||
|
||||
var ActorStateLoaders = make(map[cid.Cid]ActorStateLoader)
|
||||
|
||||
func RegisterActorState(code cid.Cid, loader ActorStateLoader) {
|
||||
ActorStateLoaders[code] = loader
|
||||
}
|
||||
|
||||
func Load(store adt.Store, act *types.Actor) (cbor.Marshaler, error) {
|
||||
loader, found := ActorStateLoaders[act.Code]
|
||||
if !found {
|
||||
return nil, xerrors.Errorf("unknown actor code %s", act.Code)
|
||||
}
|
||||
return loader(store, act.Head)
|
||||
}
|
||||
|
||||
func ActorNameByCode(c cid.Cid) string {
|
||||
if name, version, ok := actors.GetActorMetaByCode(c); ok {
|
||||
return fmt.Sprintf("fil/%d/%s", version, name)
|
||||
}
|
||||
|
||||
switch {
|
||||
{{range .versions}}
|
||||
case builtin{{.}}.IsBuiltinActor(c):
|
||||
return builtin{{.}}.ActorNameByCode(c)
|
||||
{{end}}
|
||||
{{range .versions}}
|
||||
case builtin{{.}}.IsBuiltinActor(c):
|
||||
return builtin{{.}}.ActorNameByCode(c)
|
||||
{{end}}
|
||||
default:
|
||||
return "<unknown>"
|
||||
}
|
||||
}
|
||||
|
||||
func IsBuiltinActor(c cid.Cid) bool {
|
||||
_, _, ok := actors.GetActorMetaByCode(c)
|
||||
if ok {
|
||||
return true
|
||||
}
|
||||
|
||||
{{range .versions}}
|
||||
if builtin{{.}}.IsBuiltinActor(c) {
|
||||
return true
|
||||
}
|
||||
{{if (le . 7)}}
|
||||
if builtin{{.}}.IsBuiltinActor(c) {
|
||||
return true
|
||||
}
|
||||
{{end}}
|
||||
{{end}}
|
||||
return false
|
||||
}
|
||||
|
||||
func GetAccountActorCodeID(av actors.Version) (cid.Cid, error) {
|
||||
if c, ok := actors.GetActorCodeID(av, actors.AccountKey); ok {
|
||||
return c, nil
|
||||
}
|
||||
|
||||
switch av {
|
||||
{{range .versions}}
|
||||
{{if (le . 7)}}
|
||||
case actors.Version{{.}}:
|
||||
return builtin{{.}}.AccountActorCodeID, nil
|
||||
{{end}}
|
||||
{{end}}
|
||||
}
|
||||
|
||||
return cid.Undef, xerrors.Errorf("unknown actor version %d", av)
|
||||
}
|
||||
|
||||
func IsAccountActor(c cid.Cid) bool {
|
||||
name, _, ok := actors.GetActorMetaByCode(c)
|
||||
if ok {
|
||||
return name == "account"
|
||||
}
|
||||
|
||||
{{range .versions}}
|
||||
if c == builtin{{.}}.AccountActorCodeID {
|
||||
return true
|
||||
}
|
||||
{{if (le . 7)}}
|
||||
if c == builtin{{.}}.AccountActorCodeID {
|
||||
return true
|
||||
}
|
||||
{{end}}
|
||||
{{end}}
|
||||
return false
|
||||
}
|
||||
|
||||
func GetCronActorCodeID(av actors.Version) (cid.Cid, error) {
|
||||
if c, ok := actors.GetActorCodeID(av, actors.CronKey); ok {
|
||||
return c, nil
|
||||
}
|
||||
|
||||
switch av {
|
||||
{{range .versions}}
|
||||
{{if (le . 7)}}
|
||||
case actors.Version{{.}}:
|
||||
return builtin{{.}}.CronActorCodeID, nil
|
||||
{{end}}
|
||||
{{end}}
|
||||
}
|
||||
|
||||
return cid.Undef, xerrors.Errorf("unknown actor version %d", av)
|
||||
}
|
||||
|
||||
func GetInitActorCodeID(av actors.Version) (cid.Cid, error) {
|
||||
if c, ok := actors.GetActorCodeID(av, actors.InitKey); ok {
|
||||
return c, nil
|
||||
}
|
||||
|
||||
switch av {
|
||||
{{range .versions}}
|
||||
{{if (le . 7)}}
|
||||
case actors.Version{{.}}:
|
||||
return builtin{{.}}.InitActorCodeID, nil
|
||||
{{end}}
|
||||
{{end}}
|
||||
}
|
||||
|
||||
return cid.Undef, xerrors.Errorf("unknown actor version %d", av)
|
||||
}
|
||||
|
||||
func GetMarketActorCodeID(av actors.Version) (cid.Cid, error) {
|
||||
if c, ok := actors.GetActorCodeID(av, actors.MarketKey); ok {
|
||||
return c, nil
|
||||
}
|
||||
|
||||
switch av {
|
||||
{{range .versions}}
|
||||
{{if (le . 7)}}
|
||||
case actors.Version{{.}}:
|
||||
return builtin{{.}}.StorageMarketActorCodeID, nil
|
||||
{{end}}
|
||||
{{end}}
|
||||
}
|
||||
|
||||
return cid.Undef, xerrors.Errorf("unknown actor version %d", av)
|
||||
}
|
||||
|
||||
func GetMinerActorCodeID(av actors.Version) (cid.Cid, error) {
|
||||
if c, ok := actors.GetActorCodeID(av, actors.MinerKey); ok {
|
||||
return c, nil
|
||||
}
|
||||
|
||||
switch av {
|
||||
{{range .versions}}
|
||||
{{if (le . 7)}}
|
||||
case actors.Version{{.}}:
|
||||
return builtin{{.}}.StorageMinerActorCodeID, nil
|
||||
{{end}}
|
||||
{{end}}
|
||||
}
|
||||
|
||||
return cid.Undef, xerrors.Errorf("unknown actor version %d", av)
|
||||
}
|
||||
|
||||
func IsStorageMinerActor(c cid.Cid) bool {
|
||||
name, _, ok := actors.GetActorMetaByCode(c)
|
||||
if ok {
|
||||
return name == actors.MinerKey
|
||||
}
|
||||
|
||||
{{range .versions}}
|
||||
if c == builtin{{.}}.StorageMinerActorCodeID {
|
||||
return true
|
||||
}
|
||||
{{if (le . 7)}}
|
||||
if c == builtin{{.}}.StorageMinerActorCodeID {
|
||||
return true
|
||||
}
|
||||
{{end}}
|
||||
{{end}}
|
||||
return false
|
||||
}
|
||||
|
||||
func GetMultisigActorCodeID(av actors.Version) (cid.Cid, error) {
|
||||
if c, ok := actors.GetActorCodeID(av, actors.MultisigKey); ok {
|
||||
return c, nil
|
||||
}
|
||||
|
||||
switch av {
|
||||
{{range .versions}}
|
||||
{{if (le . 7)}}
|
||||
case actors.Version{{.}}:
|
||||
return builtin{{.}}.MultisigActorCodeID, nil
|
||||
{{end}}
|
||||
{{end}}
|
||||
}
|
||||
|
||||
return cid.Undef, xerrors.Errorf("unknown actor version %d", av)
|
||||
}
|
||||
|
||||
func IsMultisigActor(c cid.Cid) bool {
|
||||
name, _, ok := actors.GetActorMetaByCode(c)
|
||||
if ok {
|
||||
return name == actors.MultisigKey
|
||||
}
|
||||
|
||||
{{range .versions}}
|
||||
if c == builtin{{.}}.MultisigActorCodeID {
|
||||
return true
|
||||
}
|
||||
{{if (le . 7)}}
|
||||
if c == builtin{{.}}.MultisigActorCodeID {
|
||||
return true
|
||||
}
|
||||
{{end}}
|
||||
{{end}}
|
||||
return false
|
||||
}
|
||||
|
||||
func GetPaymentChannelActorCodeID(av actors.Version) (cid.Cid, error) {
|
||||
if c, ok := actors.GetActorCodeID(av, actors.PaychKey); ok {
|
||||
return c, nil
|
||||
}
|
||||
|
||||
switch av {
|
||||
{{range .versions}}
|
||||
{{if (le . 7)}}
|
||||
case actors.Version{{.}}:
|
||||
return builtin{{.}}.PaymentChannelActorCodeID, nil
|
||||
{{end}}
|
||||
{{end}}
|
||||
}
|
||||
|
||||
return cid.Undef, xerrors.Errorf("unknown actor version %d", av)
|
||||
}
|
||||
|
||||
func IsPaymentChannelActor(c cid.Cid) bool {
|
||||
name, _, ok := actors.GetActorMetaByCode(c)
|
||||
if ok {
|
||||
return name == "paymentchannel"
|
||||
}
|
||||
|
||||
{{range .versions}}
|
||||
if c == builtin{{.}}.PaymentChannelActorCodeID {
|
||||
return true
|
||||
}
|
||||
{{if (le . 7)}}
|
||||
if c == builtin{{.}}.PaymentChannelActorCodeID {
|
||||
return true
|
||||
}
|
||||
{{end}}
|
||||
{{end}}
|
||||
return false
|
||||
}
|
||||
|
||||
func GetPowerActorCodeID(av actors.Version) (cid.Cid, error) {
|
||||
if c, ok := actors.GetActorCodeID(av, actors.PowerKey); ok {
|
||||
return c, nil
|
||||
}
|
||||
|
||||
switch av {
|
||||
{{range .versions}}
|
||||
{{if (le . 7)}}
|
||||
case actors.Version{{.}}:
|
||||
return builtin{{.}}.StoragePowerActorCodeID, nil
|
||||
{{end}}
|
||||
{{end}}
|
||||
}
|
||||
|
||||
return cid.Undef, xerrors.Errorf("unknown actor version %d", av)
|
||||
}
|
||||
|
||||
func GetRewardActorCodeID(av actors.Version) (cid.Cid, error) {
|
||||
if c, ok := actors.GetActorCodeID(av, actors.RewardKey); ok {
|
||||
return c, nil
|
||||
}
|
||||
|
||||
switch av {
|
||||
{{range .versions}}
|
||||
{{if (le . 7)}}
|
||||
case actors.Version{{.}}:
|
||||
return builtin{{.}}.RewardActorCodeID, nil
|
||||
{{end}}
|
||||
{{end}}
|
||||
}
|
||||
|
||||
return cid.Undef, xerrors.Errorf("unknown actor version %d", av)
|
||||
}
|
||||
|
||||
func GetSystemActorCodeID(av actors.Version) (cid.Cid, error) {
|
||||
if c, ok := actors.GetActorCodeID(av, actors.SystemKey); ok {
|
||||
return c, nil
|
||||
}
|
||||
|
||||
switch av {
|
||||
{{range .versions}}
|
||||
{{if (le . 7)}}
|
||||
case actors.Version{{.}}:
|
||||
return builtin{{.}}.SystemActorCodeID, nil
|
||||
{{end}}
|
||||
{{end}}
|
||||
}
|
||||
|
||||
return cid.Undef, xerrors.Errorf("unknown actor version %d", av)
|
||||
}
|
||||
|
||||
func GetVerifregActorCodeID(av actors.Version) (cid.Cid, error) {
|
||||
if c, ok := actors.GetActorCodeID(av, actors.VerifregKey); ok {
|
||||
return c, nil
|
||||
}
|
||||
|
||||
switch av {
|
||||
{{range .versions}}
|
||||
{{if (le . 7)}}
|
||||
case actors.Version{{.}}:
|
||||
return builtin{{.}}.VerifiedRegistryActorCodeID, nil
|
||||
{{end}}
|
||||
{{end}}
|
||||
}
|
||||
|
||||
return cid.Undef, xerrors.Errorf("unknown actor version %d", av)
|
||||
}
|
||||
|
||||
func makeAddress(addr string) address.Address {
|
||||
ret, err := address.NewFromString(addr)
|
||||
if err != nil {
|
||||
|
||||
@@ -4,12 +4,45 @@ import (
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
"golang.org/x/xerrors"
|
||||
"github.com/ipfs/go-cid"
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
|
||||
{{range .versions}}
|
||||
builtin{{.}} "github.com/filecoin-project/specs-actors{{import .}}actors/builtin"
|
||||
{{if (le . 7)}}
|
||||
builtin{{.}} "github.com/filecoin-project/specs-actors{{import .}}actors/builtin"
|
||||
{{else}}
|
||||
builtin{{.}} "github.com/filecoin-project/go-state-types/builtin"
|
||||
{{end}}
|
||||
{{end}}
|
||||
)
|
||||
|
||||
func Load(store adt.Store, act *types.Actor) (State, error) {
|
||||
if name, av, ok := actors.GetActorMetaByCode(act.Code); ok {
|
||||
if name != actors.CronKey {
|
||||
return nil, xerrors.Errorf("actor code is not cron: %s", name)
|
||||
}
|
||||
|
||||
switch av {
|
||||
{{range .versions}}
|
||||
{{if (ge . 8)}}
|
||||
case actors.Version{{.}}:
|
||||
return load{{.}}(store, act.Head)
|
||||
{{end}}
|
||||
{{end}}
|
||||
}
|
||||
}
|
||||
|
||||
switch act.Code {
|
||||
{{range .versions}}
|
||||
{{if (le . 7)}}
|
||||
case builtin{{.}}.CronActorCodeID:
|
||||
return load{{.}}(store, act.Head)
|
||||
{{end}}
|
||||
{{end}}
|
||||
}
|
||||
|
||||
return nil, xerrors.Errorf("unknown actor code %s", act.Code)
|
||||
}
|
||||
|
||||
func MakeState(store adt.Store, av actors.Version) (State, error) {
|
||||
switch av {
|
||||
{{range .versions}}
|
||||
@@ -20,17 +53,6 @@ func MakeState(store adt.Store, av actors.Version) (State, error) {
|
||||
return nil, xerrors.Errorf("unknown actor version %d", av)
|
||||
}
|
||||
|
||||
func GetActorCodeID(av actors.Version) (cid.Cid, error) {
|
||||
switch av {
|
||||
{{range .versions}}
|
||||
case actors.Version{{.}}:
|
||||
return builtin{{.}}.CronActorCodeID, nil
|
||||
{{end}}
|
||||
}
|
||||
|
||||
return cid.Undef, xerrors.Errorf("unknown actor version %d", av)
|
||||
}
|
||||
|
||||
var (
|
||||
Address = builtin{{.latestVersion}}.CronActorAddr
|
||||
Methods = builtin{{.latestVersion}}.MethodsCron
|
||||
|
||||
@@ -3,7 +3,7 @@ package cron
|
||||
import (
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
"github.com/ipfs/go-cid"
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
builtin0 "github.com/filecoin-project/specs-actors/actors/builtin"
|
||||
@@ -19,8 +19,52 @@ import (
|
||||
builtin6 "github.com/filecoin-project/specs-actors/v6/actors/builtin"
|
||||
|
||||
builtin7 "github.com/filecoin-project/specs-actors/v7/actors/builtin"
|
||||
|
||||
builtin8 "github.com/filecoin-project/go-state-types/builtin"
|
||||
)
|
||||
|
||||
func Load(store adt.Store, act *types.Actor) (State, error) {
|
||||
if name, av, ok := actors.GetActorMetaByCode(act.Code); ok {
|
||||
if name != actors.CronKey {
|
||||
return nil, xerrors.Errorf("actor code is not cron: %s", name)
|
||||
}
|
||||
|
||||
switch av {
|
||||
|
||||
case actors.Version8:
|
||||
return load8(store, act.Head)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
switch act.Code {
|
||||
|
||||
case builtin0.CronActorCodeID:
|
||||
return load0(store, act.Head)
|
||||
|
||||
case builtin2.CronActorCodeID:
|
||||
return load2(store, act.Head)
|
||||
|
||||
case builtin3.CronActorCodeID:
|
||||
return load3(store, act.Head)
|
||||
|
||||
case builtin4.CronActorCodeID:
|
||||
return load4(store, act.Head)
|
||||
|
||||
case builtin5.CronActorCodeID:
|
||||
return load5(store, act.Head)
|
||||
|
||||
case builtin6.CronActorCodeID:
|
||||
return load6(store, act.Head)
|
||||
|
||||
case builtin7.CronActorCodeID:
|
||||
return load7(store, act.Head)
|
||||
|
||||
}
|
||||
|
||||
return nil, xerrors.Errorf("unknown actor code %s", act.Code)
|
||||
}
|
||||
|
||||
func MakeState(store adt.Store, av actors.Version) (State, error) {
|
||||
switch av {
|
||||
|
||||
@@ -45,42 +89,16 @@ func MakeState(store adt.Store, av actors.Version) (State, error) {
|
||||
case actors.Version7:
|
||||
return make7(store)
|
||||
|
||||
case actors.Version8:
|
||||
return make8(store)
|
||||
|
||||
}
|
||||
return nil, xerrors.Errorf("unknown actor version %d", av)
|
||||
}
|
||||
|
||||
func GetActorCodeID(av actors.Version) (cid.Cid, error) {
|
||||
switch av {
|
||||
|
||||
case actors.Version0:
|
||||
return builtin0.CronActorCodeID, nil
|
||||
|
||||
case actors.Version2:
|
||||
return builtin2.CronActorCodeID, nil
|
||||
|
||||
case actors.Version3:
|
||||
return builtin3.CronActorCodeID, nil
|
||||
|
||||
case actors.Version4:
|
||||
return builtin4.CronActorCodeID, nil
|
||||
|
||||
case actors.Version5:
|
||||
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)
|
||||
}
|
||||
|
||||
var (
|
||||
Address = builtin7.CronActorAddr
|
||||
Methods = builtin7.MethodsCron
|
||||
Address = builtin8.CronActorAddr
|
||||
Methods = builtin8.MethodsCron
|
||||
)
|
||||
|
||||
type State interface {
|
||||
|
||||
@@ -5,7 +5,11 @@ import (
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
|
||||
{{if (le .v 7)}}
|
||||
cron{{.v}} "github.com/filecoin-project/specs-actors{{.import}}actors/builtin/cron"
|
||||
{{else}}
|
||||
cron{{.v}} "github.com/filecoin-project/go-state-types/builtin{{.import}}cron"
|
||||
{{end}}
|
||||
)
|
||||
|
||||
var _ State = (*state{{.v}})(nil)
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
package cron
|
||||
|
||||
import (
|
||||
"github.com/ipfs/go-cid"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
|
||||
cron8 "github.com/filecoin-project/go-state-types/builtin/v8/cron"
|
||||
)
|
||||
|
||||
var _ State = (*state8)(nil)
|
||||
|
||||
func load8(store adt.Store, root cid.Cid) (State, error) {
|
||||
out := state8{store: store}
|
||||
err := store.Get(store.Context(), root, &out)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &out, nil
|
||||
}
|
||||
|
||||
func make8(store adt.Store) (State, error) {
|
||||
out := state8{store: store}
|
||||
out.State = *cron8.ConstructState(cron8.BuiltInEntries())
|
||||
return &out, nil
|
||||
}
|
||||
|
||||
type state8 struct {
|
||||
cron8.State
|
||||
store adt.Store
|
||||
}
|
||||
|
||||
func (s *state8) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
@@ -10,33 +10,47 @@ import (
|
||||
"github.com/ipfs/go-cid"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
"github.com/filecoin-project/lotus/chain/actors/builtin"
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
"github.com/filecoin-project/lotus/node/modules/dtypes"
|
||||
{{range .versions}}
|
||||
builtin{{.}} "github.com/filecoin-project/specs-actors{{import .}}actors/builtin"
|
||||
{{if (le . 7)}}
|
||||
builtin{{.}} "github.com/filecoin-project/specs-actors{{import .}}actors/builtin"
|
||||
{{else}}
|
||||
builtin{{.}} "github.com/filecoin-project/go-state-types/builtin"
|
||||
{{end}}
|
||||
{{end}}
|
||||
)
|
||||
|
||||
func init() {
|
||||
{{range .versions}}
|
||||
builtin.RegisterActorState(builtin{{.}}.InitActorCodeID, func(store adt.Store, root cid.Cid) (cbor.Marshaler, error) {
|
||||
return load{{.}}(store, root)
|
||||
})
|
||||
{{end}}}
|
||||
|
||||
var (
|
||||
Address = builtin{{.latestVersion}}.InitActorAddr
|
||||
Methods = builtin{{.latestVersion}}.MethodsInit
|
||||
)
|
||||
|
||||
func Load(store adt.Store, act *types.Actor) (State, error) {
|
||||
if name, av, ok := actors.GetActorMetaByCode(act.Code); ok {
|
||||
if name != actors.InitKey {
|
||||
return nil, xerrors.Errorf("actor code is not init: %s", name)
|
||||
}
|
||||
|
||||
switch av {
|
||||
{{range .versions}}
|
||||
{{if (ge . 8)}}
|
||||
case actors.Version{{.}}:
|
||||
return load{{.}}(store, act.Head)
|
||||
{{end}}
|
||||
{{end}}
|
||||
}
|
||||
}
|
||||
|
||||
switch act.Code {
|
||||
{{range .versions}}
|
||||
case builtin{{.}}.InitActorCodeID:
|
||||
return load{{.}}(store, act.Head)
|
||||
{{if (le . 7)}}
|
||||
case builtin{{.}}.InitActorCodeID:
|
||||
return load{{.}}(store, act.Head)
|
||||
{{end}}
|
||||
{{end}}
|
||||
}
|
||||
|
||||
return nil, xerrors.Errorf("unknown actor code %s", act.Code)
|
||||
}
|
||||
|
||||
@@ -50,17 +64,6 @@ func MakeState(store adt.Store, av actors.Version, networkName string) (State, e
|
||||
return nil, xerrors.Errorf("unknown actor version %d", av)
|
||||
}
|
||||
|
||||
func GetActorCodeID(av actors.Version) (cid.Cid, error) {
|
||||
switch av {
|
||||
{{range .versions}}
|
||||
case actors.Version{{.}}:
|
||||
return builtin{{.}}.InitActorCodeID, nil
|
||||
{{end}}
|
||||
}
|
||||
|
||||
return cid.Undef, xerrors.Errorf("unknown actor version %d", av)
|
||||
}
|
||||
|
||||
type State interface {
|
||||
cbor.Marshaler
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@ import (
|
||||
"github.com/ipfs/go-cid"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
"github.com/filecoin-project/lotus/chain/actors/builtin"
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
"github.com/filecoin-project/lotus/node/modules/dtypes"
|
||||
|
||||
@@ -27,45 +26,29 @@ import (
|
||||
builtin6 "github.com/filecoin-project/specs-actors/v6/actors/builtin"
|
||||
|
||||
builtin7 "github.com/filecoin-project/specs-actors/v7/actors/builtin"
|
||||
|
||||
builtin8 "github.com/filecoin-project/go-state-types/builtin"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
||||
builtin.RegisterActorState(builtin0.InitActorCodeID, func(store adt.Store, root cid.Cid) (cbor.Marshaler, error) {
|
||||
return load0(store, root)
|
||||
})
|
||||
|
||||
builtin.RegisterActorState(builtin2.InitActorCodeID, func(store adt.Store, root cid.Cid) (cbor.Marshaler, error) {
|
||||
return load2(store, root)
|
||||
})
|
||||
|
||||
builtin.RegisterActorState(builtin3.InitActorCodeID, func(store adt.Store, root cid.Cid) (cbor.Marshaler, error) {
|
||||
return load3(store, root)
|
||||
})
|
||||
|
||||
builtin.RegisterActorState(builtin4.InitActorCodeID, func(store adt.Store, root cid.Cid) (cbor.Marshaler, error) {
|
||||
return load4(store, root)
|
||||
})
|
||||
|
||||
builtin.RegisterActorState(builtin5.InitActorCodeID, func(store adt.Store, root cid.Cid) (cbor.Marshaler, error) {
|
||||
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 (
|
||||
Address = builtin7.InitActorAddr
|
||||
Methods = builtin7.MethodsInit
|
||||
Address = builtin8.InitActorAddr
|
||||
Methods = builtin8.MethodsInit
|
||||
)
|
||||
|
||||
func Load(store adt.Store, act *types.Actor) (State, error) {
|
||||
if name, av, ok := actors.GetActorMetaByCode(act.Code); ok {
|
||||
if name != actors.InitKey {
|
||||
return nil, xerrors.Errorf("actor code is not init: %s", name)
|
||||
}
|
||||
|
||||
switch av {
|
||||
|
||||
case actors.Version8:
|
||||
return load8(store, act.Head)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
switch act.Code {
|
||||
|
||||
case builtin0.InitActorCodeID:
|
||||
@@ -90,6 +73,7 @@ func Load(store adt.Store, act *types.Actor) (State, error) {
|
||||
return load7(store, act.Head)
|
||||
|
||||
}
|
||||
|
||||
return nil, xerrors.Errorf("unknown actor code %s", act.Code)
|
||||
}
|
||||
|
||||
@@ -117,39 +101,13 @@ func MakeState(store adt.Store, av actors.Version, networkName string) (State, e
|
||||
case actors.Version7:
|
||||
return make7(store, networkName)
|
||||
|
||||
case actors.Version8:
|
||||
return make8(store, networkName)
|
||||
|
||||
}
|
||||
return nil, xerrors.Errorf("unknown actor version %d", av)
|
||||
}
|
||||
|
||||
func GetActorCodeID(av actors.Version) (cid.Cid, error) {
|
||||
switch av {
|
||||
|
||||
case actors.Version0:
|
||||
return builtin0.InitActorCodeID, nil
|
||||
|
||||
case actors.Version2:
|
||||
return builtin2.InitActorCodeID, nil
|
||||
|
||||
case actors.Version3:
|
||||
return builtin3.InitActorCodeID, nil
|
||||
|
||||
case actors.Version4:
|
||||
return builtin4.InitActorCodeID, nil
|
||||
|
||||
case actors.Version5:
|
||||
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)
|
||||
}
|
||||
|
||||
type State interface {
|
||||
cbor.Marshaler
|
||||
|
||||
|
||||
@@ -10,12 +10,17 @@ import (
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
"github.com/filecoin-project/lotus/node/modules/dtypes"
|
||||
|
||||
{{if (ge .v 3)}}
|
||||
builtin{{.v}} "github.com/filecoin-project/specs-actors{{.import}}actors/builtin"
|
||||
{{end}}
|
||||
|
||||
{{if (le .v 7)}}
|
||||
{{if (ge .v 3)}}
|
||||
builtin{{.v}} "github.com/filecoin-project/specs-actors{{.import}}actors/builtin"
|
||||
{{end}}
|
||||
init{{.v}} "github.com/filecoin-project/specs-actors{{.import}}actors/builtin/init"
|
||||
adt{{.v}} "github.com/filecoin-project/specs-actors{{.import}}actors/util/adt"
|
||||
{{else}}
|
||||
init{{.v}} "github.com/filecoin-project/go-state-types/builtin{{.import}}init"
|
||||
adt{{.v}} "github.com/filecoin-project/go-state-types/builtin{{.import}}util/adt"
|
||||
builtin{{.v}} "github.com/filecoin-project/go-state-types/builtin"
|
||||
{{end}}
|
||||
)
|
||||
|
||||
var _ State = (*state{{.v}})(nil)
|
||||
|
||||
@@ -0,0 +1,113 @@
|
||||
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"
|
||||
|
||||
builtin8 "github.com/filecoin-project/go-state-types/builtin"
|
||||
init8 "github.com/filecoin-project/go-state-types/builtin/v8/init"
|
||||
adt8 "github.com/filecoin-project/go-state-types/builtin/v8/util/adt"
|
||||
)
|
||||
|
||||
var _ State = (*state8)(nil)
|
||||
|
||||
func load8(store adt.Store, root cid.Cid) (State, error) {
|
||||
out := state8{store: store}
|
||||
err := store.Get(store.Context(), root, &out)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &out, nil
|
||||
}
|
||||
|
||||
func make8(store adt.Store, networkName string) (State, error) {
|
||||
out := state8{store: store}
|
||||
|
||||
s, err := init8.ConstructState(store, networkName)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
out.State = *s
|
||||
|
||||
return &out, nil
|
||||
}
|
||||
|
||||
type state8 struct {
|
||||
init8.State
|
||||
store adt.Store
|
||||
}
|
||||
|
||||
func (s *state8) ResolveAddress(address address.Address) (address.Address, bool, error) {
|
||||
return s.State.ResolveAddress(s.store, address)
|
||||
}
|
||||
|
||||
func (s *state8) MapAddressToNewID(address address.Address) (address.Address, error) {
|
||||
return s.State.MapAddressToNewID(s.store, address)
|
||||
}
|
||||
|
||||
func (s *state8) ForEachActor(cb func(id abi.ActorID, address address.Address) error) error {
|
||||
addrs, err := adt8.AsMap(s.store, s.State.AddressMap, builtin8.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 *state8) NetworkName() (dtypes.NetworkName, error) {
|
||||
return dtypes.NetworkName(s.State.NetworkName), nil
|
||||
}
|
||||
|
||||
func (s *state8) SetNetworkName(name string) error {
|
||||
s.State.NetworkName = name
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *state8) SetNextID(id abi.ActorID) error {
|
||||
s.State.NextID = id
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *state8) Remove(addrs ...address.Address) (err error) {
|
||||
m, err := adt8.AsMap(s.store, s.State.AddressMap, builtin8.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 *state8) SetAddressMap(mcid cid.Cid) error {
|
||||
s.State.AddressMap = mcid
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *state8) AddressMap() (adt.Map, error) {
|
||||
return adt8.AsMap(s.store, s.State.AddressMap, builtin8.DefaultHamtBitwidth)
|
||||
}
|
||||
|
||||
func (s *state8) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
package market
|
||||
|
||||
import (
|
||||
"unicode/utf8"
|
||||
|
||||
"github.com/filecoin-project/go-state-types/network"
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
@@ -8,39 +10,52 @@ import (
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
"github.com/filecoin-project/go-state-types/big"
|
||||
"github.com/filecoin-project/go-state-types/cbor"
|
||||
"github.com/ipfs/go-cid"
|
||||
cbg "github.com/whyrusleeping/cbor-gen"
|
||||
|
||||
market0 "github.com/filecoin-project/specs-actors/actors/builtin/market"
|
||||
market{{.latestVersion}} "github.com/filecoin-project/go-state-types/builtin{{import .latestVersion}}market"
|
||||
{{range .versions}}
|
||||
builtin{{.}} "github.com/filecoin-project/specs-actors{{import .}}actors/builtin"
|
||||
{{if (le . 7)}}
|
||||
builtin{{.}} "github.com/filecoin-project/specs-actors{{import .}}actors/builtin"
|
||||
{{else}}
|
||||
builtin{{.}} "github.com/filecoin-project/go-state-types/builtin"
|
||||
{{end}}
|
||||
{{end}}
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/builtin"
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
)
|
||||
|
||||
func init() {
|
||||
{{range .versions}}
|
||||
builtin.RegisterActorState(builtin{{.}}.StorageMarketActorCodeID, func(store adt.Store, root cid.Cid) (cbor.Marshaler, error) {
|
||||
return load{{.}}(store, root)
|
||||
})
|
||||
{{end}}}
|
||||
|
||||
var (
|
||||
Address = builtin{{.latestVersion}}.StorageMarketActorAddr
|
||||
Methods = builtin{{.latestVersion}}.MethodsMarket
|
||||
)
|
||||
|
||||
func Load(store adt.Store, act *types.Actor) (State, error) {
|
||||
if name, av, ok := actors.GetActorMetaByCode(act.Code); ok {
|
||||
if name != actors.MarketKey {
|
||||
return nil, xerrors.Errorf("actor code is not market: %s", name)
|
||||
}
|
||||
|
||||
switch av {
|
||||
{{range .versions}}
|
||||
{{if (ge . 8)}}
|
||||
case actors.Version{{.}}:
|
||||
return load{{.}}(store, act.Head)
|
||||
{{end}}
|
||||
{{end}}
|
||||
}
|
||||
}
|
||||
|
||||
switch act.Code {
|
||||
{{range .versions}}
|
||||
case builtin{{.}}.StorageMarketActorCodeID:
|
||||
return load{{.}}(store, act.Head)
|
||||
{{if (le . 7)}}
|
||||
case builtin{{.}}.StorageMarketActorCodeID:
|
||||
return load{{.}}(store, act.Head)
|
||||
{{end}}
|
||||
{{end}}
|
||||
}
|
||||
|
||||
return nil, xerrors.Errorf("unknown actor code %s", act.Code)
|
||||
}
|
||||
|
||||
@@ -54,17 +69,6 @@ func MakeState(store adt.Store, av actors.Version) (State, error) {
|
||||
return nil, xerrors.Errorf("unknown actor version %d", av)
|
||||
}
|
||||
|
||||
func GetActorCodeID(av actors.Version) (cid.Cid, error) {
|
||||
switch av {
|
||||
{{range .versions}}
|
||||
case actors.Version{{.}}:
|
||||
return builtin{{.}}.StorageMarketActorCodeID, nil
|
||||
{{end}}
|
||||
}
|
||||
|
||||
return cid.Undef, xerrors.Errorf("unknown actor version %d", av)
|
||||
}
|
||||
|
||||
type State interface {
|
||||
cbor.Marshaler
|
||||
BalancesChanged(State) (bool, error)
|
||||
@@ -96,19 +100,18 @@ type DealStates interface {
|
||||
}
|
||||
|
||||
type DealProposals interface {
|
||||
ForEach(cb func(id abi.DealID, dp DealProposal) error) error
|
||||
Get(id abi.DealID) (*DealProposal, bool, error)
|
||||
ForEach(cb func(id abi.DealID, dp market{{.latestVersion}}.DealProposal) error) error
|
||||
Get(id abi.DealID) (*market{{.latestVersion}}.DealProposal, bool, error)
|
||||
|
||||
array() adt.Array
|
||||
decode(*cbg.Deferred) (*DealProposal, error)
|
||||
decode(*cbg.Deferred) (*market{{.latestVersion}}.DealProposal, error)
|
||||
}
|
||||
|
||||
type PublishStorageDealsParams = market0.PublishStorageDealsParams
|
||||
|
||||
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)
|
||||
IsDealValid(index uint64) (bool, int, error)
|
||||
}
|
||||
|
||||
func DecodePublishStorageDealsReturn(b []byte, nv network.Version) (PublishStorageDealsReturn, error) {
|
||||
@@ -126,30 +129,9 @@ func DecodePublishStorageDealsReturn(b []byte, nv network.Version) (PublishStora
|
||||
return nil, xerrors.Errorf("unknown actor version %d", av)
|
||||
}
|
||||
|
||||
type VerifyDealsForActivationParams = market0.VerifyDealsForActivationParams
|
||||
type WithdrawBalanceParams = market0.WithdrawBalanceParams
|
||||
type DealProposal = market{{.latestVersion}}.DealProposal
|
||||
|
||||
type ClientDealProposal = market0.ClientDealProposal
|
||||
|
||||
type DealState struct {
|
||||
SectorStartEpoch abi.ChainEpoch // -1 if not yet included in proven sector
|
||||
LastUpdatedEpoch abi.ChainEpoch // -1 if deal state never updated
|
||||
SlashEpoch abi.ChainEpoch // -1 if deal never slashed
|
||||
}
|
||||
|
||||
type DealProposal struct {
|
||||
PieceCID cid.Cid
|
||||
PieceSize abi.PaddedPieceSize
|
||||
VerifiedDeal bool
|
||||
Client address.Address
|
||||
Provider address.Address
|
||||
Label string
|
||||
StartEpoch abi.ChainEpoch
|
||||
EndEpoch abi.ChainEpoch
|
||||
StoragePricePerEpoch abi.TokenAmount
|
||||
ProviderCollateral abi.TokenAmount
|
||||
ClientCollateral abi.TokenAmount
|
||||
}
|
||||
type DealState = market{{.latestVersion}}.DealState
|
||||
|
||||
type DealStateChanges struct {
|
||||
Added []DealIDState
|
||||
@@ -176,7 +158,7 @@ type DealProposalChanges struct {
|
||||
|
||||
type ProposalIDState struct {
|
||||
ID abi.DealID
|
||||
Proposal DealProposal
|
||||
Proposal market{{.latestVersion}}.DealProposal
|
||||
}
|
||||
|
||||
func EmptyDealState() *DealState {
|
||||
@@ -188,7 +170,7 @@ func EmptyDealState() *DealState {
|
||||
}
|
||||
|
||||
// returns the earned fees and pending fees for a given deal
|
||||
func (deal DealProposal) GetDealFees(height abi.ChainEpoch) (abi.TokenAmount, abi.TokenAmount) {
|
||||
func GetDealFees(deal market{{.latestVersion}}.DealProposal, height abi.ChainEpoch) (abi.TokenAmount, abi.TokenAmount) {
|
||||
tf := big.Mul(deal.StoragePricePerEpoch, big.NewInt(int64(deal.EndEpoch-deal.StartEpoch)))
|
||||
|
||||
ef := big.Mul(deal.StoragePricePerEpoch, big.NewInt(int64(height-deal.StartEpoch)))
|
||||
@@ -202,3 +184,11 @@ func (deal DealProposal) GetDealFees(height abi.ChainEpoch) (abi.TokenAmount, ab
|
||||
|
||||
return ef, big.Sub(tf, ef)
|
||||
}
|
||||
|
||||
func labelFromGoString(s string) (market{{.latestVersion}}.DealLabel, error) {
|
||||
if utf8.ValidString(s) {
|
||||
return market{{.latestVersion}}.NewLabelFromString(s)
|
||||
} else {
|
||||
return market{{.latestVersion}}.NewLabelFromBytes([]byte(s))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package market
|
||||
|
||||
import (
|
||||
"unicode/utf8"
|
||||
|
||||
"github.com/filecoin-project/go-state-types/network"
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
@@ -8,10 +10,9 @@ import (
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
"github.com/filecoin-project/go-state-types/big"
|
||||
"github.com/filecoin-project/go-state-types/cbor"
|
||||
"github.com/ipfs/go-cid"
|
||||
cbg "github.com/whyrusleeping/cbor-gen"
|
||||
|
||||
market0 "github.com/filecoin-project/specs-actors/actors/builtin/market"
|
||||
market8 "github.com/filecoin-project/go-state-types/builtin/v8/market"
|
||||
|
||||
builtin0 "github.com/filecoin-project/specs-actors/actors/builtin"
|
||||
|
||||
@@ -27,49 +28,32 @@ import (
|
||||
|
||||
builtin7 "github.com/filecoin-project/specs-actors/v7/actors/builtin"
|
||||
|
||||
builtin8 "github.com/filecoin-project/go-state-types/builtin"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
"github.com/filecoin-project/lotus/chain/actors/builtin"
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
||||
builtin.RegisterActorState(builtin0.StorageMarketActorCodeID, func(store adt.Store, root cid.Cid) (cbor.Marshaler, error) {
|
||||
return load0(store, root)
|
||||
})
|
||||
|
||||
builtin.RegisterActorState(builtin2.StorageMarketActorCodeID, func(store adt.Store, root cid.Cid) (cbor.Marshaler, error) {
|
||||
return load2(store, root)
|
||||
})
|
||||
|
||||
builtin.RegisterActorState(builtin3.StorageMarketActorCodeID, func(store adt.Store, root cid.Cid) (cbor.Marshaler, error) {
|
||||
return load3(store, root)
|
||||
})
|
||||
|
||||
builtin.RegisterActorState(builtin4.StorageMarketActorCodeID, func(store adt.Store, root cid.Cid) (cbor.Marshaler, error) {
|
||||
return load4(store, root)
|
||||
})
|
||||
|
||||
builtin.RegisterActorState(builtin5.StorageMarketActorCodeID, func(store adt.Store, root cid.Cid) (cbor.Marshaler, error) {
|
||||
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 (
|
||||
Address = builtin7.StorageMarketActorAddr
|
||||
Methods = builtin7.MethodsMarket
|
||||
Address = builtin8.StorageMarketActorAddr
|
||||
Methods = builtin8.MethodsMarket
|
||||
)
|
||||
|
||||
func Load(store adt.Store, act *types.Actor) (State, error) {
|
||||
if name, av, ok := actors.GetActorMetaByCode(act.Code); ok {
|
||||
if name != actors.MarketKey {
|
||||
return nil, xerrors.Errorf("actor code is not market: %s", name)
|
||||
}
|
||||
|
||||
switch av {
|
||||
|
||||
case actors.Version8:
|
||||
return load8(store, act.Head)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
switch act.Code {
|
||||
|
||||
case builtin0.StorageMarketActorCodeID:
|
||||
@@ -94,6 +78,7 @@ func Load(store adt.Store, act *types.Actor) (State, error) {
|
||||
return load7(store, act.Head)
|
||||
|
||||
}
|
||||
|
||||
return nil, xerrors.Errorf("unknown actor code %s", act.Code)
|
||||
}
|
||||
|
||||
@@ -121,39 +106,13 @@ func MakeState(store adt.Store, av actors.Version) (State, error) {
|
||||
case actors.Version7:
|
||||
return make7(store)
|
||||
|
||||
case actors.Version8:
|
||||
return make8(store)
|
||||
|
||||
}
|
||||
return nil, xerrors.Errorf("unknown actor version %d", av)
|
||||
}
|
||||
|
||||
func GetActorCodeID(av actors.Version) (cid.Cid, error) {
|
||||
switch av {
|
||||
|
||||
case actors.Version0:
|
||||
return builtin0.StorageMarketActorCodeID, nil
|
||||
|
||||
case actors.Version2:
|
||||
return builtin2.StorageMarketActorCodeID, nil
|
||||
|
||||
case actors.Version3:
|
||||
return builtin3.StorageMarketActorCodeID, nil
|
||||
|
||||
case actors.Version4:
|
||||
return builtin4.StorageMarketActorCodeID, nil
|
||||
|
||||
case actors.Version5:
|
||||
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)
|
||||
}
|
||||
|
||||
type State interface {
|
||||
cbor.Marshaler
|
||||
BalancesChanged(State) (bool, error)
|
||||
@@ -185,19 +144,17 @@ type DealStates interface {
|
||||
}
|
||||
|
||||
type DealProposals interface {
|
||||
ForEach(cb func(id abi.DealID, dp DealProposal) error) error
|
||||
Get(id abi.DealID) (*DealProposal, bool, error)
|
||||
ForEach(cb func(id abi.DealID, dp market8.DealProposal) error) error
|
||||
Get(id abi.DealID) (*market8.DealProposal, bool, error)
|
||||
|
||||
array() adt.Array
|
||||
decode(*cbg.Deferred) (*DealProposal, error)
|
||||
decode(*cbg.Deferred) (*market8.DealProposal, error)
|
||||
}
|
||||
|
||||
type PublishStorageDealsParams = market0.PublishStorageDealsParams
|
||||
|
||||
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)
|
||||
IsDealValid(index uint64) (bool, int, error)
|
||||
}
|
||||
|
||||
func DecodePublishStorageDealsReturn(b []byte, nv network.Version) (PublishStorageDealsReturn, error) {
|
||||
@@ -229,34 +186,16 @@ func DecodePublishStorageDealsReturn(b []byte, nv network.Version) (PublishStora
|
||||
case actors.Version7:
|
||||
return decodePublishStorageDealsReturn7(b)
|
||||
|
||||
case actors.Version8:
|
||||
return decodePublishStorageDealsReturn8(b)
|
||||
|
||||
}
|
||||
return nil, xerrors.Errorf("unknown actor version %d", av)
|
||||
}
|
||||
|
||||
type VerifyDealsForActivationParams = market0.VerifyDealsForActivationParams
|
||||
type WithdrawBalanceParams = market0.WithdrawBalanceParams
|
||||
type DealProposal = market8.DealProposal
|
||||
|
||||
type ClientDealProposal = market0.ClientDealProposal
|
||||
|
||||
type DealState struct {
|
||||
SectorStartEpoch abi.ChainEpoch // -1 if not yet included in proven sector
|
||||
LastUpdatedEpoch abi.ChainEpoch // -1 if deal state never updated
|
||||
SlashEpoch abi.ChainEpoch // -1 if deal never slashed
|
||||
}
|
||||
|
||||
type DealProposal struct {
|
||||
PieceCID cid.Cid
|
||||
PieceSize abi.PaddedPieceSize
|
||||
VerifiedDeal bool
|
||||
Client address.Address
|
||||
Provider address.Address
|
||||
Label string
|
||||
StartEpoch abi.ChainEpoch
|
||||
EndEpoch abi.ChainEpoch
|
||||
StoragePricePerEpoch abi.TokenAmount
|
||||
ProviderCollateral abi.TokenAmount
|
||||
ClientCollateral abi.TokenAmount
|
||||
}
|
||||
type DealState = market8.DealState
|
||||
|
||||
type DealStateChanges struct {
|
||||
Added []DealIDState
|
||||
@@ -283,7 +222,7 @@ type DealProposalChanges struct {
|
||||
|
||||
type ProposalIDState struct {
|
||||
ID abi.DealID
|
||||
Proposal DealProposal
|
||||
Proposal market8.DealProposal
|
||||
}
|
||||
|
||||
func EmptyDealState() *DealState {
|
||||
@@ -295,7 +234,7 @@ func EmptyDealState() *DealState {
|
||||
}
|
||||
|
||||
// returns the earned fees and pending fees for a given deal
|
||||
func (deal DealProposal) GetDealFees(height abi.ChainEpoch) (abi.TokenAmount, abi.TokenAmount) {
|
||||
func GetDealFees(deal market8.DealProposal, height abi.ChainEpoch) (abi.TokenAmount, abi.TokenAmount) {
|
||||
tf := big.Mul(deal.StoragePricePerEpoch, big.NewInt(int64(deal.EndEpoch-deal.StartEpoch)))
|
||||
|
||||
ef := big.Mul(deal.StoragePricePerEpoch, big.NewInt(int64(height-deal.StartEpoch)))
|
||||
@@ -309,3 +248,11 @@ func (deal DealProposal) GetDealFees(height abi.ChainEpoch) (abi.TokenAmount, ab
|
||||
|
||||
return ef, big.Sub(tf, ef)
|
||||
}
|
||||
|
||||
func labelFromGoString(s string) (market8.DealLabel, error) {
|
||||
if utf8.ValidString(s) {
|
||||
return market8.NewLabelFromString(s)
|
||||
} else {
|
||||
return market8.NewLabelFromBytes([]byte(s))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,12 +8,22 @@ import (
|
||||
"github.com/ipfs/go-cid"
|
||||
cbg "github.com/whyrusleeping/cbor-gen"
|
||||
"golang.org/x/xerrors"
|
||||
{{if (ge .v 6)}}
|
||||
rlepluslazy "github.com/filecoin-project/go-bitfield/rle"
|
||||
"github.com/filecoin-project/go-bitfield"
|
||||
{{end}}
|
||||
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
|
||||
{{if (le .v 7)}}
|
||||
market{{.v}} "github.com/filecoin-project/specs-actors{{.import}}actors/builtin/market"
|
||||
adt{{.v}} "github.com/filecoin-project/specs-actors{{.import}}actors/util/adt"
|
||||
{{else}}
|
||||
market{{.v}} "github.com/filecoin-project/go-state-types/builtin{{.import}}market"
|
||||
adt{{.v}} "github.com/filecoin-project/go-state-types/builtin/v8/util/adt"
|
||||
{{end}}
|
||||
)
|
||||
|
||||
var _ State = (*state{{.v}})(nil)
|
||||
@@ -190,7 +200,7 @@ func (s *dealStates{{.v}}) array() adt.Array {
|
||||
}
|
||||
|
||||
func fromV{{.v}}DealState(v{{.v}} market{{.v}}.DealState) DealState {
|
||||
return (DealState)(v{{.v}})
|
||||
return (DealState)(v{{.v}})
|
||||
}
|
||||
|
||||
type dealProposals{{.v}} struct {
|
||||
@@ -206,14 +216,24 @@ func (s *dealProposals{{.v}}) Get(dealID abi.DealID) (*DealProposal, bool, error
|
||||
if !found {
|
||||
return nil, false, nil
|
||||
}
|
||||
proposal := fromV{{.v}}DealProposal(proposal{{.v}})
|
||||
return &proposal, true, nil
|
||||
|
||||
proposal, err := fromV{{.v}}DealProposal(proposal{{.v}})
|
||||
if err != nil {
|
||||
return nil, true, xerrors.Errorf("decoding proposal: %w", err)
|
||||
}
|
||||
|
||||
return &proposal, true, nil
|
||||
}
|
||||
|
||||
func (s *dealProposals{{.v}}) ForEach(cb func(dealID abi.DealID, dp DealProposal) error) error {
|
||||
var dp{{.v}} market{{.v}}.DealProposal
|
||||
return s.Array.ForEach(&dp{{.v}}, func(idx int64) error {
|
||||
return cb(abi.DealID(idx), fromV{{.v}}DealProposal(dp{{.v}}))
|
||||
dp, err := fromV{{.v}}DealProposal(dp{{.v}})
|
||||
if err != nil {
|
||||
return xerrors.Errorf("decoding proposal: %w", err)
|
||||
}
|
||||
|
||||
return cb(abi.DealID(idx), dp)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -222,18 +242,48 @@ func (s *dealProposals{{.v}}) decode(val *cbg.Deferred) (*DealProposal, error) {
|
||||
if err := dp{{.v}}.UnmarshalCBOR(bytes.NewReader(val.Raw)); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
dp := fromV{{.v}}DealProposal(dp{{.v}})
|
||||
return &dp, nil
|
||||
|
||||
dp, err := fromV{{.v}}DealProposal(dp{{.v}})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &dp, nil
|
||||
}
|
||||
|
||||
func (s *dealProposals{{.v}}) array() adt.Array {
|
||||
return s.Array
|
||||
}
|
||||
|
||||
func fromV{{.v}}DealProposal(v{{.v}} market{{.v}}.DealProposal) DealProposal {
|
||||
return (DealProposal)(v{{.v}})
|
||||
func fromV{{.v}}DealProposal(v{{.v}} market{{.v}}.DealProposal) (DealProposal, error) {
|
||||
{{if (le .v 7)}}
|
||||
label, err := labelFromGoString(v{{.v}}.Label)
|
||||
if err != nil {
|
||||
return DealProposal{}, xerrors.Errorf("error setting deal label: %w", err)
|
||||
}
|
||||
{{else}}
|
||||
label := v{{.v}}.Label
|
||||
{{end}}
|
||||
|
||||
return DealProposal{
|
||||
PieceCID: v{{.v}}.PieceCID,
|
||||
PieceSize: v{{.v}}.PieceSize,
|
||||
VerifiedDeal: v{{.v}}.VerifiedDeal,
|
||||
Client: v{{.v}}.Client,
|
||||
Provider: v{{.v}}.Provider,
|
||||
|
||||
Label: label,
|
||||
|
||||
StartEpoch: v{{.v}}.StartEpoch,
|
||||
EndEpoch: v{{.v}}.EndEpoch,
|
||||
StoragePricePerEpoch: v{{.v}}.StoragePricePerEpoch,
|
||||
|
||||
ProviderCollateral: v{{.v}}.ProviderCollateral,
|
||||
ClientCollateral: v{{.v}}.ClientCollateral,
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
||||
func (s *state{{.v}}) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
@@ -253,12 +303,29 @@ type publishStorageDealsReturn{{.v}} struct {
|
||||
market{{.v}}.PublishStorageDealsReturn
|
||||
}
|
||||
|
||||
func (r *publishStorageDealsReturn{{.v}}) IsDealValid(index uint64) (bool, error) {
|
||||
func (r *publishStorageDealsReturn{{.v}}) IsDealValid(index uint64) (bool, int, error) {
|
||||
{{if (ge .v 6)}}
|
||||
return r.ValidDeals.IsSet(index)
|
||||
set, err := r.ValidDeals.IsSet(index)
|
||||
if err != nil || !set {
|
||||
return false, -1, err
|
||||
}
|
||||
maskBf, err := bitfield.NewFromIter(&rlepluslazy.RunSliceIterator{
|
||||
Runs: []rlepluslazy.Run{rlepluslazy.Run{Val: true, Len: index}}})
|
||||
if err != nil {
|
||||
return false, -1, err
|
||||
}
|
||||
before, err := bitfield.IntersectBitField(maskBf, r.ValidDeals)
|
||||
if err != nil {
|
||||
return false, -1, err
|
||||
}
|
||||
outIdx, err := before.Count()
|
||||
if err != nil {
|
||||
return false, -1, err
|
||||
}
|
||||
return set, int(outIdx), nil
|
||||
{{else}}
|
||||
// PublishStorageDeals only succeeded if all deals were valid in this version of actors
|
||||
return true, nil
|
||||
return true, int(index), nil
|
||||
{{end}}
|
||||
}
|
||||
|
||||
|
||||
@@ -199,14 +199,24 @@ func (s *dealProposals0) Get(dealID abi.DealID) (*DealProposal, bool, error) {
|
||||
if !found {
|
||||
return nil, false, nil
|
||||
}
|
||||
proposal := fromV0DealProposal(proposal0)
|
||||
|
||||
proposal, err := fromV0DealProposal(proposal0)
|
||||
if err != nil {
|
||||
return nil, true, xerrors.Errorf("decoding proposal: %w", err)
|
||||
}
|
||||
|
||||
return &proposal, true, nil
|
||||
}
|
||||
|
||||
func (s *dealProposals0) ForEach(cb func(dealID abi.DealID, dp DealProposal) error) error {
|
||||
var dp0 market0.DealProposal
|
||||
return s.Array.ForEach(&dp0, func(idx int64) error {
|
||||
return cb(abi.DealID(idx), fromV0DealProposal(dp0))
|
||||
dp, err := fromV0DealProposal(dp0)
|
||||
if err != nil {
|
||||
return xerrors.Errorf("decoding proposal: %w", err)
|
||||
}
|
||||
|
||||
return cb(abi.DealID(idx), dp)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -215,7 +225,12 @@ func (s *dealProposals0) decode(val *cbg.Deferred) (*DealProposal, error) {
|
||||
if err := dp0.UnmarshalCBOR(bytes.NewReader(val.Raw)); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
dp := fromV0DealProposal(dp0)
|
||||
|
||||
dp, err := fromV0DealProposal(dp0)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &dp, nil
|
||||
}
|
||||
|
||||
@@ -223,8 +238,29 @@ func (s *dealProposals0) array() adt.Array {
|
||||
return s.Array
|
||||
}
|
||||
|
||||
func fromV0DealProposal(v0 market0.DealProposal) DealProposal {
|
||||
return (DealProposal)(v0)
|
||||
func fromV0DealProposal(v0 market0.DealProposal) (DealProposal, error) {
|
||||
|
||||
label, err := labelFromGoString(v0.Label)
|
||||
if err != nil {
|
||||
return DealProposal{}, xerrors.Errorf("error setting deal label: %w", err)
|
||||
}
|
||||
|
||||
return DealProposal{
|
||||
PieceCID: v0.PieceCID,
|
||||
PieceSize: v0.PieceSize,
|
||||
VerifiedDeal: v0.VerifiedDeal,
|
||||
Client: v0.Client,
|
||||
Provider: v0.Provider,
|
||||
|
||||
Label: label,
|
||||
|
||||
StartEpoch: v0.StartEpoch,
|
||||
EndEpoch: v0.EndEpoch,
|
||||
StoragePricePerEpoch: v0.StoragePricePerEpoch,
|
||||
|
||||
ProviderCollateral: v0.ProviderCollateral,
|
||||
ClientCollateral: v0.ClientCollateral,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (s *state0) GetState() interface{} {
|
||||
@@ -246,10 +282,10 @@ type publishStorageDealsReturn0 struct {
|
||||
market0.PublishStorageDealsReturn
|
||||
}
|
||||
|
||||
func (r *publishStorageDealsReturn0) IsDealValid(index uint64) (bool, error) {
|
||||
func (r *publishStorageDealsReturn0) IsDealValid(index uint64) (bool, int, error) {
|
||||
|
||||
// PublishStorageDeals only succeeded if all deals were valid in this version of actors
|
||||
return true, nil
|
||||
return true, int(index), nil
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -199,14 +199,24 @@ func (s *dealProposals2) Get(dealID abi.DealID) (*DealProposal, bool, error) {
|
||||
if !found {
|
||||
return nil, false, nil
|
||||
}
|
||||
proposal := fromV2DealProposal(proposal2)
|
||||
|
||||
proposal, err := fromV2DealProposal(proposal2)
|
||||
if err != nil {
|
||||
return nil, true, xerrors.Errorf("decoding proposal: %w", err)
|
||||
}
|
||||
|
||||
return &proposal, true, nil
|
||||
}
|
||||
|
||||
func (s *dealProposals2) ForEach(cb func(dealID abi.DealID, dp DealProposal) error) error {
|
||||
var dp2 market2.DealProposal
|
||||
return s.Array.ForEach(&dp2, func(idx int64) error {
|
||||
return cb(abi.DealID(idx), fromV2DealProposal(dp2))
|
||||
dp, err := fromV2DealProposal(dp2)
|
||||
if err != nil {
|
||||
return xerrors.Errorf("decoding proposal: %w", err)
|
||||
}
|
||||
|
||||
return cb(abi.DealID(idx), dp)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -215,7 +225,12 @@ func (s *dealProposals2) decode(val *cbg.Deferred) (*DealProposal, error) {
|
||||
if err := dp2.UnmarshalCBOR(bytes.NewReader(val.Raw)); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
dp := fromV2DealProposal(dp2)
|
||||
|
||||
dp, err := fromV2DealProposal(dp2)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &dp, nil
|
||||
}
|
||||
|
||||
@@ -223,8 +238,29 @@ func (s *dealProposals2) array() adt.Array {
|
||||
return s.Array
|
||||
}
|
||||
|
||||
func fromV2DealProposal(v2 market2.DealProposal) DealProposal {
|
||||
return (DealProposal)(v2)
|
||||
func fromV2DealProposal(v2 market2.DealProposal) (DealProposal, error) {
|
||||
|
||||
label, err := labelFromGoString(v2.Label)
|
||||
if err != nil {
|
||||
return DealProposal{}, xerrors.Errorf("error setting deal label: %w", err)
|
||||
}
|
||||
|
||||
return DealProposal{
|
||||
PieceCID: v2.PieceCID,
|
||||
PieceSize: v2.PieceSize,
|
||||
VerifiedDeal: v2.VerifiedDeal,
|
||||
Client: v2.Client,
|
||||
Provider: v2.Provider,
|
||||
|
||||
Label: label,
|
||||
|
||||
StartEpoch: v2.StartEpoch,
|
||||
EndEpoch: v2.EndEpoch,
|
||||
StoragePricePerEpoch: v2.StoragePricePerEpoch,
|
||||
|
||||
ProviderCollateral: v2.ProviderCollateral,
|
||||
ClientCollateral: v2.ClientCollateral,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (s *state2) GetState() interface{} {
|
||||
@@ -246,10 +282,10 @@ type publishStorageDealsReturn2 struct {
|
||||
market2.PublishStorageDealsReturn
|
||||
}
|
||||
|
||||
func (r *publishStorageDealsReturn2) IsDealValid(index uint64) (bool, error) {
|
||||
func (r *publishStorageDealsReturn2) IsDealValid(index uint64) (bool, int, error) {
|
||||
|
||||
// PublishStorageDeals only succeeded if all deals were valid in this version of actors
|
||||
return true, nil
|
||||
return true, int(index), nil
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -194,14 +194,24 @@ func (s *dealProposals3) Get(dealID abi.DealID) (*DealProposal, bool, error) {
|
||||
if !found {
|
||||
return nil, false, nil
|
||||
}
|
||||
proposal := fromV3DealProposal(proposal3)
|
||||
|
||||
proposal, err := fromV3DealProposal(proposal3)
|
||||
if err != nil {
|
||||
return nil, true, xerrors.Errorf("decoding proposal: %w", err)
|
||||
}
|
||||
|
||||
return &proposal, true, nil
|
||||
}
|
||||
|
||||
func (s *dealProposals3) ForEach(cb func(dealID abi.DealID, dp DealProposal) error) error {
|
||||
var dp3 market3.DealProposal
|
||||
return s.Array.ForEach(&dp3, func(idx int64) error {
|
||||
return cb(abi.DealID(idx), fromV3DealProposal(dp3))
|
||||
dp, err := fromV3DealProposal(dp3)
|
||||
if err != nil {
|
||||
return xerrors.Errorf("decoding proposal: %w", err)
|
||||
}
|
||||
|
||||
return cb(abi.DealID(idx), dp)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -210,7 +220,12 @@ func (s *dealProposals3) decode(val *cbg.Deferred) (*DealProposal, error) {
|
||||
if err := dp3.UnmarshalCBOR(bytes.NewReader(val.Raw)); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
dp := fromV3DealProposal(dp3)
|
||||
|
||||
dp, err := fromV3DealProposal(dp3)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &dp, nil
|
||||
}
|
||||
|
||||
@@ -218,8 +233,29 @@ func (s *dealProposals3) array() adt.Array {
|
||||
return s.Array
|
||||
}
|
||||
|
||||
func fromV3DealProposal(v3 market3.DealProposal) DealProposal {
|
||||
return (DealProposal)(v3)
|
||||
func fromV3DealProposal(v3 market3.DealProposal) (DealProposal, error) {
|
||||
|
||||
label, err := labelFromGoString(v3.Label)
|
||||
if err != nil {
|
||||
return DealProposal{}, xerrors.Errorf("error setting deal label: %w", err)
|
||||
}
|
||||
|
||||
return DealProposal{
|
||||
PieceCID: v3.PieceCID,
|
||||
PieceSize: v3.PieceSize,
|
||||
VerifiedDeal: v3.VerifiedDeal,
|
||||
Client: v3.Client,
|
||||
Provider: v3.Provider,
|
||||
|
||||
Label: label,
|
||||
|
||||
StartEpoch: v3.StartEpoch,
|
||||
EndEpoch: v3.EndEpoch,
|
||||
StoragePricePerEpoch: v3.StoragePricePerEpoch,
|
||||
|
||||
ProviderCollateral: v3.ProviderCollateral,
|
||||
ClientCollateral: v3.ClientCollateral,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (s *state3) GetState() interface{} {
|
||||
@@ -241,10 +277,10 @@ type publishStorageDealsReturn3 struct {
|
||||
market3.PublishStorageDealsReturn
|
||||
}
|
||||
|
||||
func (r *publishStorageDealsReturn3) IsDealValid(index uint64) (bool, error) {
|
||||
func (r *publishStorageDealsReturn3) IsDealValid(index uint64) (bool, int, error) {
|
||||
|
||||
// PublishStorageDeals only succeeded if all deals were valid in this version of actors
|
||||
return true, nil
|
||||
return true, int(index), nil
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -194,14 +194,24 @@ func (s *dealProposals4) Get(dealID abi.DealID) (*DealProposal, bool, error) {
|
||||
if !found {
|
||||
return nil, false, nil
|
||||
}
|
||||
proposal := fromV4DealProposal(proposal4)
|
||||
|
||||
proposal, err := fromV4DealProposal(proposal4)
|
||||
if err != nil {
|
||||
return nil, true, xerrors.Errorf("decoding proposal: %w", err)
|
||||
}
|
||||
|
||||
return &proposal, true, nil
|
||||
}
|
||||
|
||||
func (s *dealProposals4) ForEach(cb func(dealID abi.DealID, dp DealProposal) error) error {
|
||||
var dp4 market4.DealProposal
|
||||
return s.Array.ForEach(&dp4, func(idx int64) error {
|
||||
return cb(abi.DealID(idx), fromV4DealProposal(dp4))
|
||||
dp, err := fromV4DealProposal(dp4)
|
||||
if err != nil {
|
||||
return xerrors.Errorf("decoding proposal: %w", err)
|
||||
}
|
||||
|
||||
return cb(abi.DealID(idx), dp)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -210,7 +220,12 @@ func (s *dealProposals4) decode(val *cbg.Deferred) (*DealProposal, error) {
|
||||
if err := dp4.UnmarshalCBOR(bytes.NewReader(val.Raw)); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
dp := fromV4DealProposal(dp4)
|
||||
|
||||
dp, err := fromV4DealProposal(dp4)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &dp, nil
|
||||
}
|
||||
|
||||
@@ -218,8 +233,29 @@ func (s *dealProposals4) array() adt.Array {
|
||||
return s.Array
|
||||
}
|
||||
|
||||
func fromV4DealProposal(v4 market4.DealProposal) DealProposal {
|
||||
return (DealProposal)(v4)
|
||||
func fromV4DealProposal(v4 market4.DealProposal) (DealProposal, error) {
|
||||
|
||||
label, err := labelFromGoString(v4.Label)
|
||||
if err != nil {
|
||||
return DealProposal{}, xerrors.Errorf("error setting deal label: %w", err)
|
||||
}
|
||||
|
||||
return DealProposal{
|
||||
PieceCID: v4.PieceCID,
|
||||
PieceSize: v4.PieceSize,
|
||||
VerifiedDeal: v4.VerifiedDeal,
|
||||
Client: v4.Client,
|
||||
Provider: v4.Provider,
|
||||
|
||||
Label: label,
|
||||
|
||||
StartEpoch: v4.StartEpoch,
|
||||
EndEpoch: v4.EndEpoch,
|
||||
StoragePricePerEpoch: v4.StoragePricePerEpoch,
|
||||
|
||||
ProviderCollateral: v4.ProviderCollateral,
|
||||
ClientCollateral: v4.ClientCollateral,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (s *state4) GetState() interface{} {
|
||||
@@ -241,10 +277,10 @@ type publishStorageDealsReturn4 struct {
|
||||
market4.PublishStorageDealsReturn
|
||||
}
|
||||
|
||||
func (r *publishStorageDealsReturn4) IsDealValid(index uint64) (bool, error) {
|
||||
func (r *publishStorageDealsReturn4) IsDealValid(index uint64) (bool, int, error) {
|
||||
|
||||
// PublishStorageDeals only succeeded if all deals were valid in this version of actors
|
||||
return true, nil
|
||||
return true, int(index), nil
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -194,14 +194,24 @@ func (s *dealProposals5) Get(dealID abi.DealID) (*DealProposal, bool, error) {
|
||||
if !found {
|
||||
return nil, false, nil
|
||||
}
|
||||
proposal := fromV5DealProposal(proposal5)
|
||||
|
||||
proposal, err := fromV5DealProposal(proposal5)
|
||||
if err != nil {
|
||||
return nil, true, xerrors.Errorf("decoding proposal: %w", err)
|
||||
}
|
||||
|
||||
return &proposal, true, nil
|
||||
}
|
||||
|
||||
func (s *dealProposals5) ForEach(cb func(dealID abi.DealID, dp DealProposal) error) error {
|
||||
var dp5 market5.DealProposal
|
||||
return s.Array.ForEach(&dp5, func(idx int64) error {
|
||||
return cb(abi.DealID(idx), fromV5DealProposal(dp5))
|
||||
dp, err := fromV5DealProposal(dp5)
|
||||
if err != nil {
|
||||
return xerrors.Errorf("decoding proposal: %w", err)
|
||||
}
|
||||
|
||||
return cb(abi.DealID(idx), dp)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -210,7 +220,12 @@ func (s *dealProposals5) decode(val *cbg.Deferred) (*DealProposal, error) {
|
||||
if err := dp5.UnmarshalCBOR(bytes.NewReader(val.Raw)); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
dp := fromV5DealProposal(dp5)
|
||||
|
||||
dp, err := fromV5DealProposal(dp5)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &dp, nil
|
||||
}
|
||||
|
||||
@@ -218,8 +233,29 @@ func (s *dealProposals5) array() adt.Array {
|
||||
return s.Array
|
||||
}
|
||||
|
||||
func fromV5DealProposal(v5 market5.DealProposal) DealProposal {
|
||||
return (DealProposal)(v5)
|
||||
func fromV5DealProposal(v5 market5.DealProposal) (DealProposal, error) {
|
||||
|
||||
label, err := labelFromGoString(v5.Label)
|
||||
if err != nil {
|
||||
return DealProposal{}, xerrors.Errorf("error setting deal label: %w", err)
|
||||
}
|
||||
|
||||
return DealProposal{
|
||||
PieceCID: v5.PieceCID,
|
||||
PieceSize: v5.PieceSize,
|
||||
VerifiedDeal: v5.VerifiedDeal,
|
||||
Client: v5.Client,
|
||||
Provider: v5.Provider,
|
||||
|
||||
Label: label,
|
||||
|
||||
StartEpoch: v5.StartEpoch,
|
||||
EndEpoch: v5.EndEpoch,
|
||||
StoragePricePerEpoch: v5.StoragePricePerEpoch,
|
||||
|
||||
ProviderCollateral: v5.ProviderCollateral,
|
||||
ClientCollateral: v5.ClientCollateral,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (s *state5) GetState() interface{} {
|
||||
@@ -241,10 +277,10 @@ type publishStorageDealsReturn5 struct {
|
||||
market5.PublishStorageDealsReturn
|
||||
}
|
||||
|
||||
func (r *publishStorageDealsReturn5) IsDealValid(index uint64) (bool, error) {
|
||||
func (r *publishStorageDealsReturn5) IsDealValid(index uint64) (bool, int, error) {
|
||||
|
||||
// PublishStorageDeals only succeeded if all deals were valid in this version of actors
|
||||
return true, nil
|
||||
return true, int(index), nil
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,9 @@ import (
|
||||
cbg "github.com/whyrusleeping/cbor-gen"
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
"github.com/filecoin-project/go-bitfield"
|
||||
rlepluslazy "github.com/filecoin-project/go-bitfield/rle"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
|
||||
@@ -194,14 +197,24 @@ func (s *dealProposals6) Get(dealID abi.DealID) (*DealProposal, bool, error) {
|
||||
if !found {
|
||||
return nil, false, nil
|
||||
}
|
||||
proposal := fromV6DealProposal(proposal6)
|
||||
|
||||
proposal, err := fromV6DealProposal(proposal6)
|
||||
if err != nil {
|
||||
return nil, true, xerrors.Errorf("decoding proposal: %w", err)
|
||||
}
|
||||
|
||||
return &proposal, true, nil
|
||||
}
|
||||
|
||||
func (s *dealProposals6) ForEach(cb func(dealID abi.DealID, dp DealProposal) error) error {
|
||||
var dp6 market6.DealProposal
|
||||
return s.Array.ForEach(&dp6, func(idx int64) error {
|
||||
return cb(abi.DealID(idx), fromV6DealProposal(dp6))
|
||||
dp, err := fromV6DealProposal(dp6)
|
||||
if err != nil {
|
||||
return xerrors.Errorf("decoding proposal: %w", err)
|
||||
}
|
||||
|
||||
return cb(abi.DealID(idx), dp)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -210,7 +223,12 @@ func (s *dealProposals6) decode(val *cbg.Deferred) (*DealProposal, error) {
|
||||
if err := dp6.UnmarshalCBOR(bytes.NewReader(val.Raw)); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
dp := fromV6DealProposal(dp6)
|
||||
|
||||
dp, err := fromV6DealProposal(dp6)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &dp, nil
|
||||
}
|
||||
|
||||
@@ -218,8 +236,29 @@ func (s *dealProposals6) array() adt.Array {
|
||||
return s.Array
|
||||
}
|
||||
|
||||
func fromV6DealProposal(v6 market6.DealProposal) DealProposal {
|
||||
return (DealProposal)(v6)
|
||||
func fromV6DealProposal(v6 market6.DealProposal) (DealProposal, error) {
|
||||
|
||||
label, err := labelFromGoString(v6.Label)
|
||||
if err != nil {
|
||||
return DealProposal{}, xerrors.Errorf("error setting deal label: %w", err)
|
||||
}
|
||||
|
||||
return DealProposal{
|
||||
PieceCID: v6.PieceCID,
|
||||
PieceSize: v6.PieceSize,
|
||||
VerifiedDeal: v6.VerifiedDeal,
|
||||
Client: v6.Client,
|
||||
Provider: v6.Provider,
|
||||
|
||||
Label: label,
|
||||
|
||||
StartEpoch: v6.StartEpoch,
|
||||
EndEpoch: v6.EndEpoch,
|
||||
StoragePricePerEpoch: v6.StoragePricePerEpoch,
|
||||
|
||||
ProviderCollateral: v6.ProviderCollateral,
|
||||
ClientCollateral: v6.ClientCollateral,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (s *state6) GetState() interface{} {
|
||||
@@ -241,9 +280,26 @@ type publishStorageDealsReturn6 struct {
|
||||
market6.PublishStorageDealsReturn
|
||||
}
|
||||
|
||||
func (r *publishStorageDealsReturn6) IsDealValid(index uint64) (bool, error) {
|
||||
func (r *publishStorageDealsReturn6) IsDealValid(index uint64) (bool, int, error) {
|
||||
|
||||
return r.ValidDeals.IsSet(index)
|
||||
set, err := r.ValidDeals.IsSet(index)
|
||||
if err != nil || !set {
|
||||
return false, -1, err
|
||||
}
|
||||
maskBf, err := bitfield.NewFromIter(&rlepluslazy.RunSliceIterator{
|
||||
Runs: []rlepluslazy.Run{rlepluslazy.Run{Val: true, Len: index}}})
|
||||
if err != nil {
|
||||
return false, -1, err
|
||||
}
|
||||
before, err := bitfield.IntersectBitField(maskBf, r.ValidDeals)
|
||||
if err != nil {
|
||||
return false, -1, err
|
||||
}
|
||||
outIdx, err := before.Count()
|
||||
if err != nil {
|
||||
return false, -1, err
|
||||
}
|
||||
return set, int(outIdx), nil
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,9 @@ import (
|
||||
cbg "github.com/whyrusleeping/cbor-gen"
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
"github.com/filecoin-project/go-bitfield"
|
||||
rlepluslazy "github.com/filecoin-project/go-bitfield/rle"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
|
||||
@@ -194,14 +197,24 @@ func (s *dealProposals7) Get(dealID abi.DealID) (*DealProposal, bool, error) {
|
||||
if !found {
|
||||
return nil, false, nil
|
||||
}
|
||||
proposal := fromV7DealProposal(proposal7)
|
||||
|
||||
proposal, err := fromV7DealProposal(proposal7)
|
||||
if err != nil {
|
||||
return nil, true, xerrors.Errorf("decoding proposal: %w", err)
|
||||
}
|
||||
|
||||
return &proposal, true, nil
|
||||
}
|
||||
|
||||
func (s *dealProposals7) ForEach(cb func(dealID abi.DealID, dp DealProposal) error) error {
|
||||
var dp7 market7.DealProposal
|
||||
return s.Array.ForEach(&dp7, func(idx int64) error {
|
||||
return cb(abi.DealID(idx), fromV7DealProposal(dp7))
|
||||
dp, err := fromV7DealProposal(dp7)
|
||||
if err != nil {
|
||||
return xerrors.Errorf("decoding proposal: %w", err)
|
||||
}
|
||||
|
||||
return cb(abi.DealID(idx), dp)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -210,7 +223,12 @@ func (s *dealProposals7) decode(val *cbg.Deferred) (*DealProposal, error) {
|
||||
if err := dp7.UnmarshalCBOR(bytes.NewReader(val.Raw)); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
dp := fromV7DealProposal(dp7)
|
||||
|
||||
dp, err := fromV7DealProposal(dp7)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &dp, nil
|
||||
}
|
||||
|
||||
@@ -218,8 +236,29 @@ func (s *dealProposals7) array() adt.Array {
|
||||
return s.Array
|
||||
}
|
||||
|
||||
func fromV7DealProposal(v7 market7.DealProposal) DealProposal {
|
||||
return (DealProposal)(v7)
|
||||
func fromV7DealProposal(v7 market7.DealProposal) (DealProposal, error) {
|
||||
|
||||
label, err := labelFromGoString(v7.Label)
|
||||
if err != nil {
|
||||
return DealProposal{}, xerrors.Errorf("error setting deal label: %w", err)
|
||||
}
|
||||
|
||||
return DealProposal{
|
||||
PieceCID: v7.PieceCID,
|
||||
PieceSize: v7.PieceSize,
|
||||
VerifiedDeal: v7.VerifiedDeal,
|
||||
Client: v7.Client,
|
||||
Provider: v7.Provider,
|
||||
|
||||
Label: label,
|
||||
|
||||
StartEpoch: v7.StartEpoch,
|
||||
EndEpoch: v7.EndEpoch,
|
||||
StoragePricePerEpoch: v7.StoragePricePerEpoch,
|
||||
|
||||
ProviderCollateral: v7.ProviderCollateral,
|
||||
ClientCollateral: v7.ClientCollateral,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (s *state7) GetState() interface{} {
|
||||
@@ -241,9 +280,26 @@ type publishStorageDealsReturn7 struct {
|
||||
market7.PublishStorageDealsReturn
|
||||
}
|
||||
|
||||
func (r *publishStorageDealsReturn7) IsDealValid(index uint64) (bool, error) {
|
||||
func (r *publishStorageDealsReturn7) IsDealValid(index uint64) (bool, int, error) {
|
||||
|
||||
return r.ValidDeals.IsSet(index)
|
||||
set, err := r.ValidDeals.IsSet(index)
|
||||
if err != nil || !set {
|
||||
return false, -1, err
|
||||
}
|
||||
maskBf, err := bitfield.NewFromIter(&rlepluslazy.RunSliceIterator{
|
||||
Runs: []rlepluslazy.Run{rlepluslazy.Run{Val: true, Len: index}}})
|
||||
if err != nil {
|
||||
return false, -1, err
|
||||
}
|
||||
before, err := bitfield.IntersectBitField(maskBf, r.ValidDeals)
|
||||
if err != nil {
|
||||
return false, -1, err
|
||||
}
|
||||
outIdx, err := before.Count()
|
||||
if err != nil {
|
||||
return false, -1, err
|
||||
}
|
||||
return set, int(outIdx), nil
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,305 @@
|
||||
package market
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
|
||||
"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/go-bitfield"
|
||||
rlepluslazy "github.com/filecoin-project/go-bitfield/rle"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
|
||||
market8 "github.com/filecoin-project/go-state-types/builtin/v8/market"
|
||||
adt8 "github.com/filecoin-project/go-state-types/builtin/v8/util/adt"
|
||||
)
|
||||
|
||||
var _ State = (*state8)(nil)
|
||||
|
||||
func load8(store adt.Store, root cid.Cid) (State, error) {
|
||||
out := state8{store: store}
|
||||
err := store.Get(store.Context(), root, &out)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &out, nil
|
||||
}
|
||||
|
||||
func make8(store adt.Store) (State, error) {
|
||||
out := state8{store: store}
|
||||
|
||||
s, err := market8.ConstructState(store)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
out.State = *s
|
||||
|
||||
return &out, nil
|
||||
}
|
||||
|
||||
type state8 struct {
|
||||
market8.State
|
||||
store adt.Store
|
||||
}
|
||||
|
||||
func (s *state8) TotalLocked() (abi.TokenAmount, error) {
|
||||
fml := types.BigAdd(s.TotalClientLockedCollateral, s.TotalProviderLockedCollateral)
|
||||
fml = types.BigAdd(fml, s.TotalClientStorageFee)
|
||||
return fml, nil
|
||||
}
|
||||
|
||||
func (s *state8) BalancesChanged(otherState State) (bool, error) {
|
||||
otherState8, ok := otherState.(*state8)
|
||||
if !ok {
|
||||
// there's no way to compare different versions of the state, so let's
|
||||
// just say that means the state of balances has changed
|
||||
return true, nil
|
||||
}
|
||||
return !s.State.EscrowTable.Equals(otherState8.State.EscrowTable) || !s.State.LockedTable.Equals(otherState8.State.LockedTable), nil
|
||||
}
|
||||
|
||||
func (s *state8) StatesChanged(otherState State) (bool, error) {
|
||||
otherState8, ok := otherState.(*state8)
|
||||
if !ok {
|
||||
// there's no way to compare different versions of the state, so let's
|
||||
// just say that means the state of balances has changed
|
||||
return true, nil
|
||||
}
|
||||
return !s.State.States.Equals(otherState8.State.States), nil
|
||||
}
|
||||
|
||||
func (s *state8) States() (DealStates, error) {
|
||||
stateArray, err := adt8.AsArray(s.store, s.State.States, market8.StatesAmtBitwidth)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &dealStates8{stateArray}, nil
|
||||
}
|
||||
|
||||
func (s *state8) ProposalsChanged(otherState State) (bool, error) {
|
||||
otherState8, ok := otherState.(*state8)
|
||||
if !ok {
|
||||
// there's no way to compare different versions of the state, so let's
|
||||
// just say that means the state of balances has changed
|
||||
return true, nil
|
||||
}
|
||||
return !s.State.Proposals.Equals(otherState8.State.Proposals), nil
|
||||
}
|
||||
|
||||
func (s *state8) Proposals() (DealProposals, error) {
|
||||
proposalArray, err := adt8.AsArray(s.store, s.State.Proposals, market8.ProposalsAmtBitwidth)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &dealProposals8{proposalArray}, nil
|
||||
}
|
||||
|
||||
func (s *state8) EscrowTable() (BalanceTable, error) {
|
||||
bt, err := adt8.AsBalanceTable(s.store, s.State.EscrowTable)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &balanceTable8{bt}, nil
|
||||
}
|
||||
|
||||
func (s *state8) LockedTable() (BalanceTable, error) {
|
||||
bt, err := adt8.AsBalanceTable(s.store, s.State.LockedTable)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &balanceTable8{bt}, nil
|
||||
}
|
||||
|
||||
func (s *state8) VerifyDealsForActivation(
|
||||
minerAddr address.Address, deals []abi.DealID, currEpoch, sectorExpiry abi.ChainEpoch,
|
||||
) (weight, verifiedWeight abi.DealWeight, err error) {
|
||||
w, vw, _, err := market8.ValidateDealsForActivation(&s.State, s.store, deals, minerAddr, sectorExpiry, currEpoch)
|
||||
return w, vw, err
|
||||
}
|
||||
|
||||
func (s *state8) NextID() (abi.DealID, error) {
|
||||
return s.State.NextID, nil
|
||||
}
|
||||
|
||||
type balanceTable8 struct {
|
||||
*adt8.BalanceTable
|
||||
}
|
||||
|
||||
func (bt *balanceTable8) ForEach(cb func(address.Address, abi.TokenAmount) error) error {
|
||||
asMap := (*adt8.Map)(bt.BalanceTable)
|
||||
var ta abi.TokenAmount
|
||||
return asMap.ForEach(&ta, func(key string) error {
|
||||
a, err := address.NewFromBytes([]byte(key))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return cb(a, ta)
|
||||
})
|
||||
}
|
||||
|
||||
type dealStates8 struct {
|
||||
adt.Array
|
||||
}
|
||||
|
||||
func (s *dealStates8) Get(dealID abi.DealID) (*DealState, bool, error) {
|
||||
var deal8 market8.DealState
|
||||
found, err := s.Array.Get(uint64(dealID), &deal8)
|
||||
if err != nil {
|
||||
return nil, false, err
|
||||
}
|
||||
if !found {
|
||||
return nil, false, nil
|
||||
}
|
||||
deal := fromV8DealState(deal8)
|
||||
return &deal, true, nil
|
||||
}
|
||||
|
||||
func (s *dealStates8) ForEach(cb func(dealID abi.DealID, ds DealState) error) error {
|
||||
var ds8 market8.DealState
|
||||
return s.Array.ForEach(&ds8, func(idx int64) error {
|
||||
return cb(abi.DealID(idx), fromV8DealState(ds8))
|
||||
})
|
||||
}
|
||||
|
||||
func (s *dealStates8) decode(val *cbg.Deferred) (*DealState, error) {
|
||||
var ds8 market8.DealState
|
||||
if err := ds8.UnmarshalCBOR(bytes.NewReader(val.Raw)); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
ds := fromV8DealState(ds8)
|
||||
return &ds, nil
|
||||
}
|
||||
|
||||
func (s *dealStates8) array() adt.Array {
|
||||
return s.Array
|
||||
}
|
||||
|
||||
func fromV8DealState(v8 market8.DealState) DealState {
|
||||
return (DealState)(v8)
|
||||
}
|
||||
|
||||
type dealProposals8 struct {
|
||||
adt.Array
|
||||
}
|
||||
|
||||
func (s *dealProposals8) Get(dealID abi.DealID) (*DealProposal, bool, error) {
|
||||
var proposal8 market8.DealProposal
|
||||
found, err := s.Array.Get(uint64(dealID), &proposal8)
|
||||
if err != nil {
|
||||
return nil, false, err
|
||||
}
|
||||
if !found {
|
||||
return nil, false, nil
|
||||
}
|
||||
|
||||
proposal, err := fromV8DealProposal(proposal8)
|
||||
if err != nil {
|
||||
return nil, true, xerrors.Errorf("decoding proposal: %w", err)
|
||||
}
|
||||
|
||||
return &proposal, true, nil
|
||||
}
|
||||
|
||||
func (s *dealProposals8) ForEach(cb func(dealID abi.DealID, dp DealProposal) error) error {
|
||||
var dp8 market8.DealProposal
|
||||
return s.Array.ForEach(&dp8, func(idx int64) error {
|
||||
dp, err := fromV8DealProposal(dp8)
|
||||
if err != nil {
|
||||
return xerrors.Errorf("decoding proposal: %w", err)
|
||||
}
|
||||
|
||||
return cb(abi.DealID(idx), dp)
|
||||
})
|
||||
}
|
||||
|
||||
func (s *dealProposals8) decode(val *cbg.Deferred) (*DealProposal, error) {
|
||||
var dp8 market8.DealProposal
|
||||
if err := dp8.UnmarshalCBOR(bytes.NewReader(val.Raw)); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
dp, err := fromV8DealProposal(dp8)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &dp, nil
|
||||
}
|
||||
|
||||
func (s *dealProposals8) array() adt.Array {
|
||||
return s.Array
|
||||
}
|
||||
|
||||
func fromV8DealProposal(v8 market8.DealProposal) (DealProposal, error) {
|
||||
|
||||
label := v8.Label
|
||||
|
||||
return DealProposal{
|
||||
PieceCID: v8.PieceCID,
|
||||
PieceSize: v8.PieceSize,
|
||||
VerifiedDeal: v8.VerifiedDeal,
|
||||
Client: v8.Client,
|
||||
Provider: v8.Provider,
|
||||
|
||||
Label: label,
|
||||
|
||||
StartEpoch: v8.StartEpoch,
|
||||
EndEpoch: v8.EndEpoch,
|
||||
StoragePricePerEpoch: v8.StoragePricePerEpoch,
|
||||
|
||||
ProviderCollateral: v8.ProviderCollateral,
|
||||
ClientCollateral: v8.ClientCollateral,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (s *state8) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
|
||||
var _ PublishStorageDealsReturn = (*publishStorageDealsReturn8)(nil)
|
||||
|
||||
func decodePublishStorageDealsReturn8(b []byte) (PublishStorageDealsReturn, error) {
|
||||
var retval market8.PublishStorageDealsReturn
|
||||
if err := retval.UnmarshalCBOR(bytes.NewReader(b)); err != nil {
|
||||
return nil, xerrors.Errorf("failed to unmarshal PublishStorageDealsReturn: %w", err)
|
||||
}
|
||||
|
||||
return &publishStorageDealsReturn8{retval}, nil
|
||||
}
|
||||
|
||||
type publishStorageDealsReturn8 struct {
|
||||
market8.PublishStorageDealsReturn
|
||||
}
|
||||
|
||||
func (r *publishStorageDealsReturn8) IsDealValid(index uint64) (bool, int, error) {
|
||||
|
||||
set, err := r.ValidDeals.IsSet(index)
|
||||
if err != nil || !set {
|
||||
return false, -1, err
|
||||
}
|
||||
maskBf, err := bitfield.NewFromIter(&rlepluslazy.RunSliceIterator{
|
||||
Runs: []rlepluslazy.Run{rlepluslazy.Run{Val: true, Len: index}}})
|
||||
if err != nil {
|
||||
return false, -1, err
|
||||
}
|
||||
before, err := bitfield.IntersectBitField(maskBf, r.ValidDeals)
|
||||
if err != nil {
|
||||
return false, -1, err
|
||||
}
|
||||
outIdx, err := before.Count()
|
||||
if err != nil {
|
||||
return false, -1, err
|
||||
}
|
||||
return set, int(outIdx), nil
|
||||
|
||||
}
|
||||
|
||||
func (r *publishStorageDealsReturn8) DealIDs() ([]abi.DealID, error) {
|
||||
return r.IDs, nil
|
||||
}
|
||||
@@ -4,62 +4,51 @@ import (
|
||||
"github.com/filecoin-project/go-state-types/big"
|
||||
"github.com/filecoin-project/go-state-types/network"
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/ipfs/go-cid"
|
||||
"github.com/libp2p/go-libp2p-core/peer"
|
||||
cbg "github.com/whyrusleeping/cbor-gen"
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-bitfield"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
"github.com/filecoin-project/go-state-types/cbor"
|
||||
"github.com/filecoin-project/go-state-types/dline"
|
||||
"github.com/filecoin-project/go-state-types/proof"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
"github.com/filecoin-project/lotus/chain/actors/builtin"
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
miner{{.latestVersion}} "github.com/filecoin-project/go-state-types/builtin{{import .latestVersion}}miner"
|
||||
|
||||
miner0 "github.com/filecoin-project/specs-actors/actors/builtin/miner"
|
||||
miner2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/miner"
|
||||
miner3 "github.com/filecoin-project/specs-actors/v3/actors/builtin/miner"
|
||||
miner5 "github.com/filecoin-project/specs-actors/v5/actors/builtin/miner"
|
||||
miner7 "github.com/filecoin-project/specs-actors/v7/actors/builtin/miner"
|
||||
{{range .versions}}
|
||||
builtin{{.}} "github.com/filecoin-project/specs-actors{{import .}}actors/builtin"
|
||||
{{if (le . 7)}}
|
||||
builtin{{.}} "github.com/filecoin-project/specs-actors{{import .}}actors/builtin"
|
||||
{{end}}
|
||||
{{end}}
|
||||
)
|
||||
|
||||
func init() {
|
||||
{{range .versions}}
|
||||
builtin.RegisterActorState(builtin{{.}}.StorageMinerActorCodeID, func(store adt.Store, root cid.Cid) (cbor.Marshaler, error) {
|
||||
return load{{.}}(store, root)
|
||||
})
|
||||
{{end}}
|
||||
}
|
||||
|
||||
var Methods = builtin{{.latestVersion}}.MethodsMiner
|
||||
|
||||
// Unchanged between v0, v2, v3, v4, and v5 actors
|
||||
var WPoStProvingPeriod = miner0.WPoStProvingPeriod
|
||||
var WPoStPeriodDeadlines = miner0.WPoStPeriodDeadlines
|
||||
var WPoStChallengeWindow = miner0.WPoStChallengeWindow
|
||||
var WPoStChallengeLookback = miner0.WPoStChallengeLookback
|
||||
var FaultDeclarationCutoff = miner0.FaultDeclarationCutoff
|
||||
|
||||
const MinSectorExpiration = miner0.MinSectorExpiration
|
||||
|
||||
// Not used / checked in v0
|
||||
// TODO: Abstract over network versions
|
||||
var DeclarationsMax = miner2.DeclarationsMax
|
||||
var AddressedSectorsMax = miner2.AddressedSectorsMax
|
||||
|
||||
func Load(store adt.Store, act *types.Actor) (State, error) {
|
||||
if name, av, ok := actors.GetActorMetaByCode(act.Code); ok {
|
||||
if name != actors.MinerKey {
|
||||
return nil, xerrors.Errorf("actor code is not miner: %s", name)
|
||||
}
|
||||
|
||||
switch av {
|
||||
{{range .versions}}
|
||||
{{if (ge . 8)}}
|
||||
case actors.Version{{.}}:
|
||||
return load{{.}}(store, act.Head)
|
||||
{{end}}
|
||||
{{end}}
|
||||
}
|
||||
}
|
||||
|
||||
switch act.Code {
|
||||
{{range .versions}}
|
||||
case builtin{{.}}.StorageMinerActorCodeID:
|
||||
return load{{.}}(store, act.Head)
|
||||
{{if (le . 7)}}
|
||||
case builtin{{.}}.StorageMinerActorCodeID:
|
||||
return load{{.}}(store, act.Head)
|
||||
{{end}}
|
||||
{{end}}
|
||||
}
|
||||
}
|
||||
|
||||
return nil, xerrors.Errorf("unknown actor code %s", act.Code)
|
||||
}
|
||||
|
||||
@@ -73,17 +62,6 @@ func MakeState(store adt.Store, av actors.Version) (State, error) {
|
||||
return nil, xerrors.Errorf("unknown actor version %d", av)
|
||||
}
|
||||
|
||||
func GetActorCodeID(av actors.Version) (cid.Cid, error) {
|
||||
switch av {
|
||||
{{range .versions}}
|
||||
case actors.Version{{.}}:
|
||||
return builtin{{.}}.StorageMinerActorCodeID, nil
|
||||
{{end}}
|
||||
}
|
||||
|
||||
return cid.Undef, xerrors.Errorf("unknown actor version %d", av)
|
||||
}
|
||||
|
||||
type State interface {
|
||||
cbor.Marshaler
|
||||
|
||||
@@ -98,8 +76,8 @@ type State interface {
|
||||
GetSector(abi.SectorNumber) (*SectorOnChainInfo, error)
|
||||
FindSector(abi.SectorNumber) (*SectorLocation, error)
|
||||
GetSectorExpiration(abi.SectorNumber) (*SectorExpiration, error)
|
||||
GetPrecommittedSector(abi.SectorNumber) (*SectorPreCommitOnChainInfo, error)
|
||||
ForEachPrecommittedSector(func(SectorPreCommitOnChainInfo) error) error
|
||||
GetPrecommittedSector(abi.SectorNumber) (*miner{{.latestVersion}}.SectorPreCommitOnChainInfo, error)
|
||||
ForEachPrecommittedSector(func(miner{{.latestVersion}}.SectorPreCommitOnChainInfo) error) error
|
||||
LoadSectors(sectorNos *bitfield.BitField) ([]*SectorOnChainInfo, error)
|
||||
NumLiveSectors() (uint64, error)
|
||||
IsAllocated(abi.SectorNumber) (bool, error)
|
||||
@@ -128,7 +106,7 @@ type State interface {
|
||||
sectors() (adt.Array, error)
|
||||
decodeSectorOnChainInfo(*cbg.Deferred) (SectorOnChainInfo, error)
|
||||
precommits() (adt.Map, error)
|
||||
decodeSectorPreCommitOnChainInfo(*cbg.Deferred) (SectorPreCommitOnChainInfo, error)
|
||||
decodeSectorPreCommitOnChainInfo(*cbg.Deferred) (miner{{.latestVersion}}.SectorPreCommitOnChainInfo, error)
|
||||
GetState() interface{}
|
||||
}
|
||||
|
||||
@@ -166,44 +144,7 @@ type Partition interface {
|
||||
UnprovenSectors() (bitfield.BitField, error)
|
||||
}
|
||||
|
||||
type SectorOnChainInfo struct {
|
||||
SectorNumber abi.SectorNumber
|
||||
SealProof abi.RegisteredSealProof
|
||||
SealedCID cid.Cid
|
||||
DealIDs []abi.DealID
|
||||
Activation abi.ChainEpoch
|
||||
Expiration abi.ChainEpoch
|
||||
DealWeight abi.DealWeight
|
||||
VerifiedDealWeight abi.DealWeight
|
||||
InitialPledge abi.TokenAmount
|
||||
ExpectedDayReward abi.TokenAmount
|
||||
ExpectedStoragePledge abi.TokenAmount
|
||||
SectorKeyCID *cid.Cid
|
||||
}
|
||||
|
||||
type SectorPreCommitInfo = miner0.SectorPreCommitInfo
|
||||
|
||||
type SectorPreCommitOnChainInfo struct {
|
||||
Info SectorPreCommitInfo
|
||||
PreCommitDeposit abi.TokenAmount
|
||||
PreCommitEpoch abi.ChainEpoch
|
||||
DealWeight abi.DealWeight
|
||||
VerifiedDealWeight abi.DealWeight
|
||||
}
|
||||
|
||||
type PoStPartition = miner0.PoStPartition
|
||||
type RecoveryDeclaration = miner0.RecoveryDeclaration
|
||||
type FaultDeclaration = miner0.FaultDeclaration
|
||||
type ReplicaUpdate = miner7.ReplicaUpdate
|
||||
|
||||
// Params
|
||||
type DeclareFaultsParams = miner0.DeclareFaultsParams
|
||||
type DeclareFaultsRecoveredParams = miner0.DeclareFaultsRecoveredParams
|
||||
type SubmitWindowedPoStParams = miner0.SubmitWindowedPoStParams
|
||||
type ProveCommitSectorParams = miner0.ProveCommitSectorParams
|
||||
type DisputeWindowedPoStParams = miner3.DisputeWindowedPoStParams
|
||||
type ProveCommitAggregateParams = miner5.ProveCommitAggregateParams
|
||||
type ProveReplicaUpdatesParams = miner7.ProveReplicaUpdatesParams
|
||||
type SectorOnChainInfo = miner{{.latestVersion}}.SectorOnChainInfo
|
||||
|
||||
func PreferredSealProofTypeFromWindowPoStType(nver network.Version, proof abi.RegisteredPoStProof) (abi.RegisteredSealProof, error) {
|
||||
// We added support for the new proofs in network version 7, and removed support for the old
|
||||
@@ -258,33 +199,9 @@ func WinningPoStProofTypeFromWindowPoStProofType(nver network.Version, proof abi
|
||||
}
|
||||
}
|
||||
|
||||
type MinerInfo struct {
|
||||
Owner address.Address // Must be an ID-address.
|
||||
Worker address.Address // Must be an ID-address.
|
||||
NewWorker address.Address // Must be an ID-address.
|
||||
ControlAddresses []address.Address // Must be an ID-addresses.
|
||||
WorkerChangeEpoch abi.ChainEpoch
|
||||
PeerId *peer.ID
|
||||
Multiaddrs []abi.Multiaddrs
|
||||
WindowPoStProofType abi.RegisteredPoStProof
|
||||
SectorSize abi.SectorSize
|
||||
WindowPoStPartitionSectors uint64
|
||||
ConsensusFaultElapsed abi.ChainEpoch
|
||||
}
|
||||
|
||||
func (mi MinerInfo) IsController(addr address.Address) bool {
|
||||
if addr == mi.Owner || addr == mi.Worker {
|
||||
return true
|
||||
}
|
||||
|
||||
for _, ca := range mi.ControlAddresses {
|
||||
if addr == ca {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
type MinerInfo = miner{{.latestVersion}}.MinerInfo
|
||||
type WorkerKeyChange = miner{{.latestVersion}}.WorkerKeyChange
|
||||
type WindowPostVerifyInfo = proof.WindowPoStVerifyInfo
|
||||
|
||||
type SectorExpiration struct {
|
||||
OnTime abi.ChainEpoch
|
||||
@@ -311,8 +228,8 @@ type SectorExtensions struct {
|
||||
}
|
||||
|
||||
type PreCommitChanges struct {
|
||||
Added []SectorPreCommitOnChainInfo
|
||||
Removed []SectorPreCommitOnChainInfo
|
||||
Added []miner{{.latestVersion}}.SectorPreCommitOnChainInfo
|
||||
Removed []miner{{.latestVersion}}.SectorPreCommitOnChainInfo
|
||||
}
|
||||
|
||||
type LockedFunds struct {
|
||||
|
||||
@@ -4,27 +4,19 @@ import (
|
||||
"github.com/filecoin-project/go-state-types/big"
|
||||
"github.com/filecoin-project/go-state-types/network"
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/ipfs/go-cid"
|
||||
"github.com/libp2p/go-libp2p-core/peer"
|
||||
cbg "github.com/whyrusleeping/cbor-gen"
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-bitfield"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
"github.com/filecoin-project/go-state-types/cbor"
|
||||
"github.com/filecoin-project/go-state-types/dline"
|
||||
"github.com/filecoin-project/go-state-types/proof"
|
||||
|
||||
miner8 "github.com/filecoin-project/go-state-types/builtin/v8/miner"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
"github.com/filecoin-project/lotus/chain/actors/builtin"
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
|
||||
miner0 "github.com/filecoin-project/specs-actors/actors/builtin/miner"
|
||||
miner2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/miner"
|
||||
miner3 "github.com/filecoin-project/specs-actors/v3/actors/builtin/miner"
|
||||
miner5 "github.com/filecoin-project/specs-actors/v5/actors/builtin/miner"
|
||||
miner7 "github.com/filecoin-project/specs-actors/v7/actors/builtin/miner"
|
||||
|
||||
builtin0 "github.com/filecoin-project/specs-actors/actors/builtin"
|
||||
|
||||
builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin"
|
||||
@@ -40,55 +32,20 @@ import (
|
||||
builtin7 "github.com/filecoin-project/specs-actors/v7/actors/builtin"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
||||
builtin.RegisterActorState(builtin0.StorageMinerActorCodeID, func(store adt.Store, root cid.Cid) (cbor.Marshaler, error) {
|
||||
return load0(store, root)
|
||||
})
|
||||
|
||||
builtin.RegisterActorState(builtin2.StorageMinerActorCodeID, func(store adt.Store, root cid.Cid) (cbor.Marshaler, error) {
|
||||
return load2(store, root)
|
||||
})
|
||||
|
||||
builtin.RegisterActorState(builtin3.StorageMinerActorCodeID, func(store adt.Store, root cid.Cid) (cbor.Marshaler, error) {
|
||||
return load3(store, root)
|
||||
})
|
||||
|
||||
builtin.RegisterActorState(builtin4.StorageMinerActorCodeID, func(store adt.Store, root cid.Cid) (cbor.Marshaler, error) {
|
||||
return load4(store, root)
|
||||
})
|
||||
|
||||
builtin.RegisterActorState(builtin5.StorageMinerActorCodeID, func(store adt.Store, root cid.Cid) (cbor.Marshaler, error) {
|
||||
return load5(store, root)
|
||||
})
|
||||
|
||||
builtin.RegisterActorState(builtin6.StorageMinerActorCodeID, func(store adt.Store, root cid.Cid) (cbor.Marshaler, error) {
|
||||
return load6(store, root)
|
||||
})
|
||||
|
||||
builtin.RegisterActorState(builtin7.StorageMinerActorCodeID, func(store adt.Store, root cid.Cid) (cbor.Marshaler, error) {
|
||||
return load7(store, root)
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
var Methods = builtin7.MethodsMiner
|
||||
|
||||
// Unchanged between v0, v2, v3, v4, and v5 actors
|
||||
var WPoStProvingPeriod = miner0.WPoStProvingPeriod
|
||||
var WPoStPeriodDeadlines = miner0.WPoStPeriodDeadlines
|
||||
var WPoStChallengeWindow = miner0.WPoStChallengeWindow
|
||||
var WPoStChallengeLookback = miner0.WPoStChallengeLookback
|
||||
var FaultDeclarationCutoff = miner0.FaultDeclarationCutoff
|
||||
|
||||
const MinSectorExpiration = miner0.MinSectorExpiration
|
||||
|
||||
// Not used / checked in v0
|
||||
// TODO: Abstract over network versions
|
||||
var DeclarationsMax = miner2.DeclarationsMax
|
||||
var AddressedSectorsMax = miner2.AddressedSectorsMax
|
||||
|
||||
func Load(store adt.Store, act *types.Actor) (State, error) {
|
||||
if name, av, ok := actors.GetActorMetaByCode(act.Code); ok {
|
||||
if name != actors.MinerKey {
|
||||
return nil, xerrors.Errorf("actor code is not miner: %s", name)
|
||||
}
|
||||
|
||||
switch av {
|
||||
|
||||
case actors.Version8:
|
||||
return load8(store, act.Head)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
switch act.Code {
|
||||
|
||||
case builtin0.StorageMinerActorCodeID:
|
||||
@@ -113,6 +70,7 @@ func Load(store adt.Store, act *types.Actor) (State, error) {
|
||||
return load7(store, act.Head)
|
||||
|
||||
}
|
||||
|
||||
return nil, xerrors.Errorf("unknown actor code %s", act.Code)
|
||||
}
|
||||
|
||||
@@ -140,39 +98,13 @@ func MakeState(store adt.Store, av actors.Version) (State, error) {
|
||||
case actors.Version7:
|
||||
return make7(store)
|
||||
|
||||
case actors.Version8:
|
||||
return make8(store)
|
||||
|
||||
}
|
||||
return nil, xerrors.Errorf("unknown actor version %d", av)
|
||||
}
|
||||
|
||||
func GetActorCodeID(av actors.Version) (cid.Cid, error) {
|
||||
switch av {
|
||||
|
||||
case actors.Version0:
|
||||
return builtin0.StorageMinerActorCodeID, nil
|
||||
|
||||
case actors.Version2:
|
||||
return builtin2.StorageMinerActorCodeID, nil
|
||||
|
||||
case actors.Version3:
|
||||
return builtin3.StorageMinerActorCodeID, nil
|
||||
|
||||
case actors.Version4:
|
||||
return builtin4.StorageMinerActorCodeID, nil
|
||||
|
||||
case actors.Version5:
|
||||
return builtin5.StorageMinerActorCodeID, nil
|
||||
|
||||
case actors.Version6:
|
||||
return builtin6.StorageMinerActorCodeID, nil
|
||||
|
||||
case actors.Version7:
|
||||
return builtin7.StorageMinerActorCodeID, nil
|
||||
|
||||
}
|
||||
|
||||
return cid.Undef, xerrors.Errorf("unknown actor version %d", av)
|
||||
}
|
||||
|
||||
type State interface {
|
||||
cbor.Marshaler
|
||||
|
||||
@@ -187,8 +119,8 @@ type State interface {
|
||||
GetSector(abi.SectorNumber) (*SectorOnChainInfo, error)
|
||||
FindSector(abi.SectorNumber) (*SectorLocation, error)
|
||||
GetSectorExpiration(abi.SectorNumber) (*SectorExpiration, error)
|
||||
GetPrecommittedSector(abi.SectorNumber) (*SectorPreCommitOnChainInfo, error)
|
||||
ForEachPrecommittedSector(func(SectorPreCommitOnChainInfo) error) error
|
||||
GetPrecommittedSector(abi.SectorNumber) (*miner8.SectorPreCommitOnChainInfo, error)
|
||||
ForEachPrecommittedSector(func(miner8.SectorPreCommitOnChainInfo) error) error
|
||||
LoadSectors(sectorNos *bitfield.BitField) ([]*SectorOnChainInfo, error)
|
||||
NumLiveSectors() (uint64, error)
|
||||
IsAllocated(abi.SectorNumber) (bool, error)
|
||||
@@ -217,7 +149,7 @@ type State interface {
|
||||
sectors() (adt.Array, error)
|
||||
decodeSectorOnChainInfo(*cbg.Deferred) (SectorOnChainInfo, error)
|
||||
precommits() (adt.Map, error)
|
||||
decodeSectorPreCommitOnChainInfo(*cbg.Deferred) (SectorPreCommitOnChainInfo, error)
|
||||
decodeSectorPreCommitOnChainInfo(*cbg.Deferred) (miner8.SectorPreCommitOnChainInfo, error)
|
||||
GetState() interface{}
|
||||
}
|
||||
|
||||
@@ -255,44 +187,7 @@ type Partition interface {
|
||||
UnprovenSectors() (bitfield.BitField, error)
|
||||
}
|
||||
|
||||
type SectorOnChainInfo struct {
|
||||
SectorNumber abi.SectorNumber
|
||||
SealProof abi.RegisteredSealProof
|
||||
SealedCID cid.Cid
|
||||
DealIDs []abi.DealID
|
||||
Activation abi.ChainEpoch
|
||||
Expiration abi.ChainEpoch
|
||||
DealWeight abi.DealWeight
|
||||
VerifiedDealWeight abi.DealWeight
|
||||
InitialPledge abi.TokenAmount
|
||||
ExpectedDayReward abi.TokenAmount
|
||||
ExpectedStoragePledge abi.TokenAmount
|
||||
SectorKeyCID *cid.Cid
|
||||
}
|
||||
|
||||
type SectorPreCommitInfo = miner0.SectorPreCommitInfo
|
||||
|
||||
type SectorPreCommitOnChainInfo struct {
|
||||
Info SectorPreCommitInfo
|
||||
PreCommitDeposit abi.TokenAmount
|
||||
PreCommitEpoch abi.ChainEpoch
|
||||
DealWeight abi.DealWeight
|
||||
VerifiedDealWeight abi.DealWeight
|
||||
}
|
||||
|
||||
type PoStPartition = miner0.PoStPartition
|
||||
type RecoveryDeclaration = miner0.RecoveryDeclaration
|
||||
type FaultDeclaration = miner0.FaultDeclaration
|
||||
type ReplicaUpdate = miner7.ReplicaUpdate
|
||||
|
||||
// Params
|
||||
type DeclareFaultsParams = miner0.DeclareFaultsParams
|
||||
type DeclareFaultsRecoveredParams = miner0.DeclareFaultsRecoveredParams
|
||||
type SubmitWindowedPoStParams = miner0.SubmitWindowedPoStParams
|
||||
type ProveCommitSectorParams = miner0.ProveCommitSectorParams
|
||||
type DisputeWindowedPoStParams = miner3.DisputeWindowedPoStParams
|
||||
type ProveCommitAggregateParams = miner5.ProveCommitAggregateParams
|
||||
type ProveReplicaUpdatesParams = miner7.ProveReplicaUpdatesParams
|
||||
type SectorOnChainInfo = miner8.SectorOnChainInfo
|
||||
|
||||
func PreferredSealProofTypeFromWindowPoStType(nver network.Version, proof abi.RegisteredPoStProof) (abi.RegisteredSealProof, error) {
|
||||
// We added support for the new proofs in network version 7, and removed support for the old
|
||||
@@ -347,33 +242,9 @@ func WinningPoStProofTypeFromWindowPoStProofType(nver network.Version, proof abi
|
||||
}
|
||||
}
|
||||
|
||||
type MinerInfo struct {
|
||||
Owner address.Address // Must be an ID-address.
|
||||
Worker address.Address // Must be an ID-address.
|
||||
NewWorker address.Address // Must be an ID-address.
|
||||
ControlAddresses []address.Address // Must be an ID-addresses.
|
||||
WorkerChangeEpoch abi.ChainEpoch
|
||||
PeerId *peer.ID
|
||||
Multiaddrs []abi.Multiaddrs
|
||||
WindowPoStProofType abi.RegisteredPoStProof
|
||||
SectorSize abi.SectorSize
|
||||
WindowPoStPartitionSectors uint64
|
||||
ConsensusFaultElapsed abi.ChainEpoch
|
||||
}
|
||||
|
||||
func (mi MinerInfo) IsController(addr address.Address) bool {
|
||||
if addr == mi.Owner || addr == mi.Worker {
|
||||
return true
|
||||
}
|
||||
|
||||
for _, ca := range mi.ControlAddresses {
|
||||
if addr == ca {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
type MinerInfo = miner8.MinerInfo
|
||||
type WorkerKeyChange = miner8.WorkerKeyChange
|
||||
type WindowPostVerifyInfo = proof.WindowPoStVerifyInfo
|
||||
|
||||
type SectorExpiration struct {
|
||||
OnTime abi.ChainEpoch
|
||||
@@ -400,8 +271,8 @@ type SectorExtensions struct {
|
||||
}
|
||||
|
||||
type PreCommitChanges struct {
|
||||
Added []SectorPreCommitOnChainInfo
|
||||
Removed []SectorPreCommitOnChainInfo
|
||||
Added []miner8.SectorPreCommitOnChainInfo
|
||||
Removed []miner8.SectorPreCommitOnChainInfo
|
||||
}
|
||||
|
||||
type LockedFunds struct {
|
||||
|
||||
@@ -6,23 +6,28 @@ import (
|
||||
{{if (le .v 1)}}
|
||||
"github.com/filecoin-project/go-state-types/big"
|
||||
{{end}}
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-bitfield"
|
||||
rle "github.com/filecoin-project/go-bitfield/rle"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
"github.com/filecoin-project/go-state-types/dline"
|
||||
"github.com/ipfs/go-cid"
|
||||
"github.com/libp2p/go-libp2p-core/peer"
|
||||
cbg "github.com/whyrusleeping/cbor-gen"
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
minertypes "github.com/filecoin-project/go-state-types/builtin/v8/miner"
|
||||
|
||||
{{if (ge .v 3)}}
|
||||
builtin{{.v}} "github.com/filecoin-project/specs-actors{{.import}}actors/builtin"
|
||||
{{if (le .v 7)}}
|
||||
{{if (ge .v 3)}}
|
||||
builtin{{.v}} "github.com/filecoin-project/specs-actors{{.import}}actors/builtin"
|
||||
{{end}}
|
||||
miner{{.v}} "github.com/filecoin-project/specs-actors{{.import}}actors/builtin/miner"
|
||||
adt{{.v}} "github.com/filecoin-project/specs-actors{{.import}}actors/util/adt"
|
||||
{{else}}
|
||||
miner{{.v}} "github.com/filecoin-project/go-state-types/builtin{{.import}}miner"
|
||||
adt{{.v}} "github.com/filecoin-project/go-state-types/builtin{{.import}}util/adt"
|
||||
builtin{{.v}} "github.com/filecoin-project/go-state-types/builtin"
|
||||
{{end}}
|
||||
miner{{.v}} "github.com/filecoin-project/specs-actors{{.import}}actors/builtin/miner"
|
||||
adt{{.v}} "github.com/filecoin-project/specs-actors{{.import}}actors/util/adt"
|
||||
)
|
||||
|
||||
var _ State = (*state{{.v}})(nil)
|
||||
@@ -210,7 +215,7 @@ func (s *state{{.v}}) GetSectorExpiration(num abi.SectorNumber) (*SectorExpirati
|
||||
return &out, nil
|
||||
}
|
||||
|
||||
func (s *state{{.v}}) GetPrecommittedSector(num abi.SectorNumber) (*SectorPreCommitOnChainInfo, error) {
|
||||
func (s *state{{.v}}) GetPrecommittedSector(num abi.SectorNumber) (*minertypes.SectorPreCommitOnChainInfo, error) {
|
||||
info, ok, err := s.State.GetPrecommittedSector(s.store, num)
|
||||
if !ok || err != nil {
|
||||
return nil, err
|
||||
@@ -221,7 +226,7 @@ func (s *state{{.v}}) GetPrecommittedSector(num abi.SectorNumber) (*SectorPreCom
|
||||
return &ret, nil
|
||||
}
|
||||
|
||||
func (s *state{{.v}}) ForEachPrecommittedSector(cb func(SectorPreCommitOnChainInfo) error) error {
|
||||
func (s *state{{.v}}) ForEachPrecommittedSector(cb func(minertypes.SectorPreCommitOnChainInfo) error) error {
|
||||
{{if (ge .v 3) -}}
|
||||
precommitted, err := adt{{.v}}.AsMap(s.store, s.State.PreCommittedSectors, builtin{{.v}}.DefaultHamtBitwidth)
|
||||
{{- else -}}
|
||||
@@ -389,10 +394,6 @@ func (s *state{{.v}}) Info() (MinerInfo, error) {
|
||||
return MinerInfo{}, err
|
||||
}
|
||||
|
||||
var pid *peer.ID
|
||||
if peerID, err := peer.IDFromBytes(info.PeerId); err == nil {
|
||||
pid = &peerID
|
||||
}
|
||||
{{if (le .v 2)}}
|
||||
wpp, err := info.SealProofType.RegisteredWindowPoStProof()
|
||||
if err != nil {
|
||||
@@ -404,10 +405,9 @@ func (s *state{{.v}}) Info() (MinerInfo, error) {
|
||||
Worker: info.Worker,
|
||||
ControlAddresses: info.ControlAddresses,
|
||||
|
||||
NewWorker: address.Undef,
|
||||
WorkerChangeEpoch: -1,
|
||||
PendingWorkerKey: (*WorkerKeyChange)(info.PendingWorkerKey),
|
||||
|
||||
PeerId: pid,
|
||||
PeerId: info.PeerId,
|
||||
Multiaddrs: info.Multiaddrs,
|
||||
WindowPoStProofType: {{if (ge .v 3)}}info.WindowPoStProofType{{else}}wpp{{end}},
|
||||
SectorSize: info.SectorSize,
|
||||
@@ -415,11 +415,6 @@ func (s *state{{.v}}) Info() (MinerInfo, error) {
|
||||
ConsensusFaultElapsed: {{if (ge .v 2)}}info.ConsensusFaultElapsed{{else}}-1{{end}},
|
||||
}
|
||||
|
||||
if info.PendingWorkerKey != nil {
|
||||
mi.NewWorker = info.PendingWorkerKey.NewWorker
|
||||
mi.WorkerChangeEpoch = info.PendingWorkerKey.EffectiveAt
|
||||
}
|
||||
|
||||
return mi, nil
|
||||
}
|
||||
|
||||
@@ -449,11 +444,11 @@ func (s *state{{.v}}) precommits() (adt.Map, error) {
|
||||
return adt{{.v}}.AsMap(s.store, s.PreCommittedSectors{{if (ge .v 3)}}, builtin{{.v}}.DefaultHamtBitwidth{{end}})
|
||||
}
|
||||
|
||||
func (s *state{{.v}}) decodeSectorPreCommitOnChainInfo(val *cbg.Deferred) (SectorPreCommitOnChainInfo, error) {
|
||||
func (s *state{{.v}}) decodeSectorPreCommitOnChainInfo(val *cbg.Deferred) (minertypes.SectorPreCommitOnChainInfo, error) {
|
||||
var sp miner{{.v}}.SectorPreCommitOnChainInfo
|
||||
err := sp.UnmarshalCBOR(bytes.NewReader(val.Raw))
|
||||
if err != nil {
|
||||
return SectorPreCommitOnChainInfo{}, err
|
||||
return minertypes.SectorPreCommitOnChainInfo{}, err
|
||||
}
|
||||
|
||||
return fromV{{.v}}SectorPreCommitOnChainInfo(sp), nil
|
||||
@@ -584,18 +579,14 @@ func fromV{{.v}}SectorOnChainInfo(v{{.v}} miner{{.v}}.SectorOnChainInfo) SectorO
|
||||
return info
|
||||
}
|
||||
|
||||
func fromV{{.v}}SectorPreCommitOnChainInfo(v{{.v}} miner{{.v}}.SectorPreCommitOnChainInfo) SectorPreCommitOnChainInfo {
|
||||
{{if (ge .v 2)}}
|
||||
return SectorPreCommitOnChainInfo{
|
||||
Info: (SectorPreCommitInfo)(v{{.v}}.Info),
|
||||
func fromV{{.v}}SectorPreCommitOnChainInfo(v{{.v}} miner{{.v}}.SectorPreCommitOnChainInfo) minertypes.SectorPreCommitOnChainInfo {
|
||||
return minertypes.SectorPreCommitOnChainInfo{
|
||||
Info: (minertypes.SectorPreCommitInfo)(v{{.v}}.Info),
|
||||
PreCommitDeposit: v{{.v}}.PreCommitDeposit,
|
||||
PreCommitEpoch: v{{.v}}.PreCommitEpoch,
|
||||
DealWeight: v{{.v}}.DealWeight,
|
||||
VerifiedDealWeight: v{{.v}}.VerifiedDealWeight,
|
||||
}
|
||||
{{else}}
|
||||
return (SectorPreCommitOnChainInfo)(v0)
|
||||
{{end}}
|
||||
}
|
||||
|
||||
func (s *state{{.v}}) GetState() interface{} {
|
||||
|
||||
@@ -6,16 +6,15 @@ import (
|
||||
|
||||
"github.com/filecoin-project/go-state-types/big"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-bitfield"
|
||||
rle "github.com/filecoin-project/go-bitfield/rle"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
"github.com/filecoin-project/go-state-types/dline"
|
||||
"github.com/ipfs/go-cid"
|
||||
"github.com/libp2p/go-libp2p-core/peer"
|
||||
cbg "github.com/whyrusleeping/cbor-gen"
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
minertypes "github.com/filecoin-project/go-state-types/builtin/v8/miner"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
|
||||
miner0 "github.com/filecoin-project/specs-actors/actors/builtin/miner"
|
||||
@@ -197,7 +196,7 @@ func (s *state0) GetSectorExpiration(num abi.SectorNumber) (*SectorExpiration, e
|
||||
return &out, nil
|
||||
}
|
||||
|
||||
func (s *state0) GetPrecommittedSector(num abi.SectorNumber) (*SectorPreCommitOnChainInfo, error) {
|
||||
func (s *state0) GetPrecommittedSector(num abi.SectorNumber) (*minertypes.SectorPreCommitOnChainInfo, error) {
|
||||
info, ok, err := s.State.GetPrecommittedSector(s.store, num)
|
||||
if !ok || err != nil {
|
||||
return nil, err
|
||||
@@ -208,7 +207,7 @@ func (s *state0) GetPrecommittedSector(num abi.SectorNumber) (*SectorPreCommitOn
|
||||
return &ret, nil
|
||||
}
|
||||
|
||||
func (s *state0) ForEachPrecommittedSector(cb func(SectorPreCommitOnChainInfo) error) error {
|
||||
func (s *state0) ForEachPrecommittedSector(cb func(minertypes.SectorPreCommitOnChainInfo) error) error {
|
||||
precommitted, err := adt0.AsMap(s.store, s.State.PreCommittedSectors)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -372,11 +371,6 @@ func (s *state0) Info() (MinerInfo, error) {
|
||||
return MinerInfo{}, err
|
||||
}
|
||||
|
||||
var pid *peer.ID
|
||||
if peerID, err := peer.IDFromBytes(info.PeerId); err == nil {
|
||||
pid = &peerID
|
||||
}
|
||||
|
||||
wpp, err := info.SealProofType.RegisteredWindowPoStProof()
|
||||
if err != nil {
|
||||
return MinerInfo{}, err
|
||||
@@ -387,10 +381,9 @@ func (s *state0) Info() (MinerInfo, error) {
|
||||
Worker: info.Worker,
|
||||
ControlAddresses: info.ControlAddresses,
|
||||
|
||||
NewWorker: address.Undef,
|
||||
WorkerChangeEpoch: -1,
|
||||
PendingWorkerKey: (*WorkerKeyChange)(info.PendingWorkerKey),
|
||||
|
||||
PeerId: pid,
|
||||
PeerId: info.PeerId,
|
||||
Multiaddrs: info.Multiaddrs,
|
||||
WindowPoStProofType: wpp,
|
||||
SectorSize: info.SectorSize,
|
||||
@@ -398,11 +391,6 @@ func (s *state0) Info() (MinerInfo, error) {
|
||||
ConsensusFaultElapsed: -1,
|
||||
}
|
||||
|
||||
if info.PendingWorkerKey != nil {
|
||||
mi.NewWorker = info.PendingWorkerKey.NewWorker
|
||||
mi.WorkerChangeEpoch = info.PendingWorkerKey.EffectiveAt
|
||||
}
|
||||
|
||||
return mi, nil
|
||||
}
|
||||
|
||||
@@ -432,11 +420,11 @@ func (s *state0) precommits() (adt.Map, error) {
|
||||
return adt0.AsMap(s.store, s.PreCommittedSectors)
|
||||
}
|
||||
|
||||
func (s *state0) decodeSectorPreCommitOnChainInfo(val *cbg.Deferred) (SectorPreCommitOnChainInfo, error) {
|
||||
func (s *state0) decodeSectorPreCommitOnChainInfo(val *cbg.Deferred) (minertypes.SectorPreCommitOnChainInfo, error) {
|
||||
var sp miner0.SectorPreCommitOnChainInfo
|
||||
err := sp.UnmarshalCBOR(bytes.NewReader(val.Raw))
|
||||
if err != nil {
|
||||
return SectorPreCommitOnChainInfo{}, err
|
||||
return minertypes.SectorPreCommitOnChainInfo{}, err
|
||||
}
|
||||
|
||||
return fromV0SectorPreCommitOnChainInfo(sp), nil
|
||||
@@ -522,10 +510,14 @@ func fromV0SectorOnChainInfo(v0 miner0.SectorOnChainInfo) SectorOnChainInfo {
|
||||
return info
|
||||
}
|
||||
|
||||
func fromV0SectorPreCommitOnChainInfo(v0 miner0.SectorPreCommitOnChainInfo) SectorPreCommitOnChainInfo {
|
||||
|
||||
return (SectorPreCommitOnChainInfo)(v0)
|
||||
|
||||
func fromV0SectorPreCommitOnChainInfo(v0 miner0.SectorPreCommitOnChainInfo) minertypes.SectorPreCommitOnChainInfo {
|
||||
return minertypes.SectorPreCommitOnChainInfo{
|
||||
Info: (minertypes.SectorPreCommitInfo)(v0.Info),
|
||||
PreCommitDeposit: v0.PreCommitDeposit,
|
||||
PreCommitEpoch: v0.PreCommitEpoch,
|
||||
DealWeight: v0.DealWeight,
|
||||
VerifiedDealWeight: v0.VerifiedDealWeight,
|
||||
}
|
||||
}
|
||||
|
||||
func (s *state0) GetState() interface{} {
|
||||
|
||||
@@ -4,16 +4,15 @@ import (
|
||||
"bytes"
|
||||
"errors"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-bitfield"
|
||||
rle "github.com/filecoin-project/go-bitfield/rle"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
"github.com/filecoin-project/go-state-types/dline"
|
||||
"github.com/ipfs/go-cid"
|
||||
"github.com/libp2p/go-libp2p-core/peer"
|
||||
cbg "github.com/whyrusleeping/cbor-gen"
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
minertypes "github.com/filecoin-project/go-state-types/builtin/v8/miner"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
|
||||
miner2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/miner"
|
||||
@@ -195,7 +194,7 @@ func (s *state2) GetSectorExpiration(num abi.SectorNumber) (*SectorExpiration, e
|
||||
return &out, nil
|
||||
}
|
||||
|
||||
func (s *state2) GetPrecommittedSector(num abi.SectorNumber) (*SectorPreCommitOnChainInfo, error) {
|
||||
func (s *state2) GetPrecommittedSector(num abi.SectorNumber) (*minertypes.SectorPreCommitOnChainInfo, error) {
|
||||
info, ok, err := s.State.GetPrecommittedSector(s.store, num)
|
||||
if !ok || err != nil {
|
||||
return nil, err
|
||||
@@ -206,7 +205,7 @@ func (s *state2) GetPrecommittedSector(num abi.SectorNumber) (*SectorPreCommitOn
|
||||
return &ret, nil
|
||||
}
|
||||
|
||||
func (s *state2) ForEachPrecommittedSector(cb func(SectorPreCommitOnChainInfo) error) error {
|
||||
func (s *state2) ForEachPrecommittedSector(cb func(minertypes.SectorPreCommitOnChainInfo) error) error {
|
||||
precommitted, err := adt2.AsMap(s.store, s.State.PreCommittedSectors)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -370,11 +369,6 @@ func (s *state2) Info() (MinerInfo, error) {
|
||||
return MinerInfo{}, err
|
||||
}
|
||||
|
||||
var pid *peer.ID
|
||||
if peerID, err := peer.IDFromBytes(info.PeerId); err == nil {
|
||||
pid = &peerID
|
||||
}
|
||||
|
||||
wpp, err := info.SealProofType.RegisteredWindowPoStProof()
|
||||
if err != nil {
|
||||
return MinerInfo{}, err
|
||||
@@ -385,10 +379,9 @@ func (s *state2) Info() (MinerInfo, error) {
|
||||
Worker: info.Worker,
|
||||
ControlAddresses: info.ControlAddresses,
|
||||
|
||||
NewWorker: address.Undef,
|
||||
WorkerChangeEpoch: -1,
|
||||
PendingWorkerKey: (*WorkerKeyChange)(info.PendingWorkerKey),
|
||||
|
||||
PeerId: pid,
|
||||
PeerId: info.PeerId,
|
||||
Multiaddrs: info.Multiaddrs,
|
||||
WindowPoStProofType: wpp,
|
||||
SectorSize: info.SectorSize,
|
||||
@@ -396,11 +389,6 @@ func (s *state2) Info() (MinerInfo, error) {
|
||||
ConsensusFaultElapsed: info.ConsensusFaultElapsed,
|
||||
}
|
||||
|
||||
if info.PendingWorkerKey != nil {
|
||||
mi.NewWorker = info.PendingWorkerKey.NewWorker
|
||||
mi.WorkerChangeEpoch = info.PendingWorkerKey.EffectiveAt
|
||||
}
|
||||
|
||||
return mi, nil
|
||||
}
|
||||
|
||||
@@ -430,11 +418,11 @@ func (s *state2) precommits() (adt.Map, error) {
|
||||
return adt2.AsMap(s.store, s.PreCommittedSectors)
|
||||
}
|
||||
|
||||
func (s *state2) decodeSectorPreCommitOnChainInfo(val *cbg.Deferred) (SectorPreCommitOnChainInfo, error) {
|
||||
func (s *state2) decodeSectorPreCommitOnChainInfo(val *cbg.Deferred) (minertypes.SectorPreCommitOnChainInfo, error) {
|
||||
var sp miner2.SectorPreCommitOnChainInfo
|
||||
err := sp.UnmarshalCBOR(bytes.NewReader(val.Raw))
|
||||
if err != nil {
|
||||
return SectorPreCommitOnChainInfo{}, err
|
||||
return minertypes.SectorPreCommitOnChainInfo{}, err
|
||||
}
|
||||
|
||||
return fromV2SectorPreCommitOnChainInfo(sp), nil
|
||||
@@ -552,16 +540,14 @@ func fromV2SectorOnChainInfo(v2 miner2.SectorOnChainInfo) SectorOnChainInfo {
|
||||
return info
|
||||
}
|
||||
|
||||
func fromV2SectorPreCommitOnChainInfo(v2 miner2.SectorPreCommitOnChainInfo) SectorPreCommitOnChainInfo {
|
||||
|
||||
return SectorPreCommitOnChainInfo{
|
||||
Info: (SectorPreCommitInfo)(v2.Info),
|
||||
func fromV2SectorPreCommitOnChainInfo(v2 miner2.SectorPreCommitOnChainInfo) minertypes.SectorPreCommitOnChainInfo {
|
||||
return minertypes.SectorPreCommitOnChainInfo{
|
||||
Info: (minertypes.SectorPreCommitInfo)(v2.Info),
|
||||
PreCommitDeposit: v2.PreCommitDeposit,
|
||||
PreCommitEpoch: v2.PreCommitEpoch,
|
||||
DealWeight: v2.DealWeight,
|
||||
VerifiedDealWeight: v2.VerifiedDealWeight,
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func (s *state2) GetState() interface{} {
|
||||
|
||||
@@ -4,16 +4,15 @@ import (
|
||||
"bytes"
|
||||
"errors"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-bitfield"
|
||||
rle "github.com/filecoin-project/go-bitfield/rle"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
"github.com/filecoin-project/go-state-types/dline"
|
||||
"github.com/ipfs/go-cid"
|
||||
"github.com/libp2p/go-libp2p-core/peer"
|
||||
cbg "github.com/whyrusleeping/cbor-gen"
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
minertypes "github.com/filecoin-project/go-state-types/builtin/v8/miner"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
|
||||
builtin3 "github.com/filecoin-project/specs-actors/v3/actors/builtin"
|
||||
@@ -197,7 +196,7 @@ func (s *state3) GetSectorExpiration(num abi.SectorNumber) (*SectorExpiration, e
|
||||
return &out, nil
|
||||
}
|
||||
|
||||
func (s *state3) GetPrecommittedSector(num abi.SectorNumber) (*SectorPreCommitOnChainInfo, error) {
|
||||
func (s *state3) GetPrecommittedSector(num abi.SectorNumber) (*minertypes.SectorPreCommitOnChainInfo, error) {
|
||||
info, ok, err := s.State.GetPrecommittedSector(s.store, num)
|
||||
if !ok || err != nil {
|
||||
return nil, err
|
||||
@@ -208,7 +207,7 @@ func (s *state3) GetPrecommittedSector(num abi.SectorNumber) (*SectorPreCommitOn
|
||||
return &ret, nil
|
||||
}
|
||||
|
||||
func (s *state3) ForEachPrecommittedSector(cb func(SectorPreCommitOnChainInfo) error) error {
|
||||
func (s *state3) ForEachPrecommittedSector(cb func(minertypes.SectorPreCommitOnChainInfo) error) error {
|
||||
precommitted, err := adt3.AsMap(s.store, s.State.PreCommittedSectors, builtin3.DefaultHamtBitwidth)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -372,20 +371,14 @@ func (s *state3) Info() (MinerInfo, error) {
|
||||
return MinerInfo{}, err
|
||||
}
|
||||
|
||||
var pid *peer.ID
|
||||
if peerID, err := peer.IDFromBytes(info.PeerId); err == nil {
|
||||
pid = &peerID
|
||||
}
|
||||
|
||||
mi := MinerInfo{
|
||||
Owner: info.Owner,
|
||||
Worker: info.Worker,
|
||||
ControlAddresses: info.ControlAddresses,
|
||||
|
||||
NewWorker: address.Undef,
|
||||
WorkerChangeEpoch: -1,
|
||||
PendingWorkerKey: (*WorkerKeyChange)(info.PendingWorkerKey),
|
||||
|
||||
PeerId: pid,
|
||||
PeerId: info.PeerId,
|
||||
Multiaddrs: info.Multiaddrs,
|
||||
WindowPoStProofType: info.WindowPoStProofType,
|
||||
SectorSize: info.SectorSize,
|
||||
@@ -393,11 +386,6 @@ func (s *state3) Info() (MinerInfo, error) {
|
||||
ConsensusFaultElapsed: info.ConsensusFaultElapsed,
|
||||
}
|
||||
|
||||
if info.PendingWorkerKey != nil {
|
||||
mi.NewWorker = info.PendingWorkerKey.NewWorker
|
||||
mi.WorkerChangeEpoch = info.PendingWorkerKey.EffectiveAt
|
||||
}
|
||||
|
||||
return mi, nil
|
||||
}
|
||||
|
||||
@@ -427,11 +415,11 @@ func (s *state3) precommits() (adt.Map, error) {
|
||||
return adt3.AsMap(s.store, s.PreCommittedSectors, builtin3.DefaultHamtBitwidth)
|
||||
}
|
||||
|
||||
func (s *state3) decodeSectorPreCommitOnChainInfo(val *cbg.Deferred) (SectorPreCommitOnChainInfo, error) {
|
||||
func (s *state3) decodeSectorPreCommitOnChainInfo(val *cbg.Deferred) (minertypes.SectorPreCommitOnChainInfo, error) {
|
||||
var sp miner3.SectorPreCommitOnChainInfo
|
||||
err := sp.UnmarshalCBOR(bytes.NewReader(val.Raw))
|
||||
if err != nil {
|
||||
return SectorPreCommitOnChainInfo{}, err
|
||||
return minertypes.SectorPreCommitOnChainInfo{}, err
|
||||
}
|
||||
|
||||
return fromV3SectorPreCommitOnChainInfo(sp), nil
|
||||
@@ -553,16 +541,14 @@ func fromV3SectorOnChainInfo(v3 miner3.SectorOnChainInfo) SectorOnChainInfo {
|
||||
return info
|
||||
}
|
||||
|
||||
func fromV3SectorPreCommitOnChainInfo(v3 miner3.SectorPreCommitOnChainInfo) SectorPreCommitOnChainInfo {
|
||||
|
||||
return SectorPreCommitOnChainInfo{
|
||||
Info: (SectorPreCommitInfo)(v3.Info),
|
||||
func fromV3SectorPreCommitOnChainInfo(v3 miner3.SectorPreCommitOnChainInfo) minertypes.SectorPreCommitOnChainInfo {
|
||||
return minertypes.SectorPreCommitOnChainInfo{
|
||||
Info: (minertypes.SectorPreCommitInfo)(v3.Info),
|
||||
PreCommitDeposit: v3.PreCommitDeposit,
|
||||
PreCommitEpoch: v3.PreCommitEpoch,
|
||||
DealWeight: v3.DealWeight,
|
||||
VerifiedDealWeight: v3.VerifiedDealWeight,
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func (s *state3) GetState() interface{} {
|
||||
|
||||
@@ -4,16 +4,15 @@ import (
|
||||
"bytes"
|
||||
"errors"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-bitfield"
|
||||
rle "github.com/filecoin-project/go-bitfield/rle"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
"github.com/filecoin-project/go-state-types/dline"
|
||||
"github.com/ipfs/go-cid"
|
||||
"github.com/libp2p/go-libp2p-core/peer"
|
||||
cbg "github.com/whyrusleeping/cbor-gen"
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
minertypes "github.com/filecoin-project/go-state-types/builtin/v8/miner"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
|
||||
builtin4 "github.com/filecoin-project/specs-actors/v4/actors/builtin"
|
||||
@@ -197,7 +196,7 @@ func (s *state4) GetSectorExpiration(num abi.SectorNumber) (*SectorExpiration, e
|
||||
return &out, nil
|
||||
}
|
||||
|
||||
func (s *state4) GetPrecommittedSector(num abi.SectorNumber) (*SectorPreCommitOnChainInfo, error) {
|
||||
func (s *state4) GetPrecommittedSector(num abi.SectorNumber) (*minertypes.SectorPreCommitOnChainInfo, error) {
|
||||
info, ok, err := s.State.GetPrecommittedSector(s.store, num)
|
||||
if !ok || err != nil {
|
||||
return nil, err
|
||||
@@ -208,7 +207,7 @@ func (s *state4) GetPrecommittedSector(num abi.SectorNumber) (*SectorPreCommitOn
|
||||
return &ret, nil
|
||||
}
|
||||
|
||||
func (s *state4) ForEachPrecommittedSector(cb func(SectorPreCommitOnChainInfo) error) error {
|
||||
func (s *state4) ForEachPrecommittedSector(cb func(minertypes.SectorPreCommitOnChainInfo) error) error {
|
||||
precommitted, err := adt4.AsMap(s.store, s.State.PreCommittedSectors, builtin4.DefaultHamtBitwidth)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -372,20 +371,14 @@ func (s *state4) Info() (MinerInfo, error) {
|
||||
return MinerInfo{}, err
|
||||
}
|
||||
|
||||
var pid *peer.ID
|
||||
if peerID, err := peer.IDFromBytes(info.PeerId); err == nil {
|
||||
pid = &peerID
|
||||
}
|
||||
|
||||
mi := MinerInfo{
|
||||
Owner: info.Owner,
|
||||
Worker: info.Worker,
|
||||
ControlAddresses: info.ControlAddresses,
|
||||
|
||||
NewWorker: address.Undef,
|
||||
WorkerChangeEpoch: -1,
|
||||
PendingWorkerKey: (*WorkerKeyChange)(info.PendingWorkerKey),
|
||||
|
||||
PeerId: pid,
|
||||
PeerId: info.PeerId,
|
||||
Multiaddrs: info.Multiaddrs,
|
||||
WindowPoStProofType: info.WindowPoStProofType,
|
||||
SectorSize: info.SectorSize,
|
||||
@@ -393,11 +386,6 @@ func (s *state4) Info() (MinerInfo, error) {
|
||||
ConsensusFaultElapsed: info.ConsensusFaultElapsed,
|
||||
}
|
||||
|
||||
if info.PendingWorkerKey != nil {
|
||||
mi.NewWorker = info.PendingWorkerKey.NewWorker
|
||||
mi.WorkerChangeEpoch = info.PendingWorkerKey.EffectiveAt
|
||||
}
|
||||
|
||||
return mi, nil
|
||||
}
|
||||
|
||||
@@ -427,11 +415,11 @@ func (s *state4) precommits() (adt.Map, error) {
|
||||
return adt4.AsMap(s.store, s.PreCommittedSectors, builtin4.DefaultHamtBitwidth)
|
||||
}
|
||||
|
||||
func (s *state4) decodeSectorPreCommitOnChainInfo(val *cbg.Deferred) (SectorPreCommitOnChainInfo, error) {
|
||||
func (s *state4) decodeSectorPreCommitOnChainInfo(val *cbg.Deferred) (minertypes.SectorPreCommitOnChainInfo, error) {
|
||||
var sp miner4.SectorPreCommitOnChainInfo
|
||||
err := sp.UnmarshalCBOR(bytes.NewReader(val.Raw))
|
||||
if err != nil {
|
||||
return SectorPreCommitOnChainInfo{}, err
|
||||
return minertypes.SectorPreCommitOnChainInfo{}, err
|
||||
}
|
||||
|
||||
return fromV4SectorPreCommitOnChainInfo(sp), nil
|
||||
@@ -553,16 +541,14 @@ func fromV4SectorOnChainInfo(v4 miner4.SectorOnChainInfo) SectorOnChainInfo {
|
||||
return info
|
||||
}
|
||||
|
||||
func fromV4SectorPreCommitOnChainInfo(v4 miner4.SectorPreCommitOnChainInfo) SectorPreCommitOnChainInfo {
|
||||
|
||||
return SectorPreCommitOnChainInfo{
|
||||
Info: (SectorPreCommitInfo)(v4.Info),
|
||||
func fromV4SectorPreCommitOnChainInfo(v4 miner4.SectorPreCommitOnChainInfo) minertypes.SectorPreCommitOnChainInfo {
|
||||
return minertypes.SectorPreCommitOnChainInfo{
|
||||
Info: (minertypes.SectorPreCommitInfo)(v4.Info),
|
||||
PreCommitDeposit: v4.PreCommitDeposit,
|
||||
PreCommitEpoch: v4.PreCommitEpoch,
|
||||
DealWeight: v4.DealWeight,
|
||||
VerifiedDealWeight: v4.VerifiedDealWeight,
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func (s *state4) GetState() interface{} {
|
||||
|
||||
@@ -4,16 +4,15 @@ import (
|
||||
"bytes"
|
||||
"errors"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-bitfield"
|
||||
rle "github.com/filecoin-project/go-bitfield/rle"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
"github.com/filecoin-project/go-state-types/dline"
|
||||
"github.com/ipfs/go-cid"
|
||||
"github.com/libp2p/go-libp2p-core/peer"
|
||||
cbg "github.com/whyrusleeping/cbor-gen"
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
minertypes "github.com/filecoin-project/go-state-types/builtin/v8/miner"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
|
||||
builtin5 "github.com/filecoin-project/specs-actors/v5/actors/builtin"
|
||||
@@ -197,7 +196,7 @@ func (s *state5) GetSectorExpiration(num abi.SectorNumber) (*SectorExpiration, e
|
||||
return &out, nil
|
||||
}
|
||||
|
||||
func (s *state5) GetPrecommittedSector(num abi.SectorNumber) (*SectorPreCommitOnChainInfo, error) {
|
||||
func (s *state5) GetPrecommittedSector(num abi.SectorNumber) (*minertypes.SectorPreCommitOnChainInfo, error) {
|
||||
info, ok, err := s.State.GetPrecommittedSector(s.store, num)
|
||||
if !ok || err != nil {
|
||||
return nil, err
|
||||
@@ -208,7 +207,7 @@ func (s *state5) GetPrecommittedSector(num abi.SectorNumber) (*SectorPreCommitOn
|
||||
return &ret, nil
|
||||
}
|
||||
|
||||
func (s *state5) ForEachPrecommittedSector(cb func(SectorPreCommitOnChainInfo) error) error {
|
||||
func (s *state5) ForEachPrecommittedSector(cb func(minertypes.SectorPreCommitOnChainInfo) error) error {
|
||||
precommitted, err := adt5.AsMap(s.store, s.State.PreCommittedSectors, builtin5.DefaultHamtBitwidth)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -372,20 +371,14 @@ func (s *state5) Info() (MinerInfo, error) {
|
||||
return MinerInfo{}, err
|
||||
}
|
||||
|
||||
var pid *peer.ID
|
||||
if peerID, err := peer.IDFromBytes(info.PeerId); err == nil {
|
||||
pid = &peerID
|
||||
}
|
||||
|
||||
mi := MinerInfo{
|
||||
Owner: info.Owner,
|
||||
Worker: info.Worker,
|
||||
ControlAddresses: info.ControlAddresses,
|
||||
|
||||
NewWorker: address.Undef,
|
||||
WorkerChangeEpoch: -1,
|
||||
PendingWorkerKey: (*WorkerKeyChange)(info.PendingWorkerKey),
|
||||
|
||||
PeerId: pid,
|
||||
PeerId: info.PeerId,
|
||||
Multiaddrs: info.Multiaddrs,
|
||||
WindowPoStProofType: info.WindowPoStProofType,
|
||||
SectorSize: info.SectorSize,
|
||||
@@ -393,11 +386,6 @@ func (s *state5) Info() (MinerInfo, error) {
|
||||
ConsensusFaultElapsed: info.ConsensusFaultElapsed,
|
||||
}
|
||||
|
||||
if info.PendingWorkerKey != nil {
|
||||
mi.NewWorker = info.PendingWorkerKey.NewWorker
|
||||
mi.WorkerChangeEpoch = info.PendingWorkerKey.EffectiveAt
|
||||
}
|
||||
|
||||
return mi, nil
|
||||
}
|
||||
|
||||
@@ -427,11 +415,11 @@ func (s *state5) precommits() (adt.Map, error) {
|
||||
return adt5.AsMap(s.store, s.PreCommittedSectors, builtin5.DefaultHamtBitwidth)
|
||||
}
|
||||
|
||||
func (s *state5) decodeSectorPreCommitOnChainInfo(val *cbg.Deferred) (SectorPreCommitOnChainInfo, error) {
|
||||
func (s *state5) decodeSectorPreCommitOnChainInfo(val *cbg.Deferred) (minertypes.SectorPreCommitOnChainInfo, error) {
|
||||
var sp miner5.SectorPreCommitOnChainInfo
|
||||
err := sp.UnmarshalCBOR(bytes.NewReader(val.Raw))
|
||||
if err != nil {
|
||||
return SectorPreCommitOnChainInfo{}, err
|
||||
return minertypes.SectorPreCommitOnChainInfo{}, err
|
||||
}
|
||||
|
||||
return fromV5SectorPreCommitOnChainInfo(sp), nil
|
||||
@@ -553,16 +541,14 @@ func fromV5SectorOnChainInfo(v5 miner5.SectorOnChainInfo) SectorOnChainInfo {
|
||||
return info
|
||||
}
|
||||
|
||||
func fromV5SectorPreCommitOnChainInfo(v5 miner5.SectorPreCommitOnChainInfo) SectorPreCommitOnChainInfo {
|
||||
|
||||
return SectorPreCommitOnChainInfo{
|
||||
Info: (SectorPreCommitInfo)(v5.Info),
|
||||
func fromV5SectorPreCommitOnChainInfo(v5 miner5.SectorPreCommitOnChainInfo) minertypes.SectorPreCommitOnChainInfo {
|
||||
return minertypes.SectorPreCommitOnChainInfo{
|
||||
Info: (minertypes.SectorPreCommitInfo)(v5.Info),
|
||||
PreCommitDeposit: v5.PreCommitDeposit,
|
||||
PreCommitEpoch: v5.PreCommitEpoch,
|
||||
DealWeight: v5.DealWeight,
|
||||
VerifiedDealWeight: v5.VerifiedDealWeight,
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func (s *state5) GetState() interface{} {
|
||||
|
||||
@@ -4,16 +4,15 @@ import (
|
||||
"bytes"
|
||||
"errors"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-bitfield"
|
||||
rle "github.com/filecoin-project/go-bitfield/rle"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
"github.com/filecoin-project/go-state-types/dline"
|
||||
"github.com/ipfs/go-cid"
|
||||
"github.com/libp2p/go-libp2p-core/peer"
|
||||
cbg "github.com/whyrusleeping/cbor-gen"
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
minertypes "github.com/filecoin-project/go-state-types/builtin/v8/miner"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
|
||||
builtin6 "github.com/filecoin-project/specs-actors/v6/actors/builtin"
|
||||
@@ -197,7 +196,7 @@ func (s *state6) GetSectorExpiration(num abi.SectorNumber) (*SectorExpiration, e
|
||||
return &out, nil
|
||||
}
|
||||
|
||||
func (s *state6) GetPrecommittedSector(num abi.SectorNumber) (*SectorPreCommitOnChainInfo, error) {
|
||||
func (s *state6) GetPrecommittedSector(num abi.SectorNumber) (*minertypes.SectorPreCommitOnChainInfo, error) {
|
||||
info, ok, err := s.State.GetPrecommittedSector(s.store, num)
|
||||
if !ok || err != nil {
|
||||
return nil, err
|
||||
@@ -208,7 +207,7 @@ func (s *state6) GetPrecommittedSector(num abi.SectorNumber) (*SectorPreCommitOn
|
||||
return &ret, nil
|
||||
}
|
||||
|
||||
func (s *state6) ForEachPrecommittedSector(cb func(SectorPreCommitOnChainInfo) error) error {
|
||||
func (s *state6) ForEachPrecommittedSector(cb func(minertypes.SectorPreCommitOnChainInfo) error) error {
|
||||
precommitted, err := adt6.AsMap(s.store, s.State.PreCommittedSectors, builtin6.DefaultHamtBitwidth)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -372,20 +371,14 @@ func (s *state6) Info() (MinerInfo, error) {
|
||||
return MinerInfo{}, err
|
||||
}
|
||||
|
||||
var pid *peer.ID
|
||||
if peerID, err := peer.IDFromBytes(info.PeerId); err == nil {
|
||||
pid = &peerID
|
||||
}
|
||||
|
||||
mi := MinerInfo{
|
||||
Owner: info.Owner,
|
||||
Worker: info.Worker,
|
||||
ControlAddresses: info.ControlAddresses,
|
||||
|
||||
NewWorker: address.Undef,
|
||||
WorkerChangeEpoch: -1,
|
||||
PendingWorkerKey: (*WorkerKeyChange)(info.PendingWorkerKey),
|
||||
|
||||
PeerId: pid,
|
||||
PeerId: info.PeerId,
|
||||
Multiaddrs: info.Multiaddrs,
|
||||
WindowPoStProofType: info.WindowPoStProofType,
|
||||
SectorSize: info.SectorSize,
|
||||
@@ -393,11 +386,6 @@ func (s *state6) Info() (MinerInfo, error) {
|
||||
ConsensusFaultElapsed: info.ConsensusFaultElapsed,
|
||||
}
|
||||
|
||||
if info.PendingWorkerKey != nil {
|
||||
mi.NewWorker = info.PendingWorkerKey.NewWorker
|
||||
mi.WorkerChangeEpoch = info.PendingWorkerKey.EffectiveAt
|
||||
}
|
||||
|
||||
return mi, nil
|
||||
}
|
||||
|
||||
@@ -427,11 +415,11 @@ func (s *state6) precommits() (adt.Map, error) {
|
||||
return adt6.AsMap(s.store, s.PreCommittedSectors, builtin6.DefaultHamtBitwidth)
|
||||
}
|
||||
|
||||
func (s *state6) decodeSectorPreCommitOnChainInfo(val *cbg.Deferred) (SectorPreCommitOnChainInfo, error) {
|
||||
func (s *state6) decodeSectorPreCommitOnChainInfo(val *cbg.Deferred) (minertypes.SectorPreCommitOnChainInfo, error) {
|
||||
var sp miner6.SectorPreCommitOnChainInfo
|
||||
err := sp.UnmarshalCBOR(bytes.NewReader(val.Raw))
|
||||
if err != nil {
|
||||
return SectorPreCommitOnChainInfo{}, err
|
||||
return minertypes.SectorPreCommitOnChainInfo{}, err
|
||||
}
|
||||
|
||||
return fromV6SectorPreCommitOnChainInfo(sp), nil
|
||||
@@ -553,16 +541,14 @@ func fromV6SectorOnChainInfo(v6 miner6.SectorOnChainInfo) SectorOnChainInfo {
|
||||
return info
|
||||
}
|
||||
|
||||
func fromV6SectorPreCommitOnChainInfo(v6 miner6.SectorPreCommitOnChainInfo) SectorPreCommitOnChainInfo {
|
||||
|
||||
return SectorPreCommitOnChainInfo{
|
||||
Info: (SectorPreCommitInfo)(v6.Info),
|
||||
func fromV6SectorPreCommitOnChainInfo(v6 miner6.SectorPreCommitOnChainInfo) minertypes.SectorPreCommitOnChainInfo {
|
||||
return minertypes.SectorPreCommitOnChainInfo{
|
||||
Info: (minertypes.SectorPreCommitInfo)(v6.Info),
|
||||
PreCommitDeposit: v6.PreCommitDeposit,
|
||||
PreCommitEpoch: v6.PreCommitEpoch,
|
||||
DealWeight: v6.DealWeight,
|
||||
VerifiedDealWeight: v6.VerifiedDealWeight,
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func (s *state6) GetState() interface{} {
|
||||
|
||||
@@ -4,16 +4,15 @@ import (
|
||||
"bytes"
|
||||
"errors"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-bitfield"
|
||||
rle "github.com/filecoin-project/go-bitfield/rle"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
"github.com/filecoin-project/go-state-types/dline"
|
||||
"github.com/ipfs/go-cid"
|
||||
"github.com/libp2p/go-libp2p-core/peer"
|
||||
cbg "github.com/whyrusleeping/cbor-gen"
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
minertypes "github.com/filecoin-project/go-state-types/builtin/v8/miner"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
|
||||
builtin7 "github.com/filecoin-project/specs-actors/v7/actors/builtin"
|
||||
@@ -196,7 +195,7 @@ func (s *state7) GetSectorExpiration(num abi.SectorNumber) (*SectorExpiration, e
|
||||
return &out, nil
|
||||
}
|
||||
|
||||
func (s *state7) GetPrecommittedSector(num abi.SectorNumber) (*SectorPreCommitOnChainInfo, error) {
|
||||
func (s *state7) GetPrecommittedSector(num abi.SectorNumber) (*minertypes.SectorPreCommitOnChainInfo, error) {
|
||||
info, ok, err := s.State.GetPrecommittedSector(s.store, num)
|
||||
if !ok || err != nil {
|
||||
return nil, err
|
||||
@@ -207,7 +206,7 @@ func (s *state7) GetPrecommittedSector(num abi.SectorNumber) (*SectorPreCommitOn
|
||||
return &ret, nil
|
||||
}
|
||||
|
||||
func (s *state7) ForEachPrecommittedSector(cb func(SectorPreCommitOnChainInfo) error) error {
|
||||
func (s *state7) ForEachPrecommittedSector(cb func(minertypes.SectorPreCommitOnChainInfo) error) error {
|
||||
precommitted, err := adt7.AsMap(s.store, s.State.PreCommittedSectors, builtin7.DefaultHamtBitwidth)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -371,20 +370,14 @@ func (s *state7) Info() (MinerInfo, error) {
|
||||
return MinerInfo{}, err
|
||||
}
|
||||
|
||||
var pid *peer.ID
|
||||
if peerID, err := peer.IDFromBytes(info.PeerId); err == nil {
|
||||
pid = &peerID
|
||||
}
|
||||
|
||||
mi := MinerInfo{
|
||||
Owner: info.Owner,
|
||||
Worker: info.Worker,
|
||||
ControlAddresses: info.ControlAddresses,
|
||||
|
||||
NewWorker: address.Undef,
|
||||
WorkerChangeEpoch: -1,
|
||||
PendingWorkerKey: (*WorkerKeyChange)(info.PendingWorkerKey),
|
||||
|
||||
PeerId: pid,
|
||||
PeerId: info.PeerId,
|
||||
Multiaddrs: info.Multiaddrs,
|
||||
WindowPoStProofType: info.WindowPoStProofType,
|
||||
SectorSize: info.SectorSize,
|
||||
@@ -392,11 +385,6 @@ func (s *state7) Info() (MinerInfo, error) {
|
||||
ConsensusFaultElapsed: info.ConsensusFaultElapsed,
|
||||
}
|
||||
|
||||
if info.PendingWorkerKey != nil {
|
||||
mi.NewWorker = info.PendingWorkerKey.NewWorker
|
||||
mi.WorkerChangeEpoch = info.PendingWorkerKey.EffectiveAt
|
||||
}
|
||||
|
||||
return mi, nil
|
||||
}
|
||||
|
||||
@@ -426,11 +414,11 @@ func (s *state7) precommits() (adt.Map, error) {
|
||||
return adt7.AsMap(s.store, s.PreCommittedSectors, builtin7.DefaultHamtBitwidth)
|
||||
}
|
||||
|
||||
func (s *state7) decodeSectorPreCommitOnChainInfo(val *cbg.Deferred) (SectorPreCommitOnChainInfo, error) {
|
||||
func (s *state7) decodeSectorPreCommitOnChainInfo(val *cbg.Deferred) (minertypes.SectorPreCommitOnChainInfo, error) {
|
||||
var sp miner7.SectorPreCommitOnChainInfo
|
||||
err := sp.UnmarshalCBOR(bytes.NewReader(val.Raw))
|
||||
if err != nil {
|
||||
return SectorPreCommitOnChainInfo{}, err
|
||||
return minertypes.SectorPreCommitOnChainInfo{}, err
|
||||
}
|
||||
|
||||
return fromV7SectorPreCommitOnChainInfo(sp), nil
|
||||
@@ -554,16 +542,14 @@ func fromV7SectorOnChainInfo(v7 miner7.SectorOnChainInfo) SectorOnChainInfo {
|
||||
return info
|
||||
}
|
||||
|
||||
func fromV7SectorPreCommitOnChainInfo(v7 miner7.SectorPreCommitOnChainInfo) SectorPreCommitOnChainInfo {
|
||||
|
||||
return SectorPreCommitOnChainInfo{
|
||||
Info: (SectorPreCommitInfo)(v7.Info),
|
||||
func fromV7SectorPreCommitOnChainInfo(v7 miner7.SectorPreCommitOnChainInfo) minertypes.SectorPreCommitOnChainInfo {
|
||||
return minertypes.SectorPreCommitOnChainInfo{
|
||||
Info: (minertypes.SectorPreCommitInfo)(v7.Info),
|
||||
PreCommitDeposit: v7.PreCommitDeposit,
|
||||
PreCommitEpoch: v7.PreCommitEpoch,
|
||||
DealWeight: v7.DealWeight,
|
||||
VerifiedDealWeight: v7.VerifiedDealWeight,
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func (s *state7) GetState() interface{} {
|
||||
|
||||
@@ -0,0 +1,556 @@
|
||||
package miner
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
|
||||
"github.com/filecoin-project/go-bitfield"
|
||||
rle "github.com/filecoin-project/go-bitfield/rle"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
"github.com/filecoin-project/go-state-types/dline"
|
||||
"github.com/ipfs/go-cid"
|
||||
cbg "github.com/whyrusleeping/cbor-gen"
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
minertypes "github.com/filecoin-project/go-state-types/builtin/v8/miner"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
|
||||
builtin8 "github.com/filecoin-project/go-state-types/builtin"
|
||||
miner8 "github.com/filecoin-project/go-state-types/builtin/v8/miner"
|
||||
adt8 "github.com/filecoin-project/go-state-types/builtin/v8/util/adt"
|
||||
)
|
||||
|
||||
var _ State = (*state8)(nil)
|
||||
|
||||
func load8(store adt.Store, root cid.Cid) (State, error) {
|
||||
out := state8{store: store}
|
||||
err := store.Get(store.Context(), root, &out)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &out, nil
|
||||
}
|
||||
|
||||
func make8(store adt.Store) (State, error) {
|
||||
out := state8{store: store}
|
||||
out.State = miner8.State{}
|
||||
return &out, nil
|
||||
}
|
||||
|
||||
type state8 struct {
|
||||
miner8.State
|
||||
store adt.Store
|
||||
}
|
||||
|
||||
type deadline8 struct {
|
||||
miner8.Deadline
|
||||
store adt.Store
|
||||
}
|
||||
|
||||
type partition8 struct {
|
||||
miner8.Partition
|
||||
store adt.Store
|
||||
}
|
||||
|
||||
func (s *state8) AvailableBalance(bal abi.TokenAmount) (available abi.TokenAmount, err error) {
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
err = xerrors.Errorf("failed to get available balance: %w", r)
|
||||
available = abi.NewTokenAmount(0)
|
||||
}
|
||||
}()
|
||||
// this panics if the miner doesnt have enough funds to cover their locked pledge
|
||||
available, err = s.GetAvailableBalance(bal)
|
||||
return available, err
|
||||
}
|
||||
|
||||
func (s *state8) VestedFunds(epoch abi.ChainEpoch) (abi.TokenAmount, error) {
|
||||
return s.CheckVestedFunds(s.store, epoch)
|
||||
}
|
||||
|
||||
func (s *state8) LockedFunds() (LockedFunds, error) {
|
||||
return LockedFunds{
|
||||
VestingFunds: s.State.LockedFunds,
|
||||
InitialPledgeRequirement: s.State.InitialPledge,
|
||||
PreCommitDeposits: s.State.PreCommitDeposits,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (s *state8) FeeDebt() (abi.TokenAmount, error) {
|
||||
return s.State.FeeDebt, nil
|
||||
}
|
||||
|
||||
func (s *state8) InitialPledge() (abi.TokenAmount, error) {
|
||||
return s.State.InitialPledge, nil
|
||||
}
|
||||
|
||||
func (s *state8) PreCommitDeposits() (abi.TokenAmount, error) {
|
||||
return s.State.PreCommitDeposits, nil
|
||||
}
|
||||
|
||||
func (s *state8) GetSector(num abi.SectorNumber) (*SectorOnChainInfo, error) {
|
||||
info, ok, err := s.State.GetSector(s.store, num)
|
||||
if !ok || err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
ret := fromV8SectorOnChainInfo(*info)
|
||||
return &ret, nil
|
||||
}
|
||||
|
||||
func (s *state8) FindSector(num abi.SectorNumber) (*SectorLocation, error) {
|
||||
dlIdx, partIdx, err := s.State.FindSector(s.store, num)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &SectorLocation{
|
||||
Deadline: dlIdx,
|
||||
Partition: partIdx,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (s *state8) NumLiveSectors() (uint64, error) {
|
||||
dls, err := s.State.LoadDeadlines(s.store)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
var total uint64
|
||||
if err := dls.ForEach(s.store, func(dlIdx uint64, dl *miner8.Deadline) error {
|
||||
total += dl.LiveSectors
|
||||
return nil
|
||||
}); err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return total, nil
|
||||
}
|
||||
|
||||
// GetSectorExpiration returns the effective expiration of the given sector.
|
||||
//
|
||||
// If the sector does not expire early, the Early expiration field is 0.
|
||||
func (s *state8) GetSectorExpiration(num abi.SectorNumber) (*SectorExpiration, error) {
|
||||
dls, err := s.State.LoadDeadlines(s.store)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// NOTE: this can be optimized significantly.
|
||||
// 1. If the sector is non-faulty, it will expire on-time (can be
|
||||
// learned from the sector info).
|
||||
// 2. If it's faulty, it will expire early within the first 42 entries
|
||||
// of the expiration queue.
|
||||
|
||||
stopErr := errors.New("stop")
|
||||
out := SectorExpiration{}
|
||||
err = dls.ForEach(s.store, func(dlIdx uint64, dl *miner8.Deadline) error {
|
||||
partitions, err := dl.PartitionsArray(s.store)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
quant := s.State.QuantSpecForDeadline(dlIdx)
|
||||
var part miner8.Partition
|
||||
return partitions.ForEach(&part, func(partIdx int64) error {
|
||||
if found, err := part.Sectors.IsSet(uint64(num)); err != nil {
|
||||
return err
|
||||
} else if !found {
|
||||
return nil
|
||||
}
|
||||
if found, err := part.Terminated.IsSet(uint64(num)); err != nil {
|
||||
return err
|
||||
} else if found {
|
||||
// already terminated
|
||||
return stopErr
|
||||
}
|
||||
|
||||
q, err := miner8.LoadExpirationQueue(s.store, part.ExpirationsEpochs, quant, miner8.PartitionExpirationAmtBitwidth)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
var exp miner8.ExpirationSet
|
||||
return q.ForEach(&exp, func(epoch int64) error {
|
||||
if early, err := exp.EarlySectors.IsSet(uint64(num)); err != nil {
|
||||
return err
|
||||
} else if early {
|
||||
out.Early = abi.ChainEpoch(epoch)
|
||||
return nil
|
||||
}
|
||||
if onTime, err := exp.OnTimeSectors.IsSet(uint64(num)); err != nil {
|
||||
return err
|
||||
} else if onTime {
|
||||
out.OnTime = abi.ChainEpoch(epoch)
|
||||
return stopErr
|
||||
}
|
||||
return nil
|
||||
})
|
||||
})
|
||||
})
|
||||
if err == stopErr {
|
||||
err = nil
|
||||
}
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if out.Early == 0 && out.OnTime == 0 {
|
||||
return nil, xerrors.Errorf("failed to find sector %d", num)
|
||||
}
|
||||
return &out, nil
|
||||
}
|
||||
|
||||
func (s *state8) GetPrecommittedSector(num abi.SectorNumber) (*minertypes.SectorPreCommitOnChainInfo, error) {
|
||||
info, ok, err := s.State.GetPrecommittedSector(s.store, num)
|
||||
if !ok || err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
ret := fromV8SectorPreCommitOnChainInfo(*info)
|
||||
|
||||
return &ret, nil
|
||||
}
|
||||
|
||||
func (s *state8) ForEachPrecommittedSector(cb func(minertypes.SectorPreCommitOnChainInfo) error) error {
|
||||
precommitted, err := adt8.AsMap(s.store, s.State.PreCommittedSectors, builtin8.DefaultHamtBitwidth)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
var info miner8.SectorPreCommitOnChainInfo
|
||||
if err := precommitted.ForEach(&info, func(_ string) error {
|
||||
return cb(fromV8SectorPreCommitOnChainInfo(info))
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *state8) LoadSectors(snos *bitfield.BitField) ([]*SectorOnChainInfo, error) {
|
||||
sectors, err := miner8.LoadSectors(s.store, s.State.Sectors)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// If no sector numbers are specified, load all.
|
||||
if snos == nil {
|
||||
infos := make([]*SectorOnChainInfo, 0, sectors.Length())
|
||||
var info8 miner8.SectorOnChainInfo
|
||||
if err := sectors.ForEach(&info8, func(_ int64) error {
|
||||
info := fromV8SectorOnChainInfo(info8)
|
||||
infos = append(infos, &info)
|
||||
return nil
|
||||
}); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return infos, nil
|
||||
}
|
||||
|
||||
// Otherwise, load selected.
|
||||
infos8, err := sectors.Load(*snos)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
infos := make([]*SectorOnChainInfo, len(infos8))
|
||||
for i, info8 := range infos8 {
|
||||
info := fromV8SectorOnChainInfo(*info8)
|
||||
infos[i] = &info
|
||||
}
|
||||
return infos, nil
|
||||
}
|
||||
|
||||
func (s *state8) loadAllocatedSectorNumbers() (bitfield.BitField, error) {
|
||||
var allocatedSectors bitfield.BitField
|
||||
err := s.store.Get(s.store.Context(), s.State.AllocatedSectors, &allocatedSectors)
|
||||
return allocatedSectors, err
|
||||
}
|
||||
|
||||
func (s *state8) IsAllocated(num abi.SectorNumber) (bool, error) {
|
||||
allocatedSectors, err := s.loadAllocatedSectorNumbers()
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
||||
return allocatedSectors.IsSet(uint64(num))
|
||||
}
|
||||
|
||||
func (s *state8) GetProvingPeriodStart() (abi.ChainEpoch, error) {
|
||||
return s.State.ProvingPeriodStart, nil
|
||||
}
|
||||
|
||||
func (s *state8) UnallocatedSectorNumbers(count int) ([]abi.SectorNumber, error) {
|
||||
allocatedSectors, err := s.loadAllocatedSectorNumbers()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
allocatedRuns, err := allocatedSectors.RunIterator()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
unallocatedRuns, err := rle.Subtract(
|
||||
&rle.RunSliceIterator{Runs: []rle.Run{{Val: true, Len: abi.MaxSectorNumber}}},
|
||||
allocatedRuns,
|
||||
)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
iter, err := rle.BitsFromRuns(unallocatedRuns)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
sectors := make([]abi.SectorNumber, 0, count)
|
||||
for iter.HasNext() && len(sectors) < count {
|
||||
nextNo, err := iter.Next()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
sectors = append(sectors, abi.SectorNumber(nextNo))
|
||||
}
|
||||
|
||||
return sectors, nil
|
||||
}
|
||||
|
||||
func (s *state8) GetAllocatedSectors() (*bitfield.BitField, error) {
|
||||
var allocatedSectors bitfield.BitField
|
||||
if err := s.store.Get(s.store.Context(), s.State.AllocatedSectors, &allocatedSectors); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &allocatedSectors, nil
|
||||
}
|
||||
|
||||
func (s *state8) LoadDeadline(idx uint64) (Deadline, error) {
|
||||
dls, err := s.State.LoadDeadlines(s.store)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
dl, err := dls.LoadDeadline(s.store, idx)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &deadline8{*dl, s.store}, nil
|
||||
}
|
||||
|
||||
func (s *state8) ForEachDeadline(cb func(uint64, Deadline) error) error {
|
||||
dls, err := s.State.LoadDeadlines(s.store)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return dls.ForEach(s.store, func(i uint64, dl *miner8.Deadline) error {
|
||||
return cb(i, &deadline8{*dl, s.store})
|
||||
})
|
||||
}
|
||||
|
||||
func (s *state8) NumDeadlines() (uint64, error) {
|
||||
return miner8.WPoStPeriodDeadlines, nil
|
||||
}
|
||||
|
||||
func (s *state8) DeadlinesChanged(other State) (bool, error) {
|
||||
other8, ok := other.(*state8)
|
||||
if !ok {
|
||||
// treat an upgrade as a change, always
|
||||
return true, nil
|
||||
}
|
||||
|
||||
return !s.State.Deadlines.Equals(other8.Deadlines), nil
|
||||
}
|
||||
|
||||
func (s *state8) MinerInfoChanged(other State) (bool, error) {
|
||||
other0, ok := other.(*state8)
|
||||
if !ok {
|
||||
// treat an upgrade as a change, always
|
||||
return true, nil
|
||||
}
|
||||
return !s.State.Info.Equals(other0.State.Info), nil
|
||||
}
|
||||
|
||||
func (s *state8) Info() (MinerInfo, error) {
|
||||
info, err := s.State.GetInfo(s.store)
|
||||
if err != nil {
|
||||
return MinerInfo{}, err
|
||||
}
|
||||
|
||||
mi := MinerInfo{
|
||||
Owner: info.Owner,
|
||||
Worker: info.Worker,
|
||||
ControlAddresses: info.ControlAddresses,
|
||||
|
||||
PendingWorkerKey: (*WorkerKeyChange)(info.PendingWorkerKey),
|
||||
|
||||
PeerId: info.PeerId,
|
||||
Multiaddrs: info.Multiaddrs,
|
||||
WindowPoStProofType: info.WindowPoStProofType,
|
||||
SectorSize: info.SectorSize,
|
||||
WindowPoStPartitionSectors: info.WindowPoStPartitionSectors,
|
||||
ConsensusFaultElapsed: info.ConsensusFaultElapsed,
|
||||
}
|
||||
|
||||
return mi, nil
|
||||
}
|
||||
|
||||
func (s *state8) DeadlineInfo(epoch abi.ChainEpoch) (*dline.Info, error) {
|
||||
return s.State.RecordedDeadlineInfo(epoch), nil
|
||||
}
|
||||
|
||||
func (s *state8) DeadlineCronActive() (bool, error) {
|
||||
return s.State.DeadlineCronActive, nil
|
||||
}
|
||||
|
||||
func (s *state8) sectors() (adt.Array, error) {
|
||||
return adt8.AsArray(s.store, s.Sectors, miner8.SectorsAmtBitwidth)
|
||||
}
|
||||
|
||||
func (s *state8) decodeSectorOnChainInfo(val *cbg.Deferred) (SectorOnChainInfo, error) {
|
||||
var si miner8.SectorOnChainInfo
|
||||
err := si.UnmarshalCBOR(bytes.NewReader(val.Raw))
|
||||
if err != nil {
|
||||
return SectorOnChainInfo{}, err
|
||||
}
|
||||
|
||||
return fromV8SectorOnChainInfo(si), nil
|
||||
}
|
||||
|
||||
func (s *state8) precommits() (adt.Map, error) {
|
||||
return adt8.AsMap(s.store, s.PreCommittedSectors, builtin8.DefaultHamtBitwidth)
|
||||
}
|
||||
|
||||
func (s *state8) decodeSectorPreCommitOnChainInfo(val *cbg.Deferred) (minertypes.SectorPreCommitOnChainInfo, error) {
|
||||
var sp miner8.SectorPreCommitOnChainInfo
|
||||
err := sp.UnmarshalCBOR(bytes.NewReader(val.Raw))
|
||||
if err != nil {
|
||||
return minertypes.SectorPreCommitOnChainInfo{}, err
|
||||
}
|
||||
|
||||
return fromV8SectorPreCommitOnChainInfo(sp), nil
|
||||
}
|
||||
|
||||
func (s *state8) EraseAllUnproven() error {
|
||||
|
||||
dls, err := s.State.LoadDeadlines(s.store)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
err = dls.ForEach(s.store, func(dindx uint64, dl *miner8.Deadline) error {
|
||||
ps, err := dl.PartitionsArray(s.store)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
var part miner8.Partition
|
||||
err = ps.ForEach(&part, func(pindx int64) error {
|
||||
_ = part.ActivateUnproven()
|
||||
err = ps.Set(uint64(pindx), &part)
|
||||
return nil
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
dl.Partitions, err = ps.Root()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return dls.UpdateDeadline(s.store, dindx, dl)
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return s.State.SaveDeadlines(s.store, dls)
|
||||
|
||||
}
|
||||
|
||||
func (d *deadline8) LoadPartition(idx uint64) (Partition, error) {
|
||||
p, err := d.Deadline.LoadPartition(d.store, idx)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &partition8{*p, d.store}, nil
|
||||
}
|
||||
|
||||
func (d *deadline8) ForEachPartition(cb func(uint64, Partition) error) error {
|
||||
ps, err := d.Deadline.PartitionsArray(d.store)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
var part miner8.Partition
|
||||
return ps.ForEach(&part, func(i int64) error {
|
||||
return cb(uint64(i), &partition8{part, d.store})
|
||||
})
|
||||
}
|
||||
|
||||
func (d *deadline8) PartitionsChanged(other Deadline) (bool, error) {
|
||||
other8, ok := other.(*deadline8)
|
||||
if !ok {
|
||||
// treat an upgrade as a change, always
|
||||
return true, nil
|
||||
}
|
||||
|
||||
return !d.Deadline.Partitions.Equals(other8.Deadline.Partitions), nil
|
||||
}
|
||||
|
||||
func (d *deadline8) PartitionsPoSted() (bitfield.BitField, error) {
|
||||
return d.Deadline.PartitionsPoSted, nil
|
||||
}
|
||||
|
||||
func (d *deadline8) DisputableProofCount() (uint64, error) {
|
||||
|
||||
ops, err := d.OptimisticProofsSnapshotArray(d.store)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
||||
return ops.Length(), nil
|
||||
|
||||
}
|
||||
|
||||
func (p *partition8) AllSectors() (bitfield.BitField, error) {
|
||||
return p.Partition.Sectors, nil
|
||||
}
|
||||
|
||||
func (p *partition8) FaultySectors() (bitfield.BitField, error) {
|
||||
return p.Partition.Faults, nil
|
||||
}
|
||||
|
||||
func (p *partition8) RecoveringSectors() (bitfield.BitField, error) {
|
||||
return p.Partition.Recoveries, nil
|
||||
}
|
||||
|
||||
func (p *partition8) UnprovenSectors() (bitfield.BitField, error) {
|
||||
return p.Partition.Unproven, nil
|
||||
}
|
||||
|
||||
func fromV8SectorOnChainInfo(v8 miner8.SectorOnChainInfo) SectorOnChainInfo {
|
||||
info := SectorOnChainInfo{
|
||||
SectorNumber: v8.SectorNumber,
|
||||
SealProof: v8.SealProof,
|
||||
SealedCID: v8.SealedCID,
|
||||
DealIDs: v8.DealIDs,
|
||||
Activation: v8.Activation,
|
||||
Expiration: v8.Expiration,
|
||||
DealWeight: v8.DealWeight,
|
||||
VerifiedDealWeight: v8.VerifiedDealWeight,
|
||||
InitialPledge: v8.InitialPledge,
|
||||
ExpectedDayReward: v8.ExpectedDayReward,
|
||||
ExpectedStoragePledge: v8.ExpectedStoragePledge,
|
||||
|
||||
SectorKeyCID: v8.SectorKeyCID,
|
||||
}
|
||||
return info
|
||||
}
|
||||
|
||||
func fromV8SectorPreCommitOnChainInfo(v8 miner8.SectorPreCommitOnChainInfo) minertypes.SectorPreCommitOnChainInfo {
|
||||
return minertypes.SectorPreCommitOnChainInfo{
|
||||
Info: (minertypes.SectorPreCommitInfo)(v8.Info),
|
||||
PreCommitDeposit: v8.PreCommitDeposit,
|
||||
PreCommitEpoch: v8.PreCommitEpoch,
|
||||
DealWeight: v8.DealWeight,
|
||||
VerifiedDealWeight: v8.VerifiedDealWeight,
|
||||
}
|
||||
}
|
||||
|
||||
func (s *state8) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
@@ -10,34 +10,46 @@ import (
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
"github.com/filecoin-project/go-state-types/cbor"
|
||||
"github.com/ipfs/go-cid"
|
||||
|
||||
msig0 "github.com/filecoin-project/specs-actors/actors/builtin/multisig"
|
||||
msig{{.latestVersion}} "github.com/filecoin-project/specs-actors{{import .latestVersion}}actors/builtin/multisig"
|
||||
msig{{.latestVersion}} "github.com/filecoin-project/go-state-types/builtin{{import .latestVersion}}multisig"
|
||||
{{range .versions}}
|
||||
builtin{{.}} "github.com/filecoin-project/specs-actors{{import .}}actors/builtin"
|
||||
{{if (le . 7)}}
|
||||
builtin{{.}} "github.com/filecoin-project/specs-actors{{import .}}actors/builtin"
|
||||
{{else}}
|
||||
builtin{{.}} "github.com/filecoin-project/go-state-types/builtin"
|
||||
{{end}}
|
||||
{{end}}
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
"github.com/filecoin-project/lotus/chain/actors/builtin"
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
)
|
||||
|
||||
func init() {
|
||||
{{range .versions}}
|
||||
builtin.RegisterActorState(builtin{{.}}.MultisigActorCodeID, func(store adt.Store, root cid.Cid) (cbor.Marshaler, error) {
|
||||
return load{{.}}(store, root)
|
||||
})
|
||||
{{end}}}
|
||||
|
||||
func Load(store adt.Store, act *types.Actor) (State, error) {
|
||||
if name, av, ok := actors.GetActorMetaByCode(act.Code); ok {
|
||||
if name != actors.MultisigKey {
|
||||
return nil, xerrors.Errorf("actor code is not multisig: %s", name)
|
||||
}
|
||||
|
||||
switch av {
|
||||
{{range .versions}}
|
||||
{{if (ge . 8)}}
|
||||
case actors.Version{{.}}:
|
||||
return load{{.}}(store, act.Head)
|
||||
{{end}}
|
||||
{{end}}
|
||||
}
|
||||
}
|
||||
|
||||
switch act.Code {
|
||||
{{range .versions}}
|
||||
case builtin{{.}}.MultisigActorCodeID:
|
||||
return load{{.}}(store, act.Head)
|
||||
{{if (le . 7)}}
|
||||
case builtin{{.}}.MultisigActorCodeID:
|
||||
return load{{.}}(store, act.Head)
|
||||
{{end}}
|
||||
{{end}}
|
||||
}
|
||||
|
||||
return nil, xerrors.Errorf("unknown actor code %s", act.Code)
|
||||
}
|
||||
|
||||
@@ -51,17 +63,6 @@ func MakeState(store adt.Store, av actors.Version, signers []address.Address, th
|
||||
return nil, xerrors.Errorf("unknown actor version %d", av)
|
||||
}
|
||||
|
||||
func GetActorCodeID(av actors.Version) (cid.Cid, error) {
|
||||
switch av {
|
||||
{{range .versions}}
|
||||
case actors.Version{{.}}:
|
||||
return builtin{{.}}.MultisigActorCodeID, nil
|
||||
{{end}}
|
||||
}
|
||||
|
||||
return cid.Undef, xerrors.Errorf("unknown actor version %d", av)
|
||||
}
|
||||
|
||||
type State interface {
|
||||
cbor.Marshaler
|
||||
|
||||
@@ -80,7 +81,7 @@ type State interface {
|
||||
GetState() interface{}
|
||||
}
|
||||
|
||||
type Transaction = msig0.Transaction
|
||||
type Transaction = msig{{.latestVersion}}.Transaction
|
||||
|
||||
var Methods = builtin{{.latestVersion}}.MethodsMultisig
|
||||
|
||||
|
||||
@@ -6,9 +6,17 @@ import (
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
|
||||
builtin{{.v}} "github.com/filecoin-project/specs-actors{{.import}}actors/builtin"
|
||||
init{{.v}} "github.com/filecoin-project/specs-actors{{.import}}actors/builtin/init"
|
||||
multisig{{.v}} "github.com/filecoin-project/specs-actors{{.import}}actors/builtin/multisig"
|
||||
{{if (le .v 7)}}
|
||||
builtin{{.v}} "github.com/filecoin-project/specs-actors{{.import}}actors/builtin"
|
||||
init{{.v}} "github.com/filecoin-project/specs-actors{{.import}}actors/builtin/init"
|
||||
multisig{{.v}} "github.com/filecoin-project/specs-actors{{.import}}actors/builtin/multisig"
|
||||
{{else}}
|
||||
builtin{{.v}} "github.com/filecoin-project/go-state-types/builtin"
|
||||
multisig{{.v}} "github.com/filecoin-project/go-state-types/builtin/v8/multisig"
|
||||
init{{.v}} "github.com/filecoin-project/go-state-types/builtin/v8/init"
|
||||
"github.com/filecoin-project/lotus/chain/actors/builtin"
|
||||
{{end}}
|
||||
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
init_ "github.com/filecoin-project/lotus/chain/actors/builtin/init"
|
||||
@@ -54,11 +62,24 @@ func (m message{{.v}}) Create(
|
||||
return nil, actErr
|
||||
}
|
||||
|
||||
// new actors are created by invoking 'exec' on the init actor with the constructor params
|
||||
execParams := &init{{.v}}.ExecParams{
|
||||
CodeCID: builtin{{.v}}.MultisigActorCodeID,
|
||||
ConstructorParams: enc,
|
||||
}
|
||||
{{if (le .v 7)}}
|
||||
// new actors are created by invoking 'exec' on the init actor with the constructor params
|
||||
execParams := &init{{.v}}.ExecParams{
|
||||
CodeCID: builtin{{.v}}.MultisigActorCodeID,
|
||||
ConstructorParams: enc,
|
||||
}
|
||||
{{else}}
|
||||
code, err := builtin.GetMultisigActorCodeID(actors.Version{{.v}})
|
||||
if err != nil {
|
||||
return nil, xerrors.Errorf("failed to get multisig code ID")
|
||||
}
|
||||
|
||||
// new actors are created by invoking 'exec' on the init actor with the constructor params
|
||||
execParams := &init8.ExecParams{
|
||||
CodeCID: code,
|
||||
ConstructorParams: enc,
|
||||
}
|
||||
{{end}}
|
||||
|
||||
enc, actErr = actors.SerializeParams(execParams)
|
||||
if actErr != nil {
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
package multisig
|
||||
|
||||
import (
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
|
||||
builtin8 "github.com/filecoin-project/go-state-types/builtin"
|
||||
init8 "github.com/filecoin-project/go-state-types/builtin/v8/init"
|
||||
multisig8 "github.com/filecoin-project/go-state-types/builtin/v8/multisig"
|
||||
"github.com/filecoin-project/lotus/chain/actors/builtin"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
init_ "github.com/filecoin-project/lotus/chain/actors/builtin/init"
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
)
|
||||
|
||||
type message8 struct{ message0 }
|
||||
|
||||
func (m message8) Create(
|
||||
signers []address.Address, threshold uint64,
|
||||
unlockStart, unlockDuration abi.ChainEpoch,
|
||||
initialAmount abi.TokenAmount,
|
||||
) (*types.Message, error) {
|
||||
|
||||
lenAddrs := uint64(len(signers))
|
||||
|
||||
if lenAddrs < threshold {
|
||||
return nil, xerrors.Errorf("cannot require signing of more addresses than provided for multisig")
|
||||
}
|
||||
|
||||
if threshold == 0 {
|
||||
threshold = lenAddrs
|
||||
}
|
||||
|
||||
if m.from == address.Undef {
|
||||
return nil, xerrors.Errorf("must provide source address")
|
||||
}
|
||||
|
||||
// Set up constructor parameters for multisig
|
||||
msigParams := &multisig8.ConstructorParams{
|
||||
Signers: signers,
|
||||
NumApprovalsThreshold: threshold,
|
||||
UnlockDuration: unlockDuration,
|
||||
StartEpoch: unlockStart,
|
||||
}
|
||||
|
||||
enc, actErr := actors.SerializeParams(msigParams)
|
||||
if actErr != nil {
|
||||
return nil, actErr
|
||||
}
|
||||
|
||||
code, err := builtin.GetMultisigActorCodeID(actors.Version8)
|
||||
if err != nil {
|
||||
return nil, xerrors.Errorf("failed to get multisig code ID")
|
||||
}
|
||||
|
||||
// new actors are created by invoking 'exec' on the init actor with the constructor params
|
||||
execParams := &init8.ExecParams{
|
||||
CodeCID: code,
|
||||
ConstructorParams: enc,
|
||||
}
|
||||
|
||||
enc, actErr = actors.SerializeParams(execParams)
|
||||
if actErr != nil {
|
||||
return nil, actErr
|
||||
}
|
||||
|
||||
return &types.Message{
|
||||
To: init_.Address,
|
||||
From: m.from,
|
||||
Method: builtin8.MethodsInit.Exec,
|
||||
Params: enc,
|
||||
Value: initialAmount,
|
||||
}, nil
|
||||
}
|
||||
@@ -10,10 +10,8 @@ import (
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
"github.com/filecoin-project/go-state-types/cbor"
|
||||
"github.com/ipfs/go-cid"
|
||||
|
||||
msig0 "github.com/filecoin-project/specs-actors/actors/builtin/multisig"
|
||||
msig7 "github.com/filecoin-project/specs-actors/v7/actors/builtin/multisig"
|
||||
msig8 "github.com/filecoin-project/go-state-types/builtin/v8/multisig"
|
||||
|
||||
builtin0 "github.com/filecoin-project/specs-actors/actors/builtin"
|
||||
|
||||
@@ -29,44 +27,27 @@ import (
|
||||
|
||||
builtin7 "github.com/filecoin-project/specs-actors/v7/actors/builtin"
|
||||
|
||||
builtin8 "github.com/filecoin-project/go-state-types/builtin"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
"github.com/filecoin-project/lotus/chain/actors/builtin"
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
||||
builtin.RegisterActorState(builtin0.MultisigActorCodeID, func(store adt.Store, root cid.Cid) (cbor.Marshaler, error) {
|
||||
return load0(store, root)
|
||||
})
|
||||
|
||||
builtin.RegisterActorState(builtin2.MultisigActorCodeID, func(store adt.Store, root cid.Cid) (cbor.Marshaler, error) {
|
||||
return load2(store, root)
|
||||
})
|
||||
|
||||
builtin.RegisterActorState(builtin3.MultisigActorCodeID, func(store adt.Store, root cid.Cid) (cbor.Marshaler, error) {
|
||||
return load3(store, root)
|
||||
})
|
||||
|
||||
builtin.RegisterActorState(builtin4.MultisigActorCodeID, func(store adt.Store, root cid.Cid) (cbor.Marshaler, error) {
|
||||
return load4(store, root)
|
||||
})
|
||||
|
||||
builtin.RegisterActorState(builtin5.MultisigActorCodeID, func(store adt.Store, root cid.Cid) (cbor.Marshaler, error) {
|
||||
return load5(store, root)
|
||||
})
|
||||
|
||||
builtin.RegisterActorState(builtin6.MultisigActorCodeID, func(store adt.Store, root cid.Cid) (cbor.Marshaler, error) {
|
||||
return load6(store, root)
|
||||
})
|
||||
|
||||
builtin.RegisterActorState(builtin7.MultisigActorCodeID, func(store adt.Store, root cid.Cid) (cbor.Marshaler, error) {
|
||||
return load7(store, root)
|
||||
})
|
||||
}
|
||||
|
||||
func Load(store adt.Store, act *types.Actor) (State, error) {
|
||||
if name, av, ok := actors.GetActorMetaByCode(act.Code); ok {
|
||||
if name != actors.MultisigKey {
|
||||
return nil, xerrors.Errorf("actor code is not multisig: %s", name)
|
||||
}
|
||||
|
||||
switch av {
|
||||
|
||||
case actors.Version8:
|
||||
return load8(store, act.Head)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
switch act.Code {
|
||||
|
||||
case builtin0.MultisigActorCodeID:
|
||||
@@ -91,6 +72,7 @@ func Load(store adt.Store, act *types.Actor) (State, error) {
|
||||
return load7(store, act.Head)
|
||||
|
||||
}
|
||||
|
||||
return nil, xerrors.Errorf("unknown actor code %s", act.Code)
|
||||
}
|
||||
|
||||
@@ -118,39 +100,13 @@ func MakeState(store adt.Store, av actors.Version, signers []address.Address, th
|
||||
case actors.Version7:
|
||||
return make7(store, signers, threshold, startEpoch, unlockDuration, initialBalance)
|
||||
|
||||
case actors.Version8:
|
||||
return make8(store, signers, threshold, startEpoch, unlockDuration, initialBalance)
|
||||
|
||||
}
|
||||
return nil, xerrors.Errorf("unknown actor version %d", av)
|
||||
}
|
||||
|
||||
func GetActorCodeID(av actors.Version) (cid.Cid, error) {
|
||||
switch av {
|
||||
|
||||
case actors.Version0:
|
||||
return builtin0.MultisigActorCodeID, nil
|
||||
|
||||
case actors.Version2:
|
||||
return builtin2.MultisigActorCodeID, nil
|
||||
|
||||
case actors.Version3:
|
||||
return builtin3.MultisigActorCodeID, nil
|
||||
|
||||
case actors.Version4:
|
||||
return builtin4.MultisigActorCodeID, nil
|
||||
|
||||
case actors.Version5:
|
||||
return builtin5.MultisigActorCodeID, nil
|
||||
|
||||
case actors.Version6:
|
||||
return builtin6.MultisigActorCodeID, nil
|
||||
|
||||
case actors.Version7:
|
||||
return builtin7.MultisigActorCodeID, nil
|
||||
|
||||
}
|
||||
|
||||
return cid.Undef, xerrors.Errorf("unknown actor version %d", av)
|
||||
}
|
||||
|
||||
type State interface {
|
||||
cbor.Marshaler
|
||||
|
||||
@@ -169,9 +125,9 @@ type State interface {
|
||||
GetState() interface{}
|
||||
}
|
||||
|
||||
type Transaction = msig0.Transaction
|
||||
type Transaction = msig8.Transaction
|
||||
|
||||
var Methods = builtin7.MethodsMultisig
|
||||
var Methods = builtin8.MethodsMultisig
|
||||
|
||||
func Message(version actors.Version, from address.Address) MessageBuilder {
|
||||
switch version {
|
||||
@@ -196,6 +152,9 @@ func Message(version actors.Version, from address.Address) MessageBuilder {
|
||||
|
||||
case actors.Version7:
|
||||
return message7{message0{from}}
|
||||
|
||||
case actors.Version8:
|
||||
return message8{message0{from}}
|
||||
default:
|
||||
panic(fmt.Sprintf("unsupported actors version: %d", version))
|
||||
}
|
||||
@@ -219,13 +178,13 @@ type MessageBuilder interface {
|
||||
}
|
||||
|
||||
// this type is the same between v0 and v2
|
||||
type ProposalHashData = msig7.ProposalHashData
|
||||
type ProposeReturn = msig7.ProposeReturn
|
||||
type ProposeParams = msig7.ProposeParams
|
||||
type ApproveReturn = msig7.ApproveReturn
|
||||
type ProposalHashData = msig8.ProposalHashData
|
||||
type ProposeReturn = msig8.ProposeReturn
|
||||
type ProposeParams = msig8.ProposeParams
|
||||
type ApproveReturn = msig8.ApproveReturn
|
||||
|
||||
func txnParams(id uint64, data *ProposalHashData) ([]byte, error) {
|
||||
params := msig7.TxnIDParams{ID: msig7.TxnID(id)}
|
||||
params := msig8.TxnIDParams{ID: msig8.TxnID(id)}
|
||||
if data != nil {
|
||||
if data.Requester.Protocol() != address.ID {
|
||||
return nil, xerrors.Errorf("proposer address must be an ID address, was %s", data.Requester)
|
||||
|
||||
@@ -4,7 +4,6 @@ import (
|
||||
"bytes"
|
||||
"encoding/binary"
|
||||
|
||||
adt{{.v}} "github.com/filecoin-project/specs-actors{{.import}}actors/util/adt"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
@@ -14,10 +13,17 @@ import (
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
|
||||
{{if (ge .v 3)}}
|
||||
builtin{{.v}} "github.com/filecoin-project/specs-actors{{.import}}actors/builtin"
|
||||
{{if (le .v 7)}}
|
||||
{{if (ge .v 3)}}
|
||||
builtin{{.v}} "github.com/filecoin-project/specs-actors{{.import}}actors/builtin"
|
||||
{{end}}
|
||||
msig{{.v}} "github.com/filecoin-project/specs-actors{{.import}}actors/builtin/multisig"
|
||||
adt{{.v}} "github.com/filecoin-project/specs-actors{{.import}}actors/util/adt"
|
||||
{{else}}
|
||||
msig{{.v}} "github.com/filecoin-project/go-state-types/builtin{{.import}}multisig"
|
||||
adt{{.v}} "github.com/filecoin-project/go-state-types/builtin{{.import}}util/adt"
|
||||
builtin{{.v}} "github.com/filecoin-project/go-state-types/builtin"
|
||||
{{end}}
|
||||
msig{{.v}} "github.com/filecoin-project/specs-actors{{.import}}actors/builtin/multisig"
|
||||
)
|
||||
|
||||
var _ State = (*state{{.v}})(nil)
|
||||
@@ -119,7 +125,7 @@ func (s *state{{.v}}) decodeTransaction(val *cbg.Deferred) (Transaction, error)
|
||||
if err := tx.UnmarshalCBOR(bytes.NewReader(val.Raw)); err != nil {
|
||||
return Transaction{}, err
|
||||
}
|
||||
return tx, nil
|
||||
return Transaction(tx), nil
|
||||
}
|
||||
|
||||
func (s *state{{.v}}) GetState() interface{} {
|
||||
|
||||
@@ -4,8 +4,6 @@ import (
|
||||
"bytes"
|
||||
"encoding/binary"
|
||||
|
||||
adt0 "github.com/filecoin-project/specs-actors/actors/util/adt"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
"github.com/ipfs/go-cid"
|
||||
@@ -15,6 +13,7 @@ import (
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
|
||||
msig0 "github.com/filecoin-project/specs-actors/actors/builtin/multisig"
|
||||
adt0 "github.com/filecoin-project/specs-actors/actors/util/adt"
|
||||
)
|
||||
|
||||
var _ State = (*state0)(nil)
|
||||
@@ -109,7 +108,7 @@ func (s *state0) decodeTransaction(val *cbg.Deferred) (Transaction, error) {
|
||||
if err := tx.UnmarshalCBOR(bytes.NewReader(val.Raw)); err != nil {
|
||||
return Transaction{}, err
|
||||
}
|
||||
return tx, nil
|
||||
return Transaction(tx), nil
|
||||
}
|
||||
|
||||
func (s *state0) GetState() interface{} {
|
||||
|
||||
@@ -4,8 +4,6 @@ import (
|
||||
"bytes"
|
||||
"encoding/binary"
|
||||
|
||||
adt2 "github.com/filecoin-project/specs-actors/v2/actors/util/adt"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
"github.com/ipfs/go-cid"
|
||||
@@ -15,6 +13,7 @@ import (
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
|
||||
msig2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/multisig"
|
||||
adt2 "github.com/filecoin-project/specs-actors/v2/actors/util/adt"
|
||||
)
|
||||
|
||||
var _ State = (*state2)(nil)
|
||||
@@ -109,7 +108,7 @@ func (s *state2) decodeTransaction(val *cbg.Deferred) (Transaction, error) {
|
||||
if err := tx.UnmarshalCBOR(bytes.NewReader(val.Raw)); err != nil {
|
||||
return Transaction{}, err
|
||||
}
|
||||
return tx, nil
|
||||
return Transaction(tx), nil
|
||||
}
|
||||
|
||||
func (s *state2) GetState() interface{} {
|
||||
|
||||
@@ -4,8 +4,6 @@ import (
|
||||
"bytes"
|
||||
"encoding/binary"
|
||||
|
||||
adt3 "github.com/filecoin-project/specs-actors/v3/actors/util/adt"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
"github.com/ipfs/go-cid"
|
||||
@@ -17,6 +15,7 @@ import (
|
||||
builtin3 "github.com/filecoin-project/specs-actors/v3/actors/builtin"
|
||||
|
||||
msig3 "github.com/filecoin-project/specs-actors/v3/actors/builtin/multisig"
|
||||
adt3 "github.com/filecoin-project/specs-actors/v3/actors/util/adt"
|
||||
)
|
||||
|
||||
var _ State = (*state3)(nil)
|
||||
@@ -111,7 +110,7 @@ func (s *state3) decodeTransaction(val *cbg.Deferred) (Transaction, error) {
|
||||
if err := tx.UnmarshalCBOR(bytes.NewReader(val.Raw)); err != nil {
|
||||
return Transaction{}, err
|
||||
}
|
||||
return tx, nil
|
||||
return Transaction(tx), nil
|
||||
}
|
||||
|
||||
func (s *state3) GetState() interface{} {
|
||||
|
||||
@@ -4,8 +4,6 @@ import (
|
||||
"bytes"
|
||||
"encoding/binary"
|
||||
|
||||
adt4 "github.com/filecoin-project/specs-actors/v4/actors/util/adt"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
"github.com/ipfs/go-cid"
|
||||
@@ -17,6 +15,7 @@ import (
|
||||
builtin4 "github.com/filecoin-project/specs-actors/v4/actors/builtin"
|
||||
|
||||
msig4 "github.com/filecoin-project/specs-actors/v4/actors/builtin/multisig"
|
||||
adt4 "github.com/filecoin-project/specs-actors/v4/actors/util/adt"
|
||||
)
|
||||
|
||||
var _ State = (*state4)(nil)
|
||||
@@ -111,7 +110,7 @@ func (s *state4) decodeTransaction(val *cbg.Deferred) (Transaction, error) {
|
||||
if err := tx.UnmarshalCBOR(bytes.NewReader(val.Raw)); err != nil {
|
||||
return Transaction{}, err
|
||||
}
|
||||
return tx, nil
|
||||
return Transaction(tx), nil
|
||||
}
|
||||
|
||||
func (s *state4) GetState() interface{} {
|
||||
|
||||
@@ -4,8 +4,6 @@ import (
|
||||
"bytes"
|
||||
"encoding/binary"
|
||||
|
||||
adt5 "github.com/filecoin-project/specs-actors/v5/actors/util/adt"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
"github.com/ipfs/go-cid"
|
||||
@@ -17,6 +15,7 @@ import (
|
||||
builtin5 "github.com/filecoin-project/specs-actors/v5/actors/builtin"
|
||||
|
||||
msig5 "github.com/filecoin-project/specs-actors/v5/actors/builtin/multisig"
|
||||
adt5 "github.com/filecoin-project/specs-actors/v5/actors/util/adt"
|
||||
)
|
||||
|
||||
var _ State = (*state5)(nil)
|
||||
@@ -111,7 +110,7 @@ func (s *state5) decodeTransaction(val *cbg.Deferred) (Transaction, error) {
|
||||
if err := tx.UnmarshalCBOR(bytes.NewReader(val.Raw)); err != nil {
|
||||
return Transaction{}, err
|
||||
}
|
||||
return tx, nil
|
||||
return Transaction(tx), nil
|
||||
}
|
||||
|
||||
func (s *state5) GetState() interface{} {
|
||||
|
||||
@@ -4,8 +4,6 @@ import (
|
||||
"bytes"
|
||||
"encoding/binary"
|
||||
|
||||
adt6 "github.com/filecoin-project/specs-actors/v6/actors/util/adt"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
"github.com/ipfs/go-cid"
|
||||
@@ -17,6 +15,7 @@ import (
|
||||
builtin6 "github.com/filecoin-project/specs-actors/v6/actors/builtin"
|
||||
|
||||
msig6 "github.com/filecoin-project/specs-actors/v6/actors/builtin/multisig"
|
||||
adt6 "github.com/filecoin-project/specs-actors/v6/actors/util/adt"
|
||||
)
|
||||
|
||||
var _ State = (*state6)(nil)
|
||||
@@ -111,7 +110,7 @@ func (s *state6) decodeTransaction(val *cbg.Deferred) (Transaction, error) {
|
||||
if err := tx.UnmarshalCBOR(bytes.NewReader(val.Raw)); err != nil {
|
||||
return Transaction{}, err
|
||||
}
|
||||
return tx, nil
|
||||
return Transaction(tx), nil
|
||||
}
|
||||
|
||||
func (s *state6) GetState() interface{} {
|
||||
|
||||
@@ -4,8 +4,6 @@ import (
|
||||
"bytes"
|
||||
"encoding/binary"
|
||||
|
||||
adt7 "github.com/filecoin-project/specs-actors/v7/actors/util/adt"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
"github.com/ipfs/go-cid"
|
||||
@@ -17,6 +15,7 @@ import (
|
||||
builtin7 "github.com/filecoin-project/specs-actors/v7/actors/builtin"
|
||||
|
||||
msig7 "github.com/filecoin-project/specs-actors/v7/actors/builtin/multisig"
|
||||
adt7 "github.com/filecoin-project/specs-actors/v7/actors/util/adt"
|
||||
)
|
||||
|
||||
var _ State = (*state7)(nil)
|
||||
@@ -111,7 +110,7 @@ func (s *state7) decodeTransaction(val *cbg.Deferred) (Transaction, error) {
|
||||
if err := tx.UnmarshalCBOR(bytes.NewReader(val.Raw)); err != nil {
|
||||
return Transaction{}, err
|
||||
}
|
||||
return tx, nil
|
||||
return Transaction(tx), nil
|
||||
}
|
||||
|
||||
func (s *state7) GetState() interface{} {
|
||||
|
||||
@@ -0,0 +1,117 @@
|
||||
package multisig
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/binary"
|
||||
|
||||
"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"
|
||||
|
||||
builtin8 "github.com/filecoin-project/go-state-types/builtin"
|
||||
msig8 "github.com/filecoin-project/go-state-types/builtin/v8/multisig"
|
||||
adt8 "github.com/filecoin-project/go-state-types/builtin/v8/util/adt"
|
||||
)
|
||||
|
||||
var _ State = (*state8)(nil)
|
||||
|
||||
func load8(store adt.Store, root cid.Cid) (State, error) {
|
||||
out := state8{store: store}
|
||||
err := store.Get(store.Context(), root, &out)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &out, nil
|
||||
}
|
||||
|
||||
func make8(store adt.Store, signers []address.Address, threshold uint64, startEpoch abi.ChainEpoch, unlockDuration abi.ChainEpoch, initialBalance abi.TokenAmount) (State, error) {
|
||||
out := state8{store: store}
|
||||
out.State = msig8.State{}
|
||||
out.State.Signers = signers
|
||||
out.State.NumApprovalsThreshold = threshold
|
||||
out.State.StartEpoch = startEpoch
|
||||
out.State.UnlockDuration = unlockDuration
|
||||
out.State.InitialBalance = initialBalance
|
||||
|
||||
em, err := adt8.StoreEmptyMap(store, builtin8.DefaultHamtBitwidth)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
out.State.PendingTxns = em
|
||||
|
||||
return &out, nil
|
||||
}
|
||||
|
||||
type state8 struct {
|
||||
msig8.State
|
||||
store adt.Store
|
||||
}
|
||||
|
||||
func (s *state8) LockedBalance(currEpoch abi.ChainEpoch) (abi.TokenAmount, error) {
|
||||
return s.State.AmountLocked(currEpoch - s.State.StartEpoch), nil
|
||||
}
|
||||
|
||||
func (s *state8) StartEpoch() (abi.ChainEpoch, error) {
|
||||
return s.State.StartEpoch, nil
|
||||
}
|
||||
|
||||
func (s *state8) UnlockDuration() (abi.ChainEpoch, error) {
|
||||
return s.State.UnlockDuration, nil
|
||||
}
|
||||
|
||||
func (s *state8) InitialBalance() (abi.TokenAmount, error) {
|
||||
return s.State.InitialBalance, nil
|
||||
}
|
||||
|
||||
func (s *state8) Threshold() (uint64, error) {
|
||||
return s.State.NumApprovalsThreshold, nil
|
||||
}
|
||||
|
||||
func (s *state8) Signers() ([]address.Address, error) {
|
||||
return s.State.Signers, nil
|
||||
}
|
||||
|
||||
func (s *state8) ForEachPendingTxn(cb func(id int64, txn Transaction) error) error {
|
||||
arr, err := adt8.AsMap(s.store, s.State.PendingTxns, builtin8.DefaultHamtBitwidth)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
var out msig8.Transaction
|
||||
return arr.ForEach(&out, func(key string) error {
|
||||
txid, n := binary.Varint([]byte(key))
|
||||
if n <= 0 {
|
||||
return xerrors.Errorf("invalid pending transaction key: %v", key)
|
||||
}
|
||||
return cb(txid, (Transaction)(out)) //nolint:unconvert
|
||||
})
|
||||
}
|
||||
|
||||
func (s *state8) PendingTxnChanged(other State) (bool, error) {
|
||||
other8, ok := other.(*state8)
|
||||
if !ok {
|
||||
// treat an upgrade as a change, always
|
||||
return true, nil
|
||||
}
|
||||
return !s.State.PendingTxns.Equals(other8.PendingTxns), nil
|
||||
}
|
||||
|
||||
func (s *state8) transactions() (adt.Map, error) {
|
||||
return adt8.AsMap(s.store, s.PendingTxns, builtin8.DefaultHamtBitwidth)
|
||||
}
|
||||
|
||||
func (s *state8) decodeTransaction(val *cbg.Deferred) (Transaction, error) {
|
||||
var tx msig8.Transaction
|
||||
if err := tx.UnmarshalCBOR(bytes.NewReader(val.Raw)); err != nil {
|
||||
return Transaction{}, err
|
||||
}
|
||||
return Transaction(tx), nil
|
||||
}
|
||||
|
||||
func (s *state8) GetState() interface{} {
|
||||
return &s.State
|
||||
}
|
||||
@@ -10,59 +10,50 @@ import (
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
big "github.com/filecoin-project/go-state-types/big"
|
||||
"github.com/filecoin-project/go-state-types/cbor"
|
||||
"github.com/ipfs/go-cid"
|
||||
ipldcbor "github.com/ipfs/go-ipld-cbor"
|
||||
|
||||
paych0 "github.com/filecoin-project/specs-actors/actors/builtin/paych"
|
||||
paychtypes "github.com/filecoin-project/go-state-types/builtin/v8/paych"
|
||||
{{range .versions}}
|
||||
builtin{{.}} "github.com/filecoin-project/specs-actors{{import .}}actors/builtin"
|
||||
{{if (le . 7)}}
|
||||
builtin{{.}} "github.com/filecoin-project/specs-actors{{import .}}actors/builtin"
|
||||
{{end}}
|
||||
{{end}}
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
"github.com/filecoin-project/lotus/chain/actors/adt"
|
||||
"github.com/filecoin-project/lotus/chain/actors/builtin"
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
)
|
||||
|
||||
func init() {
|
||||
{{range .versions}}
|
||||
builtin.RegisterActorState(builtin{{.}}.PaymentChannelActorCodeID, func(store adt.Store, root cid.Cid) (cbor.Marshaler, error) {
|
||||
return load{{.}}(store, root)
|
||||
})
|
||||
{{end}}}
|
||||
|
||||
// Load returns an abstract copy of payment channel state, irregardless of actor version
|
||||
func Load(store adt.Store, act *types.Actor) (State, error) {
|
||||
if name, av, ok := actors.GetActorMetaByCode(act.Code); ok {
|
||||
if name != actors.PaychKey {
|
||||
return nil, xerrors.Errorf("actor code is not paych: %s", name)
|
||||
}
|
||||
|
||||
switch av {
|
||||
{{range .versions}}
|
||||
{{if (ge . 8)}}
|
||||
case actors.Version{{.}}:
|
||||
return load{{.}}(store, act.Head)
|
||||
{{end}}
|
||||
{{end}}
|
||||
}
|
||||
}
|
||||
|
||||
switch act.Code {
|
||||
{{range .versions}}
|
||||
case builtin{{.}}.PaymentChannelActorCodeID:
|
||||
return load{{.}}(store, act.Head)
|
||||
{{if (le . 7)}}
|
||||
case builtin{{.}}.PaymentChannelActorCodeID:
|
||||
return load{{.}}(store, act.Head)
|
||||
{{end}}
|
||||
{{end}}
|
||||
}
|
||||
|
||||
return nil, xerrors.Errorf("unknown actor code %s", act.Code)
|
||||
}
|
||||
|
||||
func MakeState(store adt.Store, av actors.Version) (State, error) {
|
||||
switch av {
|
||||
{{range .versions}}
|
||||
case actors.Version{{.}}:
|
||||
return make{{.}}(store)
|
||||
{{end}}
|
||||
}
|
||||
return nil, xerrors.Errorf("unknown actor version %d", av)
|
||||
}
|
||||
|
||||
func GetActorCodeID(av actors.Version) (cid.Cid, error) {
|
||||
switch av {
|
||||
{{range .versions}}
|
||||
case actors.Version{{.}}:
|
||||
return builtin{{.}}.PaymentChannelActorCodeID, nil
|
||||
{{end}}
|
||||
}
|
||||
|
||||
return cid.Undef, xerrors.Errorf("unknown actor version %d", av)
|
||||
}
|
||||
|
||||
// State is an abstract version of payment channel state that works across
|
||||
// versions
|
||||
type State interface {
|
||||
@@ -93,17 +84,14 @@ type LaneState interface {
|
||||
Nonce() (uint64, error)
|
||||
}
|
||||
|
||||
type SignedVoucher = paych0.SignedVoucher
|
||||
type ModVerifyParams = paych0.ModVerifyParams
|
||||
|
||||
// DecodeSignedVoucher decodes base64 encoded signed voucher.
|
||||
func DecodeSignedVoucher(s string) (*SignedVoucher, error) {
|
||||
func DecodeSignedVoucher(s string) (*paychtypes.SignedVoucher, error) {
|
||||
data, err := base64.RawURLEncoding.DecodeString(s)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var sv SignedVoucher
|
||||
var sv paychtypes.SignedVoucher
|
||||
if err := ipldcbor.DecodeInto(data, &sv); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -111,8 +99,6 @@ func DecodeSignedVoucher(s string) (*SignedVoucher, error) {
|
||||
return &sv, nil
|
||||
}
|
||||
|
||||
var Methods = builtin{{.latestVersion}}.MethodsPaych
|
||||
|
||||
func Message(version actors.Version, from address.Address) MessageBuilder {
|
||||
switch version {
|
||||
{{range .versions}}
|
||||
@@ -126,7 +112,23 @@ func Message(version actors.Version, from address.Address) MessageBuilder {
|
||||
|
||||
type MessageBuilder interface {
|
||||
Create(to address.Address, initialAmount abi.TokenAmount) (*types.Message, error)
|
||||
Update(paych address.Address, voucher *SignedVoucher, secret []byte) (*types.Message, error)
|
||||
Update(paych address.Address, voucher *paychtypes.SignedVoucher, secret []byte) (*types.Message, error)
|
||||
Settle(paych address.Address) (*types.Message, error)
|
||||
Collect(paych address.Address) (*types.Message, error)
|
||||
}
|
||||
|
||||
func toV0SignedVoucher(sv paychtypes.SignedVoucher) paych0.SignedVoucher {
|
||||
return paych0.SignedVoucher{
|
||||
ChannelAddr: sv.ChannelAddr,
|
||||
TimeLockMin: sv.TimeLockMin,
|
||||
TimeLockMax: sv.TimeLockMax,
|
||||
SecretPreimage: sv.SecretHash,
|
||||
Extra: (*paych0.ModVerifyParams)(sv.Extra),
|
||||
Lane: sv.Lane,
|
||||
Nonce: sv.Nonce,
|
||||
Amount: sv.Amount,
|
||||
MinSettleHeight: sv.MinSettleHeight,
|
||||
Merges: nil,
|
||||
Signature: sv.Signature,
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,24 @@
|
||||
package paych
|
||||
|
||||
import (
|
||||
{{if (ge .v 8)}}
|
||||
"golang.org/x/xerrors"
|
||||
{{end}}
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
|
||||
builtin{{.v}} "github.com/filecoin-project/specs-actors{{.import}}actors/builtin"
|
||||
init{{.v}} "github.com/filecoin-project/specs-actors{{.import}}actors/builtin/init"
|
||||
paych{{.v}} "github.com/filecoin-project/specs-actors{{.import}}actors/builtin/paych"
|
||||
paychtypes "github.com/filecoin-project/go-state-types/builtin/v8/paych"
|
||||
{{if (le .v 7)}}
|
||||
builtin{{.v}} "github.com/filecoin-project/specs-actors{{.import}}actors/builtin"
|
||||
init{{.v}} "github.com/filecoin-project/specs-actors{{.import}}actors/builtin/init"
|
||||
paych{{.v}} "github.com/filecoin-project/specs-actors{{.import}}actors/builtin/paych"
|
||||
{{else}}
|
||||
builtin{{.v}} "github.com/filecoin-project/go-state-types/builtin"
|
||||
paych{{.v}} "github.com/filecoin-project/go-state-types/builtin/v8/paych"
|
||||
init{{.v}} "github.com/filecoin-project/go-state-types/builtin/v8/init"
|
||||
{{end}}
|
||||
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/actors"
|
||||
init_ "github.com/filecoin-project/lotus/chain/actors/builtin/init"
|
||||
@@ -16,12 +28,21 @@ import (
|
||||
type message{{.v}} struct{ from address.Address }
|
||||
|
||||
func (m message{{.v}}) Create(to address.Address, initialAmount abi.TokenAmount) (*types.Message, error) {
|
||||
{{if (le .v 7)}}
|
||||
actorCodeID := builtin{{.v}}.PaymentChannelActorCodeID
|
||||
{{else}}
|
||||
actorCodeID, ok := actors.GetActorCodeID(actors.Version{{.v}}, "paymentchannel")
|
||||
if !ok {
|
||||
return nil, xerrors.Errorf("error getting actor paymentchannel code id for actor version %d", {{.v}})
|
||||
}
|
||||
{{end}}
|
||||
|
||||
params, aerr := actors.SerializeParams(&paych{{.v}}.ConstructorParams{From: m.from, To: to})
|
||||
if aerr != nil {
|
||||
return nil, aerr
|
||||
}
|
||||
enc, aerr := actors.SerializeParams(&init{{.v}}.ExecParams{
|
||||
CodeCID: builtin{{.v}}.PaymentChannelActorCodeID,
|
||||
CodeCID: actorCodeID,
|
||||
ConstructorParams: params,
|
||||
})
|
||||
if aerr != nil {
|
||||
@@ -37,10 +58,10 @@ func (m message{{.v}}) Create(to address.Address, initialAmount abi.TokenAmount)
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (m message{{.v}}) Update(paych address.Address, sv *SignedVoucher, secret []byte) (*types.Message, error) {
|
||||
func (m message{{.v}}) Update(paych address.Address, sv *paychtypes.SignedVoucher, secret []byte) (*types.Message, error) {
|
||||
params, aerr := actors.SerializeParams(&paych{{.v}}.UpdateChannelStateParams{
|
||||
{{if (ge .v 7)}}
|
||||
Sv: toV{{.v}}SignedVoucher(*sv),
|
||||
{{if (le .v 6)}}
|
||||
Sv: toV0SignedVoucher(*sv),
|
||||
{{else}}
|
||||
Sv: *sv,
|
||||
{{end}}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user