Compare commits
617
Commits
v1.23.0-rc1
...
dev
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
338d4555e6 | ||
|
|
8006a39a0f | ||
|
|
517c0a53b1 | ||
|
|
44aadb7962 | ||
|
|
4ca5b0ede9 | ||
|
|
24b958cffd | ||
|
|
2a6d0e5f6e | ||
|
|
48912e8f09 | ||
|
|
1ba0e4b997 | ||
|
|
1e29616832 | ||
|
|
739d61c698 | ||
|
|
5b31b79d58 | ||
|
|
fc719e710f | ||
|
|
28951e5919 | ||
|
|
173dad45ed | ||
|
|
36b5f485cd | ||
|
|
2fca475dd4 | ||
|
|
dfd3b10182 | ||
|
|
e3c796c848 | ||
|
|
16b9787db9 | ||
|
|
594c52b965 | ||
|
|
b6c1400d21 | ||
|
|
4d90d0475f | ||
|
|
9e4f1a4d23 | ||
|
|
7fea1795d6 | ||
|
|
a27e0a8b41 | ||
|
|
424bab336c | ||
|
|
86c3a69904 | ||
|
|
fc0df4afb8 | ||
|
|
5daaa3fe46 | ||
|
|
26b4866841 | ||
|
|
e414acb1f5 | ||
|
|
4e55147895 | ||
|
|
c38193af73 | ||
|
|
de64fda524 | ||
|
|
cc66654a6c | ||
|
|
9240776237 | ||
|
|
6e7dc9532a | ||
|
|
84535ca6fe | ||
|
|
eeac1aa17d | ||
|
|
db673ef28d | ||
|
|
2310740584 | ||
|
|
2fd8602c5a | ||
|
|
6cc506f5cf | ||
|
|
120502408c | ||
|
|
b997f4acec | ||
|
|
ce5e242d76 | ||
|
|
96fa081ca6 | ||
|
|
196cd0b739 | ||
|
|
042bbfa415 | ||
|
|
42aa8451f8 | ||
|
|
3c67d0f720 | ||
|
|
3d0e6d0363 | ||
|
|
fa36613a5e | ||
|
|
87ae60a2bc | ||
|
|
183e35f7b7 | ||
|
|
8be9e5345b | ||
|
|
047898f64d | ||
|
|
3d061ba0ae | ||
|
|
2636815311 | ||
|
|
1c10a6e238 | ||
|
|
d365f7b0a1 | ||
|
|
425661772d | ||
|
|
99c98b5de0 | ||
|
|
3bed440d2d | ||
|
|
10130a32d7 | ||
|
|
b76b5ef4b7 | ||
|
|
a12dbaac8e | ||
|
|
f5daf95261 | ||
|
|
7b921c6761 | ||
|
|
782e09a37d | ||
|
|
e25d834a17 | ||
|
|
84bba333c4 | ||
|
|
c0942ebc2c | ||
|
|
867a7b1c01 | ||
|
|
10ed18ba12 | ||
|
|
0ec2acbf20 | ||
|
|
228b306370 | ||
|
|
17915dce5a | ||
|
|
e1b69f84d6 | ||
|
|
b563a36a99 | ||
|
|
4b0ca30daf | ||
|
|
dcc72a43ee | ||
|
|
d0e9502bfe | ||
|
|
78d7ccd391 | ||
|
|
b269a1ba35 | ||
|
|
a4c94957e6 | ||
|
|
7af42796db | ||
|
|
4b5a665422 | ||
|
|
090b98ad33 | ||
|
|
14f9770859 | ||
|
|
fdd013c103 | ||
|
|
b58daf5340 | ||
|
|
479018e3b3 | ||
|
|
41203f7b8e | ||
|
|
aef2ab6315 | ||
|
|
8c8e287be0 | ||
|
|
f99fbc1e87 | ||
|
|
5e58f64380 | ||
|
|
f0fec13ec9 | ||
|
|
326a0356a4 | ||
|
|
6c62e6d8e2 | ||
|
|
587c3fde58 | ||
|
|
cd75ea0fe4 | ||
|
|
8b2ef40f4e | ||
|
|
6b4a46d273 | ||
|
|
17d2c71c0f | ||
|
|
6ec413b7ad | ||
|
|
00e34436b3 | ||
|
|
2922959f0b | ||
|
|
c233b4317d | ||
|
|
fff151f07e | ||
|
|
d9a65223ab | ||
|
|
42d2f4d7e4 | ||
|
|
bb92984dca | ||
|
|
cad743ec54 | ||
|
|
dfa7fc7723 | ||
|
|
9321e0fd14 | ||
|
|
40e51baadc | ||
|
|
3207c69528 | ||
|
|
bd85a6a72f | ||
|
|
e65de697f0 | ||
|
|
b08dbde2da | ||
|
|
6ced5e2944 | ||
|
|
de0726fcb0 | ||
|
|
0a0f540189 | ||
|
|
f35fa5757a | ||
|
|
fa8792a65e | ||
|
|
d400d33b1e | ||
|
|
c2e2725855 | ||
|
|
aaa376c5e4 | ||
|
|
b0d1385273 | ||
|
|
0e7f9cf99b | ||
|
|
34ebb257e8 | ||
|
|
0131781808 | ||
|
|
7519f9fdf1 | ||
|
|
a29e8226c7 | ||
|
|
af0303ff7d | ||
|
|
0d7d906abf | ||
|
|
bc6017194d | ||
|
|
4f3b6175c0 | ||
|
|
9486aa98db | ||
|
|
befc82d3cd | ||
|
|
9b0cbbb0a8 | ||
|
|
1dd24fe18f | ||
|
|
b3d0b1803f | ||
|
|
760a27dd4b | ||
|
|
2bbc098bff | ||
|
|
f671654bdd | ||
|
|
a0ebd8bb16 | ||
|
|
f39478140a | ||
|
|
f4a3207ede | ||
|
|
96c1ab413f | ||
|
|
0ec3d44276 | ||
|
|
08e6e04145 | ||
|
|
dbb892d89f | ||
|
|
4ca30abeef | ||
|
|
825564a994 | ||
|
|
b412d8c179 | ||
|
|
b4ea0db04f | ||
|
|
a1a012039a | ||
|
|
2bc205ed62 | ||
|
|
da2e155b72 | ||
|
|
6fd93ed170 | ||
|
|
298b2b4785 | ||
|
|
52e7546e98 | ||
|
|
fb228ebbff | ||
|
|
92dcfe530b | ||
|
|
86723a3223 | ||
|
|
4a155a9e1f | ||
|
|
ea9a8bf83f | ||
|
|
0a064c1b3d | ||
|
|
85e76f925e | ||
|
|
ca9c873858 | ||
|
|
b414124e5e | ||
|
|
4302bc02d6 | ||
|
|
dc805eb749 | ||
|
|
9617fb6899 | ||
|
|
ceb3f1e41e | ||
|
|
70d2899ead | ||
|
|
8fcf59facc | ||
|
|
5c26a3da1f | ||
|
|
7c98160b81 | ||
|
|
a4235e2b3d | ||
|
|
ff8d81d0bc | ||
|
|
488b7966e7 | ||
|
|
07e5abbd3e | ||
|
|
2f469c2f58 | ||
|
|
ea7bbbc4ae | ||
|
|
02163fbc92 | ||
|
|
bdd339d4ed | ||
|
|
ad73b312e1 | ||
|
|
bd29359d12 | ||
|
|
73315c45fb | ||
|
|
3b4fa779ac | ||
|
|
f24d669cff | ||
|
|
313c701be6 | ||
|
|
106d354689 | ||
|
|
c6fb2b416a | ||
|
|
30fae764ae | ||
|
|
6a66a11e54 | ||
|
|
ed7d1ef493 | ||
|
|
5697645748 | ||
|
|
0476632282 | ||
|
|
55a8cbd22c | ||
|
|
426bfb795a | ||
|
|
fc71ba507f | ||
|
|
596b01fba2 | ||
|
|
9ae42929d7 | ||
|
|
49e1910050 | ||
|
|
059cbedb40 | ||
|
|
075d068ccd | ||
|
|
93618c0687 | ||
|
|
c6bda331b8 | ||
|
|
9c05a1f734 | ||
|
|
d7deb9a3eb | ||
|
|
5343b0f508 | ||
|
|
e6c8072f50 | ||
|
|
d566620de8 | ||
|
|
171f1f716a | ||
|
|
45f3e694a0 | ||
|
|
9da534c75c | ||
|
|
4e8ee737fc | ||
|
|
c940f597a4 | ||
|
|
6574213914 | ||
|
|
b45409262f | ||
|
|
dec3af7d7f | ||
|
|
b6b3998864 | ||
|
|
1c1a28e1c3 | ||
|
|
efdc32f60e | ||
|
|
c1d22d8b32 | ||
|
|
a4685b7bac | ||
|
|
6a1b523ba1 | ||
|
|
c7bdf61fb1 | ||
|
|
742062f84c | ||
|
|
093d350df3 | ||
|
|
7b72968968 | ||
|
|
034888c58e | ||
|
|
ab0e261e1b | ||
|
|
78800a4e77 | ||
|
|
a3a429edad | ||
|
|
f094e61b4a | ||
|
|
bca0023756 | ||
|
|
17c43caacf | ||
|
|
3ff8a09183 | ||
|
|
76776e5cc1 | ||
|
|
49f5825296 | ||
|
|
f189256a62 | ||
|
|
3390e3536d | ||
|
|
ff0fa3471f | ||
|
|
a884bb15bd | ||
|
|
76f231618a | ||
|
|
8c31ea1814 | ||
|
|
c05204f1d8 | ||
|
|
b4c2c249db | ||
|
|
e291da9adc | ||
|
|
0d8a3cbaf8 | ||
|
|
bb5ba64cca | ||
|
|
727a71186b | ||
|
|
e91bb642e7 | ||
|
|
9d2d53b58e | ||
|
|
e351d77ff8 | ||
|
|
d2c3e84d54 | ||
|
|
cf8587522a | ||
|
|
7903224ae5 | ||
|
|
eb0b1c986b | ||
|
|
88ff21a211 | ||
|
|
2af8b6e30e | ||
|
|
33ca0f1f79 | ||
|
|
a97dae8f46 | ||
|
|
7162c656cc | ||
|
|
aeee542fb9 | ||
|
|
7e34b49b5d | ||
|
|
1e04ccb342 | ||
|
|
24945a906a | ||
|
|
a7d29c9564 | ||
|
|
71f184f5cb | ||
|
|
28d0274f46 | ||
|
|
9ae48022ff | ||
|
|
fd7a0e1922 | ||
|
|
3a6c385b50 | ||
|
|
c5f2e99e79 | ||
|
|
c8e78f7911 | ||
|
|
5a061e4677 | ||
|
|
d1d4b35adf | ||
|
|
5e6e011fe2 | ||
|
|
f3969cdc25 | ||
|
|
4ff1d1dc8d | ||
|
|
df80c4cde2 | ||
|
|
06946a8fce | ||
|
|
23fccc6cb6 | ||
|
|
4a4ae9db66 | ||
|
|
7a4624bbd9 | ||
|
|
821836d939 | ||
|
|
d4239d66ce | ||
|
|
dc0ce8f11a | ||
|
|
4430a138b6 | ||
|
|
784214ae05 | ||
|
|
875c09840b | ||
|
|
5794b22eb6 | ||
|
|
8dec6a1672 | ||
|
|
4d2765e5ba | ||
|
|
d39fbb277f | ||
|
|
b06cba18f4 | ||
|
|
9d5d6a5f3d | ||
|
|
4028c05fea | ||
|
|
b7484121fc | ||
|
|
19d8f79a3d | ||
|
|
abbb74ca35 | ||
|
|
73566254bd | ||
|
|
2f48759457 | ||
|
|
0d8659e76f | ||
|
|
ac78c39c30 | ||
|
|
5d4c237e01 | ||
|
|
12d5d3465b | ||
|
|
711ef3b208 | ||
|
|
8be0b10d9d | ||
|
|
9dbc42fc54 | ||
|
|
e409ac8421 | ||
|
|
c2e37859b5 | ||
|
|
776f98d9f5 | ||
|
|
d45ee8dc54 | ||
|
|
885153fcfa | ||
|
|
b44ae9a7d8 | ||
|
|
d8ca0bff38 | ||
|
|
01dabf09db | ||
|
|
afc64ebc5e | ||
|
|
a48a1e31e9 | ||
|
|
bb381c201c | ||
|
|
553da395e4 | ||
|
|
953d56e216 | ||
|
|
a503a0edaa | ||
|
|
07416e8c0c | ||
|
|
c84c07eb74 | ||
|
|
54d8ddf3c1 | ||
|
|
7b6f6843a7 | ||
|
|
e16fc110d9 | ||
|
|
f269c0fb5d | ||
|
|
00a025449b | ||
|
|
d1f3380850 | ||
|
|
46f1f913c8 | ||
|
|
0a46fc7e73 | ||
|
|
cb22349506 | ||
|
|
28395af03a | ||
|
|
d2906e2dc7 | ||
|
|
0c83781a7f | ||
|
|
752b961483 | ||
|
|
ff2258ff7a | ||
|
|
4bdb6b34b3 | ||
|
|
141c020b4e | ||
|
|
fe42d974a2 | ||
|
|
e945c0d6f2 | ||
|
|
0cff56a16d | ||
|
|
0befed7200 | ||
|
|
4de06dcd32 | ||
|
|
fc313a1e7d | ||
|
|
6e231e720a | ||
|
|
3f74840b67 | ||
|
|
ff9e706c65 | ||
|
|
79826447f5 | ||
|
|
7a4f69721c | ||
|
|
766bdedd29 | ||
|
|
981a3485eb | ||
|
|
4443ac662f | ||
|
|
a7379e2cce | ||
|
|
4eb4af639a | ||
|
|
24da8bdb34 | ||
|
|
44979541be | ||
|
|
65b23b867c | ||
|
|
58ccfca831 | ||
|
|
30dd65b338 | ||
|
|
d91540ae1f | ||
|
|
8f4824d2b7 | ||
|
|
ae84f335cc | ||
|
|
dd6720c61b | ||
|
|
e358b3b358 | ||
|
|
b4e2e871dc | ||
|
|
e75c2e4208 | ||
|
|
bb5f69328d | ||
|
|
db374db306 | ||
|
|
c00e0c9f48 | ||
|
|
63560c820b | ||
|
|
1b8d627af8 | ||
|
|
9d0f586ae7 | ||
|
|
86c5453254 | ||
|
|
4d7e6732fa | ||
|
|
7e99c62f6e | ||
|
|
65fa75fd01 | ||
|
|
6f91dc7c5b | ||
|
|
8893c62a42 | ||
|
|
1e25d7b453 | ||
|
|
258a3c8270 | ||
|
|
597ca9b073 | ||
|
|
76705b5762 | ||
|
|
22045b8f2d | ||
|
|
da6b565dc1 | ||
|
|
9fd69377df | ||
|
|
d1364caa84 | ||
|
|
82a3578849 | ||
|
|
74567a16d1 | ||
|
|
0356163a2e | ||
|
|
6d45c37dc5 | ||
|
|
7710a57fa3 | ||
|
|
2dd67dc895 | ||
|
|
f6add2f723 | ||
|
|
9d44c88cbb | ||
|
|
f1f0d90897 | ||
|
|
c281d053d2 | ||
|
|
522388820a | ||
|
|
d2b7d0071d | ||
|
|
07dcc08ecb | ||
|
|
43941876f4 | ||
|
|
0afd51510b | ||
|
|
d211b5eb69 | ||
|
|
740a7ca142 | ||
|
|
8a2a18f43f | ||
|
|
2278a209e2 | ||
|
|
3b0d4f2e45 | ||
|
|
b82726f57f | ||
|
|
28fdc3abb8 | ||
|
|
4a1eccd447 | ||
|
|
77883aa72b | ||
|
|
07c9367467 | ||
|
|
1a5e8603c7 | ||
|
|
3b0d8fdd29 | ||
|
|
ec90ccf72e | ||
|
|
661d8608bc | ||
|
|
5f51d652b1 | ||
|
|
8dc90267d7 | ||
|
|
c7a6bc2fce | ||
|
|
bf666a3f7e | ||
|
|
3af5ef1167 | ||
|
|
139bde3771 | ||
|
|
d71b528253 | ||
|
|
7b4e68249a | ||
|
|
54a80a8a97 | ||
|
|
13f73623a8 | ||
|
|
8b2208fd9a | ||
|
|
682ddf6ffa | ||
|
|
edae783cf4 | ||
|
|
7dcef330e7 | ||
|
|
3636af4cd9 | ||
|
|
2db6b12b78 | ||
|
|
66fc6dc3e5 | ||
|
|
bc7dafc3ba | ||
|
|
36913db0cd | ||
|
|
5250ef85a2 | ||
|
|
41ea5a6f63 | ||
|
|
103d786c72 | ||
|
|
2c98a187dd | ||
|
|
49cff8a519 | ||
|
|
52d70d563a | ||
|
|
4184ce9c75 | ||
|
|
a99946937c | ||
|
|
f44fa5d96f | ||
|
|
8aa4917741 | ||
|
|
17505a0022 | ||
|
|
3477f7ce57 | ||
|
|
89b217ee21 | ||
|
|
841b7b8730 | ||
|
|
2fa95a09be | ||
|
|
4b2e74a6df | ||
|
|
4b4e7f81a4 | ||
|
|
f24fc836b3 | ||
|
|
687f0c070f | ||
|
|
ecd13079e7 | ||
|
|
71650cd8a4 | ||
|
|
b27121612e | ||
|
|
b4d644e768 | ||
|
|
b2b78e9dfa | ||
|
|
b7c297c537 | ||
|
|
1a771e4310 | ||
|
|
83e2408f81 | ||
|
|
dcd9869842 | ||
|
|
39b27e709e | ||
|
|
2e45f6f778 | ||
|
|
f84f8a831a | ||
|
|
1ea7e05cde | ||
|
|
831f8a499d | ||
|
|
df82a8240e | ||
|
|
e9d2223025 | ||
|
|
ad81cd18c2 | ||
|
|
92f6d3e468 | ||
|
|
5aa6dd100c | ||
|
|
6ecaf826af | ||
|
|
a0f908da57 | ||
|
|
ddebdfb37c | ||
|
|
6012e65319 | ||
|
|
aebe3d4cf7 | ||
|
|
2120fae2b6 | ||
|
|
0711fdc3dd | ||
|
|
90171c8bab | ||
|
|
6f440a6420 | ||
|
|
11827034b9 | ||
|
|
b8137f6b4d | ||
|
|
48c57d394b | ||
|
|
08134552a4 | ||
|
|
4b590e2102 | ||
|
|
59640a8b22 | ||
|
|
41fce94db4 | ||
|
|
4efc29aa64 | ||
|
|
2cd3a052e3 | ||
|
|
3070227b00 | ||
|
|
2d9412d97f | ||
|
|
bc87017ea5 | ||
|
|
dcdd1bc214 | ||
|
|
f11a7f8940 | ||
|
|
317a87d669 | ||
|
|
b1669235f7 | ||
|
|
2a0660447a | ||
|
|
2bb89d9c30 | ||
|
|
ee6c0f8570 | ||
|
|
7362556c02 | ||
|
|
8bb5d985d4 | ||
|
|
6550abdfcc | ||
|
|
ce17546a76 | ||
|
|
57d4c98d00 | ||
|
|
1022ac5e2b | ||
|
|
b484d72c80 | ||
|
|
e2ff9027f9 | ||
|
|
dbd7ac5315 | ||
|
|
4ebc408a5a | ||
|
|
1152bb2e7b | ||
|
|
8abe0ea608 | ||
|
|
0f8a4b7789 | ||
|
|
f48c6268f8 | ||
|
|
6942020253 | ||
|
|
fa7e1ef78e | ||
|
|
02db37bf37 | ||
|
|
5f91072d4d | ||
|
|
5f24a814d2 | ||
|
|
3c4aa92413 | ||
|
|
d374b1ceea | ||
|
|
33648ac546 | ||
|
|
177212f06b | ||
|
|
7bcfb6d1f4 | ||
|
|
b06341031d | ||
|
|
7b41cdb656 | ||
|
|
f4a2e1cb77 | ||
|
|
90c2f9dbe2 | ||
|
|
8d260d7478 | ||
|
|
883bbf8701 | ||
|
|
3710768910 | ||
|
|
ef2f2b0f89 | ||
|
|
9c087cc52c | ||
|
|
1e7f5c6a1e | ||
|
|
ff22a46253 | ||
|
|
90c4763e00 | ||
|
|
8bceaadda8 | ||
|
|
91fccc421a | ||
|
|
1676d51484 | ||
|
|
f59c246c7a | ||
|
|
4b8442d8b9 | ||
|
|
a3900caeb0 | ||
|
|
5ade40cbac | ||
|
|
6deec4c5f4 | ||
|
|
06f93861bc | ||
|
|
cafa1eaba4 | ||
|
|
27dc4951eb | ||
|
|
47646cbd69 | ||
|
|
5113c72b3a | ||
|
|
1970792445 | ||
|
|
4b1a405002 | ||
|
|
05cb2428c1 | ||
|
|
0bf6a333b9 | ||
|
|
5e011d536b | ||
|
|
0a5618d406 | ||
|
|
db8b593c9b | ||
|
|
3c945e9e3c | ||
|
|
a11032b10a | ||
|
|
bda7ef52da | ||
|
|
b90cfff0aa | ||
|
|
5461548b7e | ||
|
|
4a20c9b60f | ||
|
|
e7448b1bb5 | ||
|
|
df6dfdf8a9 | ||
|
|
88d7a4e610 | ||
|
|
3b765a30d3 | ||
|
|
1415391988 | ||
|
|
0077fa2a98 | ||
|
|
171734ea31 | ||
|
|
0d274df977 | ||
|
|
d9ca214309 | ||
|
|
bf9ae23c98 | ||
|
|
b5dd4e31ac | ||
|
|
d97c6b2f69 | ||
|
|
7fcf228bc4 | ||
|
|
3649ae373b | ||
|
|
9144f9cea7 | ||
|
|
eab728c4e7 | ||
|
|
cc83a7cd35 | ||
|
|
a0e95ebe97 | ||
|
|
6e9a1f44ed | ||
|
|
c11ffa58a8 | ||
|
|
8a3f91e655 | ||
|
|
c099317bb3 | ||
|
|
5d3314f121 | ||
|
|
7f33db90d8 | ||
|
|
35730637dc | ||
|
|
3988cc9b2c | ||
|
|
d574d04075 | ||
|
|
939e515d23 | ||
|
|
f2cc452d4c | ||
|
|
91bd679d1e | ||
|
|
894da941af | ||
|
|
bf6541857e | ||
|
|
35f8abc72a | ||
|
|
ebafb6584e | ||
|
|
8f48631fc4 | ||
|
|
749d13359f | ||
|
|
0209052821 | ||
|
|
72c80a3461 | ||
|
|
d1a4f1dc50 | ||
|
|
1dadff303c | ||
|
|
76031d72ad | ||
|
|
c03ad9dcfd | ||
|
|
93288fac72 |
+21
-5
@@ -63,7 +63,7 @@ commands:
|
||||
name: Install Rust
|
||||
command: |
|
||||
curl https://sh.rustup.rs -sSf | sh -s -- -y
|
||||
- run: make deps lotus
|
||||
- run: make deps
|
||||
download-params:
|
||||
steps:
|
||||
- restore_cache:
|
||||
@@ -304,9 +304,7 @@ jobs:
|
||||
darwin: true
|
||||
darwin-architecture: arm64
|
||||
- run: |
|
||||
export CPATH=$(brew --prefix)/include
|
||||
export LIBRARY_PATH=$(brew --prefix)/lib
|
||||
make lotus lotus-miner lotus-worker
|
||||
export CPATH=$(brew --prefix)/include && export LIBRARY_PATH=$(brew --prefix)/lib && make lotus lotus-miner lotus-worker
|
||||
- run: otool -hv lotus
|
||||
- run:
|
||||
name: check tag and version output match
|
||||
@@ -812,6 +810,12 @@ workflows:
|
||||
- build
|
||||
suite: itest-mpool_push_with_uuid
|
||||
target: "./itests/mpool_push_with_uuid_test.go"
|
||||
- test:
|
||||
name: test-itest-msgindex
|
||||
requires:
|
||||
- build
|
||||
suite: itest-msgindex
|
||||
target: "./itests/msgindex_test.go"
|
||||
- test:
|
||||
name: test-itest-multisig
|
||||
requires:
|
||||
@@ -878,6 +882,12 @@ workflows:
|
||||
- build
|
||||
suite: itest-sdr_upgrade
|
||||
target: "./itests/sdr_upgrade_test.go"
|
||||
- test:
|
||||
name: test-itest-sealing_resources
|
||||
requires:
|
||||
- build
|
||||
suite: itest-sealing_resources
|
||||
target: "./itests/sealing_resources_test.go"
|
||||
- test:
|
||||
name: test-itest-sector_finalize_early
|
||||
requires:
|
||||
@@ -992,6 +1002,8 @@ workflows:
|
||||
- build
|
||||
suite: itest-wdpost
|
||||
target: "./itests/wdpost_test.go"
|
||||
get-params: true
|
||||
|
||||
- test:
|
||||
name: test-itest-wdpost_worker_config
|
||||
requires:
|
||||
@@ -1061,6 +1073,7 @@ workflows:
|
||||
branches:
|
||||
only:
|
||||
- /^release\/v\d+\.\d+\.\d+(-rc\d+)?$/
|
||||
- /^ci\/.*$/
|
||||
tags:
|
||||
only:
|
||||
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
|
||||
@@ -1070,6 +1083,7 @@ workflows:
|
||||
branches:
|
||||
only:
|
||||
- /^release\/v\d+\.\d+\.\d+(-rc\d+)?$/
|
||||
- /^ci\/.*$/
|
||||
tags:
|
||||
only:
|
||||
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
|
||||
@@ -1079,6 +1093,7 @@ workflows:
|
||||
branches:
|
||||
only:
|
||||
- /^release\/v\d+\.\d+\.\d+(-rc\d+)?$/
|
||||
- /^ci\/.*$/
|
||||
tags:
|
||||
only:
|
||||
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
|
||||
@@ -1091,7 +1106,7 @@ workflows:
|
||||
filters:
|
||||
branches:
|
||||
ignore:
|
||||
- /.*/
|
||||
- /^.*$/
|
||||
tags:
|
||||
only:
|
||||
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
|
||||
@@ -1106,6 +1121,7 @@ workflows:
|
||||
branches:
|
||||
only:
|
||||
- /^release\/v\d+\.\d+\.\d+(-rc\d+)?$/
|
||||
- /^ci\/.*$/
|
||||
- build-docker:
|
||||
name: "Docker push (lotus-all-in-one / stable / mainnet)"
|
||||
image: lotus-all-in-one
|
||||
|
||||
+10
-5
@@ -63,7 +63,7 @@ commands:
|
||||
name: Install Rust
|
||||
command: |
|
||||
curl https://sh.rustup.rs -sSf | sh -s -- -y
|
||||
- run: make deps lotus
|
||||
- run: make deps
|
||||
download-params:
|
||||
steps:
|
||||
- restore_cache:
|
||||
@@ -304,9 +304,7 @@ jobs:
|
||||
darwin: true
|
||||
darwin-architecture: arm64
|
||||
- run: |
|
||||
export CPATH=$(brew --prefix)/include
|
||||
export LIBRARY_PATH=$(brew --prefix)/lib
|
||||
make lotus lotus-miner lotus-worker
|
||||
export CPATH=$(brew --prefix)/include && export LIBRARY_PATH=$(brew --prefix)/lib && make lotus lotus-miner lotus-worker
|
||||
- run: otool -hv lotus
|
||||
- run:
|
||||
name: check tag and version output match
|
||||
@@ -547,6 +545,9 @@ workflows:
|
||||
[[- if or (eq $name "worker") (eq $name "deals_concurrent") (eq $name "wdpost_worker_config")]]
|
||||
executor: golang-2xl
|
||||
[[- end]]
|
||||
[[- if (eq $name "wdpost")]]
|
||||
get-params: true
|
||||
[[end]]
|
||||
[[- end ]][[- end]]
|
||||
|
||||
[[- range $suite, $pkgs := .UnitSuites]]
|
||||
@@ -580,6 +581,7 @@ workflows:
|
||||
branches:
|
||||
only:
|
||||
- /^release\/v\d+\.\d+\.\d+(-rc\d+)?$/
|
||||
- /^ci\/.*$/
|
||||
tags:
|
||||
only:
|
||||
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
|
||||
@@ -589,6 +591,7 @@ workflows:
|
||||
branches:
|
||||
only:
|
||||
- /^release\/v\d+\.\d+\.\d+(-rc\d+)?$/
|
||||
- /^ci\/.*$/
|
||||
tags:
|
||||
only:
|
||||
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
|
||||
@@ -598,6 +601,7 @@ workflows:
|
||||
branches:
|
||||
only:
|
||||
- /^release\/v\d+\.\d+\.\d+(-rc\d+)?$/
|
||||
- /^ci\/.*$/
|
||||
tags:
|
||||
only:
|
||||
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
|
||||
@@ -610,7 +614,7 @@ workflows:
|
||||
filters:
|
||||
branches:
|
||||
ignore:
|
||||
- /.*/
|
||||
- /^.*$/
|
||||
tags:
|
||||
only:
|
||||
- /^v\d+\.\d+\.\d+(-rc\d+)?$/
|
||||
@@ -625,6 +629,7 @@ workflows:
|
||||
branches:
|
||||
only:
|
||||
- /^release\/v\d+\.\d+\.\d+(-rc\d+)?$/
|
||||
- /^ci\/.*$/
|
||||
[[- range .Networks]]
|
||||
- build-docker:
|
||||
name: "Docker push (lotus-all-in-one / stable / [[.]])"
|
||||
|
||||
@@ -52,3 +52,4 @@ dist/
|
||||
# The following files are checked into git and result
|
||||
# in dirty git state if removed from the docker context
|
||||
!extern/filecoin-ffi/rust/filecoin.pc
|
||||
!extern/test-vectors
|
||||
|
||||
+160
-26
@@ -1,21 +1,25 @@
|
||||
# Lotus changelog
|
||||
|
||||
# v1.23.0-rc1 / 2023-04-19
|
||||
# UNRELEASED
|
||||
|
||||
This is an optional but highly recommended feature release of Lotus. It includes numerous improvements and enhancements for node operators, ETH RPC-providers and storage providers.
|
||||
## New features
|
||||
- feat: Added new environment variable `LOTUS_EXEC_TRACE_CACHE_SIZE` to configure execution trace cache size ([filecoin-project/lotus#10585](https://github.com/filecoin-project/lotus/pull/10585))
|
||||
- If unset, we default to caching 16 most recent execution traces. Node operatores may want to set this to 0 while exchanges may want to crank it up.
|
||||
|
||||
Note: this release includes all the changes from v1.22.0 that supports the upcoming nv19 upgrade, scheduled on Apr 27th. You can find more details about the upgrade [here](https://github.com/filecoin-project/lotus/discussions/10686)
|
||||
# v1.23.0 / 2023-04-21
|
||||
|
||||
This is the stable feature release for the upcoming MANDATORY network upgrade at `2023-04-27T13:00:00Z`, epoch `2809800`. This feature release delivers the nv19 Lighting and nv20 Thunder network upgrade for mainnet, and includes numerous improvements and enhancements for node operators, ETH RPC-providers and storage providers.
|
||||
|
||||
## ☢️ Upgrade Warnings ☢️
|
||||
|
||||
Before upgrading to this feature release read carefully through these bullet points:
|
||||
Please read carefully through the **upgrade warnings** section if you are upgrading from a v1.20.X release, or the v1.22.0 release. If you are upgrading from a v1.21.0-rcX these warnings should be familiar to you.
|
||||
|
||||
- Starting from this release, the SplitStore feature is automatically activated on new nodes. However, for existing Lotus users, you need to explicitly configure SplitStore by uncommenting the `EnableSplitstore` option in your `config.toml` file. To enable SplitStore, set `EnableSplitstore=true`, and to disable it, set `EnableSplitstore=false`. **It's important to note that your Lotus node will not start unless this configuration is properly set. Set it to false if you are running a full archival node!**
|
||||
- This feature release requires a **minimum Go version of v1.19.7 or higher to successfully build Lotus**. Additionally, Go version v1.20 and higher is now also supported.
|
||||
- **Storage Providers:** The proofs libraries now have CUDA enabled by default, which requires you to install (CUDA)[https://lotus.filecoin.io/tutorials/lotus-miner/cuda/] if you haven't already done so. If you prefer to use OpenCL on your GPUs instead, you can use the `FFI_USE_OPENCL=1` flag when building from source. On the other hand, if you want to disable GPUs altogether, you can use the `FFI_NO_GPU=1` environment variable when building from source.
|
||||
- **Storage Providers:** The `lotus-miner sectors extend` command has been refactored to the functionality of `lotus-miner sectors renew`.
|
||||
- **Exchanges/Node operators/RPC-providers::** Execution traces (returned from `lotus state exec-trace`, `lotus state replay`, etc.), has changed to account for changes introduced by the by the FVM. **Please make sure to read the `Execution trace format change` section carefully, as these are interface breaking changes**
|
||||
- **Syncing issues:** If you have been struggling with syncing issues in normal operations you can try to adjust the amount of threads used for more concurrent FMV execution through via the `LOTUS_FVM_CONCURRENCY` enviroment variable. It is set to 4 threads by default. Recommended formula for concurrency == YOUR_RAM/4 , but max is 128. If you are a Storage Provider and are pushing many messages within a short period of time, exporting `LOTUS_SKIP_APPLY_TS_MESSAGE_CALL_WITH_GAS=1` will also help with keeping in sync.
|
||||
- **Syncing issues:** If you have been struggling with syncing issues in normal operations you can try to adjust the amount of threads used for more concurrent FMV execution through via the `LOTUS_FVM_CONCURRENCY` enviroment variable. It is set to 4 threads by default. Recommended formula for concurrency == YOUR_RAM/4 , but max during a network upgrade is 24. If you are a Storage Provider and are pushing many messages within a short period of time, exporting `LOTUS_SKIP_APPLY_TS_MESSAGE_CALL_WITH_GAS=1` will also help with keeping in sync.
|
||||
- **Catching up from a Snapshot:** Users have noticed that catching up sync from a snapshot is taking a lot longer these day. This is largely related to the built-in market actor consuming a lot of computational demand for block validation. A FIP for a short-term mitigation for this is currently in Last Call and will be included network version 19 upgrade if accepted. You [can read the FIP here.](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0060.md)
|
||||
|
||||
## Highlights
|
||||
@@ -442,41 +446,171 @@ The `lotus-miner sector list` is now running in parallel - which should speed up
|
||||
| vyzo | 1 | +3/-3 | 2 |
|
||||
| 0x5459 | 1 | +1/-1 | 1 |
|
||||
|
||||
# v1.22.0-rc4 / 2023-04-17
|
||||
# v1.22.1 / 2023-04-23
|
||||
|
||||
This is the fourth release candidate for MANDATORY 1.22.0 release of lotus.
|
||||
## Important Notice
|
||||
|
||||
Diff from previous RCs:
|
||||
- REVERT [Activation bug fix](https://github.com/filecoin-project/builtin-actors/issues/914)
|
||||
- REVERT [FIP 0052](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0052.md)
|
||||
This is a MANDATORY hotfix release that fixes a consensus-critical bug that was in v1.22.0 -- the necessary fix is https://github.com/filecoin-project/ref-fvm/pull/1750 and it is integrated into lotus via https://github.com/filecoin-project/lotus/pull/10735.
|
||||
You can NOT use 1.22.0 for the nv19 upgrade, you MUST be on 1.22.1 or higher.
|
||||
|
||||
Activation bug fix is reverted to reduce upgrade risk in order to expedite the upgrade. This is in hopes of helping improve recent chain quality degregadation along with other long syncing time related issues. FIP 0052 requires the activation bug fix to maintain security invariants and so must also be reverted.
|
||||
## About This Release
|
||||
|
||||
# v1.22.0-rc1 / 2023-04-13
|
||||
This is the stable release of Lotus v1.22.1 for the upcoming MANDATORY network upgrade at `2023-04-27T13:00:00Z`, epoch `2809800`. This release delivers the nv19 Lighting and nv20 Thunder network upgrade for mainnet.
|
||||
|
||||
Note that you must be on a go version higher than Go 1.18.8, but lower than Go v1.20.0. We would recommend Go 1.19.7.
|
||||
|
||||
This is the third release candidate for the upcoming MANDATORY 1.22.0 release of Lotus. This release will deliver the nv19 Lighting and nv20 Thunder network upgrade.
|
||||
|
||||
Note that this release candidate sets the calibration upgrade epoch, and does NOT set the epoch at which mainnet will upgrade; that detail will be finalized in the 1.22.0 release.
|
||||
|
||||
The Lighting and Thunder upgrade introduces the following Filecoin Improvement Proposals (FIPs), delivered by builtin-actors v11 (see actors [v11.0.0-rc.1](https://github.com/filecoin-project/builtin-actors/releases/tag/v11.0.0-rc1)):
|
||||
The Lighting and Thunder upgrade introduces the following Filecoin Improvement Proposals (FIPs), delivered by builtin-actors v11 (see actors [v11.0.0](https://github.com/filecoin-project/builtin-actors/releases/tag/v11.0.0-rc2)):
|
||||
|
||||
- [FIP 0060](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0060.md) - Thirty day market deal maintenance interval
|
||||
- [FIP 0061](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0061.md) - WindowPoSt grindability fix
|
||||
- [FIP 0062](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0062.md) - Fallback method handler for multisig actor
|
||||
- [FIP 0052](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0052.md) - Deals and sectors can be created and extended in 3.5 year intervals (+2 years from current params)
|
||||
- [Activation bug fix](https://github.com/filecoin-project/builtin-actors/issues/914) - internal refactor of sector info fields fixing several outstanding bugs
|
||||
|
||||
## Lighting and Thunder
|
||||
## Expedited nv19 Lightning ⚡️ rollout
|
||||
|
||||
As you may have noticed, that we are doing a two-stage incremental network upgrades in this release. This essentially means that there will be two network versions rolled out together -- nv19 and nv20.
|
||||
The two stage roll out is required for FIP-0061 - which introduces a new proof that reduces the grindability of windowPoSt and furthur secures the network. At the first upgrade, the new proof type will start to be accepted by the protocol, while the second upgrade (nv20) marks the spot when the old proof type will no longer be accepted. This allows for a smooth rollover period during which both proof types are accepted. Lotus will start generating the new proof types immediately after the nv19 upgrade.
|
||||
This is something we've safely done before. The second upgrade is something of a "ghost" upgrade -- no migration runs, and no code changes, except that clients will start reporting the new network version of nv20 to the FVM.
|
||||
In light of the recent degraded chain quality on the mainnet [an expedited nv19 upgrade has been proposed and accepted](https://github.com/filecoin-project/core-devs/discussions/123#discussioncomment-5642909) to roll out the market cron mitigation ([FIP0060](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0060.md)) that will improve block validation times, and with that the delay in block production that is causing a decrease in the chain quality currently.
|
||||
|
||||
## Calibration nv19 Lighting and nv20 Thunder Upgrade
|
||||
With this expedited roll out we want to inform you of some **key changes and important dates:**
|
||||
|
||||
This release candidate sets the calibration-net nv19 Lighting upgrade at epoch 489394, 2023-04-20T16:30:00Z and nv20 Thunder upgrade will be triggered automatically 11520 epoch later. The bundle the network will be using is [v10.0.0 actors](https://github.com/filecoin-project/builtin-actors/releases/tag/v10.0.0-rc.1)
|
||||
(located at `build/actors/v11.tar.zst`) upon/post migration, manifest CID `bafy2bzacedyne7vbddp2inj64ubztcvkmfkdnahwo353sltkqtsyzckioneuu`.
|
||||
- Accelerate the nv19-upgrade on **mainnet** from May 11th to **April 27th**.
|
||||
- Derisk nv19 by descoping the sector info migration, activation epoch fixes and drop [[FIP0052 - Extend sector/deal max duration to 3.5 year.](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0052.md)](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0052.md)
|
||||
- By descoping these changes we can greatly derisk the network upgrade itself by removing a heavy migration that could cause instability for storage providers and node operators during the network upgrade.
|
||||
- Increase the rollover period for [[FIP0061](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0052.md)](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0052.md) from 1 week to 3 weeks on mainnet. The rollover period is the duration between nv19 and nv20 which both old proofs (v1) and the new proofs (v1_1) proofs will be accepted by the network.
|
||||
|
||||
The Lighting and Thunder upgrade now implements the following Filecoin Improvement Proposals (FIPs), delivered by builtin-actors v11 (see actors [v11.0.0](https://github.com/filecoin-project/builtin-actors/releases/tag/v11.0.0)):
|
||||
|
||||
- [FIP 0060](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0060.md) - Thirty day market deal maintenance interval
|
||||
- [FIP 0061](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0061.md) - WindowPoSt grindability fix
|
||||
- [FIP 0062](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0062.md) - Fallback method handler for multisig actor
|
||||
|
||||
## v11 Builtin Actor Bundles
|
||||
|
||||
Make sure that your lotus actor bundle matches the v11 actors manifest by running after upgrading:
|
||||
|
||||
```
|
||||
lotus state actor-cids --network-version 19
|
||||
Network Version: 19
|
||||
Actor Version: 11
|
||||
Manifest CID: bafy2bzacecnhaiwcrpyjvzl4uv4q3jzoif26okl3m66q3cijp3dfwlcxwztwo
|
||||
|
||||
Actor CID
|
||||
datacap bafk2bzacebslykoyrb2hm7aacjngqgd5n2wmeii2goadrs5zaya3pvdf6pdnq
|
||||
init bafk2bzaceckwf3w6n2nw6eh77ktmsxqgsvshonvgnyk5q5syyngtetxvasfxg
|
||||
reward bafk2bzacebwjw2vxkobs7r2kwjdqqb42h2kucyuk6flbnyzw4odg5s4mogamo
|
||||
cron bafk2bzacebpewdvvgt6tk2o2u4rcovdgym67tadiis5usemlbejg7k3kt567o
|
||||
ethaccount bafk2bzaceclkmc4yidxc6lgcjpfypbde2eddnevcveo4j5kmh4ek6inqysz2k
|
||||
evm bafk2bzacediwh6etwzwmb5pivtclpdplewdjzphouwqpppce6opisjv2fjqfe
|
||||
storagemarket bafk2bzaceazu2j2zu4p24tr22btnqzkhzjvyjltlvsagaj6w3syevikeb5d7m
|
||||
storagepower bafk2bzaceaxgloxuzg35vu7l7tohdgaq2frsfp4ejmuo7tkoxjp5zqrze6sf4
|
||||
system bafk2bzaced7npe5mt5nh72jxr2igi2sofoa7gedt4w6kueeke7i3xxugqpjfm
|
||||
account bafk2bzacealnlr7st6lkwoh6wxpf2hnrlex5sknaopgmkr2tuhg7vmbfy45so
|
||||
placeholder bafk2bzacedfvut2myeleyq67fljcrw4kkmn5pb5dpyozovj7jpoez5irnc3ro
|
||||
eam bafk2bzaceaelwt4yfsfvsu3pa3miwalsvy3cfkcjvmt4sqoeopsppnrmj2mf2
|
||||
multisig bafk2bzaceafajceqwg5ybiz7xw6rxammuirkgtuv625gzaehsqfprm4bazjmk
|
||||
paymentchannel bafk2bzaceb4e6cnsnviegmqvsmoxzncruvhra54piq7bwiqfqevle6oob2gvo
|
||||
storageminer bafk2bzacec24okjqrp7c7rj3hbrs5ez5apvwah2ruka6haesgfngf37mhk6us
|
||||
verifiedregistry bafk2bzacedej3dnr62g2je2abmyjg3xqv4otvh6e26du5fcrhvw7zgcaaez3a
|
||||
```
|
||||
|
||||
## Changelog
|
||||
|
||||
- feat: build: set Lightning and Thunder upgrade epochs [filecoin-project/lotus#10716](https://github.com/filecoin-project/lotus/pull/10707)
|
||||
- fix: PoSt worker: use go-state-types for proof policies [filecoin-project/lotus#10716](https://github.com/filecoin-project/lotus/pull/10716)
|
||||
- chore: deps: update to actors v11.0.0 [filecoin-project/lotus#10718](https://github.com/filecoin-project/lotus/pull/10718)
|
||||
- chore: deps: update to go-state-types v0.11.1 [filecoin-project/lotus#10720](https://github.com/filecoin-project/lotus/pull/10720)
|
||||
- feat: upgrade: expedite nv19 [filecoin-project/lotus#10681](https://github.com/filecoin-project/lotus/pull/10681)
|
||||
- Update changelog build version (commit: [67d419e](https://github.com/filecoin-project/lotus/commit/67d419e1623e6b9f5b871d6157a3096378477c3b))
|
||||
- Update actors v11 (commit: [5df4f75](https://github.com/filecoin-project/lotus/commit/5df4f75dc22318fd304313714d5c4f4cfeed22c9))
|
||||
- Correct epoch to match specified date (commit: [a28fcea](https://github.com/filecoin-project/lotus/commit/a28fceaa559b6c7e1b5df09383af56a5c2f51caa))
|
||||
- Fast butterfly migration to validate migration (commit: [37a0dca](https://github.com/filecoin-project/lotus/commit/37a0dca11ebfadebad3920a337b4f1b2fba08a7b))
|
||||
- Make docsgen (commit: [daba4ff](https://github.com/filecoin-project/lotus/commit/daba4ff5f0e97ab6ed444a34f61499a64b92a220))
|
||||
- Update go-state-types (commit: [244ca0b](https://github.com/filecoin-project/lotus/commit/244ca0b5f32a2af684f3f9586b92861a06bb8833))
|
||||
- Revert FIP0052 (commit: [68ed494](https://github.com/filecoin-project/lotus/commit/68ed494a6e497ac556eb93b28b2536c881dc9a4c))
|
||||
- Modify upgrade schedule and params (commit: [fa0dfdf](https://github.com/filecoin-project/lotus/commit/fa0dfdfd9f89fab8491f3e613909782ab9bb7cee))
|
||||
- Update go-state-types (commit: [19ae05f](https://github.com/filecoin-project/lotus/commit/19ae05f3b3a589e28efe4690c5816dfc1c7866a6))
|
||||
|
||||
### Dependencies
|
||||
github.com/filecoin-project/go-state-types (v0.11.0-rc1 -> v0.11.1):
|
||||
|
||||
# v1.22.0 / 2023-04-21
|
||||
|
||||
EDIT: Do NOT use this release for nv19, you MUST use v1.22.1 or higher.
|
||||
|
||||
This is the stable release of Lotus v1.22.0 for the upcoming MANDATORY network upgrade at `2023-04-27T13:00:00Z`, epoch `2809800`. This release delivers the nv19 Lighting and nv20 Thunder network upgrade for mainnet.
|
||||
|
||||
Note that you must be on a go version higher then Go 1.18.8, but lower then Go v1.20.0. We would recommend Go 1.19.7.
|
||||
|
||||
The Lighting and Thunder upgrade introduces the following Filecoin Improvement Proposals (FIPs), delivered by builtin-actors v11 (see actors [v11.0.0](https://github.com/filecoin-project/builtin-actors/releases/tag/v11.0.0-rc2)):
|
||||
|
||||
- [FIP 0060](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0060.md) - Thirty day market deal maintenance interval
|
||||
- [FIP 0061](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0061.md) - WindowPoSt grindability fix
|
||||
- [FIP 0062](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0062.md) - Fallback method handler for multisig actor
|
||||
|
||||
## Expedited nv19 Lightning ⚡️ rollout
|
||||
|
||||
In light of the recent degraded chain quality on the mainnet [an expedited nv19 upgrade has been proposed and accepted](https://github.com/filecoin-project/core-devs/discussions/123#discussioncomment-5642909) to roll out the market cron mitigation ([FIP0060](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0060.md)) that will improve block validation times, and with that the delay in block production that is causing a decrease in the chain quality currently.
|
||||
|
||||
With this expedited roll out we want to inform you of some **key changes and important dates:**
|
||||
|
||||
- Accelerate the nv19-upgrade on **mainnet** from May 11th to **April 27th**.
|
||||
- Derisk nv19 by descoping the sector info migration, activation epoch fixes and drop [[FIP0052 - Extend sector/deal max duration to 3.5 year.](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0052.md)](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0052.md)
|
||||
- By descoping these changes we can greatly derisk the network upgrade itself by removing a heavy migration that could cause instability for storage providers and node operators during the network upgrade.
|
||||
- Increase the rollover period for [[FIP0061](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0052.md)](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0052.md) from 1 week to 3 weeks on mainnet. The rollover period is the duration between nv19 and nv20 which both old proofs (v1) and the new proofs (v1_1) proofs will be accepted by the network.
|
||||
|
||||
The Lighting and Thunder upgrade now implements the following Filecoin Improvement Proposals (FIPs), delivered by builtin-actors v11 (see actors [v11.0.0](https://github.com/filecoin-project/builtin-actors/releases/tag/v11.0.0)):
|
||||
|
||||
- [FIP 0060](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0060.md) - Thirty day market deal maintenance interval
|
||||
- [FIP 0061](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0061.md) - WindowPoSt grindability fix
|
||||
- [FIP 0062](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0062.md) - Fallback method handler for multisig actor
|
||||
|
||||
## v11 Builtin Actor Bundles
|
||||
|
||||
Make sure that your lotus actor bundle matches the v11 actors manifest by running after upgrading:
|
||||
|
||||
```
|
||||
lotus state actor-cids --network-version 19
|
||||
Network Version: 19
|
||||
Actor Version: 11
|
||||
Manifest CID: bafy2bzacecnhaiwcrpyjvzl4uv4q3jzoif26okl3m66q3cijp3dfwlcxwztwo
|
||||
|
||||
Actor CID
|
||||
datacap bafk2bzacebslykoyrb2hm7aacjngqgd5n2wmeii2goadrs5zaya3pvdf6pdnq
|
||||
init bafk2bzaceckwf3w6n2nw6eh77ktmsxqgsvshonvgnyk5q5syyngtetxvasfxg
|
||||
reward bafk2bzacebwjw2vxkobs7r2kwjdqqb42h2kucyuk6flbnyzw4odg5s4mogamo
|
||||
cron bafk2bzacebpewdvvgt6tk2o2u4rcovdgym67tadiis5usemlbejg7k3kt567o
|
||||
ethaccount bafk2bzaceclkmc4yidxc6lgcjpfypbde2eddnevcveo4j5kmh4ek6inqysz2k
|
||||
evm bafk2bzacediwh6etwzwmb5pivtclpdplewdjzphouwqpppce6opisjv2fjqfe
|
||||
storagemarket bafk2bzaceazu2j2zu4p24tr22btnqzkhzjvyjltlvsagaj6w3syevikeb5d7m
|
||||
storagepower bafk2bzaceaxgloxuzg35vu7l7tohdgaq2frsfp4ejmuo7tkoxjp5zqrze6sf4
|
||||
system bafk2bzaced7npe5mt5nh72jxr2igi2sofoa7gedt4w6kueeke7i3xxugqpjfm
|
||||
account bafk2bzacealnlr7st6lkwoh6wxpf2hnrlex5sknaopgmkr2tuhg7vmbfy45so
|
||||
placeholder bafk2bzacedfvut2myeleyq67fljcrw4kkmn5pb5dpyozovj7jpoez5irnc3ro
|
||||
eam bafk2bzaceaelwt4yfsfvsu3pa3miwalsvy3cfkcjvmt4sqoeopsppnrmj2mf2
|
||||
multisig bafk2bzaceafajceqwg5ybiz7xw6rxammuirkgtuv625gzaehsqfprm4bazjmk
|
||||
paymentchannel bafk2bzaceb4e6cnsnviegmqvsmoxzncruvhra54piq7bwiqfqevle6oob2gvo
|
||||
storageminer bafk2bzacec24okjqrp7c7rj3hbrs5ez5apvwah2ruka6haesgfngf37mhk6us
|
||||
verifiedregistry bafk2bzacedej3dnr62g2je2abmyjg3xqv4otvh6e26du5fcrhvw7zgcaaez3a
|
||||
```
|
||||
|
||||
## Changelog
|
||||
|
||||
|
||||
- feat: build: set Lightning and Thunder upgrade epochs [filecoin-project/lotus#10716](https://github.com/filecoin-project/lotus/pull/10707)
|
||||
- fix: PoSt worker: use go-state-types for proof policies [filecoin-project/lotus#10716](https://github.com/filecoin-project/lotus/pull/10716)
|
||||
- chore: deps: update to actors v11.0.0 [filecoin-project/lotus#10718](https://github.com/filecoin-project/lotus/pull/10718)
|
||||
- chore: deps: update to go-state-types v0.11.1 [filecoin-project/lotus#10720](https://github.com/filecoin-project/lotus/pull/10720)
|
||||
- feat: upgrade: expedite nv19 [filecoin-project/lotus#10681](https://github.com/filecoin-project/lotus/pull/10681)
|
||||
- Update changelog build version (commit: [67d419e](https://github.com/filecoin-project/lotus/commit/67d419e1623e6b9f5b871d6157a3096378477c3b))
|
||||
- Update actors v11 (commit: [5df4f75](https://github.com/filecoin-project/lotus/commit/5df4f75dc22318fd304313714d5c4f4cfeed22c9))
|
||||
- Correct epoch to match specified date (commit: [a28fcea](https://github.com/filecoin-project/lotus/commit/a28fceaa559b6c7e1b5df09383af56a5c2f51caa))
|
||||
- Fast butterfly migration to validate migration (commit: [37a0dca](https://github.com/filecoin-project/lotus/commit/37a0dca11ebfadebad3920a337b4f1b2fba08a7b))
|
||||
- Make docsgen (commit: [daba4ff](https://github.com/filecoin-project/lotus/commit/daba4ff5f0e97ab6ed444a34f61499a64b92a220))
|
||||
- Update go-state-types (commit: [244ca0b](https://github.com/filecoin-project/lotus/commit/244ca0b5f32a2af684f3f9586b92861a06bb8833))
|
||||
- Revert FIP0052 (commit: [68ed494](https://github.com/filecoin-project/lotus/commit/68ed494a6e497ac556eb93b28b2536c881dc9a4c))
|
||||
- Modify upgrade schedule and params (commit: [fa0dfdf](https://github.com/filecoin-project/lotus/commit/fa0dfdfd9f89fab8491f3e613909782ab9bb7cee))
|
||||
- Update go-state-types (commit: [19ae05f](https://github.com/filecoin-project/lotus/commit/19ae05f3b3a589e28efe4690c5816dfc1c7866a6))
|
||||
|
||||
### Dependencies
|
||||
github.com/filecoin-project/go-state-types (v0.11.0-rc1 -> v0.11.1):
|
||||
|
||||
# v1.20.4 / 2023-03-17
|
||||
|
||||
|
||||
@@ -1,273 +0,0 @@
|
||||
##### DEPRECATED
|
||||
|
||||
FROM golang:1.19.7-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
|
||||
|
||||
ENV XDG_CACHE_HOME="/tmp"
|
||||
|
||||
### taken from https://github.com/rust-lang/docker-rust/blob/master/1.63.0/buster/Dockerfile
|
||||
ENV RUSTUP_HOME=/usr/local/rustup \
|
||||
CARGO_HOME=/usr/local/cargo \
|
||||
PATH=/usr/local/cargo/bin:$PATH \
|
||||
RUST_VERSION=1.63.0
|
||||
|
||||
RUN set -eux; \
|
||||
dpkgArch="$(dpkg --print-architecture)"; \
|
||||
case "${dpkgArch##*-}" in \
|
||||
amd64) rustArch='x86_64-unknown-linux-gnu'; rustupSha256='5cc9ffd1026e82e7fb2eec2121ad71f4b0f044e88bca39207b3f6b769aaa799c' ;; \
|
||||
arm64) rustArch='aarch64-unknown-linux-gnu'; rustupSha256='e189948e396d47254103a49c987e7fb0e5dd8e34b200aa4481ecc4b8e41fb929' ;; \
|
||||
*) echo >&2 "unsupported architecture: ${dpkgArch}"; exit 1 ;; \
|
||||
esac; \
|
||||
url="https://static.rust-lang.org/rustup/archive/1.25.1/${rustArch}/rustup-init"; \
|
||||
wget "$url"; \
|
||||
echo "${rustupSha256} *rustup-init" | sha256sum -c -; \
|
||||
chmod +x rustup-init; \
|
||||
./rustup-init -y --no-modify-path --profile minimal --default-toolchain $RUST_VERSION --default-host ${rustArch}; \
|
||||
rm rustup-init; \
|
||||
chmod -R a+w $RUSTUP_HOME $CARGO_HOME; \
|
||||
rustup --version; \
|
||||
cargo --version; \
|
||||
rustc --version;
|
||||
### end rust
|
||||
|
||||
FROM builder-deps AS builder-local
|
||||
MAINTAINER Lotus Development Team
|
||||
|
||||
COPY ./ /opt/filecoin
|
||||
WORKDIR /opt/filecoin
|
||||
|
||||
### make configurable filecoin-ffi build
|
||||
ARG FFI_BUILD_FROM_SOURCE=0
|
||||
ENV FFI_BUILD_FROM_SOURCE=${FFI_BUILD_FROM_SOURCE}
|
||||
|
||||
RUN make clean deps
|
||||
|
||||
|
||||
FROM builder-local AS builder-test
|
||||
MAINTAINER Lotus Development Team
|
||||
|
||||
WORKDIR /opt/filecoin
|
||||
|
||||
RUN make debug
|
||||
|
||||
|
||||
FROM builder-local AS builder
|
||||
MAINTAINER Lotus Development Team
|
||||
|
||||
WORKDIR /opt/filecoin
|
||||
|
||||
ARG RUSTFLAGS=""
|
||||
ARG GOFLAGS=""
|
||||
|
||||
RUN make lotus lotus-miner lotus-worker lotus-shed lotus-wallet lotus-gateway lotus-stats
|
||||
|
||||
|
||||
FROM ubuntu:20.04 AS base
|
||||
MAINTAINER Lotus Development Team
|
||||
|
||||
# Base resources
|
||||
COPY --from=builder /etc/ssl/certs /etc/ssl/certs
|
||||
COPY --from=builder /lib/*/libdl.so.2 /lib/
|
||||
COPY --from=builder /lib/*/librt.so.1 /lib/
|
||||
COPY --from=builder /lib/*/libgcc_s.so.1 /lib/
|
||||
COPY --from=builder /lib/*/libutil.so.1 /lib/
|
||||
COPY --from=builder /usr/lib/*/libltdl.so.7 /lib/
|
||||
COPY --from=builder /usr/lib/*/libnuma.so.1 /lib/
|
||||
COPY --from=builder /usr/lib/*/libhwloc.so.5 /lib/
|
||||
COPY --from=builder /usr/lib/*/libOpenCL.so.1 /lib/
|
||||
|
||||
RUN useradd -r -u 532 -U fc \
|
||||
&& mkdir -p /etc/OpenCL/vendors \
|
||||
&& echo "libnvidia-opencl.so.1" > /etc/OpenCL/vendors/nvidia.icd
|
||||
|
||||
###
|
||||
FROM base AS lotus
|
||||
MAINTAINER Lotus Development Team
|
||||
|
||||
COPY --from=builder /opt/filecoin/lotus /usr/local/bin/
|
||||
COPY --from=builder /opt/filecoin/lotus-shed /usr/local/bin/
|
||||
COPY scripts/docker-lotus-entrypoint.sh /
|
||||
|
||||
ENV FILECOIN_PARAMETER_CACHE /var/tmp/filecoin-proof-parameters
|
||||
ENV LOTUS_PATH /var/lib/lotus
|
||||
ENV DOCKER_LOTUS_IMPORT_SNAPSHOT https://fil-chain-snapshots-fallback.s3.amazonaws.com/mainnet/minimal_finality_stateroots_latest.car
|
||||
ENV DOCKER_LOTUS_IMPORT_WALLET ""
|
||||
|
||||
RUN mkdir /var/lib/lotus /var/tmp/filecoin-proof-parameters
|
||||
RUN chown fc: /var/lib/lotus /var/tmp/filecoin-proof-parameters
|
||||
|
||||
VOLUME /var/lib/lotus
|
||||
VOLUME /var/tmp/filecoin-proof-parameters
|
||||
|
||||
USER fc
|
||||
|
||||
EXPOSE 1234
|
||||
|
||||
ENTRYPOINT ["/docker-lotus-entrypoint.sh"]
|
||||
|
||||
CMD ["-help"]
|
||||
|
||||
###
|
||||
FROM base AS lotus-wallet
|
||||
MAINTAINER Lotus Development Team
|
||||
|
||||
COPY --from=builder /opt/filecoin/lotus-wallet /usr/local/bin/
|
||||
|
||||
ENV WALLET_PATH /var/lib/lotus-wallet
|
||||
|
||||
RUN mkdir /var/lib/lotus-wallet
|
||||
RUN chown fc: /var/lib/lotus-wallet
|
||||
|
||||
VOLUME /var/lib/lotus-wallet
|
||||
|
||||
USER fc
|
||||
|
||||
EXPOSE 1777
|
||||
|
||||
ENTRYPOINT ["/usr/local/bin/lotus-wallet"]
|
||||
|
||||
CMD ["-help"]
|
||||
|
||||
###
|
||||
FROM base AS lotus-gateway
|
||||
MAINTAINER Lotus Development Team
|
||||
|
||||
COPY --from=builder /opt/filecoin/lotus-gateway /usr/local/bin/
|
||||
|
||||
USER fc
|
||||
|
||||
EXPOSE 1234
|
||||
|
||||
ENTRYPOINT ["/usr/local/bin/lotus-gateway"]
|
||||
|
||||
CMD ["-help"]
|
||||
|
||||
|
||||
###
|
||||
FROM base AS lotus-miner
|
||||
MAINTAINER Lotus Development Team
|
||||
|
||||
COPY --from=builder /opt/filecoin/lotus-miner /usr/local/bin/
|
||||
COPY scripts/docker-lotus-miner-entrypoint.sh /
|
||||
|
||||
ENV FILECOIN_PARAMETER_CACHE /var/tmp/filecoin-proof-parameters
|
||||
ENV LOTUS_MINER_PATH /var/lib/lotus-miner
|
||||
|
||||
RUN mkdir /var/lib/lotus-miner /var/tmp/filecoin-proof-parameters
|
||||
RUN chown fc: /var/lib/lotus-miner /var/tmp/filecoin-proof-parameters
|
||||
|
||||
VOLUME /var/lib/lotus-miner
|
||||
VOLUME /var/tmp/filecoin-proof-parameters
|
||||
|
||||
USER fc
|
||||
|
||||
EXPOSE 2345
|
||||
|
||||
ENTRYPOINT ["/docker-lotus-miner-entrypoint.sh"]
|
||||
|
||||
CMD ["-help"]
|
||||
|
||||
|
||||
###
|
||||
FROM base AS lotus-worker
|
||||
MAINTAINER Lotus Development Team
|
||||
|
||||
COPY --from=builder /opt/filecoin/lotus-worker /usr/local/bin/
|
||||
|
||||
ENV FILECOIN_PARAMETER_CACHE /var/tmp/filecoin-proof-parameters
|
||||
ENV LOTUS_WORKER_PATH /var/lib/lotus-worker
|
||||
|
||||
RUN mkdir /var/lib/lotus-worker
|
||||
RUN chown fc: /var/lib/lotus-worker
|
||||
|
||||
VOLUME /var/lib/lotus-worker
|
||||
|
||||
USER fc
|
||||
|
||||
EXPOSE 3456
|
||||
|
||||
ENTRYPOINT ["/usr/local/bin/lotus-worker"]
|
||||
|
||||
CMD ["-help"]
|
||||
|
||||
|
||||
###
|
||||
from base as lotus-all-in-one
|
||||
|
||||
ENV FILECOIN_PARAMETER_CACHE /var/tmp/filecoin-proof-parameters
|
||||
ENV LOTUS_MINER_PATH /var/lib/lotus-miner
|
||||
ENV LOTUS_PATH /var/lib/lotus
|
||||
ENV LOTUS_WORKER_PATH /var/lib/lotus-worker
|
||||
ENV WALLET_PATH /var/lib/lotus-wallet
|
||||
ENV DOCKER_LOTUS_IMPORT_SNAPSHOT https://fil-chain-snapshots-fallback.s3.amazonaws.com/mainnet/minimal_finality_stateroots_latest.car
|
||||
|
||||
COPY --from=builder /opt/filecoin/lotus /usr/local/bin/
|
||||
COPY --from=builder /opt/filecoin/lotus-shed /usr/local/bin/
|
||||
COPY --from=builder /opt/filecoin/lotus-wallet /usr/local/bin/
|
||||
COPY --from=builder /opt/filecoin/lotus-gateway /usr/local/bin/
|
||||
COPY --from=builder /opt/filecoin/lotus-miner /usr/local/bin/
|
||||
COPY --from=builder /opt/filecoin/lotus-worker /usr/local/bin/
|
||||
COPY --from=builder /opt/filecoin/lotus-stats /usr/local/bin/
|
||||
|
||||
RUN mkdir /var/tmp/filecoin-proof-parameters
|
||||
RUN mkdir /var/lib/lotus
|
||||
RUN mkdir /var/lib/lotus-miner
|
||||
RUN mkdir /var/lib/lotus-worker
|
||||
RUN mkdir /var/lib/lotus-wallet
|
||||
RUN chown fc: /var/tmp/filecoin-proof-parameters
|
||||
RUN chown fc: /var/lib/lotus
|
||||
RUN chown fc: /var/lib/lotus-miner
|
||||
RUN chown fc: /var/lib/lotus-worker
|
||||
RUN chown fc: /var/lib/lotus-wallet
|
||||
|
||||
|
||||
VOLUME /var/tmp/filecoin-proof-parameters
|
||||
VOLUME /var/lib/lotus
|
||||
VOLUME /var/lib/lotus-miner
|
||||
VOLUME /var/lib/lotus-worker
|
||||
VOLUME /var/lib/lotus-wallet
|
||||
|
||||
EXPOSE 1234
|
||||
EXPOSE 2345
|
||||
EXPOSE 3456
|
||||
EXPOSE 1777
|
||||
|
||||
###
|
||||
from base as lotus-test
|
||||
|
||||
ENV FILECOIN_PARAMETER_CACHE /var/tmp/filecoin-proof-parameters
|
||||
ENV LOTUS_MINER_PATH /var/lib/lotus-miner
|
||||
ENV LOTUS_PATH /var/lib/lotus
|
||||
ENV LOTUS_WORKER_PATH /var/lib/lotus-worker
|
||||
ENV WALLET_PATH /var/lib/lotus-wallet
|
||||
|
||||
COPY --from=builder-test /opt/filecoin/lotus /usr/local/bin/
|
||||
COPY --from=builder-test /opt/filecoin/lotus-miner /usr/local/bin/
|
||||
COPY --from=builder-test /opt/filecoin/lotus-worker /usr/local/bin/
|
||||
COPY --from=builder-test /opt/filecoin/lotus-seed /usr/local/bin/
|
||||
|
||||
RUN mkdir /var/tmp/filecoin-proof-parameters
|
||||
RUN mkdir /var/lib/lotus
|
||||
RUN mkdir /var/lib/lotus-miner
|
||||
RUN mkdir /var/lib/lotus-worker
|
||||
RUN mkdir /var/lib/lotus-wallet
|
||||
RUN chown fc: /var/tmp/filecoin-proof-parameters
|
||||
RUN chown fc: /var/lib/lotus
|
||||
RUN chown fc: /var/lib/lotus-miner
|
||||
RUN chown fc: /var/lib/lotus-worker
|
||||
RUN chown fc: /var/lib/lotus-wallet
|
||||
|
||||
|
||||
VOLUME /var/tmp/filecoin-proof-parameters
|
||||
VOLUME /var/lib/lotus
|
||||
VOLUME /var/lib/lotus-miner
|
||||
VOLUME /var/lib/lotus-worker
|
||||
VOLUME /var/lib/lotus-wallet
|
||||
|
||||
EXPOSE 1234
|
||||
EXPOSE 2345
|
||||
EXPOSE 3456
|
||||
EXPOSE 1777
|
||||
|
||||
@@ -355,7 +355,7 @@ fiximports:
|
||||
./scripts/fiximports
|
||||
|
||||
gen: actors-code-gen type-gen cfgdoc-gen docsgen api-gen circleci fiximports
|
||||
@echo ">>> IF YOU'VE MODIFIED THE CLI OR CONFIG, REMEMBER TO ALSO MAKE docsgen-cli"
|
||||
@echo ">>> IF YOU'VE MODIFIED THE CLI OR CONFIG, REMEMBER TO ALSO RUN 'make docsgen-cli'"
|
||||
.PHONY: gen
|
||||
|
||||
jen: gen
|
||||
|
||||
+14
-11
@@ -7,8 +7,8 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
blocks "github.com/ipfs/go-block-format"
|
||||
"github.com/ipfs/go-cid"
|
||||
blocks "github.com/ipfs/go-libipfs/blocks"
|
||||
"github.com/libp2p/go-libp2p/core/peer"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
@@ -297,8 +297,10 @@ type FullNode interface {
|
||||
MpoolGetNonce(context.Context, address.Address) (uint64, error) //perm:read
|
||||
MpoolSub(context.Context) (<-chan MpoolUpdate, error) //perm:read
|
||||
|
||||
// MpoolClear clears pending messages from the mpool
|
||||
MpoolClear(context.Context, bool) error //perm:write
|
||||
// MpoolClear clears pending messages from the mpool.
|
||||
// If clearLocal is true, ALL messages will be cleared.
|
||||
// If clearLocal is false, local messages will be protected, all others will be cleared.
|
||||
MpoolClear(ctx context.Context, clearLocal bool) error //perm:write
|
||||
|
||||
// MpoolGetConfig returns (a copy of) the current mpool config
|
||||
MpoolGetConfig(context.Context) (*types.MpoolConfig, error) //perm:read
|
||||
@@ -810,6 +812,7 @@ type FullNode interface {
|
||||
EthGetStorageAt(ctx context.Context, address ethtypes.EthAddress, position ethtypes.EthBytes, blkParam string) (ethtypes.EthBytes, error) //perm:read
|
||||
EthGetBalance(ctx context.Context, address ethtypes.EthAddress, blkParam string) (ethtypes.EthBigInt, error) //perm:read
|
||||
EthChainId(ctx context.Context) (ethtypes.EthUint64, error) //perm:read
|
||||
EthSyncing(ctx context.Context) (ethtypes.EthSyncingResult, error) //perm:read
|
||||
NetVersion(ctx context.Context) (string, error) //perm:read
|
||||
NetListening(ctx context.Context) (bool, error) //perm:read
|
||||
EthProtocolVersion(ctx context.Context) (ethtypes.EthUint64, error) //perm:read
|
||||
@@ -827,23 +830,23 @@ type FullNode interface {
|
||||
|
||||
// Polling method for a filter, returns event logs which occurred since last poll.
|
||||
// (requires write perm since timestamp of last filter execution will be written)
|
||||
EthGetFilterChanges(ctx context.Context, id ethtypes.EthFilterID) (*ethtypes.EthFilterResult, error) //perm:write
|
||||
EthGetFilterChanges(ctx context.Context, id ethtypes.EthFilterID) (*ethtypes.EthFilterResult, error) //perm:read
|
||||
|
||||
// Returns event logs matching filter with given id.
|
||||
// (requires write perm since timestamp of last filter execution will be written)
|
||||
EthGetFilterLogs(ctx context.Context, id ethtypes.EthFilterID) (*ethtypes.EthFilterResult, error) //perm:write
|
||||
EthGetFilterLogs(ctx context.Context, id ethtypes.EthFilterID) (*ethtypes.EthFilterResult, error) //perm:read
|
||||
|
||||
// Installs a persistent filter based on given filter spec.
|
||||
EthNewFilter(ctx context.Context, filter *ethtypes.EthFilterSpec) (ethtypes.EthFilterID, error) //perm:write
|
||||
EthNewFilter(ctx context.Context, filter *ethtypes.EthFilterSpec) (ethtypes.EthFilterID, error) //perm:read
|
||||
|
||||
// Installs a persistent filter to notify when a new block arrives.
|
||||
EthNewBlockFilter(ctx context.Context) (ethtypes.EthFilterID, error) //perm:write
|
||||
EthNewBlockFilter(ctx context.Context) (ethtypes.EthFilterID, error) //perm:read
|
||||
|
||||
// Installs a persistent filter to notify when new messages arrive in the message pool.
|
||||
EthNewPendingTransactionFilter(ctx context.Context) (ethtypes.EthFilterID, error) //perm:write
|
||||
EthNewPendingTransactionFilter(ctx context.Context) (ethtypes.EthFilterID, error) //perm:read
|
||||
|
||||
// Uninstalls a filter with given id.
|
||||
EthUninstallFilter(ctx context.Context, id ethtypes.EthFilterID) (bool, error) //perm:write
|
||||
EthUninstallFilter(ctx context.Context, id ethtypes.EthFilterID) (bool, error) //perm:read
|
||||
|
||||
// Subscribe to different event types using websockets
|
||||
// eventTypes is one or more of:
|
||||
@@ -852,10 +855,10 @@ type FullNode interface {
|
||||
// - logs: notify new event logs that match a criteria
|
||||
// params contains additional parameters used with the log event type
|
||||
// The client will receive a stream of EthSubscriptionResponse values until EthUnsubscribe is called.
|
||||
EthSubscribe(ctx context.Context, params jsonrpc.RawParams) (ethtypes.EthSubscriptionID, error) //perm:write
|
||||
EthSubscribe(ctx context.Context, params jsonrpc.RawParams) (ethtypes.EthSubscriptionID, error) //perm:read
|
||||
|
||||
// Unsubscribe from a websocket subscription
|
||||
EthUnsubscribe(ctx context.Context, id ethtypes.EthSubscriptionID) (bool, error) //perm:write
|
||||
EthUnsubscribe(ctx context.Context, id ethtypes.EthSubscriptionID) (bool, error) //perm:read
|
||||
|
||||
// Returns the client version
|
||||
Web3ClientVersion(ctx context.Context) (string, error) //perm:read
|
||||
|
||||
+8
-1
@@ -3,8 +3,8 @@ package api
|
||||
import (
|
||||
"context"
|
||||
|
||||
blocks "github.com/ipfs/go-block-format"
|
||||
"github.com/ipfs/go-cid"
|
||||
blocks "github.com/ipfs/go-libipfs/blocks"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-jsonrpc"
|
||||
@@ -33,6 +33,12 @@ import (
|
||||
// * Generate openrpc blobs
|
||||
|
||||
type Gateway interface {
|
||||
MpoolPending(context.Context, types.TipSetKey) ([]*types.SignedMessage, error)
|
||||
ChainGetBlock(context.Context, cid.Cid) (*types.BlockHeader, error)
|
||||
MinerGetBaseInfo(context.Context, address.Address, abi.ChainEpoch, types.TipSetKey) (*MiningBaseInfo, error)
|
||||
StateMinerSectorCount(context.Context, address.Address, types.TipSetKey) (MinerSectors, error)
|
||||
GasEstimateGasPremium(context.Context, uint64, address.Address, int64, types.TipSetKey) (types.BigInt, error)
|
||||
StateReplay(context.Context, types.TipSetKey, cid.Cid) (*InvocResult, error)
|
||||
ChainHasObj(context.Context, cid.Cid) (bool, error)
|
||||
ChainPutObj(context.Context, blocks.Block) error
|
||||
ChainHead(ctx context.Context) (*types.TipSet, error)
|
||||
@@ -95,6 +101,7 @@ type Gateway interface {
|
||||
EthGetStorageAt(ctx context.Context, address ethtypes.EthAddress, position ethtypes.EthBytes, blkParam string) (ethtypes.EthBytes, error)
|
||||
EthGetBalance(ctx context.Context, address ethtypes.EthAddress, blkParam string) (ethtypes.EthBigInt, error)
|
||||
EthChainId(ctx context.Context) (ethtypes.EthUint64, error)
|
||||
EthSyncing(ctx context.Context) (ethtypes.EthSyncingResult, error)
|
||||
NetVersion(ctx context.Context) (string, error)
|
||||
NetListening(ctx context.Context) (bool, error)
|
||||
EthProtocolVersion(ctx context.Context) (ethtypes.EthUint64, error)
|
||||
|
||||
+1
-1
@@ -73,5 +73,5 @@ type CommonNet interface {
|
||||
|
||||
type NatInfo struct {
|
||||
Reachability network.Reachability
|
||||
PublicAddr string
|
||||
PublicAddrs []string
|
||||
}
|
||||
|
||||
@@ -129,6 +129,8 @@ type StorageMiner interface {
|
||||
SectorMatchPendingPiecesToOpenSectors(ctx context.Context) error //perm:admin
|
||||
// SectorAbortUpgrade can be called on sectors that are in the process of being upgraded to abort it
|
||||
SectorAbortUpgrade(context.Context, abi.SectorNumber) error //perm:admin
|
||||
// SectorUnseal unseals the provided sector
|
||||
SectorUnseal(ctx context.Context, number abi.SectorNumber) error //perm:admin
|
||||
|
||||
// SectorNumAssignerMeta returns sector number assigner metadata - reserved/allocated
|
||||
SectorNumAssignerMeta(ctx context.Context) (NumAssignerMeta, error) //perm:read
|
||||
|
||||
@@ -14,9 +14,9 @@ import (
|
||||
"unicode"
|
||||
|
||||
"github.com/google/uuid"
|
||||
blocks "github.com/ipfs/go-block-format"
|
||||
"github.com/ipfs/go-cid"
|
||||
"github.com/ipfs/go-graphsync"
|
||||
blocks "github.com/ipfs/go-libipfs/blocks"
|
||||
textselector "github.com/ipld/go-ipld-selector-text-lite"
|
||||
pubsub "github.com/libp2p/go-libp2p-pubsub"
|
||||
"github.com/libp2p/go-libp2p/core/metrics"
|
||||
@@ -86,6 +86,7 @@ func init() {
|
||||
}
|
||||
|
||||
ExampleValues[reflect.TypeOf(addr)] = addr
|
||||
ExampleValues[reflect.TypeOf(&addr)] = &addr
|
||||
|
||||
pid, err := peer.Decode("12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf")
|
||||
if err != nil {
|
||||
|
||||
@@ -21,6 +21,7 @@ func CreateEthRPCAliases(as apitypes.Aliaser) {
|
||||
as.AliasMethod("eth_getStorageAt", "Filecoin.EthGetStorageAt")
|
||||
as.AliasMethod("eth_getBalance", "Filecoin.EthGetBalance")
|
||||
as.AliasMethod("eth_chainId", "Filecoin.EthChainId")
|
||||
as.AliasMethod("eth_syncing", "Filecoin.EthSyncing")
|
||||
as.AliasMethod("eth_feeHistory", "Filecoin.EthFeeHistory")
|
||||
as.AliasMethod("eth_protocolVersion", "Filecoin.EthProtocolVersion")
|
||||
as.AliasMethod("eth_maxPriorityFeePerGas", "Filecoin.EthMaxPriorityFeePerGas")
|
||||
|
||||
+16
-1
@@ -12,8 +12,8 @@ import (
|
||||
|
||||
gomock "github.com/golang/mock/gomock"
|
||||
uuid "github.com/google/uuid"
|
||||
blocks "github.com/ipfs/go-block-format"
|
||||
cid "github.com/ipfs/go-cid"
|
||||
blocks "github.com/ipfs/go-libipfs/blocks"
|
||||
metrics "github.com/libp2p/go-libp2p/core/metrics"
|
||||
network0 "github.com/libp2p/go-libp2p/core/network"
|
||||
peer "github.com/libp2p/go-libp2p/core/peer"
|
||||
@@ -1476,6 +1476,21 @@ func (mr *MockFullNodeMockRecorder) EthSubscribe(arg0, arg1 interface{}) *gomock
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EthSubscribe", reflect.TypeOf((*MockFullNode)(nil).EthSubscribe), arg0, arg1)
|
||||
}
|
||||
|
||||
// EthSyncing mocks base method.
|
||||
func (m *MockFullNode) EthSyncing(arg0 context.Context) (ethtypes.EthSyncingResult, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "EthSyncing", arg0)
|
||||
ret0, _ := ret[0].(ethtypes.EthSyncingResult)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// EthSyncing indicates an expected call of EthSyncing.
|
||||
func (mr *MockFullNodeMockRecorder) EthSyncing(arg0 interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EthSyncing", reflect.TypeOf((*MockFullNode)(nil).EthSyncing), arg0)
|
||||
}
|
||||
|
||||
// EthUninstallFilter mocks base method.
|
||||
func (m *MockFullNode) EthUninstallFilter(arg0 context.Context, arg1 ethtypes.EthFilterID) (bool, error) {
|
||||
m.ctrl.T.Helper()
|
||||
|
||||
+126
-9
@@ -8,8 +8,8 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
blocks "github.com/ipfs/go-block-format"
|
||||
"github.com/ipfs/go-cid"
|
||||
blocks "github.com/ipfs/go-libipfs/blocks"
|
||||
"github.com/libp2p/go-libp2p/core/metrics"
|
||||
"github.com/libp2p/go-libp2p/core/network"
|
||||
"github.com/libp2p/go-libp2p/core/peer"
|
||||
@@ -274,9 +274,9 @@ type FullNodeMethods struct {
|
||||
|
||||
EthGetCode func(p0 context.Context, p1 ethtypes.EthAddress, p2 string) (ethtypes.EthBytes, error) `perm:"read"`
|
||||
|
||||
EthGetFilterChanges func(p0 context.Context, p1 ethtypes.EthFilterID) (*ethtypes.EthFilterResult, error) `perm:"write"`
|
||||
EthGetFilterChanges func(p0 context.Context, p1 ethtypes.EthFilterID) (*ethtypes.EthFilterResult, error) `perm:"read"`
|
||||
|
||||
EthGetFilterLogs func(p0 context.Context, p1 ethtypes.EthFilterID) (*ethtypes.EthFilterResult, error) `perm:"write"`
|
||||
EthGetFilterLogs func(p0 context.Context, p1 ethtypes.EthFilterID) (*ethtypes.EthFilterResult, error) `perm:"read"`
|
||||
|
||||
EthGetLogs func(p0 context.Context, p1 *ethtypes.EthFilterSpec) (*ethtypes.EthFilterResult, error) `perm:"read"`
|
||||
|
||||
@@ -302,21 +302,23 @@ type FullNodeMethods struct {
|
||||
|
||||
EthMaxPriorityFeePerGas func(p0 context.Context) (ethtypes.EthBigInt, error) `perm:"read"`
|
||||
|
||||
EthNewBlockFilter func(p0 context.Context) (ethtypes.EthFilterID, error) `perm:"write"`
|
||||
EthNewBlockFilter func(p0 context.Context) (ethtypes.EthFilterID, error) `perm:"read"`
|
||||
|
||||
EthNewFilter func(p0 context.Context, p1 *ethtypes.EthFilterSpec) (ethtypes.EthFilterID, error) `perm:"write"`
|
||||
EthNewFilter func(p0 context.Context, p1 *ethtypes.EthFilterSpec) (ethtypes.EthFilterID, error) `perm:"read"`
|
||||
|
||||
EthNewPendingTransactionFilter func(p0 context.Context) (ethtypes.EthFilterID, error) `perm:"write"`
|
||||
EthNewPendingTransactionFilter func(p0 context.Context) (ethtypes.EthFilterID, error) `perm:"read"`
|
||||
|
||||
EthProtocolVersion func(p0 context.Context) (ethtypes.EthUint64, error) `perm:"read"`
|
||||
|
||||
EthSendRawTransaction func(p0 context.Context, p1 ethtypes.EthBytes) (ethtypes.EthHash, error) `perm:"read"`
|
||||
|
||||
EthSubscribe func(p0 context.Context, p1 jsonrpc.RawParams) (ethtypes.EthSubscriptionID, error) `perm:"write"`
|
||||
EthSubscribe func(p0 context.Context, p1 jsonrpc.RawParams) (ethtypes.EthSubscriptionID, error) `perm:"read"`
|
||||
|
||||
EthUninstallFilter func(p0 context.Context, p1 ethtypes.EthFilterID) (bool, error) `perm:"write"`
|
||||
EthSyncing func(p0 context.Context) (ethtypes.EthSyncingResult, error) `perm:"read"`
|
||||
|
||||
EthUnsubscribe func(p0 context.Context, p1 ethtypes.EthSubscriptionID) (bool, error) `perm:"write"`
|
||||
EthUninstallFilter func(p0 context.Context, p1 ethtypes.EthFilterID) (bool, error) `perm:"read"`
|
||||
|
||||
EthUnsubscribe func(p0 context.Context, p1 ethtypes.EthSubscriptionID) (bool, error) `perm:"read"`
|
||||
|
||||
FilecoinAddressToEthAddress func(p0 context.Context, p1 address.Address) (ethtypes.EthAddress, error) `perm:"read"`
|
||||
|
||||
@@ -630,6 +632,8 @@ type GatewayStruct struct {
|
||||
}
|
||||
|
||||
type GatewayMethods struct {
|
||||
ChainGetBlock func(p0 context.Context, p1 cid.Cid) (*types.BlockHeader, error) ``
|
||||
|
||||
ChainGetBlockMessages func(p0 context.Context, p1 cid.Cid) (*BlockMessages, error) ``
|
||||
|
||||
ChainGetGenesis func(p0 context.Context) (*types.TipSet, error) ``
|
||||
@@ -722,14 +726,22 @@ type GatewayMethods struct {
|
||||
|
||||
EthSubscribe func(p0 context.Context, p1 jsonrpc.RawParams) (ethtypes.EthSubscriptionID, error) ``
|
||||
|
||||
EthSyncing func(p0 context.Context) (ethtypes.EthSyncingResult, error) ``
|
||||
|
||||
EthUninstallFilter func(p0 context.Context, p1 ethtypes.EthFilterID) (bool, error) ``
|
||||
|
||||
EthUnsubscribe func(p0 context.Context, p1 ethtypes.EthSubscriptionID) (bool, error) ``
|
||||
|
||||
GasEstimateGasPremium func(p0 context.Context, p1 uint64, p2 address.Address, p3 int64, p4 types.TipSetKey) (types.BigInt, error) ``
|
||||
|
||||
GasEstimateMessageGas func(p0 context.Context, p1 *types.Message, p2 *MessageSendSpec, p3 types.TipSetKey) (*types.Message, error) ``
|
||||
|
||||
MinerGetBaseInfo func(p0 context.Context, p1 address.Address, p2 abi.ChainEpoch, p3 types.TipSetKey) (*MiningBaseInfo, error) ``
|
||||
|
||||
MpoolGetNonce func(p0 context.Context, p1 address.Address) (uint64, error) ``
|
||||
|
||||
MpoolPending func(p0 context.Context, p1 types.TipSetKey) ([]*types.SignedMessage, error) ``
|
||||
|
||||
MpoolPush func(p0 context.Context, p1 *types.SignedMessage) (cid.Cid, error) ``
|
||||
|
||||
MsigGetAvailableBalance func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (types.BigInt, error) ``
|
||||
@@ -768,12 +780,16 @@ type GatewayMethods struct {
|
||||
|
||||
StateMinerProvingDeadline func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*dline.Info, error) ``
|
||||
|
||||
StateMinerSectorCount func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (MinerSectors, error) ``
|
||||
|
||||
StateNetworkName func(p0 context.Context) (dtypes.NetworkName, error) ``
|
||||
|
||||
StateNetworkVersion func(p0 context.Context, p1 types.TipSetKey) (apitypes.NetworkVersion, error) ``
|
||||
|
||||
StateReadState func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*ActorState, error) ``
|
||||
|
||||
StateReplay func(p0 context.Context, p1 types.TipSetKey, p2 cid.Cid) (*InvocResult, error) ``
|
||||
|
||||
StateSearchMsg func(p0 context.Context, p1 types.TipSetKey, p2 cid.Cid, p3 abi.ChainEpoch, p4 bool) (*MsgLookup, error) ``
|
||||
|
||||
StateSectorGetInfo func(p0 context.Context, p1 address.Address, p2 abi.SectorNumber, p3 types.TipSetKey) (*miner.SectorOnChainInfo, error) ``
|
||||
@@ -1079,6 +1095,8 @@ type StorageMinerMethods struct {
|
||||
|
||||
SectorTerminatePending func(p0 context.Context) ([]abi.SectorID, error) `perm:"admin"`
|
||||
|
||||
SectorUnseal func(p0 context.Context, p1 abi.SectorNumber) error `perm:"admin"`
|
||||
|
||||
SectorsList func(p0 context.Context) ([]abi.SectorNumber, error) `perm:"read"`
|
||||
|
||||
SectorsListInStates func(p0 context.Context, p1 []SectorState) ([]abi.SectorNumber, error) `perm:"read"`
|
||||
@@ -2414,6 +2432,17 @@ func (s *FullNodeStub) EthSubscribe(p0 context.Context, p1 jsonrpc.RawParams) (e
|
||||
return *new(ethtypes.EthSubscriptionID), ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *FullNodeStruct) EthSyncing(p0 context.Context) (ethtypes.EthSyncingResult, error) {
|
||||
if s.Internal.EthSyncing == nil {
|
||||
return *new(ethtypes.EthSyncingResult), ErrNotSupported
|
||||
}
|
||||
return s.Internal.EthSyncing(p0)
|
||||
}
|
||||
|
||||
func (s *FullNodeStub) EthSyncing(p0 context.Context) (ethtypes.EthSyncingResult, error) {
|
||||
return *new(ethtypes.EthSyncingResult), ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *FullNodeStruct) EthUninstallFilter(p0 context.Context, p1 ethtypes.EthFilterID) (bool, error) {
|
||||
if s.Internal.EthUninstallFilter == nil {
|
||||
return false, ErrNotSupported
|
||||
@@ -4086,6 +4115,17 @@ func (s *FullNodeStub) Web3ClientVersion(p0 context.Context) (string, error) {
|
||||
return "", ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *GatewayStruct) ChainGetBlock(p0 context.Context, p1 cid.Cid) (*types.BlockHeader, error) {
|
||||
if s.Internal.ChainGetBlock == nil {
|
||||
return nil, ErrNotSupported
|
||||
}
|
||||
return s.Internal.ChainGetBlock(p0, p1)
|
||||
}
|
||||
|
||||
func (s *GatewayStub) ChainGetBlock(p0 context.Context, p1 cid.Cid) (*types.BlockHeader, error) {
|
||||
return nil, ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *GatewayStruct) ChainGetBlockMessages(p0 context.Context, p1 cid.Cid) (*BlockMessages, error) {
|
||||
if s.Internal.ChainGetBlockMessages == nil {
|
||||
return nil, ErrNotSupported
|
||||
@@ -4592,6 +4632,17 @@ func (s *GatewayStub) EthSubscribe(p0 context.Context, p1 jsonrpc.RawParams) (et
|
||||
return *new(ethtypes.EthSubscriptionID), ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *GatewayStruct) EthSyncing(p0 context.Context) (ethtypes.EthSyncingResult, error) {
|
||||
if s.Internal.EthSyncing == nil {
|
||||
return *new(ethtypes.EthSyncingResult), ErrNotSupported
|
||||
}
|
||||
return s.Internal.EthSyncing(p0)
|
||||
}
|
||||
|
||||
func (s *GatewayStub) EthSyncing(p0 context.Context) (ethtypes.EthSyncingResult, error) {
|
||||
return *new(ethtypes.EthSyncingResult), ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *GatewayStruct) EthUninstallFilter(p0 context.Context, p1 ethtypes.EthFilterID) (bool, error) {
|
||||
if s.Internal.EthUninstallFilter == nil {
|
||||
return false, ErrNotSupported
|
||||
@@ -4614,6 +4665,17 @@ func (s *GatewayStub) EthUnsubscribe(p0 context.Context, p1 ethtypes.EthSubscrip
|
||||
return false, ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *GatewayStruct) GasEstimateGasPremium(p0 context.Context, p1 uint64, p2 address.Address, p3 int64, p4 types.TipSetKey) (types.BigInt, error) {
|
||||
if s.Internal.GasEstimateGasPremium == nil {
|
||||
return *new(types.BigInt), ErrNotSupported
|
||||
}
|
||||
return s.Internal.GasEstimateGasPremium(p0, p1, p2, p3, p4)
|
||||
}
|
||||
|
||||
func (s *GatewayStub) GasEstimateGasPremium(p0 context.Context, p1 uint64, p2 address.Address, p3 int64, p4 types.TipSetKey) (types.BigInt, error) {
|
||||
return *new(types.BigInt), ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *GatewayStruct) GasEstimateMessageGas(p0 context.Context, p1 *types.Message, p2 *MessageSendSpec, p3 types.TipSetKey) (*types.Message, error) {
|
||||
if s.Internal.GasEstimateMessageGas == nil {
|
||||
return nil, ErrNotSupported
|
||||
@@ -4625,6 +4687,17 @@ func (s *GatewayStub) GasEstimateMessageGas(p0 context.Context, p1 *types.Messag
|
||||
return nil, ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *GatewayStruct) MinerGetBaseInfo(p0 context.Context, p1 address.Address, p2 abi.ChainEpoch, p3 types.TipSetKey) (*MiningBaseInfo, error) {
|
||||
if s.Internal.MinerGetBaseInfo == nil {
|
||||
return nil, ErrNotSupported
|
||||
}
|
||||
return s.Internal.MinerGetBaseInfo(p0, p1, p2, p3)
|
||||
}
|
||||
|
||||
func (s *GatewayStub) MinerGetBaseInfo(p0 context.Context, p1 address.Address, p2 abi.ChainEpoch, p3 types.TipSetKey) (*MiningBaseInfo, error) {
|
||||
return nil, ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *GatewayStruct) MpoolGetNonce(p0 context.Context, p1 address.Address) (uint64, error) {
|
||||
if s.Internal.MpoolGetNonce == nil {
|
||||
return 0, ErrNotSupported
|
||||
@@ -4636,6 +4709,17 @@ func (s *GatewayStub) MpoolGetNonce(p0 context.Context, p1 address.Address) (uin
|
||||
return 0, ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *GatewayStruct) MpoolPending(p0 context.Context, p1 types.TipSetKey) ([]*types.SignedMessage, error) {
|
||||
if s.Internal.MpoolPending == nil {
|
||||
return *new([]*types.SignedMessage), ErrNotSupported
|
||||
}
|
||||
return s.Internal.MpoolPending(p0, p1)
|
||||
}
|
||||
|
||||
func (s *GatewayStub) MpoolPending(p0 context.Context, p1 types.TipSetKey) ([]*types.SignedMessage, error) {
|
||||
return *new([]*types.SignedMessage), ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *GatewayStruct) MpoolPush(p0 context.Context, p1 *types.SignedMessage) (cid.Cid, error) {
|
||||
if s.Internal.MpoolPush == nil {
|
||||
return *new(cid.Cid), ErrNotSupported
|
||||
@@ -4845,6 +4929,17 @@ func (s *GatewayStub) StateMinerProvingDeadline(p0 context.Context, p1 address.A
|
||||
return nil, ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *GatewayStruct) StateMinerSectorCount(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (MinerSectors, error) {
|
||||
if s.Internal.StateMinerSectorCount == nil {
|
||||
return *new(MinerSectors), ErrNotSupported
|
||||
}
|
||||
return s.Internal.StateMinerSectorCount(p0, p1, p2)
|
||||
}
|
||||
|
||||
func (s *GatewayStub) StateMinerSectorCount(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (MinerSectors, error) {
|
||||
return *new(MinerSectors), ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *GatewayStruct) StateNetworkName(p0 context.Context) (dtypes.NetworkName, error) {
|
||||
if s.Internal.StateNetworkName == nil {
|
||||
return *new(dtypes.NetworkName), ErrNotSupported
|
||||
@@ -4878,6 +4973,17 @@ func (s *GatewayStub) StateReadState(p0 context.Context, p1 address.Address, p2
|
||||
return nil, ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *GatewayStruct) StateReplay(p0 context.Context, p1 types.TipSetKey, p2 cid.Cid) (*InvocResult, error) {
|
||||
if s.Internal.StateReplay == nil {
|
||||
return nil, ErrNotSupported
|
||||
}
|
||||
return s.Internal.StateReplay(p0, p1, p2)
|
||||
}
|
||||
|
||||
func (s *GatewayStub) StateReplay(p0 context.Context, p1 types.TipSetKey, p2 cid.Cid) (*InvocResult, error) {
|
||||
return nil, ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *GatewayStruct) StateSearchMsg(p0 context.Context, p1 types.TipSetKey, p2 cid.Cid, p3 abi.ChainEpoch, p4 bool) (*MsgLookup, error) {
|
||||
if s.Internal.StateSearchMsg == nil {
|
||||
return nil, ErrNotSupported
|
||||
@@ -6385,6 +6491,17 @@ func (s *StorageMinerStub) SectorTerminatePending(p0 context.Context) ([]abi.Sec
|
||||
return *new([]abi.SectorID), ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *StorageMinerStruct) SectorUnseal(p0 context.Context, p1 abi.SectorNumber) error {
|
||||
if s.Internal.SectorUnseal == nil {
|
||||
return ErrNotSupported
|
||||
}
|
||||
return s.Internal.SectorUnseal(p0, p1)
|
||||
}
|
||||
|
||||
func (s *StorageMinerStub) SectorUnseal(p0 context.Context, p1 abi.SectorNumber) error {
|
||||
return ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *StorageMinerStruct) SectorsList(p0 context.Context) ([]abi.SectorNumber, error) {
|
||||
if s.Internal.SectorsList == nil {
|
||||
return *new([]abi.SectorNumber), ErrNotSupported
|
||||
|
||||
+25
-25
@@ -299,6 +299,7 @@ type MinerInfo struct {
|
||||
SectorSize abi.SectorSize
|
||||
WindowPoStPartitionSectors uint64
|
||||
ConsensusFaultElapsed abi.ChainEpoch
|
||||
PendingOwnerAddress *address.Address
|
||||
Beneficiary address.Address
|
||||
BeneficiaryTerm *miner.BeneficiaryTerm
|
||||
PendingBeneficiaryTerm *miner.PendingBeneficiaryChange
|
||||
@@ -314,31 +315,30 @@ type NetworkParams struct {
|
||||
}
|
||||
|
||||
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
|
||||
UpgradeSkyrHeight abi.ChainEpoch
|
||||
UpgradeSharkHeight abi.ChainEpoch
|
||||
UpgradeHyggeHeight abi.ChainEpoch
|
||||
UpgradeLightningHeight abi.ChainEpoch
|
||||
UpgradeThunderHeight abi.ChainEpoch
|
||||
UpgradeSmokeHeight abi.ChainEpoch
|
||||
UpgradeBreezeHeight abi.ChainEpoch
|
||||
UpgradeIgnitionHeight abi.ChainEpoch
|
||||
UpgradeLiftoffHeight abi.ChainEpoch
|
||||
UpgradeAssemblyHeight abi.ChainEpoch
|
||||
UpgradeRefuelHeight abi.ChainEpoch
|
||||
UpgradeTapeHeight abi.ChainEpoch
|
||||
UpgradeKumquatHeight 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
|
||||
UpgradeSkyrHeight abi.ChainEpoch
|
||||
UpgradeSharkHeight abi.ChainEpoch
|
||||
UpgradeHyggeHeight abi.ChainEpoch
|
||||
UpgradeLightningHeight abi.ChainEpoch
|
||||
UpgradeThunderHeight abi.ChainEpoch
|
||||
}
|
||||
|
||||
type NonceMapType map[address.Address]uint64
|
||||
|
||||
+1
-1
@@ -3,8 +3,8 @@ package v0api
|
||||
import (
|
||||
"context"
|
||||
|
||||
blocks "github.com/ipfs/go-block-format"
|
||||
"github.com/ipfs/go-cid"
|
||||
blocks "github.com/ipfs/go-libipfs/blocks"
|
||||
textselector "github.com/ipld/go-ipld-selector-text-lite"
|
||||
"github.com/libp2p/go-libp2p/core/peer"
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@ package v0api
|
||||
import (
|
||||
"context"
|
||||
|
||||
blocks "github.com/ipfs/go-block-format"
|
||||
"github.com/ipfs/go-cid"
|
||||
blocks "github.com/ipfs/go-libipfs/blocks"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
@@ -35,6 +35,12 @@ import (
|
||||
// * Generate openrpc blobs
|
||||
|
||||
type Gateway interface {
|
||||
MpoolPending(context.Context, types.TipSetKey) ([]*types.SignedMessage, error)
|
||||
ChainGetBlock(context.Context, cid.Cid) (*types.BlockHeader, error)
|
||||
MinerGetBaseInfo(context.Context, address.Address, abi.ChainEpoch, types.TipSetKey) (*api.MiningBaseInfo, error)
|
||||
StateMinerSectorCount(context.Context, address.Address, types.TipSetKey) (api.MinerSectors, error)
|
||||
GasEstimateGasPremium(context.Context, uint64, address.Address, int64, types.TipSetKey) (types.BigInt, error)
|
||||
StateReplay(context.Context, types.TipSetKey, cid.Cid) (*api.InvocResult, error)
|
||||
ChainHasObj(context.Context, cid.Cid) (bool, error)
|
||||
ChainPutObj(context.Context, blocks.Block) error
|
||||
ChainHead(ctx context.Context) (*types.TipSet, error)
|
||||
|
||||
+79
-1
@@ -5,8 +5,8 @@ package v0api
|
||||
import (
|
||||
"context"
|
||||
|
||||
blocks "github.com/ipfs/go-block-format"
|
||||
"github.com/ipfs/go-cid"
|
||||
blocks "github.com/ipfs/go-libipfs/blocks"
|
||||
"github.com/libp2p/go-libp2p/core/peer"
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
@@ -431,6 +431,8 @@ type GatewayStruct struct {
|
||||
}
|
||||
|
||||
type GatewayMethods struct {
|
||||
ChainGetBlock func(p0 context.Context, p1 cid.Cid) (*types.BlockHeader, error) ``
|
||||
|
||||
ChainGetBlockMessages func(p0 context.Context, p1 cid.Cid) (*api.BlockMessages, error) ``
|
||||
|
||||
ChainGetMessage func(p0 context.Context, p1 cid.Cid) (*types.Message, error) ``
|
||||
@@ -449,10 +451,16 @@ type GatewayMethods struct {
|
||||
|
||||
ChainReadObj func(p0 context.Context, p1 cid.Cid) ([]byte, error) ``
|
||||
|
||||
GasEstimateGasPremium func(p0 context.Context, p1 uint64, p2 address.Address, p3 int64, p4 types.TipSetKey) (types.BigInt, error) ``
|
||||
|
||||
GasEstimateMessageGas func(p0 context.Context, p1 *types.Message, p2 *api.MessageSendSpec, p3 types.TipSetKey) (*types.Message, error) ``
|
||||
|
||||
MinerGetBaseInfo func(p0 context.Context, p1 address.Address, p2 abi.ChainEpoch, p3 types.TipSetKey) (*api.MiningBaseInfo, error) ``
|
||||
|
||||
MpoolGetNonce func(p0 context.Context, p1 address.Address) (uint64, error) ``
|
||||
|
||||
MpoolPending func(p0 context.Context, p1 types.TipSetKey) ([]*types.SignedMessage, error) ``
|
||||
|
||||
MpoolPush func(p0 context.Context, p1 *types.SignedMessage) (cid.Cid, error) ``
|
||||
|
||||
MsigGetAvailableBalance func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (types.BigInt, error) ``
|
||||
@@ -487,10 +495,14 @@ type GatewayMethods struct {
|
||||
|
||||
StateMinerProvingDeadline func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*dline.Info, error) ``
|
||||
|
||||
StateMinerSectorCount func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (api.MinerSectors, error) ``
|
||||
|
||||
StateNetworkName func(p0 context.Context) (dtypes.NetworkName, error) ``
|
||||
|
||||
StateNetworkVersion func(p0 context.Context, p1 types.TipSetKey) (abinetwork.Version, error) ``
|
||||
|
||||
StateReplay func(p0 context.Context, p1 types.TipSetKey, p2 cid.Cid) (*api.InvocResult, error) ``
|
||||
|
||||
StateSearchMsg func(p0 context.Context, p1 cid.Cid) (*api.MsgLookup, error) ``
|
||||
|
||||
StateSectorGetInfo func(p0 context.Context, p1 address.Address, p2 abi.SectorNumber, p3 types.TipSetKey) (*miner.SectorOnChainInfo, error) ``
|
||||
@@ -2575,6 +2587,17 @@ func (s *FullNodeStub) WalletVerify(p0 context.Context, p1 address.Address, p2 [
|
||||
return false, ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *GatewayStruct) ChainGetBlock(p0 context.Context, p1 cid.Cid) (*types.BlockHeader, error) {
|
||||
if s.Internal.ChainGetBlock == nil {
|
||||
return nil, ErrNotSupported
|
||||
}
|
||||
return s.Internal.ChainGetBlock(p0, p1)
|
||||
}
|
||||
|
||||
func (s *GatewayStub) ChainGetBlock(p0 context.Context, p1 cid.Cid) (*types.BlockHeader, error) {
|
||||
return nil, ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *GatewayStruct) ChainGetBlockMessages(p0 context.Context, p1 cid.Cid) (*api.BlockMessages, error) {
|
||||
if s.Internal.ChainGetBlockMessages == nil {
|
||||
return nil, ErrNotSupported
|
||||
@@ -2674,6 +2697,17 @@ func (s *GatewayStub) ChainReadObj(p0 context.Context, p1 cid.Cid) ([]byte, erro
|
||||
return *new([]byte), ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *GatewayStruct) GasEstimateGasPremium(p0 context.Context, p1 uint64, p2 address.Address, p3 int64, p4 types.TipSetKey) (types.BigInt, error) {
|
||||
if s.Internal.GasEstimateGasPremium == nil {
|
||||
return *new(types.BigInt), ErrNotSupported
|
||||
}
|
||||
return s.Internal.GasEstimateGasPremium(p0, p1, p2, p3, p4)
|
||||
}
|
||||
|
||||
func (s *GatewayStub) GasEstimateGasPremium(p0 context.Context, p1 uint64, p2 address.Address, p3 int64, p4 types.TipSetKey) (types.BigInt, error) {
|
||||
return *new(types.BigInt), ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *GatewayStruct) GasEstimateMessageGas(p0 context.Context, p1 *types.Message, p2 *api.MessageSendSpec, p3 types.TipSetKey) (*types.Message, error) {
|
||||
if s.Internal.GasEstimateMessageGas == nil {
|
||||
return nil, ErrNotSupported
|
||||
@@ -2685,6 +2719,17 @@ func (s *GatewayStub) GasEstimateMessageGas(p0 context.Context, p1 *types.Messag
|
||||
return nil, ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *GatewayStruct) MinerGetBaseInfo(p0 context.Context, p1 address.Address, p2 abi.ChainEpoch, p3 types.TipSetKey) (*api.MiningBaseInfo, error) {
|
||||
if s.Internal.MinerGetBaseInfo == nil {
|
||||
return nil, ErrNotSupported
|
||||
}
|
||||
return s.Internal.MinerGetBaseInfo(p0, p1, p2, p3)
|
||||
}
|
||||
|
||||
func (s *GatewayStub) MinerGetBaseInfo(p0 context.Context, p1 address.Address, p2 abi.ChainEpoch, p3 types.TipSetKey) (*api.MiningBaseInfo, error) {
|
||||
return nil, ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *GatewayStruct) MpoolGetNonce(p0 context.Context, p1 address.Address) (uint64, error) {
|
||||
if s.Internal.MpoolGetNonce == nil {
|
||||
return 0, ErrNotSupported
|
||||
@@ -2696,6 +2741,17 @@ func (s *GatewayStub) MpoolGetNonce(p0 context.Context, p1 address.Address) (uin
|
||||
return 0, ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *GatewayStruct) MpoolPending(p0 context.Context, p1 types.TipSetKey) ([]*types.SignedMessage, error) {
|
||||
if s.Internal.MpoolPending == nil {
|
||||
return *new([]*types.SignedMessage), ErrNotSupported
|
||||
}
|
||||
return s.Internal.MpoolPending(p0, p1)
|
||||
}
|
||||
|
||||
func (s *GatewayStub) MpoolPending(p0 context.Context, p1 types.TipSetKey) ([]*types.SignedMessage, error) {
|
||||
return *new([]*types.SignedMessage), ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *GatewayStruct) MpoolPush(p0 context.Context, p1 *types.SignedMessage) (cid.Cid, error) {
|
||||
if s.Internal.MpoolPush == nil {
|
||||
return *new(cid.Cid), ErrNotSupported
|
||||
@@ -2883,6 +2939,17 @@ func (s *GatewayStub) StateMinerProvingDeadline(p0 context.Context, p1 address.A
|
||||
return nil, ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *GatewayStruct) StateMinerSectorCount(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (api.MinerSectors, error) {
|
||||
if s.Internal.StateMinerSectorCount == nil {
|
||||
return *new(api.MinerSectors), ErrNotSupported
|
||||
}
|
||||
return s.Internal.StateMinerSectorCount(p0, p1, p2)
|
||||
}
|
||||
|
||||
func (s *GatewayStub) StateMinerSectorCount(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (api.MinerSectors, error) {
|
||||
return *new(api.MinerSectors), ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *GatewayStruct) StateNetworkName(p0 context.Context) (dtypes.NetworkName, error) {
|
||||
if s.Internal.StateNetworkName == nil {
|
||||
return *new(dtypes.NetworkName), ErrNotSupported
|
||||
@@ -2905,6 +2972,17 @@ func (s *GatewayStub) StateNetworkVersion(p0 context.Context, p1 types.TipSetKey
|
||||
return *new(abinetwork.Version), ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *GatewayStruct) StateReplay(p0 context.Context, p1 types.TipSetKey, p2 cid.Cid) (*api.InvocResult, error) {
|
||||
if s.Internal.StateReplay == nil {
|
||||
return nil, ErrNotSupported
|
||||
}
|
||||
return s.Internal.StateReplay(p0, p1, p2)
|
||||
}
|
||||
|
||||
func (s *GatewayStub) StateReplay(p0 context.Context, p1 types.TipSetKey, p2 cid.Cid) (*api.InvocResult, error) {
|
||||
return nil, ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *GatewayStruct) StateSearchMsg(p0 context.Context, p1 cid.Cid) (*api.MsgLookup, error) {
|
||||
if s.Internal.StateSearchMsg == nil {
|
||||
return nil, ErrNotSupported
|
||||
|
||||
@@ -11,8 +11,8 @@ import (
|
||||
|
||||
gomock "github.com/golang/mock/gomock"
|
||||
uuid "github.com/google/uuid"
|
||||
blocks "github.com/ipfs/go-block-format"
|
||||
cid "github.com/ipfs/go-cid"
|
||||
blocks "github.com/ipfs/go-libipfs/blocks"
|
||||
metrics "github.com/libp2p/go-libp2p/core/metrics"
|
||||
network0 "github.com/libp2p/go-libp2p/core/network"
|
||||
peer "github.com/libp2p/go-libp2p/core/peer"
|
||||
|
||||
+1
-1
@@ -3,8 +3,8 @@ package blockstore
|
||||
import (
|
||||
"context"
|
||||
|
||||
blocks "github.com/ipfs/go-block-format"
|
||||
"github.com/ipfs/go-cid"
|
||||
blocks "github.com/ipfs/go-libipfs/blocks"
|
||||
"golang.org/x/xerrors"
|
||||
)
|
||||
|
||||
|
||||
@@ -5,9 +5,9 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
block "github.com/ipfs/go-block-format"
|
||||
"github.com/ipfs/go-cid"
|
||||
ipld "github.com/ipfs/go-ipld-format"
|
||||
block "github.com/ipfs/go-libipfs/blocks"
|
||||
"golang.org/x/xerrors"
|
||||
)
|
||||
|
||||
|
||||
@@ -13,9 +13,9 @@ import (
|
||||
"github.com/dgraph-io/badger/v2"
|
||||
"github.com/dgraph-io/badger/v2/options"
|
||||
"github.com/dgraph-io/badger/v2/pb"
|
||||
blocks "github.com/ipfs/go-block-format"
|
||||
"github.com/ipfs/go-cid"
|
||||
ipld "github.com/ipfs/go-ipld-format"
|
||||
blocks "github.com/ipfs/go-libipfs/blocks"
|
||||
logger "github.com/ipfs/go-log/v2"
|
||||
pool "github.com/libp2p/go-buffer-pool"
|
||||
"github.com/multiformats/go-base32"
|
||||
@@ -660,6 +660,60 @@ func (b *Blockstore) Has(ctx context.Context, cid cid.Cid) (bool, error) {
|
||||
}
|
||||
}
|
||||
|
||||
// GetMany implements a GetMany method for the badgerDB blockstore
|
||||
// This method returns empty slices and an error if an error other than ErrKeyNotFound is encountered
|
||||
// For every ErrKeyNotFound, the missing CID is returned but the rest of the results are returned without error
|
||||
func (b *Blockstore) GetMany(ctx context.Context, cids []cid.Cid) ([]blocks.Block, []cid.Cid, error) {
|
||||
if err := b.access(); err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
defer b.viewers.Done()
|
||||
|
||||
b.lockDB()
|
||||
defer b.unlockDB()
|
||||
|
||||
blks := make([]blocks.Block, 0, len(cids))
|
||||
missingCids := make([]cid.Cid, 0, len(cids))
|
||||
err := b.db.View(func(txn *badger.Txn) error {
|
||||
f := func(c cid.Cid) error { // encapsulate in an anonymous function to handle key pool deferral for each key
|
||||
if !c.Defined() {
|
||||
return ipld.ErrNotFound{Cid: c}
|
||||
}
|
||||
k, pooled := b.PooledStorageKey(c)
|
||||
if pooled {
|
||||
defer KeyPool.Put(k)
|
||||
}
|
||||
switch item, err := txn.Get(k); err {
|
||||
case nil:
|
||||
val, err := item.ValueCopy(nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
blk, err := blocks.NewBlockWithCid(val, c)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
blks = append(blks, blk)
|
||||
case badger.ErrKeyNotFound:
|
||||
missingCids = append(missingCids, c)
|
||||
default:
|
||||
return fmt.Errorf("failed to get block from badger blockstore: %w", err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
for _, c := range cids {
|
||||
if err := f(c); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
})
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
return blks, missingCids, nil
|
||||
}
|
||||
|
||||
// Get implements Blockstore.Get.
|
||||
func (b *Blockstore) Get(ctx context.Context, cid cid.Cid) (blocks.Block, error) {
|
||||
if !cid.Defined() {
|
||||
@@ -746,6 +800,20 @@ func (b *Blockstore) Put(ctx context.Context, block blocks.Block) error {
|
||||
}
|
||||
|
||||
put := func(db *badger.DB) error {
|
||||
// Check if we have it before writing it.
|
||||
switch err := db.View(func(txn *badger.Txn) error {
|
||||
_, err := txn.Get(k)
|
||||
return err
|
||||
}); err {
|
||||
case badger.ErrKeyNotFound:
|
||||
case nil:
|
||||
// Already exists, skip the put.
|
||||
return nil
|
||||
default:
|
||||
return err
|
||||
}
|
||||
|
||||
// Then write it.
|
||||
err := db.Update(func(txn *badger.Txn) error {
|
||||
return txn.Set(k, block.RawData())
|
||||
})
|
||||
@@ -801,12 +869,33 @@ func (b *Blockstore) PutMany(ctx context.Context, blocks []blocks.Block) error {
|
||||
keys = append(keys, k)
|
||||
}
|
||||
|
||||
err := b.db.View(func(txn *badger.Txn) error {
|
||||
for i, k := range keys {
|
||||
switch _, err := txn.Get(k); err {
|
||||
case badger.ErrKeyNotFound:
|
||||
case nil:
|
||||
keys[i] = nil
|
||||
default:
|
||||
// Something is actually wrong
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
put := func(db *badger.DB) error {
|
||||
batch := db.NewWriteBatch()
|
||||
defer batch.Cancel()
|
||||
|
||||
for i, block := range blocks {
|
||||
k := keys[i]
|
||||
if k == nil {
|
||||
// skipped because we already have it.
|
||||
continue
|
||||
}
|
||||
if err := batch.Set(k, block.RawData()); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -10,8 +10,8 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
blocks "github.com/ipfs/go-block-format"
|
||||
"github.com/ipfs/go-cid"
|
||||
blocks "github.com/ipfs/go-libipfs/blocks"
|
||||
"github.com/stretchr/testify/require"
|
||||
"golang.org/x/sync/errgroup"
|
||||
|
||||
|
||||
@@ -9,10 +9,10 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
blocks "github.com/ipfs/go-block-format"
|
||||
"github.com/ipfs/go-cid"
|
||||
u "github.com/ipfs/go-ipfs-util"
|
||||
ipld "github.com/ipfs/go-ipld-format"
|
||||
blocks "github.com/ipfs/go-libipfs/blocks"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/filecoin-project/lotus/blockstore"
|
||||
|
||||
@@ -4,9 +4,9 @@ import (
|
||||
"context"
|
||||
"os"
|
||||
|
||||
block "github.com/ipfs/go-block-format"
|
||||
"github.com/ipfs/go-cid"
|
||||
ipld "github.com/ipfs/go-ipld-format"
|
||||
block "github.com/ipfs/go-libipfs/blocks"
|
||||
)
|
||||
|
||||
// buflog is a logger for the buffered blockstore. It is subscoped from the
|
||||
|
||||
@@ -4,8 +4,8 @@ import (
|
||||
"context"
|
||||
"io"
|
||||
|
||||
blocks "github.com/ipfs/go-block-format"
|
||||
"github.com/ipfs/go-cid"
|
||||
blocks "github.com/ipfs/go-libipfs/blocks"
|
||||
)
|
||||
|
||||
var _ Blockstore = (*discardstore)(nil)
|
||||
|
||||
@@ -5,9 +5,9 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
blocks "github.com/ipfs/go-block-format"
|
||||
"github.com/ipfs/go-cid"
|
||||
ipld "github.com/ipfs/go-ipld-format"
|
||||
blocks "github.com/ipfs/go-libipfs/blocks"
|
||||
"golang.org/x/xerrors"
|
||||
)
|
||||
|
||||
|
||||
@@ -4,8 +4,8 @@ import (
|
||||
"context"
|
||||
"io"
|
||||
|
||||
blocks "github.com/ipfs/go-block-format"
|
||||
"github.com/ipfs/go-cid"
|
||||
blocks "github.com/ipfs/go-libipfs/blocks"
|
||||
mh "github.com/multiformats/go-multihash"
|
||||
"golang.org/x/xerrors"
|
||||
)
|
||||
|
||||
+1
-1
@@ -5,9 +5,9 @@ import (
|
||||
"context"
|
||||
"io"
|
||||
|
||||
blocks "github.com/ipfs/go-block-format"
|
||||
"github.com/ipfs/go-cid"
|
||||
httpapi "github.com/ipfs/go-ipfs-http-client"
|
||||
blocks "github.com/ipfs/go-libipfs/blocks"
|
||||
iface "github.com/ipfs/interface-go-ipfs-core"
|
||||
"github.com/ipfs/interface-go-ipfs-core/options"
|
||||
"github.com/ipfs/interface-go-ipfs-core/path"
|
||||
|
||||
+1
-1
@@ -3,9 +3,9 @@ package blockstore
|
||||
import (
|
||||
"context"
|
||||
|
||||
blocks "github.com/ipfs/go-block-format"
|
||||
"github.com/ipfs/go-cid"
|
||||
ipld "github.com/ipfs/go-ipld-format"
|
||||
blocks "github.com/ipfs/go-libipfs/blocks"
|
||||
)
|
||||
|
||||
// NewMemory returns a temporary memory-backed blockstore.
|
||||
|
||||
@@ -4,8 +4,8 @@ import (
|
||||
"context"
|
||||
"testing"
|
||||
|
||||
blocks "github.com/ipfs/go-block-format"
|
||||
"github.com/ipfs/go-cid"
|
||||
blocks "github.com/ipfs/go-libipfs/blocks"
|
||||
mh "github.com/multiformats/go-multihash"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
+1
-1
@@ -8,9 +8,9 @@ import (
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
|
||||
blocks "github.com/ipfs/go-block-format"
|
||||
"github.com/ipfs/go-cid"
|
||||
ipld "github.com/ipfs/go-ipld-format"
|
||||
blocks "github.com/ipfs/go-libipfs/blocks"
|
||||
"github.com/libp2p/go-msgio"
|
||||
cbg "github.com/whyrusleeping/cbor-gen"
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
@@ -5,9 +5,9 @@ import (
|
||||
"context"
|
||||
"encoding/binary"
|
||||
|
||||
block "github.com/ipfs/go-block-format"
|
||||
"github.com/ipfs/go-cid"
|
||||
ipld "github.com/ipfs/go-ipld-format"
|
||||
block "github.com/ipfs/go-libipfs/blocks"
|
||||
"github.com/libp2p/go-msgio"
|
||||
cbg "github.com/whyrusleeping/cbor-gen"
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
@@ -6,8 +6,8 @@ import (
|
||||
"io"
|
||||
"testing"
|
||||
|
||||
block "github.com/ipfs/go-block-format"
|
||||
ipld "github.com/ipfs/go-ipld-format"
|
||||
block "github.com/ipfs/go-libipfs/blocks"
|
||||
"github.com/libp2p/go-msgio"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
@@ -12,8 +12,8 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
blocks "github.com/ipfs/go-block-format"
|
||||
"github.com/ipfs/go-cid"
|
||||
blocks "github.com/ipfs/go-libipfs/blocks"
|
||||
"go.uber.org/multierr"
|
||||
"golang.org/x/xerrors"
|
||||
)
|
||||
|
||||
@@ -8,10 +8,10 @@ import (
|
||||
"sync/atomic"
|
||||
"time"
|
||||
|
||||
blocks "github.com/ipfs/go-block-format"
|
||||
"github.com/ipfs/go-cid"
|
||||
dstore "github.com/ipfs/go-datastore"
|
||||
ipld "github.com/ipfs/go-ipld-format"
|
||||
blocks "github.com/ipfs/go-libipfs/blocks"
|
||||
logging "github.com/ipfs/go-log/v2"
|
||||
"go.opencensus.io/stats"
|
||||
"go.uber.org/multierr"
|
||||
@@ -164,7 +164,7 @@ type SplitStore struct {
|
||||
path string
|
||||
|
||||
mx sync.Mutex
|
||||
warmupEpoch abi.ChainEpoch // protected by mx
|
||||
warmupEpoch atomic.Int64
|
||||
baseEpoch abi.ChainEpoch // protected by compaction lock
|
||||
pruneEpoch abi.ChainEpoch // protected by compaction lock
|
||||
|
||||
@@ -684,9 +684,7 @@ func (s *SplitStore) View(ctx context.Context, cid cid.Cid, cb func([]byte) erro
|
||||
}
|
||||
|
||||
func (s *SplitStore) isWarm() bool {
|
||||
s.mx.Lock()
|
||||
defer s.mx.Unlock()
|
||||
return s.warmupEpoch > 0
|
||||
return s.warmupEpoch.Load() > 0
|
||||
}
|
||||
|
||||
// State tracking
|
||||
@@ -757,7 +755,7 @@ func (s *SplitStore) Start(chain ChainAccessor, us stmgr.UpgradeSchedule) error
|
||||
bs, err = s.ds.Get(s.ctx, warmupEpochKey)
|
||||
switch err {
|
||||
case nil:
|
||||
s.warmupEpoch = bytesToEpoch(bs)
|
||||
s.warmupEpoch.Store(bytesToInt64(bs))
|
||||
|
||||
case dstore.ErrNotFound:
|
||||
warmup = true
|
||||
@@ -791,7 +789,7 @@ func (s *SplitStore) Start(chain ChainAccessor, us stmgr.UpgradeSchedule) error
|
||||
return xerrors.Errorf("error loading compaction index: %w", err)
|
||||
}
|
||||
|
||||
log.Infow("starting splitstore", "baseEpoch", s.baseEpoch, "warmupEpoch", s.warmupEpoch)
|
||||
log.Infow("starting splitstore", "baseEpoch", s.baseEpoch, "warmupEpoch", s.warmupEpoch.Load())
|
||||
|
||||
if warmup {
|
||||
err = s.warmup(curTs)
|
||||
|
||||
@@ -145,7 +145,7 @@ func (s *SplitStore) doCheck(curTs *types.TipSet) error {
|
||||
func (s *SplitStore) Info() map[string]interface{} {
|
||||
info := make(map[string]interface{})
|
||||
info["base epoch"] = s.baseEpoch
|
||||
info["warmup epoch"] = s.warmupEpoch
|
||||
info["warmup epoch"] = s.warmupEpoch.Load()
|
||||
info["compactions"] = s.compactionIndex
|
||||
info["prunes"] = s.pruneIndex
|
||||
info["compacting"] = s.compacting == 1
|
||||
|
||||
@@ -10,9 +10,9 @@ import (
|
||||
"sync/atomic"
|
||||
"time"
|
||||
|
||||
blocks "github.com/ipfs/go-block-format"
|
||||
"github.com/ipfs/go-cid"
|
||||
ipld "github.com/ipfs/go-ipld-format"
|
||||
blocks "github.com/ipfs/go-libipfs/blocks"
|
||||
cbg "github.com/whyrusleeping/cbor-gen"
|
||||
"go.opencensus.io/stats"
|
||||
"golang.org/x/sync/errgroup"
|
||||
@@ -455,7 +455,7 @@ func (s *SplitStore) protectTxnRefs(markSet MarkSet) error {
|
||||
// transactionally protect a reference by walking the object and marking.
|
||||
// concurrent markings are short circuited by checking the markset.
|
||||
func (s *SplitStore) doTxnProtect(root cid.Cid, markSet MarkSet) (int64, error) {
|
||||
if err := s.checkYield(); err != nil {
|
||||
if err := s.checkClosing(); err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
||||
@@ -1114,13 +1114,17 @@ func (s *SplitStore) walkChain(ts *types.TipSet, inclState, inclMsgs abi.ChainEp
|
||||
if err := walkBlock(c); err != nil {
|
||||
return xerrors.Errorf("error walking block (cid: %s): %w", c, err)
|
||||
}
|
||||
|
||||
if err := s.checkYield(); err != nil {
|
||||
return xerrors.Errorf("check yield: %w", err)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
if err := g.Wait(); err != nil {
|
||||
return err
|
||||
return xerrors.Errorf("walkBlock workers errored: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1153,8 +1157,8 @@ func (s *SplitStore) walkObject(c cid.Cid, visitor ObjectVisitor, f func(cid.Cid
|
||||
}
|
||||
|
||||
// check this before recursing
|
||||
if err := s.checkYield(); err != nil {
|
||||
return 0, err
|
||||
if err := s.checkClosing(); err != nil {
|
||||
return 0, xerrors.Errorf("check closing: %w", err)
|
||||
}
|
||||
|
||||
var links []cid.Cid
|
||||
@@ -1222,8 +1226,8 @@ func (s *SplitStore) walkObjectIncomplete(c cid.Cid, visitor ObjectVisitor, f, m
|
||||
}
|
||||
|
||||
// check this before recursing
|
||||
if err := s.checkYield(); err != nil {
|
||||
return sz, err
|
||||
if err := s.checkClosing(); err != nil {
|
||||
return sz, xerrors.Errorf("check closing: %w", err)
|
||||
}
|
||||
|
||||
var links []cid.Cid
|
||||
|
||||
@@ -4,9 +4,9 @@ import (
|
||||
"context"
|
||||
"errors"
|
||||
|
||||
blocks "github.com/ipfs/go-block-format"
|
||||
"github.com/ipfs/go-cid"
|
||||
ipld "github.com/ipfs/go-ipld-format"
|
||||
blocks "github.com/ipfs/go-libipfs/blocks"
|
||||
|
||||
bstore "github.com/filecoin-project/lotus/blockstore"
|
||||
)
|
||||
|
||||
@@ -5,8 +5,8 @@ import (
|
||||
"runtime"
|
||||
"sync/atomic"
|
||||
|
||||
blocks "github.com/ipfs/go-block-format"
|
||||
"github.com/ipfs/go-cid"
|
||||
blocks "github.com/ipfs/go-libipfs/blocks"
|
||||
"golang.org/x/xerrors"
|
||||
)
|
||||
|
||||
|
||||
@@ -11,11 +11,11 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
blocks "github.com/ipfs/go-block-format"
|
||||
"github.com/ipfs/go-cid"
|
||||
"github.com/ipfs/go-datastore"
|
||||
dssync "github.com/ipfs/go-datastore/sync"
|
||||
ipld "github.com/ipfs/go-ipld-format"
|
||||
blocks "github.com/ipfs/go-libipfs/blocks"
|
||||
logging "github.com/ipfs/go-log/v2"
|
||||
mh "github.com/multiformats/go-multihash"
|
||||
|
||||
@@ -429,7 +429,7 @@ func testSplitStoreReification(t *testing.T, f func(context.Context, blockstore.
|
||||
}
|
||||
defer ss.Close() //nolint
|
||||
|
||||
ss.warmupEpoch = 1
|
||||
ss.warmupEpoch.Store(1)
|
||||
go ss.reifyOrchestrator()
|
||||
|
||||
waitForReification := func() {
|
||||
@@ -529,7 +529,7 @@ func testSplitStoreReificationLimit(t *testing.T, f func(context.Context, blocks
|
||||
}
|
||||
defer ss.Close() //nolint
|
||||
|
||||
ss.warmupEpoch = 1
|
||||
ss.warmupEpoch.Store(1)
|
||||
go ss.reifyOrchestrator()
|
||||
|
||||
waitForReification := func() {
|
||||
|
||||
@@ -5,9 +5,9 @@ import (
|
||||
"sync/atomic"
|
||||
"time"
|
||||
|
||||
blocks "github.com/ipfs/go-block-format"
|
||||
"github.com/ipfs/go-cid"
|
||||
ipld "github.com/ipfs/go-ipld-format"
|
||||
blocks "github.com/ipfs/go-libipfs/blocks"
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
@@ -136,9 +136,8 @@ func (s *SplitStore) doWarmup(curTs *types.TipSet) error {
|
||||
if err != nil {
|
||||
return xerrors.Errorf("error saving warm up epoch: %w", err)
|
||||
}
|
||||
s.mx.Lock()
|
||||
s.warmupEpoch = epoch
|
||||
s.mx.Unlock()
|
||||
|
||||
s.warmupEpoch.Store(int64(epoch))
|
||||
|
||||
// also save the compactionIndex, as this is used as an indicator of warmup for upgraded nodes
|
||||
err = s.ds.Put(s.ctx, compactionIndexKey, int64ToBytes(s.compactionIndex))
|
||||
|
||||
+1
-1
@@ -4,8 +4,8 @@ import (
|
||||
"context"
|
||||
"sync"
|
||||
|
||||
blocks "github.com/ipfs/go-block-format"
|
||||
"github.com/ipfs/go-cid"
|
||||
blocks "github.com/ipfs/go-libipfs/blocks"
|
||||
)
|
||||
|
||||
// NewMemorySync returns a thread-safe in-memory blockstore.
|
||||
|
||||
+1
-1
@@ -6,9 +6,9 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
blocks "github.com/ipfs/go-block-format"
|
||||
"github.com/ipfs/go-cid"
|
||||
ipld "github.com/ipfs/go-ipld-format"
|
||||
blocks "github.com/ipfs/go-libipfs/blocks"
|
||||
"github.com/raulk/clock"
|
||||
"go.uber.org/multierr"
|
||||
)
|
||||
|
||||
@@ -6,8 +6,8 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
blocks "github.com/ipfs/go-block-format"
|
||||
"github.com/ipfs/go-cid"
|
||||
blocks "github.com/ipfs/go-libipfs/blocks"
|
||||
"github.com/raulk/clock"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
+1
-1
@@ -3,9 +3,9 @@ package blockstore
|
||||
import (
|
||||
"context"
|
||||
|
||||
blocks "github.com/ipfs/go-block-format"
|
||||
"github.com/ipfs/go-cid"
|
||||
ipld "github.com/ipfs/go-ipld-format"
|
||||
blocks "github.com/ipfs/go-libipfs/blocks"
|
||||
)
|
||||
|
||||
type unionBlockstore []Blockstore
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"context"
|
||||
"testing"
|
||||
|
||||
blocks "github.com/ipfs/go-libipfs/blocks"
|
||||
blocks "github.com/ipfs/go-block-format"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
|
||||
Binary file not shown.
+102
-102
@@ -74,25 +74,25 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet
|
||||
}, {
|
||||
Network: "butterflynet",
|
||||
Version: 11,
|
||||
BundleGitTag: "v11.0.0-rc2",
|
||||
ManifestCid: MustParseCid("bafy2bzaceajj76ms4q2ka3ckzj2iiifl7ewxqdpolshcmhml32sqwolrmsh6e"),
|
||||
BundleGitTag: "v11.0.0",
|
||||
ManifestCid: MustParseCid("bafy2bzaceaiy4dsxxus5xp5n5i4tjzkb7sc54mjz7qnk2efhgmsrobjesxnza"),
|
||||
Actors: map[string]cid.Cid{
|
||||
"account": MustParseCid("bafk2bzacecsf7v7mm4osq7cqbygyudg5zkwqbpbkmi3iluakugzvbd2cuucfw"),
|
||||
"cron": MustParseCid("bafk2bzacediqvwudrujh7ejowrcumrnara7k2fonr35vulnggpwwwh3o32pmu"),
|
||||
"datacap": MustParseCid("bafk2bzaceb7jkx5kxwwbkw5ehz63sq2b6urouegn4cdczlziaw5ea44u67ock"),
|
||||
"eam": MustParseCid("bafk2bzacebq2zzzkcra7ahantiq7xlkgcrkoq2azmeqpwhoie5gxcxhurbdp2"),
|
||||
"ethaccount": MustParseCid("bafk2bzacebrtwz4nyl3nkgjfpvtqjrjixnbujkr72fwzf5bqhpqfo4hgbjqo2"),
|
||||
"evm": MustParseCid("bafk2bzacecoxcwxbukue76b4rrqhnjywgzjdlhbbemma4kqdzalpkgtdpog7q"),
|
||||
"init": MustParseCid("bafk2bzacebwfs5wna2dculc4mpl4a25cjrmguoscbebeb5g5yft4ntfpku7cu"),
|
||||
"multisig": MustParseCid("bafk2bzaceavnestm7obwlj3moeewcnuomzigfzys4lt26s3l3psjeligf4hju"),
|
||||
"paymentchannel": MustParseCid("bafk2bzaceb4vefsbgswrciqo26wnacvqwpicqjfyicwsdjmv4rbcc4zeae72g"),
|
||||
"account": MustParseCid("bafk2bzacecfdqb7p3jakhaa3cqnzpt7hxmhghrbxvafsylqno3febx55fnidw"),
|
||||
"cron": MustParseCid("bafk2bzaceavmqu2qihgbe3xdaotgypuzvdpiifnm7ll6rolks2u4lac6voosk"),
|
||||
"datacap": MustParseCid("bafk2bzacealtvh65rzb34fmyzw4m2np2htnio4w3pn4alzqovwxkdbf23dvpo"),
|
||||
"eam": MustParseCid("bafk2bzacedko6hcjmwpuwgma5pb4gr2wgyvregk3nqqjxit7dv4es6vh5cjoc"),
|
||||
"ethaccount": MustParseCid("bafk2bzacedhcei2xnr34poxr4xziypm2obqlibke4cs2cjfnr3sz6nf6h7fyy"),
|
||||
"evm": MustParseCid("bafk2bzacebn5lwxboiikhz67ajwa34v2lc4qevnhpwdnipbmrnutkvrrqkb46"),
|
||||
"init": MustParseCid("bafk2bzacea6vw4esh5tg7mprv5jkbx5xcyilcy4vvf64lss32mjyuvv2mh5ng"),
|
||||
"multisig": MustParseCid("bafk2bzacedq2afnwcfipay5twv5mgzjoio5bbjvyo4yqchdwqcr7wrareyx54"),
|
||||
"paymentchannel": MustParseCid("bafk2bzacebbsvr7i7mqmaadyjibe5wxnv7bwvvec2wlgknuwda6ep45amnd5w"),
|
||||
"placeholder": MustParseCid("bafk2bzacedfvut2myeleyq67fljcrw4kkmn5pb5dpyozovj7jpoez5irnc3ro"),
|
||||
"reward": MustParseCid("bafk2bzacedyl4uerjbw3tu5mcgkn7ftvr3j3poy4uv5tuzyuvcdinjb75cz3w"),
|
||||
"storagemarket": MustParseCid("bafk2bzacechvhqru32tw7zii2raii3upjrkybiubepjtartyhzibnac57gxyo"),
|
||||
"storageminer": MustParseCid("bafk2bzacedu6tzfpxwzqym3z2j252d57gqj3jduap7ijf5mczvhmsirs6wxfs"),
|
||||
"storagepower": MustParseCid("bafk2bzacebdoeoiayvshg4zaxygmpuituux3ccd4gxfl3ile7ckpsyy7kpnms"),
|
||||
"system": MustParseCid("bafk2bzaceatn5cj3jqmrug65ur26jhrzcgmishv5hjfswvsyxsieccchhwies"),
|
||||
"verifiedregistry": MustParseCid("bafk2bzacecjshlgoyim3r2uvhtjthu5udxpq5fvjy4pmpi3sy4v6a4chjvb4k"),
|
||||
"reward": MustParseCid("bafk2bzaceafuh6idvaqqkj353vs4qdl42tcmvnymewu5zf4rq2nruxdyunses"),
|
||||
"storagemarket": MustParseCid("bafk2bzaceb7bx4honi3byjllpdk6fea32dpu3vqvil3okodybdk5m3erlnwjw"),
|
||||
"storageminer": MustParseCid("bafk2bzacebxjhofdr3sb2uhy2ky2vcijh4nhmwkh5xijtbgk6dzkknji2kn7a"),
|
||||
"storagepower": MustParseCid("bafk2bzaceabskmmkas6njbowols7t4ib3bipa5abpomk3jtgfwojtzd7mjzfm"),
|
||||
"system": MustParseCid("bafk2bzacedtuh7cht3fud7fb4avl4g2zbz57lc4ohiaufpaex6dkmdokn5rgo"),
|
||||
"verifiedregistry": MustParseCid("bafk2bzaceb37hxeuoo5rgf6ansrdl2ykm5v5zp6kireubn4orcopr67jbxv6k"),
|
||||
},
|
||||
}, {
|
||||
Network: "calibrationnet",
|
||||
@@ -249,25 +249,25 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet
|
||||
}, {
|
||||
Network: "caterpillarnet",
|
||||
Version: 11,
|
||||
BundleGitTag: "v11.0.0-rc2",
|
||||
ManifestCid: MustParseCid("bafy2bzacedeberqleewemblnbpwufbs6hnric73jy2anlb2sef4o72jf6mxsu"),
|
||||
BundleGitTag: "v11.0.0",
|
||||
ManifestCid: MustParseCid("bafy2bzacebexc2jgzwr5ngn6jdnkwdqwwmcapajuypdgvopoe6bnvp4yxm4o2"),
|
||||
Actors: map[string]cid.Cid{
|
||||
"account": MustParseCid("bafk2bzacearzuvg6ugk4evuvgjkap2cyln2efrpano75ecgam4bzyl5l2enn6"),
|
||||
"cron": MustParseCid("bafk2bzaceas3ku3ol6pwlab7g7zgttfn5bhdo2qbc6vpkbgb2wbrzqsldsv6u"),
|
||||
"datacap": MustParseCid("bafk2bzacebyrneejblvplw6if36hhxx765hx7efnk7a4sj3lqsuupz6m7rgqm"),
|
||||
"eam": MustParseCid("bafk2bzaceaclwxphuqwymjozzomza3q2jhf6ib4mqewlrrgmkkqzupvpbaksk"),
|
||||
"ethaccount": MustParseCid("bafk2bzacebikzogkoy4fzkqrc3vdirr4h7eq3zzty7csc7aaabevocf65nfds"),
|
||||
"evm": MustParseCid("bafk2bzacectdxa4ctrobwmq5h42aqbras42b6hjea7krgkc3ghatuitgset4i"),
|
||||
"init": MustParseCid("bafk2bzacecdtsmhlxakdoyojcntubtj7kdplwq67dlodihs22zlz762ljkico"),
|
||||
"multisig": MustParseCid("bafk2bzacebgwns6gt4sv44ey7hz7nfqmk2z6g3yjrr32ovz5iuklrrc6xujn6"),
|
||||
"paymentchannel": MustParseCid("bafk2bzacedxwn53sstmkmakev6yjvwezfsozbeoljnk2ls2yfmndvytkcw3iq"),
|
||||
"account": MustParseCid("bafk2bzaceanjiq5m3feytue5m7hhxfkob2ofg2greoct5tr77reuhrjglo66g"),
|
||||
"cron": MustParseCid("bafk2bzaceavgd5qj6n744tukhdrvxejygzs3jnlizmcvjsdnxkgiimrd5jrys"),
|
||||
"datacap": MustParseCid("bafk2bzacedmdywxwrzop2gmf4ys5stydlmvbe35j3nyr2efmf273briksuvse"),
|
||||
"eam": MustParseCid("bafk2bzacec7qo7s72li7tqysllstlrxxm2dhfqv2w32pytel2e775cki4ozqm"),
|
||||
"ethaccount": MustParseCid("bafk2bzaceaygtkliu26ubb7ivljrvaeesp5sbjlis5okzl35ishxioa2tlx4w"),
|
||||
"evm": MustParseCid("bafk2bzacebo7iqzy2ophz4f3civzwlltec7q5fut7kmtfckr6vy33r6ic5eqe"),
|
||||
"init": MustParseCid("bafk2bzaceb7uzzlsquqwrqhb2vpbvk3jgr4wp5i3smu2splnag2v5sppdehns"),
|
||||
"multisig": MustParseCid("bafk2bzacebwibfqrytobl4pjtny244zkmfoomazbap3r5gddjryckx5js4csi"),
|
||||
"paymentchannel": MustParseCid("bafk2bzacecuaa5esuxpouigxoamyl5gire2qqqhvyhewsig2x2j73f6ksh7go"),
|
||||
"placeholder": MustParseCid("bafk2bzacedfvut2myeleyq67fljcrw4kkmn5pb5dpyozovj7jpoez5irnc3ro"),
|
||||
"reward": MustParseCid("bafk2bzacedjwx5vlghmudjd4zbgzjs7cgk5yyzn7hxb5usqyfwhhumhfse2wq"),
|
||||
"storagemarket": MustParseCid("bafk2bzacedxnxuwq64g5jsoz6dejx2lm6gjis5evzglaxdnb2rrb4oh2tvjhg"),
|
||||
"storageminer": MustParseCid("bafk2bzacedpmjackp3e3wucnu2kx4r6gl7cues2ogyfffvuv4x7ec5mwbwlie"),
|
||||
"storagepower": MustParseCid("bafk2bzacecjlefvghymezg6lrccaedviwirjg3vmu5sd5qz6aps3khjjvhlxm"),
|
||||
"system": MustParseCid("bafk2bzacec6p5l2no77yiaznaxogzg5zwgocfn32h7ebzry7vyxnbfqvn3oqa"),
|
||||
"verifiedregistry": MustParseCid("bafk2bzacebmi44uxzpu3xhzlkjkczrjz2sv4brj3thxwc7c6nvhcjoc4divca"),
|
||||
"reward": MustParseCid("bafk2bzaced4xxqhv63njf2ibvsqshlwikafctxev7aho5lgsfxyt2javjwvtw"),
|
||||
"storagemarket": MustParseCid("bafk2bzacedwtx3xokqmbgkgkoqkdt6lam4ymdjb3eznlbtec5wcrtx74l2bpc"),
|
||||
"storageminer": MustParseCid("bafk2bzacebbbe4sdo3xxkez7x7lkl6j46w34vx7eg7xswmdzhp7moa44p3wjg"),
|
||||
"storagepower": MustParseCid("bafk2bzacedfgz6n24tjsor4pcayomim2f5f3a3fgyatmjgwxxeejna7okndda"),
|
||||
"system": MustParseCid("bafk2bzacebxfzeom3d7ahcz2n2nlwp7ncv767bdbbrisugks4l6v7lcu2tmyg"),
|
||||
"verifiedregistry": MustParseCid("bafk2bzacedaws3or3twy45ltcxucgvqijsje4x675ph6vup2w35smlfneamno"),
|
||||
},
|
||||
}, {
|
||||
Network: "devnet",
|
||||
@@ -332,25 +332,25 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet
|
||||
}, {
|
||||
Network: "devnet",
|
||||
Version: 11,
|
||||
BundleGitTag: "v11.0.0-rc2",
|
||||
ManifestCid: MustParseCid("bafy2bzacec2nca2tmntojbsjmi6gpt7gnslv3phratoara3lpamv5w3do2qh2"),
|
||||
BundleGitTag: "v11.0.0",
|
||||
ManifestCid: MustParseCid("bafy2bzaceay35go4xbjb45km6o46e5bib3bi46panhovcbedrynzwmm3drr4i"),
|
||||
Actors: map[string]cid.Cid{
|
||||
"account": MustParseCid("bafk2bzacedxucublg7o7zdy4vw4zr46vngpiflysif333saptv3tfzrh7ktcs"),
|
||||
"cron": MustParseCid("bafk2bzacebnihuzok7gxzmopayqmou42j3uwfpsdzpqkzxf4xvxbxco76cx42"),
|
||||
"datacap": MustParseCid("bafk2bzacebcz2agc2pojoqecllda5bytbtfns7uxozk6hexuzgktl3d447k3g"),
|
||||
"eam": MustParseCid("bafk2bzacedmy4fvb26m7rxom55tcjlekpprxieecgfqpxivum6cv72ca5ld3k"),
|
||||
"ethaccount": MustParseCid("bafk2bzacedlthlzuuaay4ouhvrdbcmljhudihgwtguxlqc5bqwem3hcymeiee"),
|
||||
"evm": MustParseCid("bafk2bzaceboozl4smxva6g6z6dqegtzszq2qheewgr3gbvd32bbvs64simorc"),
|
||||
"init": MustParseCid("bafk2bzacectfoykh2du5w2odxgtcu6jttdeup3j3sh6tke6zbgqzzmhqlc7vw"),
|
||||
"multisig": MustParseCid("bafk2bzaceawofhfckab5zwthkgyos5ornbrg7aeudhavgd6jglfb67tezjxpo"),
|
||||
"paymentchannel": MustParseCid("bafk2bzacebmw7foxdepc44p6wtwkoshvczi6lagspwivfy3o5zc6xcq7e2uzw"),
|
||||
"account": MustParseCid("bafk2bzacecf2pprkbdlpm4e2xz3ufunxtgrgyh2ie3stuqiyhibsvdze7kvri"),
|
||||
"cron": MustParseCid("bafk2bzaceasr5d2skowvzv5mzsyak6waqrgc46ewj6rzbapkfi5woom6n6bwa"),
|
||||
"datacap": MustParseCid("bafk2bzaceaqd77gptubupda7rp7daxkxbkzwc253dxhiyoezxvj2tljmkgpny"),
|
||||
"eam": MustParseCid("bafk2bzacedve6p4ye6zxydjbfs4ode5r2equ7rqzpyltujsq2lu6wyxnijfx4"),
|
||||
"ethaccount": MustParseCid("bafk2bzacea25xfsxwew3h2crer6jlb4c5vwu2gtch2jh73ocuxjhupenyrugy"),
|
||||
"evm": MustParseCid("bafk2bzacece5hivtkmi757lyfahgti7xuqgofodb2u65pxgf6oizfwiiwlcsi"),
|
||||
"init": MustParseCid("bafk2bzacecxnr5y7qifzdqqiwfbjxv2yr7lbkcyu3e2mf5zjdncteupxdlquu"),
|
||||
"multisig": MustParseCid("bafk2bzaceayap4k4u3lbysaeeixct5fvhmafy3fa5eagvdpk3i4a7ubfdpobe"),
|
||||
"paymentchannel": MustParseCid("bafk2bzaceafgrz5wepbein35gie7rnsu7zttxvgllgdneuefmmy4j5izydtza"),
|
||||
"placeholder": MustParseCid("bafk2bzacedfvut2myeleyq67fljcrw4kkmn5pb5dpyozovj7jpoez5irnc3ro"),
|
||||
"reward": MustParseCid("bafk2bzacebeclhjkqqstbnvhzsqf5b54257sblr673kuaqemz7mm4kapyepgw"),
|
||||
"storagemarket": MustParseCid("bafk2bzacea6jtlm65dcihroldmnfk6qxqrsjxxfw5hniftm4rnhuopm2gk6yg"),
|
||||
"storageminer": MustParseCid("bafk2bzacebpzfxjn2z2fk3ariehjldy6l5yker3o57etnup3thqmiqd4vbbdo"),
|
||||
"storagepower": MustParseCid("bafk2bzaceced2xdnoob5yb4tgyhdr2y2f5c5xo7k2ghe5kna5xuevapbvjwpw"),
|
||||
"system": MustParseCid("bafk2bzacea356un67ewdbot57dqreil7gqatzj6uy333xbgah5j6zpdwnpu2k"),
|
||||
"verifiedregistry": MustParseCid("bafk2bzacea6jep5uswr6rfwuizfliy5bzbqahuednohmbgeo2lk443yugq2ho"),
|
||||
"reward": MustParseCid("bafk2bzacedwbtfqlx47fdkxjrb5mwiatheci44x3zkpx33smybc2cme23ymuo"),
|
||||
"storagemarket": MustParseCid("bafk2bzaceaj74fmooaf3gj3ebwon64ky7hhdh7kytdr3agclqfrqzmpzykh7g"),
|
||||
"storageminer": MustParseCid("bafk2bzacedb7bokkzzs7hnbhivp74pgcpermuy7j6b3ncodylksukkxtnn7ze"),
|
||||
"storagepower": MustParseCid("bafk2bzacedilnkegizkxz3nuutib4d4wwlk4bkla22loepia2h53yf4hysmq6"),
|
||||
"system": MustParseCid("bafk2bzacedpyoncjbl4oxkjm5e77ngvpy2xfajjc4myfsv2vltvzxioattlu2"),
|
||||
"verifiedregistry": MustParseCid("bafk2bzacebdqi5tr5pjnem5nylg2zbqcugvi7oxi35bhnrfudx4y4ufhlit2k"),
|
||||
},
|
||||
}, {
|
||||
Network: "hyperspace",
|
||||
@@ -438,25 +438,25 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet
|
||||
}, {
|
||||
Network: "mainnet",
|
||||
Version: 11,
|
||||
BundleGitTag: "v11.0.0-rc2",
|
||||
ManifestCid: MustParseCid("bafy2bzacebgfsebvidddy6l6zplsgmibmuqiyfwxotnvoxknvnnhxerjnrgke"),
|
||||
BundleGitTag: "v11.0.0",
|
||||
ManifestCid: MustParseCid("bafy2bzacecnhaiwcrpyjvzl4uv4q3jzoif26okl3m66q3cijp3dfwlcxwztwo"),
|
||||
Actors: map[string]cid.Cid{
|
||||
"account": MustParseCid("bafk2bzacecrtbcv3sgamwajiigx4j6v3zd6ycdzicycfjheduxksntymovj72"),
|
||||
"cron": MustParseCid("bafk2bzacecdxzej5q7yodb6zkxjkfrmmuuemu2ykgh4qepnagis6j3gfo73zk"),
|
||||
"datacap": MustParseCid("bafk2bzacecsvwqyxiotzin33zkeqdmt63uokfww6ren6wqvynhow6kwl52oma"),
|
||||
"eam": MustParseCid("bafk2bzaceccgh7emq3a2f46l4buukmwchlggbdcdvxjt34snx64h7tq37vkya"),
|
||||
"ethaccount": MustParseCid("bafk2bzaceahuwxxcpnzzcxqkqa5247pvoojxq72koy36qlq223yyn7mhul7xk"),
|
||||
"evm": MustParseCid("bafk2bzaceafofne3osqnbupdosg23ixb4lsssnd6yo7rdj5gqvfwwxxnwxt22"),
|
||||
"init": MustParseCid("bafk2bzacedxf5bwugxllkuwpyg4ddleckryydoojbcirngbckmlxpdcrmtkw2"),
|
||||
"multisig": MustParseCid("bafk2bzaceakw5rdw67ok44cssjlr655th2kgzjjbcbadbymsl35feplyoljea"),
|
||||
"paymentchannel": MustParseCid("bafk2bzacecj5g34lvlq72wttc65dqdxebrmph4yjftygopsgo6ifabguuf5rm"),
|
||||
"account": MustParseCid("bafk2bzacealnlr7st6lkwoh6wxpf2hnrlex5sknaopgmkr2tuhg7vmbfy45so"),
|
||||
"cron": MustParseCid("bafk2bzacebpewdvvgt6tk2o2u4rcovdgym67tadiis5usemlbejg7k3kt567o"),
|
||||
"datacap": MustParseCid("bafk2bzacebslykoyrb2hm7aacjngqgd5n2wmeii2goadrs5zaya3pvdf6pdnq"),
|
||||
"eam": MustParseCid("bafk2bzaceaelwt4yfsfvsu3pa3miwalsvy3cfkcjvmt4sqoeopsppnrmj2mf2"),
|
||||
"ethaccount": MustParseCid("bafk2bzaceclkmc4yidxc6lgcjpfypbde2eddnevcveo4j5kmh4ek6inqysz2k"),
|
||||
"evm": MustParseCid("bafk2bzacediwh6etwzwmb5pivtclpdplewdjzphouwqpppce6opisjv2fjqfe"),
|
||||
"init": MustParseCid("bafk2bzaceckwf3w6n2nw6eh77ktmsxqgsvshonvgnyk5q5syyngtetxvasfxg"),
|
||||
"multisig": MustParseCid("bafk2bzaceafajceqwg5ybiz7xw6rxammuirkgtuv625gzaehsqfprm4bazjmk"),
|
||||
"paymentchannel": MustParseCid("bafk2bzaceb4e6cnsnviegmqvsmoxzncruvhra54piq7bwiqfqevle6oob2gvo"),
|
||||
"placeholder": MustParseCid("bafk2bzacedfvut2myeleyq67fljcrw4kkmn5pb5dpyozovj7jpoez5irnc3ro"),
|
||||
"reward": MustParseCid("bafk2bzacebnz62vsryganusdr4gwhhtm7vj5q5ev43tpcp4usgieh2xnk7dzk"),
|
||||
"storagemarket": MustParseCid("bafk2bzacecprtjtwkfbdzcqglg6bwbqzosamebta7darvistsareszgsxf6ig"),
|
||||
"storageminer": MustParseCid("bafk2bzacedomhrky77hoodiworfnh7imh66entqwsudm2hsmedfx2ymsprd6e"),
|
||||
"storagepower": MustParseCid("bafk2bzacecyri3krbroak66cpccmnjwjzjtzyv7a3qbqjscgnhb46yadtp36w"),
|
||||
"system": MustParseCid("bafk2bzacedehzsjoy5msxblwnkzi7hzuuohdzugh3j3bp427jcnef57xkqevc"),
|
||||
"verifiedregistry": MustParseCid("bafk2bzaceazvpyoiqrsmitkjsaei3r6746d2fqoiy7yjo7htguvwo5ntlxfrq"),
|
||||
"reward": MustParseCid("bafk2bzacebwjw2vxkobs7r2kwjdqqb42h2kucyuk6flbnyzw4odg5s4mogamo"),
|
||||
"storagemarket": MustParseCid("bafk2bzaceazu2j2zu4p24tr22btnqzkhzjvyjltlvsagaj6w3syevikeb5d7m"),
|
||||
"storageminer": MustParseCid("bafk2bzacec24okjqrp7c7rj3hbrs5ez5apvwah2ruka6haesgfngf37mhk6us"),
|
||||
"storagepower": MustParseCid("bafk2bzaceaxgloxuzg35vu7l7tohdgaq2frsfp4ejmuo7tkoxjp5zqrze6sf4"),
|
||||
"system": MustParseCid("bafk2bzaced7npe5mt5nh72jxr2igi2sofoa7gedt4w6kueeke7i3xxugqpjfm"),
|
||||
"verifiedregistry": MustParseCid("bafk2bzacedej3dnr62g2je2abmyjg3xqv4otvh6e26du5fcrhvw7zgcaaez3a"),
|
||||
},
|
||||
}, {
|
||||
Network: "testing",
|
||||
@@ -521,25 +521,25 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet
|
||||
}, {
|
||||
Network: "testing",
|
||||
Version: 11,
|
||||
BundleGitTag: "v11.0.0-rc2",
|
||||
ManifestCid: MustParseCid("bafy2bzacedsxzhzzkfbexqyspkiwqyyn27xplscxtpria4babxsxqmvwvgzmg"),
|
||||
BundleGitTag: "v11.0.0",
|
||||
ManifestCid: MustParseCid("bafy2bzacea2vxre32tg3xhpejrktiuzx4d3pcoe7yyazgscfibmegmchr6n42"),
|
||||
Actors: map[string]cid.Cid{
|
||||
"account": MustParseCid("bafk2bzacecn3i4m2utctacfctwf3tord3a2z364yffacydc6h3mtv37exehxo"),
|
||||
"cron": MustParseCid("bafk2bzacedpt2d3ckjirv45esiug4hoousgqixdu3ya6yydhebjuklx6lkzuw"),
|
||||
"datacap": MustParseCid("bafk2bzacebfp7bklbkomcexam2r5aawv2ucuqzkdmeamch7bigsprmadfvxvk"),
|
||||
"eam": MustParseCid("bafk2bzaceds3dguvp5pvqnq7cwvz46mqbqem35nfril5frwumcauzdliamvam"),
|
||||
"ethaccount": MustParseCid("bafk2bzaceab3egffns45nwvvgtbncoq6jyqgyt4czvwrayz6x6isotbob55ve"),
|
||||
"evm": MustParseCid("bafk2bzacealplkpnbvap6qrz4vuiebkuutum3e5nasnscepfx5pw4grrvkfpe"),
|
||||
"init": MustParseCid("bafk2bzaced7mmznvvjh3vrlm3s3iostm7iwwvust3lcpujbldh4dmmrecoxia"),
|
||||
"multisig": MustParseCid("bafk2bzaceajadbzimbpdjzddi56p6hih5ro6p7pvwb635ivk6byktbjy2a3rq"),
|
||||
"paymentchannel": MustParseCid("bafk2bzacech2ns3zv7j3xxmbw37zldh5brg4j4shurf5scnf2q74ksow7f6tg"),
|
||||
"account": MustParseCid("bafk2bzaceccerssb3tgel6ukdghlwvs7dxsolj4fpkgn7dh7owzwapqb6ejpw"),
|
||||
"cron": MustParseCid("bafk2bzacebtfl6fczxnitrqqjhyefskf3asyn3gzuvqcddieoqfsaddk5fd4q"),
|
||||
"datacap": MustParseCid("bafk2bzacediikc55y6uzmnhucf4mik6rqpjulwvgp5gdibogxjhgbvusmzff2"),
|
||||
"eam": MustParseCid("bafk2bzaceazqi5ezossp6kvqogaaba6hxlfarqgniktmb7iy5qonha3eflz6m"),
|
||||
"ethaccount": MustParseCid("bafk2bzaceb77ospgfqqmf67v23wkyeg7lr2mu53ybaacu3bslx7s7nhttdueo"),
|
||||
"evm": MustParseCid("bafk2bzacedvgt7mv22hux4vrnklylq7qmw43kfrqwam6wdsfzkdnaewr33qbu"),
|
||||
"init": MustParseCid("bafk2bzacealzb3nk2oypway5ubz3hs5py5ok5tuw545454vg4d3mwbslef4js"),
|
||||
"multisig": MustParseCid("bafk2bzacec45ppn4hrwizmopp2v2atkxw35tb6yem6uqhqilrv7aiaknnnxmu"),
|
||||
"paymentchannel": MustParseCid("bafk2bzaceajbr3t6cngzh3katqteflbcrtwtdgbthnlfemon5tg6rytf2uonw"),
|
||||
"placeholder": MustParseCid("bafk2bzacedfvut2myeleyq67fljcrw4kkmn5pb5dpyozovj7jpoez5irnc3ro"),
|
||||
"reward": MustParseCid("bafk2bzacearazt2oxjp5vbzymu2zfur2p5wj7giabxunj42w5embrmgi2byh2"),
|
||||
"storagemarket": MustParseCid("bafk2bzacecqtfzdcwygdjo7jyeonkfvhuyit6hv6an2bit6t6xdmliyiaxpyy"),
|
||||
"storageminer": MustParseCid("bafk2bzaceah46gbb5ls2dor2ajr7quofchee3bwghtq3btcjve3dpyrxo56tc"),
|
||||
"storagepower": MustParseCid("bafk2bzacedmz4i6cslncm65si47tnpmdbn5owvvm7kjisvbfvvkvdv2viucck"),
|
||||
"system": MustParseCid("bafk2bzaceably72ppjsvbtm2pmc7zzczvxsc7qaab5off6jy2qntwhax3klqa"),
|
||||
"verifiedregistry": MustParseCid("bafk2bzacecozu2vc3tqk7az7koqdiejcgk2q476542pnv7tmx5beomtvtjbzc"),
|
||||
"reward": MustParseCid("bafk2bzacea7ycf53kbq4robcuh3ziy7qwwhaqamc5krn3lugypgpxhlewdaiq"),
|
||||
"storagemarket": MustParseCid("bafk2bzacedskmbcpaeb6bezs32szh52jrukvihobluadauayroo5gzrt32tkm"),
|
||||
"storageminer": MustParseCid("bafk2bzaced3yg5lctmswnbkxyd6cleg3llyux7fu2vbddyd2ho36fpym423mq"),
|
||||
"storagepower": MustParseCid("bafk2bzacebvpdf372fzxgixztbz2r7ayxyvx7jmdxwlfuqt2cq7tnqgie3klw"),
|
||||
"system": MustParseCid("bafk2bzaceaatvscbnkv36ixhtt2zel4er5oskxevgumh5gegqkv7uzah36f24"),
|
||||
"verifiedregistry": MustParseCid("bafk2bzacebp2r56wxadvfzpfbmqwfi3dlnwpmoc5u4tau2hfftbkuafkhye64"),
|
||||
},
|
||||
}, {
|
||||
Network: "testing-fake-proofs",
|
||||
@@ -604,24 +604,24 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet
|
||||
}, {
|
||||
Network: "testing-fake-proofs",
|
||||
Version: 11,
|
||||
BundleGitTag: "v11.0.0-rc2",
|
||||
ManifestCid: MustParseCid("bafy2bzacebebmxp3bmls3erhyyothy243ljtet4wtey54ufbygat3nhs6rody"),
|
||||
BundleGitTag: "v11.0.0",
|
||||
ManifestCid: MustParseCid("bafy2bzacecojemqglhzzhjnhgtrcbsgkyv67ziytvtbhwlr4ym4oxqofv7zui"),
|
||||
Actors: map[string]cid.Cid{
|
||||
"account": MustParseCid("bafk2bzacecn3i4m2utctacfctwf3tord3a2z364yffacydc6h3mtv37exehxo"),
|
||||
"cron": MustParseCid("bafk2bzacedpt2d3ckjirv45esiug4hoousgqixdu3ya6yydhebjuklx6lkzuw"),
|
||||
"datacap": MustParseCid("bafk2bzacebfp7bklbkomcexam2r5aawv2ucuqzkdmeamch7bigsprmadfvxvk"),
|
||||
"eam": MustParseCid("bafk2bzaceds3dguvp5pvqnq7cwvz46mqbqem35nfril5frwumcauzdliamvam"),
|
||||
"ethaccount": MustParseCid("bafk2bzaceab3egffns45nwvvgtbncoq6jyqgyt4czvwrayz6x6isotbob55ve"),
|
||||
"evm": MustParseCid("bafk2bzacealplkpnbvap6qrz4vuiebkuutum3e5nasnscepfx5pw4grrvkfpe"),
|
||||
"init": MustParseCid("bafk2bzaced7mmznvvjh3vrlm3s3iostm7iwwvust3lcpujbldh4dmmrecoxia"),
|
||||
"multisig": MustParseCid("bafk2bzaceajadbzimbpdjzddi56p6hih5ro6p7pvwb635ivk6byktbjy2a3rq"),
|
||||
"paymentchannel": MustParseCid("bafk2bzacech2ns3zv7j3xxmbw37zldh5brg4j4shurf5scnf2q74ksow7f6tg"),
|
||||
"account": MustParseCid("bafk2bzaceccerssb3tgel6ukdghlwvs7dxsolj4fpkgn7dh7owzwapqb6ejpw"),
|
||||
"cron": MustParseCid("bafk2bzacebtfl6fczxnitrqqjhyefskf3asyn3gzuvqcddieoqfsaddk5fd4q"),
|
||||
"datacap": MustParseCid("bafk2bzacediikc55y6uzmnhucf4mik6rqpjulwvgp5gdibogxjhgbvusmzff2"),
|
||||
"eam": MustParseCid("bafk2bzaceazqi5ezossp6kvqogaaba6hxlfarqgniktmb7iy5qonha3eflz6m"),
|
||||
"ethaccount": MustParseCid("bafk2bzaceb77ospgfqqmf67v23wkyeg7lr2mu53ybaacu3bslx7s7nhttdueo"),
|
||||
"evm": MustParseCid("bafk2bzacedvgt7mv22hux4vrnklylq7qmw43kfrqwam6wdsfzkdnaewr33qbu"),
|
||||
"init": MustParseCid("bafk2bzacealzb3nk2oypway5ubz3hs5py5ok5tuw545454vg4d3mwbslef4js"),
|
||||
"multisig": MustParseCid("bafk2bzacec45ppn4hrwizmopp2v2atkxw35tb6yem6uqhqilrv7aiaknnnxmu"),
|
||||
"paymentchannel": MustParseCid("bafk2bzaceajbr3t6cngzh3katqteflbcrtwtdgbthnlfemon5tg6rytf2uonw"),
|
||||
"placeholder": MustParseCid("bafk2bzacedfvut2myeleyq67fljcrw4kkmn5pb5dpyozovj7jpoez5irnc3ro"),
|
||||
"reward": MustParseCid("bafk2bzacearazt2oxjp5vbzymu2zfur2p5wj7giabxunj42w5embrmgi2byh2"),
|
||||
"storagemarket": MustParseCid("bafk2bzacecqtfzdcwygdjo7jyeonkfvhuyit6hv6an2bit6t6xdmliyiaxpyy"),
|
||||
"storageminer": MustParseCid("bafk2bzacec6ntijn67h3gnn5htgbnlpwfp7g47t4nlkr3llr6trnaj35p3kas"),
|
||||
"storagepower": MustParseCid("bafk2bzaceasdxhi4r4ksy6ageji3xhajr5m5rgixk2w6ojp456kbacmjvxqai"),
|
||||
"system": MustParseCid("bafk2bzaceably72ppjsvbtm2pmc7zzczvxsc7qaab5off6jy2qntwhax3klqa"),
|
||||
"verifiedregistry": MustParseCid("bafk2bzacecozu2vc3tqk7az7koqdiejcgk2q476542pnv7tmx5beomtvtjbzc"),
|
||||
"reward": MustParseCid("bafk2bzacea7ycf53kbq4robcuh3ziy7qwwhaqamc5krn3lugypgpxhlewdaiq"),
|
||||
"storagemarket": MustParseCid("bafk2bzacedskmbcpaeb6bezs32szh52jrukvihobluadauayroo5gzrt32tkm"),
|
||||
"storageminer": MustParseCid("bafk2bzacebqeztpa5exztccqjwqhan5droiy7ga6zekm6f2gzxoe655vneczm"),
|
||||
"storagepower": MustParseCid("bafk2bzaceb2tlyuwxncdxsh3hc4fwcjnpxaijkiv54ustwdjbrqabxdsc27km"),
|
||||
"system": MustParseCid("bafk2bzaceaatvscbnkv36ixhtt2zel4er5oskxevgumh5gegqkv7uzah36f24"),
|
||||
"verifiedregistry": MustParseCid("bafk2bzacebp2r56wxadvfzpfbmqwfi3dlnwpmoc5u4tau2hfftbkuafkhye64"),
|
||||
},
|
||||
}}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -49,16 +49,11 @@ var UpgradeHyperdriveHeight = abi.ChainEpoch(-16)
|
||||
var UpgradeChocolateHeight = abi.ChainEpoch(-17)
|
||||
var UpgradeOhSnapHeight = abi.ChainEpoch(-18)
|
||||
var UpgradeSkyrHeight = abi.ChainEpoch(-19)
|
||||
var UpgradeSharkHeight = abi.ChainEpoch(-20)
|
||||
var UpgradeHyggeHeight = abi.ChainEpoch(-21)
|
||||
var UpgradeLightningHeight = abi.ChainEpoch(-22)
|
||||
|
||||
const UpgradeSharkHeight = abi.ChainEpoch(-20)
|
||||
|
||||
const UpgradeHyggeHeight = abi.ChainEpoch(100)
|
||||
|
||||
// ??????????
|
||||
const UpgradeLightningHeight = 200
|
||||
|
||||
// ??????????????????
|
||||
const UpgradeThunderHeight = 300
|
||||
const UpgradeThunderHeight = 50
|
||||
|
||||
var DrandSchedule = map[abi.ChainEpoch]DrandEnum{
|
||||
0: DrandMainnet,
|
||||
|
||||
@@ -89,11 +89,11 @@ const UpgradeSharkHeight = 2383680
|
||||
// 2023-03-14T15:14:00Z
|
||||
const UpgradeHyggeHeight = 2683348
|
||||
|
||||
// ??????????
|
||||
var UpgradeLightningHeight = abi.ChainEpoch(9999999999)
|
||||
// 2023-04-27T13:00:00Z
|
||||
var UpgradeLightningHeight = abi.ChainEpoch(2809800)
|
||||
|
||||
// ??????????
|
||||
var UpgradeThunderHeight = UpgradeLightningHeight + 1
|
||||
// 2023-05-18T13:00:00Z
|
||||
var UpgradeThunderHeight = UpgradeLightningHeight + 2880*21
|
||||
|
||||
var SupportedProofTypes = []abi.RegisteredSealProof{
|
||||
abi.RegisteredSealProof_StackedDrg32GiBV1,
|
||||
|
||||
@@ -26,17 +26,13 @@ const UnixfsLinksPerLevel = 1024
|
||||
|
||||
const AllowableClockDriftSecs = uint64(1)
|
||||
|
||||
// TODO: nv19: Re-enable when migration is setup
|
||||
//// Used by tests and some obscure tooling
|
||||
///* inline-gen template
|
||||
//
|
||||
//const TestNetworkVersion = network.Version{{.latestNetworkVersion}}
|
||||
//
|
||||
///* inline-gen start */
|
||||
// Used by tests and some obscure tooling
|
||||
/* inline-gen template
|
||||
const TestNetworkVersion = network.Version{{.latestNetworkVersion}}
|
||||
/* inline-gen start */
|
||||
const TestNetworkVersion = network.Version20
|
||||
|
||||
const TestNetworkVersion = network.Version18
|
||||
|
||||
///* inline-gen end */
|
||||
/* inline-gen end */
|
||||
|
||||
// Epochs
|
||||
const ForkLengthThreshold = Finality
|
||||
|
||||
@@ -9,6 +9,7 @@ package build
|
||||
|
||||
import (
|
||||
"math/big"
|
||||
"time"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
|
||||
@@ -137,3 +138,7 @@ const BootstrapPeerThreshold = 1
|
||||
// ChainId defines the chain ID used in the Ethereum JSON-RPC endpoint.
|
||||
// As per https://github.com/ethereum-lists/chains
|
||||
const Eip155ChainId = 31415926
|
||||
|
||||
// Reducing the delivery delay for equivocation of
|
||||
// consistent broadcast to just half a second.
|
||||
var CBDeliveryDelay = 500 * time.Millisecond
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@ func BuildTypeString() string {
|
||||
}
|
||||
|
||||
// BuildVersion is the local build version
|
||||
const BuildVersion = "1.23.0-rc1"
|
||||
const BuildVersion = "1.23.2-dev"
|
||||
|
||||
func UserVersion() string {
|
||||
if os.Getenv("LOTUS_VERSION_IGNORE_COMMIT") == "1" {
|
||||
|
||||
@@ -61,6 +61,10 @@ const (
|
||||
MaxPreCommitRandomnessLookback = builtin11.EpochsInDay + SealRandomnessLookback
|
||||
)
|
||||
|
||||
var (
|
||||
MarketDefaultAllocationTermBuffer = market11.MarketDefaultAllocationTermBuffer
|
||||
)
|
||||
|
||||
// SetSupportedProofTypes sets supported proof types, across all actor versions.
|
||||
// This should only be used for testing.
|
||||
func SetSupportedProofTypes(types ...abi.RegisteredSealProof) {
|
||||
|
||||
@@ -39,6 +39,10 @@ const (
|
||||
MaxPreCommitRandomnessLookback = builtin{{.latestVersion}}.EpochsInDay + SealRandomnessLookback
|
||||
)
|
||||
|
||||
var (
|
||||
MarketDefaultAllocationTermBuffer = market{{.latestVersion}}.MarketDefaultAllocationTermBuffer
|
||||
)
|
||||
|
||||
// SetSupportedProofTypes sets supported proof types, across all actor versions.
|
||||
// This should only be used for testing.
|
||||
func SetSupportedProofTypes(types ...abi.RegisteredSealProof) {
|
||||
|
||||
@@ -110,6 +110,7 @@ func (t *TipSetExecutor) ApplyBlocks(ctx context.Context,
|
||||
TipSetGetter: stmgr.TipSetGetterForTipset(sm.ChainStore(), ts),
|
||||
Tracing: vmTracing,
|
||||
ReturnEvents: sm.ChainStore().IsStoringEvents(),
|
||||
ExecutionLane: vm.ExecutionLanePriority,
|
||||
}
|
||||
|
||||
return sm.VMConstructor()(ctx, vmopt)
|
||||
|
||||
@@ -382,13 +382,21 @@ func (filec *FilecoinEC) VerifyWinningPoStProof(ctx context.Context, nv network.
|
||||
return nil
|
||||
}
|
||||
|
||||
func (filec *FilecoinEC) IsEpochBeyondCurrMax(epoch abi.ChainEpoch) bool {
|
||||
func (filec *FilecoinEC) IsEpochInConsensusRange(epoch abi.ChainEpoch) bool {
|
||||
if filec.genesis == nil {
|
||||
return true
|
||||
}
|
||||
|
||||
// Don't try to sync anything before finality. Don't propagate such blocks either.
|
||||
//
|
||||
// We use _our_ current head, not the expected head, because the network's head can lag on
|
||||
// catch-up (after a network outage).
|
||||
if epoch < filec.store.GetHeaviestTipSet().Height()-build.Finality {
|
||||
return false
|
||||
}
|
||||
|
||||
now := uint64(build.Clock.Now().Unix())
|
||||
return epoch > (abi.ChainEpoch((now-filec.genesis.MinTimestamp())/build.BlockDelaySecs) + MaxHeightDrift)
|
||||
return epoch <= (abi.ChainEpoch((now-filec.genesis.MinTimestamp())/build.BlockDelaySecs) + MaxHeightDrift)
|
||||
}
|
||||
|
||||
func (filec *FilecoinEC) minerIsValid(ctx context.Context, maddr address.Address, baseTs *types.TipSet) error {
|
||||
|
||||
+12
-11
@@ -32,9 +32,10 @@ type Consensus interface {
|
||||
// the block (signature verifications, VRF checks, message validity, etc.)
|
||||
ValidateBlock(ctx context.Context, b *types.FullBlock) (err error)
|
||||
|
||||
// IsEpochBeyondCurrMax is used to configure the fork rules for longest-chain
|
||||
// consensus protocols.
|
||||
IsEpochBeyondCurrMax(epoch abi.ChainEpoch) bool
|
||||
// IsEpochInConsensusRange returns true if the epoch is "in range" for consensus. That is:
|
||||
// - It's not before finality.
|
||||
// - It's not too far in the future.
|
||||
IsEpochInConsensusRange(epoch abi.ChainEpoch) bool
|
||||
|
||||
// CreateBlock implements all the logic required to propose and assemble a new Filecoin block.
|
||||
//
|
||||
@@ -65,23 +66,24 @@ func ValidateBlockPubsub(ctx context.Context, cns Consensus, self bool, msg *pub
|
||||
|
||||
stats.Record(ctx, metrics.BlockReceived.M(1))
|
||||
|
||||
recordFailureFlagPeer := func(what string) {
|
||||
// bv.Validate will flag the peer in that case
|
||||
panic(what)
|
||||
}
|
||||
|
||||
blk, what, err := decodeAndCheckBlock(msg)
|
||||
if err != nil {
|
||||
log.Error("got invalid block over pubsub: ", err)
|
||||
recordFailureFlagPeer(what)
|
||||
return pubsub.ValidationReject, what
|
||||
}
|
||||
|
||||
if !cns.IsEpochInConsensusRange(blk.Header.Height) {
|
||||
// We ignore these blocks instead of rejecting to avoid breaking the network if
|
||||
// we're recovering from an outage (e.g., where nobody agrees on where "head" is
|
||||
// currently).
|
||||
log.Warnf("received block outside of consensus range (%d)", blk.Header.Height)
|
||||
return pubsub.ValidationIgnore, "invalid_block_height"
|
||||
}
|
||||
|
||||
// validate the block meta: the Message CID in the header must match the included messages
|
||||
err = validateMsgMeta(ctx, blk)
|
||||
if err != nil {
|
||||
log.Warnf("error validating message metadata: %s", err)
|
||||
recordFailureFlagPeer("invalid_block_meta")
|
||||
return pubsub.ValidationReject, "invalid_block_meta"
|
||||
}
|
||||
|
||||
@@ -91,7 +93,6 @@ func ValidateBlockPubsub(ctx context.Context, cns Consensus, self bool, msg *pub
|
||||
log.Warn("ignoring block msg: ", err)
|
||||
return pubsub.ValidationIgnore, reject
|
||||
}
|
||||
recordFailureFlagPeer(reject)
|
||||
return pubsub.ValidationReject, reject
|
||||
}
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ type Events struct {
|
||||
*hcEvents
|
||||
}
|
||||
|
||||
func NewEventsWithConfidence(ctx context.Context, api EventAPI, gcConfidence abi.ChainEpoch) (*Events, error) {
|
||||
func newEventsWithGCConfidence(ctx context.Context, api EventAPI, gcConfidence abi.ChainEpoch) (*Events, error) {
|
||||
cache := newCache(api, gcConfidence)
|
||||
|
||||
ob := newObserver(cache, gcConfidence)
|
||||
@@ -63,5 +63,5 @@ func NewEventsWithConfidence(ctx context.Context, api EventAPI, gcConfidence abi
|
||||
|
||||
func NewEvents(ctx context.Context, api EventAPI) (*Events, error) {
|
||||
gcConfidence := 2 * build.ForkLengthThreshold
|
||||
return NewEventsWithConfidence(ctx, api, gcConfidence)
|
||||
return newEventsWithGCConfidence(ctx, api, gcConfidence)
|
||||
}
|
||||
|
||||
@@ -174,13 +174,16 @@ func (fcs *fakeCS) makeTs(t *testing.T, parents []cid.Cid, h abi.ChainEpoch, msg
|
||||
},
|
||||
})
|
||||
|
||||
require.NoError(t, err)
|
||||
|
||||
fcs.mu.Lock()
|
||||
defer fcs.mu.Unlock()
|
||||
|
||||
if fcs.tipsets == nil {
|
||||
fcs.tipsets = map[types.TipSetKey]*types.TipSet{}
|
||||
}
|
||||
fcs.tipsets[ts.Key()] = ts
|
||||
|
||||
require.NoError(t, err)
|
||||
|
||||
return ts
|
||||
}
|
||||
|
||||
|
||||
@@ -125,7 +125,7 @@ func (o *observer) listenHeadChangesOnce(ctx context.Context) error {
|
||||
|
||||
for changes := range notifs {
|
||||
if err := o.applyChanges(ctx, changes); err != nil {
|
||||
return err
|
||||
return xerrors.Errorf("failed to apply a change notification: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,8 +4,8 @@ import (
|
||||
"context"
|
||||
"sync"
|
||||
|
||||
blocks "github.com/ipfs/go-block-format"
|
||||
"github.com/ipfs/go-cid"
|
||||
blocks "github.com/ipfs/go-libipfs/blocks"
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
|
||||
+2
-1
@@ -34,6 +34,7 @@ import (
|
||||
"github.com/filecoin-project/lotus/chain/consensus"
|
||||
"github.com/filecoin-project/lotus/chain/consensus/filcns"
|
||||
genesis2 "github.com/filecoin-project/lotus/chain/gen/genesis"
|
||||
"github.com/filecoin-project/lotus/chain/index"
|
||||
"github.com/filecoin-project/lotus/chain/rand"
|
||||
"github.com/filecoin-project/lotus/chain/stmgr"
|
||||
"github.com/filecoin-project/lotus/chain/store"
|
||||
@@ -256,7 +257,7 @@ func NewGeneratorWithSectorsAndUpgradeSchedule(numSectors int, us stmgr.UpgradeS
|
||||
//return nil, xerrors.Errorf("creating drand beacon: %w", err)
|
||||
//}
|
||||
|
||||
sm, err := stmgr.NewStateManager(cs, consensus.NewTipSetExecutor(filcns.RewardFunc), sys, us, beac, ds)
|
||||
sm, err := stmgr.NewStateManager(cs, consensus.NewTipSetExecutor(filcns.RewardFunc), sys, us, beac, ds, index.DummyMsgIndex)
|
||||
if err != nil {
|
||||
return nil, xerrors.Errorf("initing stmgr: %w", err)
|
||||
}
|
||||
|
||||
@@ -3,8 +3,8 @@ package genesis
|
||||
import (
|
||||
"encoding/hex"
|
||||
|
||||
blocks "github.com/ipfs/go-block-format"
|
||||
"github.com/ipfs/go-cid"
|
||||
blocks "github.com/ipfs/go-libipfs/blocks"
|
||||
"github.com/multiformats/go-multihash"
|
||||
)
|
||||
|
||||
|
||||
@@ -11,7 +11,6 @@ import (
|
||||
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
|
||||
"github.com/filecoin-project/lotus/build"
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
)
|
||||
|
||||
@@ -27,24 +26,20 @@ func New(dstore ds.Batching) *SlashFilter {
|
||||
}
|
||||
}
|
||||
|
||||
func (f *SlashFilter) MinedBlock(ctx context.Context, bh *types.BlockHeader, parentEpoch abi.ChainEpoch) error {
|
||||
if build.IsNearUpgrade(bh.Height, build.UpgradeOrangeHeight) {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (f *SlashFilter) MinedBlock(ctx context.Context, bh *types.BlockHeader, parentEpoch abi.ChainEpoch) (cid.Cid, error) {
|
||||
epochKey := ds.NewKey(fmt.Sprintf("/%s/%d", bh.Miner, bh.Height))
|
||||
{
|
||||
// double-fork mining (2 blocks at one epoch)
|
||||
if err := checkFault(ctx, f.byEpoch, epochKey, bh, "double-fork mining faults"); err != nil {
|
||||
return err
|
||||
if witness, err := checkFault(ctx, f.byEpoch, epochKey, bh, "double-fork mining faults"); err != nil {
|
||||
return witness, xerrors.Errorf("check double-fork mining faults: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
parentsKey := ds.NewKey(fmt.Sprintf("/%s/%x", bh.Miner, types.NewTipSetKey(bh.Parents...).Bytes()))
|
||||
{
|
||||
// time-offset mining faults (2 blocks with the same parents)
|
||||
if err := checkFault(ctx, f.byParents, parentsKey, bh, "time-offset mining faults"); err != nil {
|
||||
return err
|
||||
if witness, err := checkFault(ctx, f.byParents, parentsKey, bh, "time-offset mining faults"); err != nil {
|
||||
return witness, xerrors.Errorf("check time-offset mining faults: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,19 +50,19 @@ func (f *SlashFilter) MinedBlock(ctx context.Context, bh *types.BlockHeader, par
|
||||
parentEpochKey := ds.NewKey(fmt.Sprintf("/%s/%d", bh.Miner, parentEpoch))
|
||||
have, err := f.byEpoch.Has(ctx, parentEpochKey)
|
||||
if err != nil {
|
||||
return err
|
||||
return cid.Undef, err
|
||||
}
|
||||
|
||||
if have {
|
||||
// If we had, make sure it's in our parent tipset
|
||||
cidb, err := f.byEpoch.Get(ctx, parentEpochKey)
|
||||
if err != nil {
|
||||
return xerrors.Errorf("getting other block cid: %w", err)
|
||||
return cid.Undef, xerrors.Errorf("getting other block cid: %w", err)
|
||||
}
|
||||
|
||||
_, parent, err := cid.CidFromBytes(cidb)
|
||||
if err != nil {
|
||||
return err
|
||||
return cid.Undef, err
|
||||
}
|
||||
|
||||
var found bool
|
||||
@@ -78,45 +73,45 @@ func (f *SlashFilter) MinedBlock(ctx context.Context, bh *types.BlockHeader, par
|
||||
}
|
||||
|
||||
if !found {
|
||||
return xerrors.Errorf("produced block would trigger 'parent-grinding fault' consensus fault; miner: %s; bh: %s, expected parent: %s", bh.Miner, bh.Cid(), parent)
|
||||
return parent, xerrors.Errorf("produced block would trigger 'parent-grinding fault' consensus fault; miner: %s; bh: %s, expected parent: %s", bh.Miner, bh.Cid(), parent)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if err := f.byParents.Put(ctx, parentsKey, bh.Cid().Bytes()); err != nil {
|
||||
return xerrors.Errorf("putting byEpoch entry: %w", err)
|
||||
return cid.Undef, xerrors.Errorf("putting byEpoch entry: %w", err)
|
||||
}
|
||||
|
||||
if err := f.byEpoch.Put(ctx, epochKey, bh.Cid().Bytes()); err != nil {
|
||||
return xerrors.Errorf("putting byEpoch entry: %w", err)
|
||||
return cid.Undef, xerrors.Errorf("putting byEpoch entry: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
return cid.Undef, nil
|
||||
}
|
||||
|
||||
func checkFault(ctx context.Context, t ds.Datastore, key ds.Key, bh *types.BlockHeader, faultType string) error {
|
||||
func checkFault(ctx context.Context, t ds.Datastore, key ds.Key, bh *types.BlockHeader, faultType string) (cid.Cid, error) {
|
||||
fault, err := t.Has(ctx, key)
|
||||
if err != nil {
|
||||
return err
|
||||
return cid.Undef, xerrors.Errorf("failed to read from datastore: %w", err)
|
||||
}
|
||||
|
||||
if fault {
|
||||
cidb, err := t.Get(ctx, key)
|
||||
if err != nil {
|
||||
return xerrors.Errorf("getting other block cid: %w", err)
|
||||
return cid.Undef, xerrors.Errorf("getting other block cid: %w", err)
|
||||
}
|
||||
|
||||
_, other, err := cid.CidFromBytes(cidb)
|
||||
if err != nil {
|
||||
return err
|
||||
return cid.Undef, err
|
||||
}
|
||||
|
||||
if other == bh.Cid() {
|
||||
return nil
|
||||
return cid.Undef, nil
|
||||
}
|
||||
|
||||
return xerrors.Errorf("produced block would trigger '%s' consensus fault; miner: %s; bh: %s, other: %s", faultType, bh.Miner, bh.Cid(), other)
|
||||
return other, xerrors.Errorf("produced block would trigger '%s' consensus fault; miner: %s; bh: %s, other: %s", faultType, bh.Miner, bh.Cid(), other)
|
||||
}
|
||||
|
||||
return nil
|
||||
return cid.Undef, nil
|
||||
}
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
package index
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
)
|
||||
|
||||
var ErrNotFound = errors.New("message not found")
|
||||
var ErrClosed = errors.New("index closed")
|
||||
|
||||
// MsgInfo is the Message metadata the index tracks.
|
||||
type MsgInfo struct {
|
||||
// the message this record refers to
|
||||
Message cid.Cid
|
||||
// the tipset where this message was included
|
||||
TipSet cid.Cid
|
||||
// the epoch where this message was included
|
||||
Epoch abi.ChainEpoch
|
||||
}
|
||||
|
||||
// MsgIndex is the interface to the message index
|
||||
type MsgIndex interface {
|
||||
// GetMsgInfo retrieves the message metadata through the index.
|
||||
// The lookup is done using the onchain message Cid; that is the signed message Cid
|
||||
// for SECP messages and unsigned message Cid for BLS messages.
|
||||
GetMsgInfo(ctx context.Context, m cid.Cid) (MsgInfo, error)
|
||||
// Close closes the index
|
||||
Close() error
|
||||
}
|
||||
|
||||
type dummyMsgIndex struct{}
|
||||
|
||||
func (dummyMsgIndex) GetMsgInfo(ctx context.Context, m cid.Cid) (MsgInfo, error) {
|
||||
return MsgInfo{}, ErrNotFound
|
||||
}
|
||||
|
||||
func (dummyMsgIndex) Close() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
var DummyMsgIndex MsgIndex = dummyMsgIndex{}
|
||||
@@ -0,0 +1,563 @@
|
||||
package index
|
||||
|
||||
import (
|
||||
"context"
|
||||
"database/sql"
|
||||
"errors"
|
||||
"io/fs"
|
||||
"os"
|
||||
"path"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
logging "github.com/ipfs/go-log/v2"
|
||||
_ "github.com/mattn/go-sqlite3"
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/store"
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
)
|
||||
|
||||
var log = logging.Logger("msgindex")
|
||||
|
||||
var dbName = "msgindex.db"
|
||||
var dbDefs = []string{
|
||||
`CREATE TABLE IF NOT EXISTS messages (
|
||||
cid VARCHAR(80) PRIMARY KEY ON CONFLICT REPLACE,
|
||||
tipset_cid VARCHAR(80) NOT NULL,
|
||||
epoch INTEGER NOT NULL
|
||||
)`,
|
||||
`CREATE INDEX IF NOT EXISTS tipset_cids ON messages (tipset_cid)
|
||||
`,
|
||||
`CREATE TABLE IF NOT EXISTS _meta (
|
||||
version UINT64 NOT NULL UNIQUE
|
||||
)`,
|
||||
`INSERT OR IGNORE INTO _meta (version) VALUES (1)`,
|
||||
}
|
||||
|
||||
var dbPragmas = []string{
|
||||
"PRAGMA synchronous = normal",
|
||||
"PRAGMA temp_store = memory",
|
||||
"PRAGMA mmap_size = 30000000000",
|
||||
"PRAGMA page_size = 32768",
|
||||
"PRAGMA auto_vacuum = NONE",
|
||||
"PRAGMA automatic_index = OFF",
|
||||
"PRAGMA journal_mode = WAL",
|
||||
"PRAGMA read_uncommitted = ON",
|
||||
}
|
||||
|
||||
const (
|
||||
// prepared stmts
|
||||
dbqGetMessageInfo = "SELECT tipset_cid, epoch FROM messages WHERE cid = ?"
|
||||
dbqInsertMessage = "INSERT INTO messages VALUES (?, ?, ?)"
|
||||
dbqDeleteTipsetMessages = "DELETE FROM messages WHERE tipset_cid = ?"
|
||||
// reconciliation
|
||||
dbqCountMessages = "SELECT COUNT(*) FROM messages"
|
||||
dbqMinEpoch = "SELECT MIN(epoch) FROM messages"
|
||||
dbqCountTipsetMessages = "SELECT COUNT(*) FROM messages WHERE tipset_cid = ?"
|
||||
dbqDeleteMessagesByEpoch = "DELETE FROM messages WHERE epoch >= ?"
|
||||
)
|
||||
|
||||
// coalescer configuration (TODO: use observer instead)
|
||||
// these are exposed to make tests snappy
|
||||
var (
|
||||
CoalesceMinDelay = time.Second
|
||||
CoalesceMaxDelay = 15 * time.Second
|
||||
CoalesceMergeInterval = time.Second
|
||||
)
|
||||
|
||||
// chain store interface; we could use store.ChainStore directly,
|
||||
// but this simplifies unit testing.
|
||||
type ChainStore interface {
|
||||
SubscribeHeadChanges(f store.ReorgNotifee)
|
||||
MessagesForTipset(ctx context.Context, ts *types.TipSet) ([]types.ChainMsg, error)
|
||||
GetHeaviestTipSet() *types.TipSet
|
||||
GetTipSetFromKey(ctx context.Context, tsk types.TipSetKey) (*types.TipSet, error)
|
||||
}
|
||||
|
||||
var _ ChainStore = (*store.ChainStore)(nil)
|
||||
|
||||
type msgIndex struct {
|
||||
cs ChainStore
|
||||
|
||||
db *sql.DB
|
||||
selectMsgStmt *sql.Stmt
|
||||
insertMsgStmt *sql.Stmt
|
||||
deleteTipSetStmt *sql.Stmt
|
||||
|
||||
sema chan struct{}
|
||||
mx sync.Mutex
|
||||
pend []headChange
|
||||
|
||||
cancel func()
|
||||
workers sync.WaitGroup
|
||||
closeLk sync.RWMutex
|
||||
closed bool
|
||||
}
|
||||
|
||||
var _ MsgIndex = (*msgIndex)(nil)
|
||||
|
||||
type headChange struct {
|
||||
rev []*types.TipSet
|
||||
app []*types.TipSet
|
||||
}
|
||||
|
||||
func NewMsgIndex(lctx context.Context, basePath string, cs ChainStore) (MsgIndex, error) {
|
||||
var (
|
||||
dbPath string
|
||||
exists bool
|
||||
err error
|
||||
)
|
||||
|
||||
err = os.MkdirAll(basePath, 0755)
|
||||
if err != nil {
|
||||
return nil, xerrors.Errorf("error creating msgindex base directory: %w", err)
|
||||
}
|
||||
|
||||
dbPath = path.Join(basePath, dbName)
|
||||
_, err = os.Stat(dbPath)
|
||||
switch {
|
||||
case err == nil:
|
||||
exists = true
|
||||
|
||||
case errors.Is(err, fs.ErrNotExist):
|
||||
|
||||
case err != nil:
|
||||
return nil, xerrors.Errorf("error stating msgindex database: %w", err)
|
||||
}
|
||||
|
||||
db, err := sql.Open("sqlite3", dbPath)
|
||||
if err != nil {
|
||||
// TODO [nice to have]: automaticaly delete corrupt databases
|
||||
// but for now we can just error and let the operator delete.
|
||||
return nil, xerrors.Errorf("error opening msgindex database: %w", err)
|
||||
}
|
||||
|
||||
if err := prepareDB(db); err != nil {
|
||||
return nil, xerrors.Errorf("error creating msgindex database: %w", err)
|
||||
}
|
||||
|
||||
// TODO we may consider populating the index when first creating the db
|
||||
if exists {
|
||||
if err := reconcileIndex(db, cs); err != nil {
|
||||
return nil, xerrors.Errorf("error reconciling msgindex database: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
ctx, cancel := context.WithCancel(lctx)
|
||||
|
||||
msgIndex := &msgIndex{
|
||||
db: db,
|
||||
cs: cs,
|
||||
sema: make(chan struct{}, 1),
|
||||
cancel: cancel,
|
||||
}
|
||||
|
||||
err = msgIndex.prepareStatements()
|
||||
if err != nil {
|
||||
if err := db.Close(); err != nil {
|
||||
log.Errorf("error closing msgindex database: %s", err)
|
||||
}
|
||||
|
||||
return nil, xerrors.Errorf("error preparing msgindex database statements: %w", err)
|
||||
}
|
||||
|
||||
rnf := store.WrapHeadChangeCoalescer(
|
||||
msgIndex.onHeadChange,
|
||||
CoalesceMinDelay,
|
||||
CoalesceMaxDelay,
|
||||
CoalesceMergeInterval,
|
||||
)
|
||||
cs.SubscribeHeadChanges(rnf)
|
||||
|
||||
msgIndex.workers.Add(1)
|
||||
go msgIndex.background(ctx)
|
||||
|
||||
return msgIndex, nil
|
||||
}
|
||||
|
||||
func PopulateAfterSnapshot(lctx context.Context, basePath string, cs ChainStore) error {
|
||||
err := os.MkdirAll(basePath, 0755)
|
||||
if err != nil {
|
||||
return xerrors.Errorf("error creating msgindex base directory: %w", err)
|
||||
}
|
||||
|
||||
dbPath := path.Join(basePath, dbName)
|
||||
|
||||
// if a database already exists, we try to delete it and create a new one
|
||||
if _, err := os.Stat(dbPath); err == nil {
|
||||
if err = os.Remove(dbPath); err != nil {
|
||||
return xerrors.Errorf("msgindex already exists at %s and can't be deleted", dbPath)
|
||||
}
|
||||
}
|
||||
|
||||
db, err := sql.Open("sqlite3", dbPath)
|
||||
if err != nil {
|
||||
return xerrors.Errorf("error opening msgindex database: %w", err)
|
||||
}
|
||||
defer func() {
|
||||
if err := db.Close(); err != nil {
|
||||
log.Errorf("error closing msgindex database: %s", err)
|
||||
}
|
||||
}()
|
||||
|
||||
if err := prepareDB(db); err != nil {
|
||||
return xerrors.Errorf("error creating msgindex database: %w", err)
|
||||
}
|
||||
|
||||
tx, err := db.Begin()
|
||||
if err != nil {
|
||||
return xerrors.Errorf("error when starting transaction: %w", err)
|
||||
}
|
||||
|
||||
rollback := func() {
|
||||
if err := tx.Rollback(); err != nil {
|
||||
log.Errorf("error in rollback: %s", err)
|
||||
}
|
||||
}
|
||||
|
||||
insertStmt, err := tx.Prepare(dbqInsertMessage)
|
||||
if err != nil {
|
||||
rollback()
|
||||
return xerrors.Errorf("error preparing insertStmt: %w", err)
|
||||
}
|
||||
|
||||
curTs := cs.GetHeaviestTipSet()
|
||||
startHeight := curTs.Height()
|
||||
for curTs != nil {
|
||||
tscid, err := curTs.Key().Cid()
|
||||
if err != nil {
|
||||
rollback()
|
||||
return xerrors.Errorf("error computing tipset cid: %w", err)
|
||||
}
|
||||
|
||||
tskey := tscid.String()
|
||||
epoch := int64(curTs.Height())
|
||||
|
||||
msgs, err := cs.MessagesForTipset(lctx, curTs)
|
||||
if err != nil {
|
||||
log.Infof("stopping import after %d tipsets", startHeight-curTs.Height())
|
||||
break
|
||||
}
|
||||
|
||||
for _, msg := range msgs {
|
||||
key := msg.Cid().String()
|
||||
if _, err := insertStmt.Exec(key, tskey, epoch); err != nil {
|
||||
rollback()
|
||||
return xerrors.Errorf("error inserting message: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
curTs, err = cs.GetTipSetFromKey(lctx, curTs.Parents())
|
||||
if err != nil {
|
||||
rollback()
|
||||
return xerrors.Errorf("error walking chain: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
err = tx.Commit()
|
||||
if err != nil {
|
||||
return xerrors.Errorf("error committing transaction: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// init utilities
|
||||
func prepareDB(db *sql.DB) error {
|
||||
for _, stmt := range dbDefs {
|
||||
if _, err := db.Exec(stmt); err != nil {
|
||||
return xerrors.Errorf("error executing sql statement '%s': %w", stmt, err)
|
||||
}
|
||||
}
|
||||
|
||||
for _, stmt := range dbPragmas {
|
||||
if _, err := db.Exec(stmt); err != nil {
|
||||
return xerrors.Errorf("error executing sql statement '%s': %w", stmt, err)
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func reconcileIndex(db *sql.DB, cs ChainStore) error {
|
||||
// Invariant: after reconciliation, every tipset in the index is in the current chain; ie either
|
||||
// the chain head or reachable by walking the chain.
|
||||
// Algorithm:
|
||||
// 1. Count messages in index; if none, trivially reconciled.
|
||||
// TODO we may consider populating the index in that case
|
||||
// 2. Find the minimum tipset in the index; this will mark the end of the reconciliation walk
|
||||
// 3. Walk from current tipset until we find a tipset in the index.
|
||||
// 4. Delete (revert!) all tipsets above the found tipset.
|
||||
// 5. If the walk ends in the boundary epoch, then delete everything.
|
||||
//
|
||||
|
||||
row := db.QueryRow(dbqCountMessages)
|
||||
|
||||
var result int64
|
||||
if err := row.Scan(&result); err != nil {
|
||||
return xerrors.Errorf("error counting messages: %w", err)
|
||||
}
|
||||
|
||||
if result == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
row = db.QueryRow(dbqMinEpoch)
|
||||
if err := row.Scan(&result); err != nil {
|
||||
return xerrors.Errorf("error finding boundary epoch: %w", err)
|
||||
}
|
||||
|
||||
boundaryEpoch := abi.ChainEpoch(result)
|
||||
|
||||
countMsgsStmt, err := db.Prepare(dbqCountTipsetMessages)
|
||||
if err != nil {
|
||||
return xerrors.Errorf("error preparing statement: %w", err)
|
||||
}
|
||||
|
||||
curTs := cs.GetHeaviestTipSet()
|
||||
for curTs != nil && curTs.Height() >= boundaryEpoch {
|
||||
tsCid, err := curTs.Key().Cid()
|
||||
if err != nil {
|
||||
return xerrors.Errorf("error computing tipset cid: %w", err)
|
||||
}
|
||||
|
||||
key := tsCid.String()
|
||||
row = countMsgsStmt.QueryRow(key)
|
||||
if err := row.Scan(&result); err != nil {
|
||||
return xerrors.Errorf("error counting messages: %w", err)
|
||||
}
|
||||
|
||||
if result > 0 {
|
||||
// found it!
|
||||
boundaryEpoch = curTs.Height() + 1
|
||||
break
|
||||
}
|
||||
|
||||
// walk up
|
||||
parents := curTs.Parents()
|
||||
curTs, err = cs.GetTipSetFromKey(context.TODO(), parents)
|
||||
if err != nil {
|
||||
return xerrors.Errorf("error walking chain: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
// delete everything above the minEpoch
|
||||
if _, err = db.Exec(dbqDeleteMessagesByEpoch, int64(boundaryEpoch)); err != nil {
|
||||
return xerrors.Errorf("error deleting stale reorged out message: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *msgIndex) prepareStatements() error {
|
||||
stmt, err := x.db.Prepare(dbqGetMessageInfo)
|
||||
if err != nil {
|
||||
return xerrors.Errorf("prepare selectMsgStmt: %w", err)
|
||||
}
|
||||
x.selectMsgStmt = stmt
|
||||
|
||||
stmt, err = x.db.Prepare(dbqInsertMessage)
|
||||
if err != nil {
|
||||
return xerrors.Errorf("prepare insertMsgStmt: %w", err)
|
||||
}
|
||||
x.insertMsgStmt = stmt
|
||||
|
||||
stmt, err = x.db.Prepare(dbqDeleteTipsetMessages)
|
||||
if err != nil {
|
||||
return xerrors.Errorf("prepare deleteTipSetStmt: %w", err)
|
||||
}
|
||||
x.deleteTipSetStmt = stmt
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// head change notifee
|
||||
func (x *msgIndex) onHeadChange(rev, app []*types.TipSet) error {
|
||||
x.closeLk.RLock()
|
||||
defer x.closeLk.RUnlock()
|
||||
|
||||
if x.closed {
|
||||
return nil
|
||||
}
|
||||
|
||||
// do it in the background to avoid blocking head change processing
|
||||
x.mx.Lock()
|
||||
x.pend = append(x.pend, headChange{rev: rev, app: app})
|
||||
pendLen := len(x.pend)
|
||||
x.mx.Unlock()
|
||||
|
||||
// complain loudly if this is building backlog
|
||||
if pendLen > 10 {
|
||||
log.Warnf("message index head change processing is building backlog: %d pending head changes", pendLen)
|
||||
}
|
||||
|
||||
select {
|
||||
case x.sema <- struct{}{}:
|
||||
default:
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *msgIndex) background(ctx context.Context) {
|
||||
defer x.workers.Done()
|
||||
|
||||
for {
|
||||
select {
|
||||
case <-x.sema:
|
||||
err := x.processHeadChanges(ctx)
|
||||
if err != nil {
|
||||
// we can't rely on an inconsistent index, so shut it down.
|
||||
log.Errorf("error processing head change notifications: %s; shutting down message index", err)
|
||||
if err2 := x.Close(); err2 != nil {
|
||||
log.Errorf("error shutting down index: %s", err2)
|
||||
}
|
||||
}
|
||||
|
||||
case <-ctx.Done():
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (x *msgIndex) processHeadChanges(ctx context.Context) error {
|
||||
x.mx.Lock()
|
||||
pend := x.pend
|
||||
x.pend = nil
|
||||
x.mx.Unlock()
|
||||
|
||||
tx, err := x.db.Begin()
|
||||
if err != nil {
|
||||
return xerrors.Errorf("error creating transaction: %w", err)
|
||||
}
|
||||
|
||||
for _, hc := range pend {
|
||||
for _, ts := range hc.rev {
|
||||
if err := x.doRevert(ctx, tx, ts); err != nil {
|
||||
if err2 := tx.Rollback(); err2 != nil {
|
||||
log.Errorf("error rolling back transaction: %s", err2)
|
||||
}
|
||||
return xerrors.Errorf("error reverting %s: %w", ts, err)
|
||||
}
|
||||
}
|
||||
|
||||
for _, ts := range hc.app {
|
||||
if err := x.doApply(ctx, tx, ts); err != nil {
|
||||
if err2 := tx.Rollback(); err2 != nil {
|
||||
log.Errorf("error rolling back transaction: %s", err2)
|
||||
}
|
||||
return xerrors.Errorf("error applying %s: %w", ts, err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return tx.Commit()
|
||||
}
|
||||
|
||||
func (x *msgIndex) doRevert(ctx context.Context, tx *sql.Tx, ts *types.TipSet) error {
|
||||
tskey, err := ts.Key().Cid()
|
||||
if err != nil {
|
||||
return xerrors.Errorf("error computing tipset cid: %w", err)
|
||||
}
|
||||
|
||||
key := tskey.String()
|
||||
_, err = tx.Stmt(x.deleteTipSetStmt).Exec(key)
|
||||
return err
|
||||
}
|
||||
|
||||
func (x *msgIndex) doApply(ctx context.Context, tx *sql.Tx, ts *types.TipSet) error {
|
||||
tscid, err := ts.Key().Cid()
|
||||
if err != nil {
|
||||
return xerrors.Errorf("error computing tipset cid: %w", err)
|
||||
}
|
||||
|
||||
tskey := tscid.String()
|
||||
epoch := int64(ts.Height())
|
||||
|
||||
msgs, err := x.cs.MessagesForTipset(ctx, ts)
|
||||
if err != nil {
|
||||
return xerrors.Errorf("error retrieving messages for tipset %s: %w", ts, err)
|
||||
}
|
||||
|
||||
insertStmt := tx.Stmt(x.insertMsgStmt)
|
||||
for _, msg := range msgs {
|
||||
key := msg.Cid().String()
|
||||
if _, err := insertStmt.Exec(key, tskey, epoch); err != nil {
|
||||
return xerrors.Errorf("error inserting message: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// interface
|
||||
func (x *msgIndex) GetMsgInfo(ctx context.Context, m cid.Cid) (MsgInfo, error) {
|
||||
x.closeLk.RLock()
|
||||
defer x.closeLk.RUnlock()
|
||||
|
||||
if x.closed {
|
||||
return MsgInfo{}, ErrClosed
|
||||
}
|
||||
|
||||
var (
|
||||
tipset string
|
||||
epoch int64
|
||||
)
|
||||
|
||||
key := m.String()
|
||||
row := x.selectMsgStmt.QueryRow(key)
|
||||
err := row.Scan(&tipset, &epoch)
|
||||
switch {
|
||||
case err == sql.ErrNoRows:
|
||||
return MsgInfo{}, ErrNotFound
|
||||
|
||||
case err != nil:
|
||||
return MsgInfo{}, xerrors.Errorf("error querying msgindex database: %w", err)
|
||||
}
|
||||
|
||||
tipsetCid, err := cid.Decode(tipset)
|
||||
if err != nil {
|
||||
return MsgInfo{}, xerrors.Errorf("error decoding tipset cid: %w", err)
|
||||
}
|
||||
|
||||
return MsgInfo{
|
||||
Message: m,
|
||||
TipSet: tipsetCid,
|
||||
Epoch: abi.ChainEpoch(epoch),
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (x *msgIndex) Close() error {
|
||||
x.closeLk.Lock()
|
||||
defer x.closeLk.Unlock()
|
||||
|
||||
if x.closed {
|
||||
return nil
|
||||
}
|
||||
|
||||
x.closed = true
|
||||
|
||||
x.cancel()
|
||||
x.workers.Wait()
|
||||
|
||||
return x.db.Close()
|
||||
}
|
||||
|
||||
// informal apis for itests; not exposed in the main interface
|
||||
func (x *msgIndex) CountMessages() (int64, error) {
|
||||
x.closeLk.RLock()
|
||||
defer x.closeLk.RUnlock()
|
||||
|
||||
if x.closed {
|
||||
return 0, ErrClosed
|
||||
}
|
||||
|
||||
var result int64
|
||||
row := x.db.QueryRow(dbqCountMessages)
|
||||
err := row.Scan(&result)
|
||||
return result, err
|
||||
}
|
||||
@@ -0,0 +1,307 @@
|
||||
package index
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"math/rand"
|
||||
"os"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
blocks "github.com/ipfs/go-block-format"
|
||||
"github.com/ipfs/go-cid"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/store"
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
"github.com/filecoin-project/lotus/chain/types/mock"
|
||||
)
|
||||
|
||||
func TestBasicMsgIndex(t *testing.T) {
|
||||
// the most basic of tests:
|
||||
// 1. Create an index with mock chain store
|
||||
// 2. Advance the chain for a few tipsets
|
||||
// 3. Verify that the index contains all messages with the correct tipset/epoch
|
||||
cs := newMockChainStore()
|
||||
cs.genesis()
|
||||
|
||||
tmp := t.TempDir()
|
||||
t.Cleanup(func() { _ = os.RemoveAll(tmp) })
|
||||
|
||||
msgIndex, err := NewMsgIndex(context.Background(), tmp, cs)
|
||||
require.NoError(t, err)
|
||||
|
||||
defer msgIndex.Close() //nolint
|
||||
|
||||
for i := 0; i < 10; i++ {
|
||||
t.Logf("advance to epoch %d", i+1)
|
||||
err := cs.advance()
|
||||
require.NoError(t, err)
|
||||
}
|
||||
|
||||
waitForCoalescerAfterLastEvent()
|
||||
|
||||
t.Log("verifying index")
|
||||
verifyIndex(t, cs, msgIndex)
|
||||
}
|
||||
|
||||
func TestReorgMsgIndex(t *testing.T) {
|
||||
// slightly more nuanced test that includes reorgs
|
||||
// 1. Create an index with mock chain store
|
||||
// 2. Advance/Reorg the chain for a few tipsets
|
||||
// 3. Verify that the index contains all messages with the correct tipset/epoch
|
||||
cs := newMockChainStore()
|
||||
cs.genesis()
|
||||
|
||||
tmp := t.TempDir()
|
||||
t.Cleanup(func() { _ = os.RemoveAll(tmp) })
|
||||
|
||||
msgIndex, err := NewMsgIndex(context.Background(), tmp, cs)
|
||||
require.NoError(t, err)
|
||||
|
||||
defer msgIndex.Close() //nolint
|
||||
|
||||
for i := 0; i < 10; i++ {
|
||||
t.Logf("advance to epoch %d", i+1)
|
||||
err := cs.advance()
|
||||
require.NoError(t, err)
|
||||
}
|
||||
|
||||
waitForCoalescerAfterLastEvent()
|
||||
|
||||
// a simple reorg
|
||||
t.Log("doing reorg")
|
||||
reorgme := cs.curTs
|
||||
reorgmeParent, err := cs.GetTipSetFromKey(context.Background(), reorgme.Parents())
|
||||
require.NoError(t, err)
|
||||
cs.setHead(reorgmeParent)
|
||||
reorgmeChild := cs.makeBlk()
|
||||
err = cs.reorg([]*types.TipSet{reorgme}, []*types.TipSet{reorgmeChild})
|
||||
require.NoError(t, err)
|
||||
|
||||
waitForCoalescerAfterLastEvent()
|
||||
|
||||
t.Log("verifying index")
|
||||
verifyIndex(t, cs, msgIndex)
|
||||
|
||||
t.Log("verifying that reorged messages are not present")
|
||||
verifyMissing(t, cs, msgIndex, reorgme)
|
||||
}
|
||||
|
||||
func TestReconcileMsgIndex(t *testing.T) {
|
||||
// test that exercises the reconciliation code paths
|
||||
// 1. Create and populate a basic msgindex, similar to TestBasicMsgIndex.
|
||||
// 2. Close it
|
||||
// 3. Reorg the mock chain store
|
||||
// 4. Reopen the index to trigger reconciliation
|
||||
// 5. Enxure that only the stable messages remain.
|
||||
cs := newMockChainStore()
|
||||
cs.genesis()
|
||||
|
||||
tmp := t.TempDir()
|
||||
t.Cleanup(func() { _ = os.RemoveAll(tmp) })
|
||||
|
||||
msgIndex, err := NewMsgIndex(context.Background(), tmp, cs)
|
||||
require.NoError(t, err)
|
||||
|
||||
for i := 0; i < 10; i++ {
|
||||
t.Logf("advance to epoch %d", i+1)
|
||||
err := cs.advance()
|
||||
require.NoError(t, err)
|
||||
}
|
||||
|
||||
waitForCoalescerAfterLastEvent()
|
||||
|
||||
// Close it and reorg
|
||||
err = msgIndex.Close()
|
||||
require.NoError(t, err)
|
||||
cs.notify = nil
|
||||
|
||||
// a simple reorg
|
||||
t.Log("doing reorg")
|
||||
reorgme := cs.curTs
|
||||
reorgmeParent, err := cs.GetTipSetFromKey(context.Background(), reorgme.Parents())
|
||||
require.NoError(t, err)
|
||||
cs.setHead(reorgmeParent)
|
||||
reorgmeChild := cs.makeBlk()
|
||||
err = cs.reorg([]*types.TipSet{reorgme}, []*types.TipSet{reorgmeChild})
|
||||
require.NoError(t, err)
|
||||
|
||||
// reopen to reconcile
|
||||
msgIndex, err = NewMsgIndex(context.Background(), tmp, cs)
|
||||
require.NoError(t, err)
|
||||
|
||||
defer msgIndex.Close() //nolint
|
||||
|
||||
t.Log("verifying index")
|
||||
// need to step one up because the last tipset is not known by the index
|
||||
cs.setHead(reorgmeParent)
|
||||
verifyIndex(t, cs, msgIndex)
|
||||
|
||||
t.Log("verifying that reorged and unknown messages are not present")
|
||||
verifyMissing(t, cs, msgIndex, reorgme, reorgmeChild)
|
||||
}
|
||||
|
||||
func verifyIndex(t *testing.T, cs *mockChainStore, msgIndex MsgIndex) {
|
||||
for ts := cs.curTs; ts.Height() > 0; {
|
||||
t.Logf("verify at height %d", ts.Height())
|
||||
blks := ts.Blocks()
|
||||
if len(blks) == 0 {
|
||||
break
|
||||
}
|
||||
|
||||
tsCid, err := ts.Key().Cid()
|
||||
require.NoError(t, err)
|
||||
|
||||
msgs, err := cs.MessagesForTipset(context.Background(), ts)
|
||||
require.NoError(t, err)
|
||||
for _, m := range msgs {
|
||||
minfo, err := msgIndex.GetMsgInfo(context.Background(), m.Cid())
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, tsCid, minfo.TipSet)
|
||||
require.Equal(t, ts.Height(), minfo.Epoch)
|
||||
}
|
||||
|
||||
parents := ts.Parents()
|
||||
ts, err = cs.GetTipSetFromKey(context.Background(), parents)
|
||||
require.NoError(t, err)
|
||||
}
|
||||
}
|
||||
|
||||
func verifyMissing(t *testing.T, cs *mockChainStore, msgIndex MsgIndex, missing ...*types.TipSet) {
|
||||
for _, ts := range missing {
|
||||
msgs, err := cs.MessagesForTipset(context.Background(), ts)
|
||||
require.NoError(t, err)
|
||||
for _, m := range msgs {
|
||||
_, err := msgIndex.GetMsgInfo(context.Background(), m.Cid())
|
||||
require.Equal(t, ErrNotFound, err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
type mockChainStore struct {
|
||||
notify store.ReorgNotifee
|
||||
|
||||
curTs *types.TipSet
|
||||
tipsets map[types.TipSetKey]*types.TipSet
|
||||
msgs map[types.TipSetKey][]types.ChainMsg
|
||||
|
||||
nonce uint64
|
||||
}
|
||||
|
||||
var _ ChainStore = (*mockChainStore)(nil)
|
||||
|
||||
var systemAddr address.Address
|
||||
var rng *rand.Rand
|
||||
|
||||
func init() {
|
||||
systemAddr, _ = address.NewIDAddress(0)
|
||||
rng = rand.New(rand.NewSource(314159))
|
||||
|
||||
// adjust those to make tests snappy
|
||||
CoalesceMinDelay = 100 * time.Millisecond
|
||||
CoalesceMaxDelay = time.Second
|
||||
CoalesceMergeInterval = 100 * time.Millisecond
|
||||
}
|
||||
|
||||
func newMockChainStore() *mockChainStore {
|
||||
return &mockChainStore{
|
||||
tipsets: make(map[types.TipSetKey]*types.TipSet),
|
||||
msgs: make(map[types.TipSetKey][]types.ChainMsg),
|
||||
}
|
||||
}
|
||||
|
||||
func (cs *mockChainStore) genesis() {
|
||||
genBlock := mock.MkBlock(nil, 0, 0)
|
||||
genTs := mock.TipSet(genBlock)
|
||||
cs.msgs[genTs.Key()] = nil
|
||||
cs.setHead(genTs)
|
||||
}
|
||||
|
||||
func (cs *mockChainStore) setHead(ts *types.TipSet) {
|
||||
cs.curTs = ts
|
||||
cs.tipsets[ts.Key()] = ts
|
||||
}
|
||||
|
||||
func (cs *mockChainStore) advance() error {
|
||||
ts := cs.makeBlk()
|
||||
return cs.reorg(nil, []*types.TipSet{ts})
|
||||
}
|
||||
|
||||
func (cs *mockChainStore) reorg(rev, app []*types.TipSet) error {
|
||||
for _, ts := range rev {
|
||||
parents := ts.Parents()
|
||||
cs.curTs = cs.tipsets[parents]
|
||||
}
|
||||
|
||||
for _, ts := range app {
|
||||
cs.tipsets[ts.Key()] = ts
|
||||
cs.curTs = ts
|
||||
}
|
||||
|
||||
if cs.notify != nil {
|
||||
return cs.notify(rev, app)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (cs *mockChainStore) makeBlk() *types.TipSet {
|
||||
height := cs.curTs.Height() + 1
|
||||
|
||||
blk := mock.MkBlock(cs.curTs, uint64(height), uint64(height))
|
||||
blk.Messages = cs.makeGarbageCid()
|
||||
|
||||
ts := mock.TipSet(blk)
|
||||
msg1 := cs.makeMsg()
|
||||
msg2 := cs.makeMsg()
|
||||
cs.msgs[ts.Key()] = []types.ChainMsg{msg1, msg2}
|
||||
|
||||
return ts
|
||||
}
|
||||
|
||||
func (cs *mockChainStore) makeMsg() *types.Message {
|
||||
nonce := cs.nonce
|
||||
cs.nonce++
|
||||
return &types.Message{To: systemAddr, From: systemAddr, Nonce: nonce}
|
||||
}
|
||||
|
||||
func (cs *mockChainStore) makeGarbageCid() cid.Cid {
|
||||
garbage := blocks.NewBlock([]byte{byte(rng.Intn(256)), byte(rng.Intn(256)), byte(rng.Intn(256))})
|
||||
return garbage.Cid()
|
||||
}
|
||||
|
||||
func (cs *mockChainStore) SubscribeHeadChanges(f store.ReorgNotifee) {
|
||||
cs.notify = f
|
||||
}
|
||||
|
||||
func (cs *mockChainStore) MessagesForTipset(ctx context.Context, ts *types.TipSet) ([]types.ChainMsg, error) {
|
||||
msgs, ok := cs.msgs[ts.Key()]
|
||||
if !ok {
|
||||
return nil, errors.New("unknown tipset")
|
||||
}
|
||||
|
||||
return msgs, nil
|
||||
}
|
||||
|
||||
func (cs *mockChainStore) GetHeaviestTipSet() *types.TipSet {
|
||||
return cs.curTs
|
||||
}
|
||||
|
||||
func (cs *mockChainStore) GetTipSetFromKey(ctx context.Context, tsk types.TipSetKey) (*types.TipSet, error) {
|
||||
ts, ok := cs.tipsets[tsk]
|
||||
if !ok {
|
||||
return nil, errors.New("unknown tipset")
|
||||
}
|
||||
return ts, nil
|
||||
}
|
||||
|
||||
func waitForCoalescerAfterLastEvent() {
|
||||
// It can take up to CoalesceMinDelay for the coalescer timer to fire after the last event.
|
||||
// When the timer fires, it can wait up to CoalesceMinDelay again for more events.
|
||||
// Therefore the total wait is 2 * CoalesceMinDelay.
|
||||
// Then we wait another second for the listener (the index) to actually process events.
|
||||
time.Sleep(2*CoalesceMinDelay + time.Second)
|
||||
}
|
||||
+25
-12
@@ -32,14 +32,19 @@ func (mp *MessagePool) CheckMessages(ctx context.Context, protos []*api.MessageP
|
||||
// CheckPendingMessages performs a set of logical sets for all messages pending from a given actor
|
||||
func (mp *MessagePool) CheckPendingMessages(ctx context.Context, from address.Address) ([][]api.MessageCheckStatus, error) {
|
||||
var msgs []*types.Message
|
||||
mp.lk.Lock()
|
||||
mset, ok := mp.pending[from]
|
||||
mp.lk.RLock()
|
||||
mset, ok, err := mp.getPendingMset(ctx, from)
|
||||
if err != nil {
|
||||
mp.lk.RUnlock()
|
||||
return nil, xerrors.Errorf("errored while getting pending mset: %w", err)
|
||||
}
|
||||
if ok {
|
||||
msgs = make([]*types.Message, 0, len(mset.msgs))
|
||||
for _, sm := range mset.msgs {
|
||||
msgs = append(msgs, &sm.Message)
|
||||
}
|
||||
}
|
||||
mp.lk.Unlock()
|
||||
mp.lk.RUnlock()
|
||||
|
||||
if len(msgs) == 0 {
|
||||
return nil, nil
|
||||
@@ -58,13 +63,17 @@ func (mp *MessagePool) CheckReplaceMessages(ctx context.Context, replace []*type
|
||||
msgMap := make(map[address.Address]map[uint64]*types.Message)
|
||||
count := 0
|
||||
|
||||
mp.lk.Lock()
|
||||
mp.lk.RLock()
|
||||
for _, m := range replace {
|
||||
mmap, ok := msgMap[m.From]
|
||||
if !ok {
|
||||
mmap = make(map[uint64]*types.Message)
|
||||
msgMap[m.From] = mmap
|
||||
mset, ok := mp.pending[m.From]
|
||||
mset, ok, err := mp.getPendingMset(ctx, m.From)
|
||||
if err != nil {
|
||||
mp.lk.RUnlock()
|
||||
return nil, xerrors.Errorf("errored while getting pending mset: %w", err)
|
||||
}
|
||||
if ok {
|
||||
count += len(mset.msgs)
|
||||
for _, sm := range mset.msgs {
|
||||
@@ -76,7 +85,7 @@ func (mp *MessagePool) CheckReplaceMessages(ctx context.Context, replace []*type
|
||||
}
|
||||
mmap[m.Nonce] = m
|
||||
}
|
||||
mp.lk.Unlock()
|
||||
mp.lk.RUnlock()
|
||||
|
||||
msgs := make([]*types.Message, 0, count)
|
||||
start := 0
|
||||
@@ -103,9 +112,9 @@ func (mp *MessagePool) checkMessages(ctx context.Context, msgs []*types.Message,
|
||||
if mp.api.IsLite() {
|
||||
return nil, nil
|
||||
}
|
||||
mp.curTsLk.Lock()
|
||||
mp.curTsLk.RLock()
|
||||
curTs := mp.curTs
|
||||
mp.curTsLk.Unlock()
|
||||
mp.curTsLk.RUnlock()
|
||||
|
||||
epoch := curTs.Height() + 1
|
||||
|
||||
@@ -143,22 +152,26 @@ func (mp *MessagePool) checkMessages(ctx context.Context, msgs []*types.Message,
|
||||
|
||||
st, ok := state[m.From]
|
||||
if !ok {
|
||||
mp.lk.Lock()
|
||||
mset, ok := mp.pending[m.From]
|
||||
mp.lk.RLock()
|
||||
mset, ok, err := mp.getPendingMset(ctx, m.From)
|
||||
if err != nil {
|
||||
mp.lk.RUnlock()
|
||||
return nil, xerrors.Errorf("errored while getting pending mset: %w", err)
|
||||
}
|
||||
if ok && !interned {
|
||||
st = &actorState{nextNonce: mset.nextNonce, requiredFunds: mset.requiredFunds}
|
||||
for _, m := range mset.msgs {
|
||||
st.requiredFunds = new(stdbig.Int).Add(st.requiredFunds, m.Message.Value.Int)
|
||||
}
|
||||
state[m.From] = st
|
||||
mp.lk.Unlock()
|
||||
mp.lk.RUnlock()
|
||||
|
||||
check.OK = true
|
||||
check.Hint = map[string]interface{}{
|
||||
"nonce": st.nextNonce,
|
||||
}
|
||||
} else {
|
||||
mp.lk.Unlock()
|
||||
mp.lk.RUnlock()
|
||||
|
||||
stateNonce, err := mp.getStateNonce(ctx, m.From, curTs)
|
||||
if err != nil {
|
||||
|
||||
@@ -118,7 +118,7 @@ func init() {
|
||||
}
|
||||
|
||||
type MessagePool struct {
|
||||
lk sync.Mutex
|
||||
lk sync.RWMutex
|
||||
|
||||
ds dtypes.MetadataDS
|
||||
|
||||
@@ -137,9 +137,9 @@ type MessagePool struct {
|
||||
// do NOT access this map directly, use getPendingMset, setPendingMset, deletePendingMset, forEachPending, and clearPending respectively
|
||||
pending map[address.Address]*msgSet
|
||||
|
||||
keyCache map[address.Address]address.Address
|
||||
keyCache *lru.Cache[address.Address, address.Address]
|
||||
|
||||
curTsLk sync.Mutex // DO NOT LOCK INSIDE lk
|
||||
curTsLk sync.RWMutex // DO NOT LOCK INSIDE lk
|
||||
curTs *types.TipSet
|
||||
|
||||
cfgLk sync.RWMutex
|
||||
@@ -169,13 +169,13 @@ type MessagePool struct {
|
||||
|
||||
sigValCache *lru.TwoQueueCache[string, struct{}]
|
||||
|
||||
nonceCache *lru.Cache[nonceCacheKey, uint64]
|
||||
stateNonceCache *lru.Cache[stateNonceCacheKey, uint64]
|
||||
|
||||
evtTypes [3]journal.EventType
|
||||
journal journal.Journal
|
||||
}
|
||||
|
||||
type nonceCacheKey struct {
|
||||
type stateNonceCacheKey struct {
|
||||
tsk types.TipSetKey
|
||||
addr address.Address
|
||||
}
|
||||
@@ -371,7 +371,8 @@ func (ms *msgSet) toSlice() []*types.SignedMessage {
|
||||
func New(ctx context.Context, api Provider, ds dtypes.MetadataDS, us stmgr.UpgradeSchedule, netName dtypes.NetworkName, j journal.Journal) (*MessagePool, error) {
|
||||
cache, _ := lru.New2Q[cid.Cid, crypto.Signature](build.BlsSignatureCacheSize)
|
||||
verifcache, _ := lru.New2Q[string, struct{}](build.VerifSigCacheSize)
|
||||
noncecache, _ := lru.New[nonceCacheKey, uint64](256)
|
||||
stateNonceCache, _ := lru.New[stateNonceCacheKey, uint64](32768) // 32k * ~200 bytes = 6MB
|
||||
keycache, _ := lru.New[address.Address, address.Address](1_000_000)
|
||||
|
||||
cfg, err := loadConfig(ctx, ds)
|
||||
if err != nil {
|
||||
@@ -383,26 +384,26 @@ func New(ctx context.Context, api Provider, ds dtypes.MetadataDS, us stmgr.Upgra
|
||||
}
|
||||
|
||||
mp := &MessagePool{
|
||||
ds: ds,
|
||||
addSema: make(chan struct{}, 1),
|
||||
closer: make(chan struct{}),
|
||||
repubTk: build.Clock.Ticker(RepublishInterval),
|
||||
repubTrigger: make(chan struct{}, 1),
|
||||
localAddrs: make(map[address.Address]struct{}),
|
||||
pending: make(map[address.Address]*msgSet),
|
||||
keyCache: make(map[address.Address]address.Address),
|
||||
minGasPrice: types.NewInt(0),
|
||||
getNtwkVersion: us.GetNtwkVersion,
|
||||
pruneTrigger: make(chan struct{}, 1),
|
||||
pruneCooldown: make(chan struct{}, 1),
|
||||
blsSigCache: cache,
|
||||
sigValCache: verifcache,
|
||||
nonceCache: noncecache,
|
||||
changes: lps.New(50),
|
||||
localMsgs: namespace.Wrap(ds, datastore.NewKey(localMsgsDs)),
|
||||
api: api,
|
||||
netName: netName,
|
||||
cfg: cfg,
|
||||
ds: ds,
|
||||
addSema: make(chan struct{}, 1),
|
||||
closer: make(chan struct{}),
|
||||
repubTk: build.Clock.Ticker(RepublishInterval),
|
||||
repubTrigger: make(chan struct{}, 1),
|
||||
localAddrs: make(map[address.Address]struct{}),
|
||||
pending: make(map[address.Address]*msgSet),
|
||||
keyCache: keycache,
|
||||
minGasPrice: types.NewInt(0),
|
||||
getNtwkVersion: us.GetNtwkVersion,
|
||||
pruneTrigger: make(chan struct{}, 1),
|
||||
pruneCooldown: make(chan struct{}, 1),
|
||||
blsSigCache: cache,
|
||||
sigValCache: verifcache,
|
||||
stateNonceCache: stateNonceCache,
|
||||
changes: lps.New(50),
|
||||
localMsgs: namespace.Wrap(ds, datastore.NewKey(localMsgsDs)),
|
||||
api: api,
|
||||
netName: netName,
|
||||
cfg: cfg,
|
||||
evtTypes: [...]journal.EventType{
|
||||
evtTypeMpoolAdd: j.RegisterEventType("mpool", "add"),
|
||||
evtTypeMpoolRemove: j.RegisterEventType("mpool", "remove"),
|
||||
@@ -447,12 +448,8 @@ func New(ctx context.Context, api Provider, ds dtypes.MetadataDS, us stmgr.Upgra
|
||||
return mp, nil
|
||||
}
|
||||
|
||||
func (mp *MessagePool) TryForEachPendingMessage(f func(cid.Cid) error) error {
|
||||
// avoid deadlocks in splitstore compaction when something else needs to access the blockstore
|
||||
// while holding the mpool lock
|
||||
if !mp.lk.TryLock() {
|
||||
return xerrors.Errorf("mpool TryForEachPendingMessage: could not acquire lock")
|
||||
}
|
||||
func (mp *MessagePool) ForEachPendingMessage(f func(cid.Cid) error) error {
|
||||
mp.lk.Lock()
|
||||
defer mp.lk.Unlock()
|
||||
|
||||
for _, mset := range mp.pending {
|
||||
@@ -473,9 +470,18 @@ func (mp *MessagePool) TryForEachPendingMessage(f func(cid.Cid) error) error {
|
||||
}
|
||||
|
||||
func (mp *MessagePool) resolveToKey(ctx context.Context, addr address.Address) (address.Address, error) {
|
||||
//if addr is not an ID addr, then it is already resolved to a key
|
||||
if addr.Protocol() != address.ID {
|
||||
return addr, nil
|
||||
}
|
||||
return mp.resolveToKeyFromID(ctx, addr)
|
||||
}
|
||||
|
||||
func (mp *MessagePool) resolveToKeyFromID(ctx context.Context, addr address.Address) (address.Address, error) {
|
||||
|
||||
// check the cache
|
||||
a, f := mp.keyCache[addr]
|
||||
if f {
|
||||
a, ok := mp.keyCache.Get(addr)
|
||||
if ok {
|
||||
return a, nil
|
||||
}
|
||||
|
||||
@@ -486,9 +492,7 @@ func (mp *MessagePool) resolveToKey(ctx context.Context, addr address.Address) (
|
||||
}
|
||||
|
||||
// place both entries in the cache (may both be key addresses, which is fine)
|
||||
mp.keyCache[addr] = ka
|
||||
mp.keyCache[ka] = ka
|
||||
|
||||
mp.keyCache.Add(addr, ka)
|
||||
return ka, nil
|
||||
}
|
||||
|
||||
@@ -741,8 +745,7 @@ func (mp *MessagePool) checkMessage(ctx context.Context, m *types.SignedMessage)
|
||||
}
|
||||
|
||||
if err := mp.VerifyMsgSig(m); err != nil {
|
||||
log.Warnf("signature verification failed: %s", err)
|
||||
return err
|
||||
return xerrors.Errorf("signature verification failed: %s", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
@@ -763,7 +766,28 @@ func (mp *MessagePool) Add(ctx context.Context, m *types.SignedMessage) error {
|
||||
<-mp.addSema
|
||||
}()
|
||||
|
||||
mp.curTsLk.RLock()
|
||||
tmpCurTs := mp.curTs
|
||||
mp.curTsLk.RUnlock()
|
||||
|
||||
//ensures computations are cached without holding lock
|
||||
_, _ = mp.api.GetActorAfter(m.Message.From, tmpCurTs)
|
||||
_, _ = mp.getStateNonce(ctx, m.Message.From, tmpCurTs)
|
||||
|
||||
mp.curTsLk.Lock()
|
||||
if tmpCurTs == mp.curTs {
|
||||
//with the lock enabled, mp.curTs is the same Ts as we just had, so we know that our computations are cached
|
||||
} else {
|
||||
//curTs has been updated so we want to cache the new one:
|
||||
tmpCurTs = mp.curTs
|
||||
//we want to release the lock, cache the computations then grab it again
|
||||
mp.curTsLk.Unlock()
|
||||
_, _ = mp.api.GetActorAfter(m.Message.From, tmpCurTs)
|
||||
_, _ = mp.getStateNonce(ctx, m.Message.From, tmpCurTs)
|
||||
mp.curTsLk.Lock()
|
||||
//now that we have the lock, we continue, we could do this as a loop forever, but that's bad to loop forever, and this was added as an optimization and it seems once is enough because the computation < block time
|
||||
}
|
||||
|
||||
defer mp.curTsLk.Unlock()
|
||||
|
||||
_, err = mp.addTs(ctx, m, mp.curTs, false, false)
|
||||
@@ -852,9 +876,6 @@ func (mp *MessagePool) addTs(ctx context.Context, m *types.SignedMessage, curTs
|
||||
return false, xerrors.Errorf("minimum expected nonce is %d: %w", snonce, ErrNonceTooLow)
|
||||
}
|
||||
|
||||
mp.lk.Lock()
|
||||
defer mp.lk.Unlock()
|
||||
|
||||
senderAct, err := mp.api.GetActorAfter(m.Message.From, curTs)
|
||||
if err != nil {
|
||||
return false, xerrors.Errorf("failed to get sender actor: %w", err)
|
||||
@@ -869,6 +890,9 @@ func (mp *MessagePool) addTs(ctx context.Context, m *types.SignedMessage, curTs
|
||||
return false, xerrors.Errorf("sender actor %s is not a valid top-level sender", m.Message.From)
|
||||
}
|
||||
|
||||
mp.lk.Lock()
|
||||
defer mp.lk.Unlock()
|
||||
|
||||
publish, err := mp.verifyMsgBeforeAdd(ctx, m, curTs, local)
|
||||
if err != nil {
|
||||
return false, xerrors.Errorf("verify msg failed: %w", err)
|
||||
@@ -940,13 +964,11 @@ func (mp *MessagePool) addLocked(ctx context.Context, m *types.SignedMessage, st
|
||||
}
|
||||
|
||||
if _, err := mp.api.PutMessage(ctx, m); err != nil {
|
||||
log.Warnf("mpooladd cs.PutMessage failed: %s", err)
|
||||
return err
|
||||
return xerrors.Errorf("mpooladd cs.PutMessage failed: %s", err)
|
||||
}
|
||||
|
||||
if _, err := mp.api.PutMessage(ctx, &m.Message); err != nil {
|
||||
log.Warnf("mpooladd cs.PutMessage failed: %s", err)
|
||||
return err
|
||||
return xerrors.Errorf("mpooladd cs.PutMessage failed: %s", err)
|
||||
}
|
||||
|
||||
// Note: If performance becomes an issue, making this getOrCreatePendingMset will save some work
|
||||
@@ -1001,19 +1023,19 @@ func (mp *MessagePool) addLocked(ctx context.Context, m *types.SignedMessage, st
|
||||
}
|
||||
|
||||
func (mp *MessagePool) GetNonce(ctx context.Context, addr address.Address, _ types.TipSetKey) (uint64, error) {
|
||||
mp.curTsLk.Lock()
|
||||
defer mp.curTsLk.Unlock()
|
||||
mp.curTsLk.RLock()
|
||||
defer mp.curTsLk.RUnlock()
|
||||
|
||||
mp.lk.Lock()
|
||||
defer mp.lk.Unlock()
|
||||
mp.lk.RLock()
|
||||
defer mp.lk.RUnlock()
|
||||
|
||||
return mp.getNonceLocked(ctx, addr, mp.curTs)
|
||||
}
|
||||
|
||||
// GetActor should not be used. It is only here to satisfy interface mess caused by lite node handling
|
||||
func (mp *MessagePool) GetActor(_ context.Context, addr address.Address, _ types.TipSetKey) (*types.Actor, error) {
|
||||
mp.curTsLk.Lock()
|
||||
defer mp.curTsLk.Unlock()
|
||||
mp.curTsLk.RLock()
|
||||
defer mp.curTsLk.RUnlock()
|
||||
return mp.api.GetActorAfter(addr, mp.curTs)
|
||||
}
|
||||
|
||||
@@ -1046,24 +1068,52 @@ func (mp *MessagePool) getStateNonce(ctx context.Context, addr address.Address,
|
||||
done := metrics.Timer(ctx, metrics.MpoolGetNonceDuration)
|
||||
defer done()
|
||||
|
||||
nk := nonceCacheKey{
|
||||
nk := stateNonceCacheKey{
|
||||
tsk: ts.Key(),
|
||||
addr: addr,
|
||||
}
|
||||
|
||||
n, ok := mp.nonceCache.Get(nk)
|
||||
n, ok := mp.stateNonceCache.Get(nk)
|
||||
if ok {
|
||||
return n, nil
|
||||
}
|
||||
|
||||
act, err := mp.api.GetActorAfter(addr, ts)
|
||||
// get the nonce from the actor before ts
|
||||
actor, err := mp.api.GetActorBefore(addr, ts)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
nextNonce := actor.Nonce
|
||||
|
||||
raddr, err := mp.resolveToKey(ctx, addr)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
||||
mp.nonceCache.Add(nk, act.Nonce)
|
||||
// loop over all messages sent by 'addr' and find the highest nonce
|
||||
messages, err := mp.api.MessagesForTipset(ctx, ts)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
for _, message := range messages {
|
||||
msg := message.VMMessage()
|
||||
|
||||
return act.Nonce, nil
|
||||
maddr, err := mp.resolveToKey(ctx, msg.From)
|
||||
if err != nil {
|
||||
log.Warnf("failed to resolve message from address: %s", err)
|
||||
continue
|
||||
}
|
||||
|
||||
if maddr == raddr {
|
||||
if n := msg.Nonce + 1; n > nextNonce {
|
||||
nextNonce = n
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mp.stateNonceCache.Add(nk, nextNonce)
|
||||
|
||||
return nextNonce, nil
|
||||
}
|
||||
|
||||
func (mp *MessagePool) getStateBalance(ctx context.Context, addr address.Address, ts *types.TipSet) (types.BigInt, error) {
|
||||
@@ -1164,11 +1214,11 @@ func (mp *MessagePool) remove(ctx context.Context, from address.Address, nonce u
|
||||
}
|
||||
|
||||
func (mp *MessagePool) Pending(ctx context.Context) ([]*types.SignedMessage, *types.TipSet) {
|
||||
mp.curTsLk.Lock()
|
||||
defer mp.curTsLk.Unlock()
|
||||
mp.curTsLk.RLock()
|
||||
defer mp.curTsLk.RUnlock()
|
||||
|
||||
mp.lk.Lock()
|
||||
defer mp.lk.Unlock()
|
||||
mp.lk.RLock()
|
||||
defer mp.lk.RUnlock()
|
||||
|
||||
return mp.allPending(ctx)
|
||||
}
|
||||
@@ -1184,11 +1234,11 @@ func (mp *MessagePool) allPending(ctx context.Context) ([]*types.SignedMessage,
|
||||
}
|
||||
|
||||
func (mp *MessagePool) PendingFor(ctx context.Context, a address.Address) ([]*types.SignedMessage, *types.TipSet) {
|
||||
mp.curTsLk.Lock()
|
||||
defer mp.curTsLk.Unlock()
|
||||
mp.curTsLk.RLock()
|
||||
defer mp.curTsLk.RUnlock()
|
||||
|
||||
mp.lk.Lock()
|
||||
defer mp.lk.Unlock()
|
||||
mp.lk.RLock()
|
||||
defer mp.lk.RUnlock()
|
||||
return mp.pendingFor(ctx, a), mp.curTs
|
||||
}
|
||||
|
||||
@@ -1237,9 +1287,9 @@ func (mp *MessagePool) HeadChange(ctx context.Context, revert []*types.TipSet, a
|
||||
|
||||
maybeRepub := func(cid cid.Cid) {
|
||||
if !repubTrigger {
|
||||
mp.lk.Lock()
|
||||
mp.lk.RLock()
|
||||
_, republished := mp.republished[cid]
|
||||
mp.lk.Unlock()
|
||||
mp.lk.RUnlock()
|
||||
if republished {
|
||||
repubTrigger = true
|
||||
}
|
||||
@@ -1310,9 +1360,9 @@ func (mp *MessagePool) HeadChange(ctx context.Context, revert []*types.TipSet, a
|
||||
}
|
||||
|
||||
if len(revert) > 0 && futureDebug {
|
||||
mp.lk.Lock()
|
||||
mp.lk.RLock()
|
||||
msgs, ts := mp.allPending(ctx)
|
||||
mp.lk.Unlock()
|
||||
mp.lk.RUnlock()
|
||||
|
||||
buckets := map[address.Address]*statBucket{}
|
||||
|
||||
|
||||
@@ -11,9 +11,11 @@ import (
|
||||
"github.com/ipfs/go-datastore"
|
||||
logging "github.com/ipfs/go-log/v2"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
big2 "github.com/filecoin-project/go-state-types/big"
|
||||
"github.com/filecoin-project/go-state-types/crypto"
|
||||
"github.com/filecoin-project/go-state-types/network"
|
||||
builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin"
|
||||
@@ -120,6 +122,22 @@ func (tma *testMpoolAPI) PubSubPublish(string, []byte) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (tma *testMpoolAPI) GetActorBefore(addr address.Address, ts *types.TipSet) (*types.Actor, error) {
|
||||
balance, ok := tma.balance[addr]
|
||||
if !ok {
|
||||
balance = types.NewInt(1000e6)
|
||||
tma.balance[addr] = balance
|
||||
}
|
||||
|
||||
nonce := tma.statenonce[addr]
|
||||
|
||||
return &types.Actor{
|
||||
Code: builtin2.AccountActorCodeID,
|
||||
Nonce: nonce,
|
||||
Balance: balance,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (tma *testMpoolAPI) GetActorAfter(addr address.Address, ts *types.TipSet) (*types.Actor, error) {
|
||||
// regression check for load bug
|
||||
if ts == nil {
|
||||
@@ -508,6 +526,36 @@ func TestPruningSimple(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestGasRewardNegative(t *testing.T) {
|
||||
var mp MessagePool
|
||||
|
||||
msg := types.SignedMessage{
|
||||
Message: types.Message{
|
||||
GasLimit: 1000,
|
||||
GasFeeCap: big2.NewInt(20000),
|
||||
GasPremium: big2.NewInt(15000),
|
||||
},
|
||||
}
|
||||
baseFee := big2.NewInt(30000)
|
||||
// Over the GasPremium, but under the BaseFee
|
||||
gr1 := mp.getGasReward(&msg, baseFee)
|
||||
|
||||
msg.Message.GasFeeCap = big2.NewInt(15000)
|
||||
// Equal to GasPremium, under the BaseFee
|
||||
gr2 := mp.getGasReward(&msg, baseFee)
|
||||
|
||||
msg.Message.GasFeeCap = big2.NewInt(10000)
|
||||
// Under both GasPremium and BaseFee
|
||||
gr3 := mp.getGasReward(&msg, baseFee)
|
||||
|
||||
require.True(t, gr1.Sign() < 0)
|
||||
require.True(t, gr2.Sign() < 0)
|
||||
require.True(t, gr3.Sign() < 0)
|
||||
|
||||
require.True(t, gr1.Cmp(gr2) > 0)
|
||||
require.True(t, gr2.Cmp(gr3) > 0)
|
||||
}
|
||||
|
||||
func TestLoadLocal(t *testing.T) {
|
||||
tma := newTestMpoolAPI()
|
||||
ds := datastore.NewMapDatastore()
|
||||
|
||||
@@ -2,6 +2,7 @@ package messagepool
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"time"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
@@ -27,6 +28,7 @@ type Provider interface {
|
||||
SubscribeHeadChanges(func(rev, app []*types.TipSet) error) *types.TipSet
|
||||
PutMessage(ctx context.Context, m types.ChainMsg) (cid.Cid, error)
|
||||
PubSubPublish(string, []byte) error
|
||||
GetActorBefore(address.Address, *types.TipSet) (*types.Actor, error)
|
||||
GetActorAfter(address.Address, *types.TipSet) (*types.Actor, error)
|
||||
StateDeterministicAddressAtFinality(context.Context, address.Address, *types.TipSet) (address.Address, error)
|
||||
StateNetworkVersion(context.Context, abi.ChainEpoch) network.Version
|
||||
@@ -58,6 +60,23 @@ func (mpp *mpoolProvider) IsLite() bool {
|
||||
return mpp.lite != nil
|
||||
}
|
||||
|
||||
func (mpp *mpoolProvider) getActorLite(addr address.Address, ts *types.TipSet) (*types.Actor, error) {
|
||||
if !mpp.IsLite() {
|
||||
return nil, errors.New("should not use getActorLite on non lite Provider")
|
||||
}
|
||||
|
||||
n, err := mpp.lite.GetNonce(context.TODO(), addr, ts.Key())
|
||||
if err != nil {
|
||||
return nil, xerrors.Errorf("getting nonce over lite: %w", err)
|
||||
}
|
||||
a, err := mpp.lite.GetActor(context.TODO(), addr, ts.Key())
|
||||
if err != nil {
|
||||
return nil, xerrors.Errorf("getting actor over lite: %w", err)
|
||||
}
|
||||
a.Nonce = n
|
||||
return a, nil
|
||||
}
|
||||
|
||||
func (mpp *mpoolProvider) SubscribeHeadChanges(cb func(rev, app []*types.TipSet) error) *types.TipSet {
|
||||
mpp.sm.ChainStore().SubscribeHeadChanges(
|
||||
store.WrapHeadChangeCoalescer(
|
||||
@@ -77,18 +96,17 @@ func (mpp *mpoolProvider) PubSubPublish(k string, v []byte) error {
|
||||
return mpp.ps.Publish(k, v) // nolint
|
||||
}
|
||||
|
||||
func (mpp *mpoolProvider) GetActorBefore(addr address.Address, ts *types.TipSet) (*types.Actor, error) {
|
||||
if mpp.IsLite() {
|
||||
return mpp.getActorLite(addr, ts)
|
||||
}
|
||||
|
||||
return mpp.sm.LoadActor(context.TODO(), addr, ts)
|
||||
}
|
||||
|
||||
func (mpp *mpoolProvider) GetActorAfter(addr address.Address, ts *types.TipSet) (*types.Actor, error) {
|
||||
if mpp.IsLite() {
|
||||
n, err := mpp.lite.GetNonce(context.TODO(), addr, ts.Key())
|
||||
if err != nil {
|
||||
return nil, xerrors.Errorf("getting nonce over lite: %w", err)
|
||||
}
|
||||
a, err := mpp.lite.GetActor(context.TODO(), addr, ts.Key())
|
||||
if err != nil {
|
||||
return nil, xerrors.Errorf("getting actor over lite: %w", err)
|
||||
}
|
||||
a.Nonce = n
|
||||
return a, nil
|
||||
return mpp.getActorLite(addr, ts)
|
||||
}
|
||||
|
||||
stcid, _, err := mpp.sm.TipSetState(context.TODO(), ts)
|
||||
|
||||
@@ -20,19 +20,23 @@ const repubMsgLimit = 30
|
||||
var RepublishBatchDelay = 100 * time.Millisecond
|
||||
|
||||
func (mp *MessagePool) republishPendingMessages(ctx context.Context) error {
|
||||
mp.curTsLk.Lock()
|
||||
mp.curTsLk.RLock()
|
||||
ts := mp.curTs
|
||||
mp.curTsLk.RUnlock()
|
||||
|
||||
baseFee, err := mp.api.ChainComputeBaseFee(context.TODO(), ts)
|
||||
if err != nil {
|
||||
mp.curTsLk.Unlock()
|
||||
return xerrors.Errorf("computing basefee: %w", err)
|
||||
}
|
||||
baseFeeLowerBound := getBaseFeeLowerBound(baseFee, baseFeeLowerBoundFactor)
|
||||
|
||||
pending := make(map[address.Address]map[uint64]*types.SignedMessage)
|
||||
|
||||
mp.lk.Lock()
|
||||
mp.republished = nil // clear this to avoid races triggering an early republish
|
||||
mp.lk.Unlock()
|
||||
|
||||
mp.lk.RLock()
|
||||
mp.forEachLocal(ctx, func(ctx context.Context, actor address.Address) {
|
||||
mset, ok, err := mp.getPendingMset(ctx, actor)
|
||||
if err != nil {
|
||||
@@ -53,9 +57,7 @@ func (mp *MessagePool) republishPendingMessages(ctx context.Context) error {
|
||||
}
|
||||
pending[actor] = pend
|
||||
})
|
||||
|
||||
mp.lk.Unlock()
|
||||
mp.curTsLk.Unlock()
|
||||
mp.lk.RUnlock()
|
||||
|
||||
if len(pending) == 0 {
|
||||
return nil
|
||||
@@ -176,8 +178,8 @@ loop:
|
||||
republished[m.Cid()] = struct{}{}
|
||||
}
|
||||
|
||||
mp.lk.Lock()
|
||||
// update the republished set so that we can trigger early republish from head changes
|
||||
mp.lk.Lock()
|
||||
mp.republished = republished
|
||||
mp.lk.Unlock()
|
||||
|
||||
|
||||
@@ -40,11 +40,21 @@ type msgChain struct {
|
||||
}
|
||||
|
||||
func (mp *MessagePool) SelectMessages(ctx context.Context, ts *types.TipSet, tq float64) ([]*types.SignedMessage, error) {
|
||||
mp.curTsLk.Lock()
|
||||
defer mp.curTsLk.Unlock()
|
||||
mp.curTsLk.RLock()
|
||||
defer mp.curTsLk.RUnlock()
|
||||
|
||||
mp.lk.Lock()
|
||||
defer mp.lk.Unlock()
|
||||
mp.lk.RLock()
|
||||
defer mp.lk.RUnlock()
|
||||
|
||||
// See if we need to prune before selection; excessive buildup can lead to slow selection,
|
||||
// so prune if we have too many messages (ignoring the cooldown).
|
||||
mpCfg := mp.getConfig()
|
||||
if mp.currentSize > mpCfg.SizeLimitHigh {
|
||||
log.Infof("too many messages; pruning before selection")
|
||||
if err := mp.pruneMessages(ctx, ts); err != nil {
|
||||
log.Warnf("error pruning excess messages: %s", err)
|
||||
}
|
||||
}
|
||||
|
||||
// if the ticket quality is high enough that the first block has higher probability
|
||||
// than any other block, then we don't bother with optimal selection because the
|
||||
|
||||
@@ -13,6 +13,7 @@ import (
|
||||
"os"
|
||||
"sort"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
"github.com/ipfs/go-datastore"
|
||||
@@ -1690,3 +1691,188 @@ readLoop:
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func TestRealWorldSelectionTiming(t *testing.T) {
|
||||
//stm: @TOKEN_WALLET_NEW_001, @TOKEN_WALLET_SIGN_001, @CHAIN_MEMPOOL_SELECT_001
|
||||
|
||||
// load test-messages.json.gz and rewrite the messages so that
|
||||
// 1) we map each real actor to a test actor so that we can sign the messages
|
||||
// 2) adjust the nonces so that they start from 0
|
||||
file, err := os.Open("test-messages2.json.gz")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
gzr, err := gzip.NewReader(file)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
dec := json.NewDecoder(gzr)
|
||||
|
||||
var msgs []*types.SignedMessage
|
||||
baseNonces := make(map[address.Address]uint64)
|
||||
|
||||
readLoop:
|
||||
for {
|
||||
m := new(types.SignedMessage)
|
||||
err := dec.Decode(m)
|
||||
switch err {
|
||||
case nil:
|
||||
msgs = append(msgs, m)
|
||||
nonce, ok := baseNonces[m.Message.From]
|
||||
if !ok || m.Message.Nonce < nonce {
|
||||
baseNonces[m.Message.From] = m.Message.Nonce
|
||||
}
|
||||
|
||||
case io.EOF:
|
||||
break readLoop
|
||||
|
||||
default:
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
actorMap := make(map[address.Address]address.Address)
|
||||
actorWallets := make(map[address.Address]api.Wallet)
|
||||
|
||||
for _, m := range msgs {
|
||||
baseNonce := baseNonces[m.Message.From]
|
||||
|
||||
localActor, ok := actorMap[m.Message.From]
|
||||
if !ok {
|
||||
w, err := wallet.NewWallet(wallet.NewMemKeyStore())
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
a, err := w.WalletNew(context.Background(), types.KTSecp256k1)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
actorMap[m.Message.From] = a
|
||||
actorWallets[a] = w
|
||||
localActor = a
|
||||
}
|
||||
|
||||
w, ok := actorWallets[localActor]
|
||||
if !ok {
|
||||
t.Fatalf("failed to lookup wallet for actor %s", localActor)
|
||||
}
|
||||
|
||||
m.Message.From = localActor
|
||||
m.Message.Nonce -= baseNonce
|
||||
|
||||
sig, err := w.WalletSign(context.TODO(), localActor, m.Message.Cid().Bytes(), api.MsgMeta{})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
m.Signature = *sig
|
||||
}
|
||||
|
||||
mp, tma := makeTestMpool()
|
||||
|
||||
block := tma.nextBlockWithHeight(uint64(build.UpgradeHyggeHeight) + 10)
|
||||
ts := mock.TipSet(block)
|
||||
tma.applyBlock(t, block)
|
||||
|
||||
for _, a := range actorMap {
|
||||
tma.setBalance(a, 1000000)
|
||||
}
|
||||
|
||||
tma.baseFee = types.NewInt(800_000_000)
|
||||
|
||||
sort.Slice(msgs, func(i, j int) bool {
|
||||
return msgs[i].Message.Nonce < msgs[j].Message.Nonce
|
||||
})
|
||||
|
||||
// add the messages
|
||||
for _, m := range msgs {
|
||||
mustAdd(t, mp, m)
|
||||
}
|
||||
|
||||
// do message selection and check block packing
|
||||
minGasLimit := int64(0.9 * float64(build.BlockGasLimit))
|
||||
|
||||
// greedy first
|
||||
start := time.Now()
|
||||
selected, err := mp.SelectMessages(context.Background(), ts, 1.0)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
t.Logf("selected %d messages in %s", len(selected), time.Since(start))
|
||||
|
||||
gasLimit := int64(0)
|
||||
for _, m := range selected {
|
||||
gasLimit += m.Message.GasLimit
|
||||
}
|
||||
if gasLimit < minGasLimit {
|
||||
t.Fatalf("failed to pack with tq=1.0; packed %d, minimum packing: %d", gasLimit, minGasLimit)
|
||||
}
|
||||
|
||||
// high quality ticket
|
||||
start = time.Now()
|
||||
selected, err = mp.SelectMessages(context.Background(), ts, .8)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
t.Logf("selected %d messages in %s", len(selected), time.Since(start))
|
||||
|
||||
gasLimit = int64(0)
|
||||
for _, m := range selected {
|
||||
gasLimit += m.Message.GasLimit
|
||||
}
|
||||
if gasLimit < minGasLimit {
|
||||
t.Fatalf("failed to pack with tq=0.8; packed %d, minimum packing: %d", gasLimit, minGasLimit)
|
||||
}
|
||||
|
||||
// mid quality ticket
|
||||
start = time.Now()
|
||||
selected, err = mp.SelectMessages(context.Background(), ts, .4)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
t.Logf("selected %d messages in %s", len(selected), time.Since(start))
|
||||
|
||||
gasLimit = int64(0)
|
||||
for _, m := range selected {
|
||||
gasLimit += m.Message.GasLimit
|
||||
}
|
||||
if gasLimit < minGasLimit {
|
||||
t.Fatalf("failed to pack with tq=0.4; packed %d, minimum packing: %d", gasLimit, minGasLimit)
|
||||
}
|
||||
|
||||
// low quality ticket
|
||||
start = time.Now()
|
||||
selected, err = mp.SelectMessages(context.Background(), ts, .1)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
t.Logf("selected %d messages in %s", len(selected), time.Since(start))
|
||||
|
||||
gasLimit = int64(0)
|
||||
for _, m := range selected {
|
||||
gasLimit += m.Message.GasLimit
|
||||
}
|
||||
if gasLimit < minGasLimit {
|
||||
t.Fatalf("failed to pack with tq=0.1; packed %d, minimum packing: %d", gasLimit, minGasLimit)
|
||||
}
|
||||
|
||||
// very low quality ticket
|
||||
start = time.Now()
|
||||
selected, err = mp.SelectMessages(context.Background(), ts, .01)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
t.Logf("selected %d messages in %s", len(selected), time.Since(start))
|
||||
|
||||
gasLimit = int64(0)
|
||||
for _, m := range selected {
|
||||
gasLimit += m.Message.GasLimit
|
||||
}
|
||||
if gasLimit < minGasLimit {
|
||||
t.Fatalf("failed to pack with tq=0.01; packed %d, minimum packing: %d", gasLimit, minGasLimit)
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -128,10 +128,47 @@ func (sm *StateManager) ExecutionTraceWithMonitor(ctx context.Context, ts *types
|
||||
}
|
||||
|
||||
func (sm *StateManager) ExecutionTrace(ctx context.Context, ts *types.TipSet) (cid.Cid, []*api.InvocResult, error) {
|
||||
tsKey := ts.Key()
|
||||
|
||||
// check if we have the trace for this tipset in the cache
|
||||
if execTraceCacheSize > 0 {
|
||||
sm.execTraceCacheLock.Lock()
|
||||
if entry, ok := sm.execTraceCache.Get(tsKey); ok {
|
||||
// we have to make a deep copy since caller can modify the invocTrace
|
||||
// and we don't want that to change what we store in cache
|
||||
invocTraceCopy := makeDeepCopy(entry.invocTrace)
|
||||
sm.execTraceCacheLock.Unlock()
|
||||
return entry.postStateRoot, invocTraceCopy, nil
|
||||
}
|
||||
sm.execTraceCacheLock.Unlock()
|
||||
}
|
||||
|
||||
var invocTrace []*api.InvocResult
|
||||
st, err := sm.ExecutionTraceWithMonitor(ctx, ts, &InvocationTracer{trace: &invocTrace})
|
||||
if err != nil {
|
||||
return cid.Undef, nil, err
|
||||
}
|
||||
|
||||
if execTraceCacheSize > 0 {
|
||||
invocTraceCopy := makeDeepCopy(invocTrace)
|
||||
|
||||
sm.execTraceCacheLock.Lock()
|
||||
sm.execTraceCache.Add(tsKey, tipSetCacheEntry{st, invocTraceCopy})
|
||||
sm.execTraceCacheLock.Unlock()
|
||||
}
|
||||
|
||||
return st, invocTrace, nil
|
||||
}
|
||||
|
||||
func makeDeepCopy(invocTrace []*api.InvocResult) []*api.InvocResult {
|
||||
c := make([]*api.InvocResult, len(invocTrace))
|
||||
for i, ir := range invocTrace {
|
||||
if ir == nil {
|
||||
continue
|
||||
}
|
||||
tmp := *ir
|
||||
c[i] = &tmp
|
||||
}
|
||||
|
||||
return c
|
||||
}
|
||||
|
||||
@@ -36,6 +36,7 @@ import (
|
||||
"github.com/filecoin-project/lotus/chain/consensus"
|
||||
"github.com/filecoin-project/lotus/chain/consensus/filcns"
|
||||
"github.com/filecoin-project/lotus/chain/gen"
|
||||
"github.com/filecoin-project/lotus/chain/index"
|
||||
"github.com/filecoin-project/lotus/chain/stmgr"
|
||||
. "github.com/filecoin-project/lotus/chain/stmgr"
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
@@ -168,7 +169,7 @@ func TestForkHeightTriggers(t *testing.T) {
|
||||
}
|
||||
|
||||
return st.Flush(ctx)
|
||||
}}}, cg.BeaconSchedule(), datastore.NewMapDatastore())
|
||||
}}}, cg.BeaconSchedule(), datastore.NewMapDatastore(), index.DummyMsgIndex)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -286,7 +287,7 @@ func testForkRefuseCall(t *testing.T, nullsBefore, nullsAfter int) {
|
||||
root cid.Cid, height abi.ChainEpoch, ts *types.TipSet) (cid.Cid, error) {
|
||||
migrationCount++
|
||||
return root, nil
|
||||
}}}, cg.BeaconSchedule(), datastore.NewMapDatastore())
|
||||
}}}, cg.BeaconSchedule(), datastore.NewMapDatastore(), index.DummyMsgIndex)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -504,7 +505,7 @@ func TestForkPreMigration(t *testing.T) {
|
||||
return nil
|
||||
},
|
||||
}}},
|
||||
}, cg.BeaconSchedule(), datastore.NewMapDatastore())
|
||||
}, cg.BeaconSchedule(), datastore.NewMapDatastore(), index.DummyMsgIndex)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -579,6 +580,7 @@ func TestDisablePreMigration(t *testing.T) {
|
||||
},
|
||||
cg.BeaconSchedule(),
|
||||
datastore.NewMapDatastore(),
|
||||
index.DummyMsgIndex,
|
||||
)
|
||||
require.NoError(t, err)
|
||||
require.NoError(t, sm.Start(context.Background()))
|
||||
@@ -633,6 +635,7 @@ func TestMigrtionCache(t *testing.T) {
|
||||
},
|
||||
cg.BeaconSchedule(),
|
||||
metadataDs,
|
||||
index.DummyMsgIndex,
|
||||
)
|
||||
require.NoError(t, err)
|
||||
require.NoError(t, sm.Start(context.Background()))
|
||||
@@ -685,6 +688,7 @@ func TestMigrtionCache(t *testing.T) {
|
||||
},
|
||||
cg.BeaconSchedule(),
|
||||
metadataDs,
|
||||
index.DummyMsgIndex,
|
||||
)
|
||||
require.NoError(t, err)
|
||||
sm.SetVMConstructor(func(ctx context.Context, vmopt *vm.VMOpts) (vm.Interface, error) {
|
||||
|
||||
@@ -10,6 +10,7 @@ import (
|
||||
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/index"
|
||||
"github.com/filecoin-project/lotus/chain/store"
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
)
|
||||
@@ -18,6 +19,7 @@ import (
|
||||
// happened, with an optional limit to how many epochs it will search. It guarantees that the message has been on
|
||||
// chain for at least confidence epochs without being reverted before returning.
|
||||
func (sm *StateManager) WaitForMessage(ctx context.Context, mcid cid.Cid, confidence uint64, lookbackLimit abi.ChainEpoch, allowReplaced bool) (*types.TipSet, *types.MessageReceipt, cid.Cid, error) {
|
||||
// TODO use the index to speed this up.
|
||||
ctx, cancel := context.WithCancel(ctx)
|
||||
defer cancel()
|
||||
|
||||
@@ -55,10 +57,15 @@ func (sm *StateManager) WaitForMessage(ctx context.Context, mcid cid.Cid, confid
|
||||
var backFm cid.Cid
|
||||
backSearchWait := make(chan struct{})
|
||||
go func() {
|
||||
fts, r, foundMsg, err := sm.searchBackForMsg(ctx, head[0].Val, msg, lookbackLimit, allowReplaced)
|
||||
if err != nil {
|
||||
log.Warnf("failed to look back through chain for message: %v", err)
|
||||
return
|
||||
fts, r, foundMsg, err := sm.searchForIndexedMsg(ctx, mcid, msg)
|
||||
|
||||
found := (err == nil && r != nil && foundMsg.Defined())
|
||||
if !found {
|
||||
fts, r, foundMsg, err = sm.searchBackForMsg(ctx, head[0].Val, msg, lookbackLimit, allowReplaced)
|
||||
if err != nil {
|
||||
log.Warnf("failed to look back through chain for message: %v", err)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
backTs = fts
|
||||
@@ -145,7 +152,30 @@ func (sm *StateManager) SearchForMessage(ctx context.Context, head *types.TipSet
|
||||
return head, r, foundMsg, nil
|
||||
}
|
||||
|
||||
fts, r, foundMsg, err := sm.searchBackForMsg(ctx, head, msg, lookbackLimit, allowReplaced)
|
||||
fts, r, foundMsg, err := sm.searchForIndexedMsg(ctx, mcid, msg)
|
||||
|
||||
switch {
|
||||
case err == nil:
|
||||
if r != nil && foundMsg.Defined() {
|
||||
return fts, r, foundMsg, nil
|
||||
}
|
||||
|
||||
// debug log this, it's noteworthy
|
||||
if r == nil {
|
||||
log.Debugf("missing receipt for message in index for %s", mcid)
|
||||
}
|
||||
if !foundMsg.Defined() {
|
||||
log.Debugf("message %s not found", mcid)
|
||||
}
|
||||
|
||||
case errors.Is(err, index.ErrNotFound):
|
||||
// ok for the index to have incomplete data
|
||||
|
||||
default:
|
||||
log.Warnf("error searching message index: %s", err)
|
||||
}
|
||||
|
||||
fts, r, foundMsg, err = sm.searchBackForMsg(ctx, head, msg, lookbackLimit, allowReplaced)
|
||||
|
||||
if err != nil {
|
||||
log.Warnf("failed to look back through chain for message %s", mcid)
|
||||
@@ -159,6 +189,44 @@ func (sm *StateManager) SearchForMessage(ctx context.Context, head *types.TipSet
|
||||
return fts, r, foundMsg, nil
|
||||
}
|
||||
|
||||
func (sm *StateManager) searchForIndexedMsg(ctx context.Context, mcid cid.Cid, m types.ChainMsg) (*types.TipSet, *types.MessageReceipt, cid.Cid, error) {
|
||||
minfo, err := sm.msgIndex.GetMsgInfo(ctx, mcid)
|
||||
if err != nil {
|
||||
return nil, nil, cid.Undef, xerrors.Errorf("error looking up message in index: %w", err)
|
||||
}
|
||||
|
||||
// check the height against the current tipset; minimum execution confidence requires that the
|
||||
// inclusion tipset height is lower than the current head + 1
|
||||
curTs := sm.cs.GetHeaviestTipSet()
|
||||
if curTs.Height() <= minfo.Epoch+1 {
|
||||
return nil, nil, cid.Undef, xerrors.Errorf("indexed message does not appear before the current tipset; index epoch: %d, current epoch: %d", minfo.Epoch, curTs.Height())
|
||||
}
|
||||
|
||||
// now get the execution tipset
|
||||
// TODO optimization: the index should have it implicitly so we can return it in the msginfo.
|
||||
xts, err := sm.cs.GetTipsetByHeight(ctx, minfo.Epoch+1, curTs, false)
|
||||
if err != nil {
|
||||
return nil, nil, cid.Undef, xerrors.Errorf("error looking up execution tipset: %w", err)
|
||||
}
|
||||
|
||||
// check that the parent of the execution index is indeed the inclusion tipset
|
||||
parent := xts.Parents()
|
||||
parentCid, err := parent.Cid()
|
||||
if err != nil {
|
||||
return nil, nil, cid.Undef, xerrors.Errorf("error computing tipset cid: %w", err)
|
||||
}
|
||||
|
||||
if !parentCid.Equals(minfo.TipSet) {
|
||||
return nil, nil, cid.Undef, xerrors.Errorf("inclusion tipset mismatch: have %s, expected %s", parentCid, minfo.TipSet)
|
||||
}
|
||||
|
||||
r, foundMsg, err := sm.tipsetExecutedMessage(ctx, xts, mcid, m.VMMessage(), false)
|
||||
if err != nil {
|
||||
return nil, nil, cid.Undef, xerrors.Errorf("error in tipstExecutedMessage: %w", err)
|
||||
}
|
||||
return xts, r, foundMsg, nil
|
||||
}
|
||||
|
||||
// searchBackForMsg searches up to limit tipsets backwards from the given
|
||||
// tipset for a message receipt.
|
||||
// If limit is
|
||||
|
||||
+46
-4
@@ -3,8 +3,11 @@ package stmgr
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
"strconv"
|
||||
"sync"
|
||||
|
||||
lru "github.com/hashicorp/golang-lru/v2"
|
||||
"github.com/ipfs/go-cid"
|
||||
dstore "github.com/ipfs/go-datastore"
|
||||
cbor "github.com/ipfs/go-ipld-cbor"
|
||||
@@ -25,6 +28,7 @@ import (
|
||||
"github.com/filecoin-project/lotus/chain/actors/builtin/paych"
|
||||
"github.com/filecoin-project/lotus/chain/actors/policy"
|
||||
"github.com/filecoin-project/lotus/chain/beacon"
|
||||
"github.com/filecoin-project/lotus/chain/index"
|
||||
"github.com/filecoin-project/lotus/chain/rand"
|
||||
"github.com/filecoin-project/lotus/chain/state"
|
||||
"github.com/filecoin-project/lotus/chain/store"
|
||||
@@ -38,6 +42,7 @@ import (
|
||||
const LookbackNoLimit = api.LookbackNoLimit
|
||||
const ReceiptAmtBitwidth = 3
|
||||
|
||||
var execTraceCacheSize = 16
|
||||
var log = logging.Logger("statemgr")
|
||||
|
||||
type StateManagerAPI interface {
|
||||
@@ -70,6 +75,17 @@ func (m *migrationResultCache) keyForMigration(root cid.Cid) dstore.Key {
|
||||
return dstore.NewKey(kStr)
|
||||
}
|
||||
|
||||
func init() {
|
||||
if s := os.Getenv("LOTUS_EXEC_TRACE_CACHE_SIZE"); s != "" {
|
||||
letc, err := strconv.Atoi(s)
|
||||
if err != nil {
|
||||
log.Errorf("failed to parse 'LOTUS_EXEC_TRACE_CACHE_SIZE' env var: %s", err)
|
||||
} else {
|
||||
execTraceCacheSize = letc
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (m *migrationResultCache) Get(ctx context.Context, root cid.Cid) (cid.Cid, bool, error) {
|
||||
k := m.keyForMigration(root)
|
||||
|
||||
@@ -135,6 +151,15 @@ type StateManager struct {
|
||||
tsExec Executor
|
||||
tsExecMonitor ExecMonitor
|
||||
beacon beacon.Schedule
|
||||
|
||||
msgIndex index.MsgIndex
|
||||
|
||||
// We keep a small cache for calls to ExecutionTrace which helps improve
|
||||
// performance for node operators like exchanges and block explorers
|
||||
execTraceCache *lru.ARCCache[types.TipSetKey, tipSetCacheEntry]
|
||||
// We need a lock while making the copy as to prevent other callers
|
||||
// overwrite the cache while making the copy
|
||||
execTraceCacheLock sync.Mutex
|
||||
}
|
||||
|
||||
// Caches a single state tree
|
||||
@@ -143,7 +168,12 @@ type treeCache struct {
|
||||
tree *state.StateTree
|
||||
}
|
||||
|
||||
func NewStateManager(cs *store.ChainStore, exec Executor, sys vm.SyscallBuilder, us UpgradeSchedule, beacon beacon.Schedule, metadataDs dstore.Batching) (*StateManager, error) {
|
||||
type tipSetCacheEntry struct {
|
||||
postStateRoot cid.Cid
|
||||
invocTrace []*api.InvocResult
|
||||
}
|
||||
|
||||
func NewStateManager(cs *store.ChainStore, exec Executor, sys vm.SyscallBuilder, us UpgradeSchedule, beacon beacon.Schedule, metadataDs dstore.Batching, msgIndex index.MsgIndex) (*StateManager, error) {
|
||||
// If we have upgrades, make sure they're in-order and make sense.
|
||||
if err := us.Validate(); err != nil {
|
||||
return nil, err
|
||||
@@ -182,6 +212,16 @@ func NewStateManager(cs *store.ChainStore, exec Executor, sys vm.SyscallBuilder,
|
||||
}
|
||||
}
|
||||
|
||||
log.Debugf("execTraceCache size: %d", execTraceCacheSize)
|
||||
var execTraceCache *lru.ARCCache[types.TipSetKey, tipSetCacheEntry]
|
||||
var err error
|
||||
if execTraceCacheSize > 0 {
|
||||
execTraceCache, err = lru.NewARC[types.TipSetKey, tipSetCacheEntry](execTraceCacheSize)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
return &StateManager{
|
||||
networkVersions: networkVersions,
|
||||
latestVersion: lastVersion,
|
||||
@@ -197,12 +237,14 @@ func NewStateManager(cs *store.ChainStore, exec Executor, sys vm.SyscallBuilder,
|
||||
root: cid.Undef,
|
||||
tree: nil,
|
||||
},
|
||||
compWait: make(map[string]chan struct{}),
|
||||
compWait: make(map[string]chan struct{}),
|
||||
msgIndex: msgIndex,
|
||||
execTraceCache: execTraceCache,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func NewStateManagerWithUpgradeScheduleAndMonitor(cs *store.ChainStore, exec Executor, sys vm.SyscallBuilder, us UpgradeSchedule, b beacon.Schedule, em ExecMonitor, metadataDs dstore.Batching) (*StateManager, error) {
|
||||
sm, err := NewStateManager(cs, exec, sys, us, b, metadataDs)
|
||||
func NewStateManagerWithUpgradeScheduleAndMonitor(cs *store.ChainStore, exec Executor, sys vm.SyscallBuilder, us UpgradeSchedule, b beacon.Schedule, em ExecMonitor, metadataDs dstore.Batching, msgIndex index.MsgIndex) (*StateManager, error) {
|
||||
sm, err := NewStateManager(cs, exec, sys, us, b, metadataDs, msgIndex)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
+16
-1
@@ -72,7 +72,7 @@ func ComputeState(ctx context.Context, sm *StateManager, height abi.ChainEpoch,
|
||||
|
||||
base, trace, err := sm.ExecutionTrace(ctx, ts)
|
||||
if err != nil {
|
||||
return cid.Undef, nil, err
|
||||
return cid.Undef, nil, xerrors.Errorf("failed to compute base state: %w", err)
|
||||
}
|
||||
|
||||
for i := ts.Height(); i < height; i++ {
|
||||
@@ -116,6 +116,21 @@ func ComputeState(ctx context.Context, sm *StateManager, height abi.ChainEpoch,
|
||||
if ret.ExitCode != 0 {
|
||||
log.Infof("compute state apply message %d failed (exit: %d): %s", i, ret.ExitCode, ret.ActorErr)
|
||||
}
|
||||
|
||||
ir := &api.InvocResult{
|
||||
MsgCid: msg.Cid(),
|
||||
Msg: msg,
|
||||
MsgRct: &ret.MessageReceipt,
|
||||
ExecutionTrace: ret.ExecutionTrace,
|
||||
Duration: ret.Duration,
|
||||
}
|
||||
if ret.ActorErr != nil {
|
||||
ir.Error = ret.ActorErr.Error()
|
||||
}
|
||||
if ret.GasCosts != nil {
|
||||
ir.GasCost = MakeMsgGasCost(msg, ret)
|
||||
}
|
||||
trace = append(trace, ir)
|
||||
}
|
||||
|
||||
root, err := vmi.Flush(ctx)
|
||||
|
||||
+29
-15
@@ -2,18 +2,21 @@ package store
|
||||
|
||||
import (
|
||||
"context"
|
||||
"hash/maphash"
|
||||
"os"
|
||||
"strconv"
|
||||
"sync"
|
||||
|
||||
"github.com/puzpuzpuz/xsync/v2"
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
"github.com/filecoin-project/lotus/lib/shardedmutex"
|
||||
)
|
||||
|
||||
var DefaultChainIndexCacheSize = 32 << 15
|
||||
// DefaultChainIndexCacheSize no longer sets the maximum size, just the initial size of the map.
|
||||
var DefaultChainIndexCacheSize = 1 << 15
|
||||
|
||||
func init() {
|
||||
if s := os.Getenv("LOTUS_CHAIN_INDEX_CACHE"); s != "" {
|
||||
@@ -27,8 +30,9 @@ func init() {
|
||||
}
|
||||
|
||||
type ChainIndex struct {
|
||||
indexCacheLk sync.Mutex
|
||||
indexCache map[types.TipSetKey]*lbEntry
|
||||
indexCache *xsync.MapOf[types.TipSetKey, *lbEntry]
|
||||
|
||||
fillCacheLock shardedmutex.ShardedMutexFor[types.TipSetKey]
|
||||
|
||||
loadTipSet loadTipSetFunc
|
||||
|
||||
@@ -36,11 +40,16 @@ type ChainIndex struct {
|
||||
}
|
||||
type loadTipSetFunc func(context.Context, types.TipSetKey) (*types.TipSet, error)
|
||||
|
||||
func maphashTSK(s maphash.Seed, tsk types.TipSetKey) uint64 {
|
||||
return maphash.Bytes(s, tsk.Bytes())
|
||||
}
|
||||
|
||||
func NewChainIndex(lts loadTipSetFunc) *ChainIndex {
|
||||
return &ChainIndex{
|
||||
indexCache: make(map[types.TipSetKey]*lbEntry, DefaultChainIndexCacheSize),
|
||||
loadTipSet: lts,
|
||||
skipLength: 20,
|
||||
indexCache: xsync.NewTypedMapOfPresized[types.TipSetKey, *lbEntry](maphashTSK, DefaultChainIndexCacheSize),
|
||||
fillCacheLock: shardedmutex.NewFor(maphashTSK, 32),
|
||||
loadTipSet: lts,
|
||||
skipLength: 20,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,17 +68,23 @@ func (ci *ChainIndex) GetTipsetByHeight(ctx context.Context, from *types.TipSet,
|
||||
return nil, xerrors.Errorf("failed to round down: %w", err)
|
||||
}
|
||||
|
||||
ci.indexCacheLk.Lock()
|
||||
defer ci.indexCacheLk.Unlock()
|
||||
cur := rounded.Key()
|
||||
for {
|
||||
lbe, ok := ci.indexCache[cur]
|
||||
lbe, ok := ci.indexCache.Load(cur) // check the cache
|
||||
if !ok {
|
||||
fc, err := ci.fillCache(ctx, cur)
|
||||
if err != nil {
|
||||
return nil, xerrors.Errorf("failed to fill cache: %w", err)
|
||||
lk := ci.fillCacheLock.GetLock(cur)
|
||||
lk.Lock() // if entry is missing, take the lock
|
||||
lbe, ok = ci.indexCache.Load(cur) // check if someone else added it while we waited for lock
|
||||
if !ok {
|
||||
fc, err := ci.fillCache(ctx, cur)
|
||||
if err != nil {
|
||||
lk.Unlock()
|
||||
return nil, xerrors.Errorf("failed to fill cache: %w", err)
|
||||
}
|
||||
lbe = fc
|
||||
ci.indexCache.Store(cur, lbe)
|
||||
}
|
||||
lbe = fc
|
||||
lk.Unlock()
|
||||
}
|
||||
|
||||
if to == lbe.targetHeight {
|
||||
@@ -137,7 +152,6 @@ func (ci *ChainIndex) fillCache(ctx context.Context, tsk types.TipSetKey) (*lbEn
|
||||
targetHeight: skipTarget.Height(),
|
||||
target: skipTarget.Key(),
|
||||
}
|
||||
ci.indexCache[tsk] = lbe
|
||||
|
||||
return lbe, nil
|
||||
}
|
||||
|
||||
+27
-4
@@ -3,10 +3,10 @@ package store
|
||||
import (
|
||||
"context"
|
||||
|
||||
block "github.com/ipfs/go-block-format"
|
||||
"github.com/ipfs/go-cid"
|
||||
cbor "github.com/ipfs/go-ipld-cbor"
|
||||
ipld "github.com/ipfs/go-ipld-format"
|
||||
block "github.com/ipfs/go-libipfs/blocks"
|
||||
cbg "github.com/whyrusleeping/cbor-gen"
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
@@ -114,12 +114,35 @@ func (cs *ChainStore) BlockMsgsForTipset(ctx context.Context, ts *types.TipSet)
|
||||
return nil, xerrors.Errorf("failed to load state tree at tipset %s: %w", ts, err)
|
||||
}
|
||||
|
||||
useIds := false
|
||||
selectMsg := func(m *types.Message) (bool, error) {
|
||||
var sender address.Address
|
||||
if ts.Height() >= build.UpgradeHyperdriveHeight {
|
||||
sender, err = st.LookupID(m.From)
|
||||
if err != nil {
|
||||
return false, err
|
||||
if useIds {
|
||||
sender, err = st.LookupID(m.From)
|
||||
if err != nil {
|
||||
return false, xerrors.Errorf("failed to resolve sender: %w", err)
|
||||
}
|
||||
} else {
|
||||
if m.From.Protocol() != address.ID {
|
||||
// we haven't been told to use IDs, just use the robust addr
|
||||
sender = m.From
|
||||
} else {
|
||||
// uh-oh, we actually have an ID-sender!
|
||||
useIds = true
|
||||
for robust, nonce := range applied {
|
||||
resolved, err := st.LookupID(robust)
|
||||
if err != nil {
|
||||
return false, xerrors.Errorf("failed to resolve sender: %w", err)
|
||||
}
|
||||
applied[resolved] = nonce
|
||||
}
|
||||
|
||||
sender, err = st.LookupID(m.From)
|
||||
if err != nil {
|
||||
return false, xerrors.Errorf("failed to resolve sender: %w", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
sender = m.From
|
||||
|
||||
+86
-36
@@ -3,13 +3,15 @@ package store
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
blocks "github.com/ipfs/go-block-format"
|
||||
"github.com/ipfs/go-cid"
|
||||
blocks "github.com/ipfs/go-libipfs/blocks"
|
||||
format "github.com/ipfs/go-ipld-format"
|
||||
"github.com/ipld/go-car"
|
||||
carutil "github.com/ipld/go-car/util"
|
||||
carv2 "github.com/ipld/go-car/v2"
|
||||
@@ -121,11 +123,9 @@ func (cs *ChainStore) Import(ctx context.Context, r io.Reader) (*types.TipSet, e
|
||||
}
|
||||
|
||||
ts := root
|
||||
tssToPersist := make([]*types.TipSet, 0, TipsetkeyBackfillRange)
|
||||
for i := 0; i < int(TipsetkeyBackfillRange); i++ {
|
||||
err = cs.PersistTipset(ctx, ts)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
tssToPersist = append(tssToPersist, ts)
|
||||
parentTsKey := ts.Parents()
|
||||
ts, err = cs.LoadTipSet(ctx, parentTsKey)
|
||||
if ts == nil || err != nil {
|
||||
@@ -134,6 +134,10 @@ func (cs *ChainStore) Import(ctx context.Context, r io.Reader) (*types.TipSet, e
|
||||
}
|
||||
}
|
||||
|
||||
if err := cs.PersistTipsets(ctx, tssToPersist); err != nil {
|
||||
return nil, xerrors.Errorf("failed to persist tipsets: %w", err)
|
||||
}
|
||||
|
||||
return root, nil
|
||||
}
|
||||
|
||||
@@ -167,8 +171,11 @@ func (t walkSchedTaskType) String() string {
|
||||
}
|
||||
|
||||
type walkTask struct {
|
||||
c cid.Cid
|
||||
taskType walkSchedTaskType
|
||||
c cid.Cid
|
||||
taskType walkSchedTaskType
|
||||
topLevelTaskType walkSchedTaskType
|
||||
blockCid cid.Cid
|
||||
epoch abi.ChainEpoch
|
||||
}
|
||||
|
||||
// an ever growing FIFO
|
||||
@@ -317,8 +324,11 @@ func newWalkScheduler(ctx context.Context, store bstore.Blockstore, cfg walkSche
|
||||
cancel() // kill workers
|
||||
return nil, ctx.Err()
|
||||
case s.workerTasks.in <- walkTask{
|
||||
c: b.Cid(),
|
||||
taskType: blockTask,
|
||||
c: b.Cid(),
|
||||
taskType: blockTask,
|
||||
topLevelTaskType: blockTask,
|
||||
blockCid: b.Cid(),
|
||||
epoch: cfg.head.Height(),
|
||||
}:
|
||||
}
|
||||
}
|
||||
@@ -363,6 +373,9 @@ func (s *walkScheduler) enqueueIfNew(task walkTask) {
|
||||
//log.Infow("ignored", "cid", todo.c.String())
|
||||
return
|
||||
}
|
||||
|
||||
// This lets through RAW and CBOR blocks, the only two types that we
|
||||
// end up writing to the exported CAR.
|
||||
if task.c.Prefix().Codec != cid.Raw && task.c.Prefix().Codec != cid.DagCBOR {
|
||||
//log.Infow("ignored", "cid", todo.c.String())
|
||||
return
|
||||
@@ -416,8 +429,17 @@ func (s *walkScheduler) processTask(t walkTask, workerN int) error {
|
||||
}
|
||||
|
||||
blk, err := s.store.Get(s.ctx, t.c)
|
||||
if errors.Is(err, format.ErrNotFound{}) && t.topLevelTaskType == receiptTask {
|
||||
log.Debugw("ignoring not-found block in Receipts",
|
||||
"block", t.blockCid,
|
||||
"epoch", t.epoch,
|
||||
"cid", t.c)
|
||||
return nil
|
||||
}
|
||||
if err != nil {
|
||||
return xerrors.Errorf("writing object to car, bs.Get: %w", err)
|
||||
return xerrors.Errorf(
|
||||
"blockstore.Get(%s). Task: %s. Block: %s (%s). Epoch: %d. Err: %w",
|
||||
t.c, t.taskType, t.topLevelTaskType, t.blockCid, t.epoch, err)
|
||||
}
|
||||
|
||||
s.results <- taskResult{
|
||||
@@ -425,15 +447,19 @@ func (s *walkScheduler) processTask(t walkTask, workerN int) error {
|
||||
b: blk,
|
||||
}
|
||||
|
||||
// We exported the ipld block. If it wasn't a CBOR block, there's nothing
|
||||
// else to do and we can bail out early as it won't have any links
|
||||
// etc.
|
||||
if t.c.Prefix().Codec != cid.DagCBOR || t.c.Prefix().MhType == mh.IDENTITY {
|
||||
return nil
|
||||
}
|
||||
|
||||
rawData := blk.RawData()
|
||||
|
||||
// extract relevant dags to walk from the block
|
||||
if t.taskType == blockTask {
|
||||
blk := t.c
|
||||
data, err := s.store.Get(s.ctx, blk)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
var b types.BlockHeader
|
||||
if err := b.UnmarshalCBOR(bytes.NewBuffer(data.RawData())); err != nil {
|
||||
if err := b.UnmarshalCBOR(bytes.NewBuffer(rawData)); err != nil {
|
||||
return xerrors.Errorf("unmarshalling block header (cid=%s): %w", blk, err)
|
||||
}
|
||||
if b.Height%1_000 == 0 {
|
||||
@@ -443,13 +469,19 @@ func (s *walkScheduler) processTask(t walkTask, workerN int) error {
|
||||
log.Info("exporting genesis block")
|
||||
for i := range b.Parents {
|
||||
s.enqueueIfNew(walkTask{
|
||||
c: b.Parents[i],
|
||||
taskType: dagTask,
|
||||
c: b.Parents[i],
|
||||
taskType: dagTask,
|
||||
topLevelTaskType: blockTask,
|
||||
blockCid: b.Parents[i],
|
||||
epoch: 0,
|
||||
})
|
||||
}
|
||||
s.enqueueIfNew(walkTask{
|
||||
c: b.ParentStateRoot,
|
||||
taskType: stateTask,
|
||||
c: b.ParentStateRoot,
|
||||
taskType: stateTask,
|
||||
topLevelTaskType: stateTask,
|
||||
blockCid: t.c,
|
||||
epoch: 0,
|
||||
})
|
||||
|
||||
return s.sendFinish(workerN)
|
||||
@@ -457,33 +489,45 @@ func (s *walkScheduler) processTask(t walkTask, workerN int) error {
|
||||
// enqueue block parents
|
||||
for i := range b.Parents {
|
||||
s.enqueueIfNew(walkTask{
|
||||
c: b.Parents[i],
|
||||
taskType: blockTask,
|
||||
c: b.Parents[i],
|
||||
taskType: blockTask,
|
||||
topLevelTaskType: blockTask,
|
||||
blockCid: b.Parents[i],
|
||||
epoch: b.Height,
|
||||
})
|
||||
}
|
||||
if s.cfg.tail.Height() >= b.Height {
|
||||
log.Debugw("tail reached: only blocks will be exported from now until genesis", "cid", blk.String())
|
||||
log.Debugw("tail reached: only blocks will be exported from now until genesis", "cid", t.c.String())
|
||||
return nil
|
||||
}
|
||||
|
||||
if s.cfg.includeMessages {
|
||||
// enqueue block messages
|
||||
s.enqueueIfNew(walkTask{
|
||||
c: b.Messages,
|
||||
taskType: messageTask,
|
||||
c: b.Messages,
|
||||
taskType: messageTask,
|
||||
topLevelTaskType: messageTask,
|
||||
blockCid: t.c,
|
||||
epoch: b.Height,
|
||||
})
|
||||
}
|
||||
if s.cfg.includeReceipts {
|
||||
// enqueue block receipts
|
||||
s.enqueueIfNew(walkTask{
|
||||
c: b.ParentMessageReceipts,
|
||||
taskType: receiptTask,
|
||||
c: b.ParentMessageReceipts,
|
||||
taskType: receiptTask,
|
||||
topLevelTaskType: receiptTask,
|
||||
blockCid: t.c,
|
||||
epoch: b.Height,
|
||||
})
|
||||
}
|
||||
if s.cfg.includeState {
|
||||
s.enqueueIfNew(walkTask{
|
||||
c: b.ParentStateRoot,
|
||||
taskType: stateTask,
|
||||
c: b.ParentStateRoot,
|
||||
taskType: stateTask,
|
||||
topLevelTaskType: stateTask,
|
||||
blockCid: t.c,
|
||||
epoch: b.Height,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -491,16 +535,22 @@ func (s *walkScheduler) processTask(t walkTask, workerN int) error {
|
||||
}
|
||||
|
||||
// Not a chain-block: we scan for CIDs in the raw block-data
|
||||
return cbg.ScanForLinks(bytes.NewReader(blk.RawData()), func(c cid.Cid) {
|
||||
if t.c.Prefix().Codec != cid.DagCBOR || t.c.Prefix().MhType == mh.IDENTITY {
|
||||
return
|
||||
}
|
||||
|
||||
err = cbg.ScanForLinks(bytes.NewReader(rawData), func(c cid.Cid) {
|
||||
s.enqueueIfNew(walkTask{
|
||||
c: c,
|
||||
taskType: dagTask,
|
||||
c: c,
|
||||
taskType: dagTask,
|
||||
topLevelTaskType: t.topLevelTaskType,
|
||||
blockCid: t.blockCid,
|
||||
epoch: t.epoch,
|
||||
})
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
return xerrors.Errorf(
|
||||
"ScanForLinks(%s). Task: %s. Block: %s (%s). Epoch: %d. Err: %w",
|
||||
t.c, t.taskType, t.topLevelTaskType, t.blockCid, t.epoch, err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (cs *ChainStore) ExportRange(
|
||||
|
||||
+40
-24
@@ -12,11 +12,11 @@ import (
|
||||
"time"
|
||||
|
||||
lru "github.com/hashicorp/golang-lru/v2"
|
||||
block "github.com/ipfs/go-block-format"
|
||||
"github.com/ipfs/go-cid"
|
||||
dstore "github.com/ipfs/go-datastore"
|
||||
"github.com/ipfs/go-datastore/query"
|
||||
cbor "github.com/ipfs/go-ipld-cbor"
|
||||
block "github.com/ipfs/go-libipfs/blocks"
|
||||
logging "github.com/ipfs/go-log/v2"
|
||||
"go.opencensus.io/stats"
|
||||
"go.opencensus.io/trace"
|
||||
@@ -378,7 +378,7 @@ func (cs *ChainStore) SetGenesis(ctx context.Context, b *types.BlockHeader) erro
|
||||
}
|
||||
|
||||
func (cs *ChainStore) PutTipSet(ctx context.Context, ts *types.TipSet) error {
|
||||
if err := cs.PersistTipset(ctx, ts); err != nil {
|
||||
if err := cs.PersistTipsets(ctx, []*types.TipSet{ts}); err != nil {
|
||||
return xerrors.Errorf("failed to persist tipset: %w", err)
|
||||
}
|
||||
|
||||
@@ -425,6 +425,11 @@ func (cs *ChainStore) MaybeTakeHeavierTipSet(ctx context.Context, ts *types.TipS
|
||||
}
|
||||
|
||||
defer cs.heaviestLk.Unlock()
|
||||
|
||||
if ts.Equals(cs.heaviest) {
|
||||
return nil
|
||||
}
|
||||
|
||||
w, err := cs.weight(ctx, cs.StateBlockstore(), ts)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -639,22 +644,10 @@ func (cs *ChainStore) reorgWorker(ctx context.Context, initialNotifees []ReorgNo
|
||||
func (cs *ChainStore) takeHeaviestTipSet(ctx context.Context, ts *types.TipSet) error {
|
||||
_, span := trace.StartSpan(ctx, "takeHeaviestTipSet")
|
||||
defer span.End()
|
||||
|
||||
if cs.heaviest != nil { // buf
|
||||
if len(cs.reorgCh) > 0 {
|
||||
log.Warnf("Reorg channel running behind, %d reorgs buffered", len(cs.reorgCh))
|
||||
}
|
||||
cs.reorgCh <- reorg{
|
||||
old: cs.heaviest,
|
||||
new: ts,
|
||||
}
|
||||
} else {
|
||||
log.Warnf("no heaviest tipset found, using %s", ts.Cids())
|
||||
}
|
||||
|
||||
span.AddAttributes(trace.BoolAttribute("newHead", true))
|
||||
|
||||
log.Infof("New heaviest tipset! %s (height=%d)", ts.Cids(), ts.Height())
|
||||
prevHeaviest := cs.heaviest
|
||||
cs.heaviest = ts
|
||||
|
||||
if err := cs.writeHead(ctx, ts); err != nil {
|
||||
@@ -662,6 +655,18 @@ func (cs *ChainStore) takeHeaviestTipSet(ctx context.Context, ts *types.TipSet)
|
||||
return err
|
||||
}
|
||||
|
||||
if prevHeaviest != nil { // buf
|
||||
if len(cs.reorgCh) > 0 {
|
||||
log.Warnf("Reorg channel running behind, %d reorgs buffered", len(cs.reorgCh))
|
||||
}
|
||||
cs.reorgCh <- reorg{
|
||||
old: prevHeaviest,
|
||||
new: ts,
|
||||
}
|
||||
} else {
|
||||
log.Warnf("no previous heaviest tipset found, using %s", ts.Cids())
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -970,18 +975,25 @@ func (cs *ChainStore) AddToTipSetTracker(ctx context.Context, b *types.BlockHead
|
||||
return nil
|
||||
}
|
||||
|
||||
func (cs *ChainStore) PersistTipset(ctx context.Context, ts *types.TipSet) error {
|
||||
if err := cs.persistBlockHeaders(ctx, ts.Blocks()...); err != nil {
|
||||
func (cs *ChainStore) PersistTipsets(ctx context.Context, tipsets []*types.TipSet) error {
|
||||
toPersist := make([]*types.BlockHeader, 0, len(tipsets)*int(build.BlocksPerEpoch))
|
||||
tsBlks := make([]block.Block, 0, len(tipsets))
|
||||
for _, ts := range tipsets {
|
||||
toPersist = append(toPersist, ts.Blocks()...)
|
||||
tsBlk, err := ts.Key().ToStorageBlock()
|
||||
if err != nil {
|
||||
return xerrors.Errorf("failed to get tipset key block: %w", err)
|
||||
}
|
||||
|
||||
tsBlks = append(tsBlks, tsBlk)
|
||||
}
|
||||
|
||||
if err := cs.persistBlockHeaders(ctx, toPersist...); err != nil {
|
||||
return xerrors.Errorf("failed to persist block headers: %w", err)
|
||||
}
|
||||
|
||||
tsBlk, err := ts.Key().ToStorageBlock()
|
||||
if err != nil {
|
||||
return xerrors.Errorf("failed to get tipset key block: %w", err)
|
||||
}
|
||||
|
||||
if err = cs.chainLocalBlockstore.Put(ctx, tsBlk); err != nil {
|
||||
return xerrors.Errorf("failed to put tipset key block: %w", err)
|
||||
if err := cs.chainLocalBlockstore.PutMany(ctx, tsBlks); err != nil {
|
||||
return xerrors.Errorf("failed to put tipset key blocks: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
@@ -1149,6 +1161,10 @@ func (cs *ChainStore) TryFillTipSet(ctx context.Context, ts *types.TipSet) (*Ful
|
||||
// selects the tipset before the null round if true, and the tipset following
|
||||
// the null round if false.
|
||||
func (cs *ChainStore) GetTipsetByHeight(ctx context.Context, h abi.ChainEpoch, ts *types.TipSet, prev bool) (*types.TipSet, error) {
|
||||
if h < 0 {
|
||||
return nil, xerrors.Errorf("height %d is negative", h)
|
||||
}
|
||||
|
||||
if ts == nil {
|
||||
ts = cs.GetHeaviestTipSet()
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ import (
|
||||
"github.com/filecoin-project/lotus/chain/consensus"
|
||||
"github.com/filecoin-project/lotus/chain/consensus/filcns"
|
||||
"github.com/filecoin-project/lotus/chain/gen"
|
||||
"github.com/filecoin-project/lotus/chain/index"
|
||||
"github.com/filecoin-project/lotus/chain/stmgr"
|
||||
"github.com/filecoin-project/lotus/chain/store"
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
@@ -214,7 +215,7 @@ func TestChainExportImportFull(t *testing.T) {
|
||||
t.Fatal("imported chain differed from exported chain")
|
||||
}
|
||||
|
||||
sm, err := stmgr.NewStateManager(cs, consensus.NewTipSetExecutor(filcns.RewardFunc), nil, filcns.DefaultUpgradeSchedule(), cg.BeaconSchedule(), ds)
|
||||
sm, err := stmgr.NewStateManager(cs, consensus.NewTipSetExecutor(filcns.RewardFunc), nil, filcns.DefaultUpgradeSchedule(), cg.BeaconSchedule(), ds, index.DummyMsgIndex)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
@@ -8,11 +8,11 @@ import (
|
||||
"time"
|
||||
|
||||
lru "github.com/hashicorp/golang-lru/v2"
|
||||
blocks "github.com/ipfs/go-block-format"
|
||||
bserv "github.com/ipfs/go-blockservice"
|
||||
"github.com/ipfs/go-cid"
|
||||
blocks "github.com/ipfs/go-libipfs/blocks"
|
||||
logging "github.com/ipfs/go-log/v2"
|
||||
"github.com/ipni/storetheindex/announce/message"
|
||||
"github.com/ipni/go-libipni/announce/message"
|
||||
pubsub "github.com/libp2p/go-libp2p-pubsub"
|
||||
"github.com/libp2p/go-libp2p/core/connmgr"
|
||||
"github.com/libp2p/go-libp2p/core/peer"
|
||||
@@ -358,7 +358,11 @@ func (mv *MessageValidator) Validate(ctx context.Context, pid peer.ID, msg *pubs
|
||||
fallthrough
|
||||
case xerrors.Is(err, messagepool.ErrNonceGap):
|
||||
fallthrough
|
||||
case xerrors.Is(err, messagepool.ErrGasFeeCapTooLow):
|
||||
fallthrough
|
||||
case xerrors.Is(err, messagepool.ErrNonceTooLow):
|
||||
fallthrough
|
||||
case xerrors.Is(err, messagepool.ErrExistingNonce):
|
||||
return pubsub.ValidationIgnore
|
||||
default:
|
||||
return pubsub.ValidationReject
|
||||
|
||||
@@ -7,9 +7,9 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/golang/mock/gomock"
|
||||
blocks "github.com/ipfs/go-block-format"
|
||||
"github.com/ipfs/go-cid"
|
||||
blocks "github.com/ipfs/go-libipfs/blocks"
|
||||
"github.com/ipni/storetheindex/announce/message"
|
||||
"github.com/ipni/go-libipni/announce/message"
|
||||
pubsub "github.com/libp2p/go-libp2p-pubsub"
|
||||
pb "github.com/libp2p/go-libp2p-pubsub/pb"
|
||||
"github.com/libp2p/go-libp2p/core/peer"
|
||||
|
||||
+10
-11
@@ -11,10 +11,10 @@ import (
|
||||
|
||||
"github.com/Gurpartap/async"
|
||||
"github.com/hashicorp/go-multierror"
|
||||
blocks "github.com/ipfs/go-block-format"
|
||||
"github.com/ipfs/go-cid"
|
||||
cbor "github.com/ipfs/go-ipld-cbor"
|
||||
ipld "github.com/ipfs/go-ipld-format"
|
||||
blocks "github.com/ipfs/go-libipfs/blocks"
|
||||
logging "github.com/ipfs/go-log/v2"
|
||||
"github.com/libp2p/go-libp2p/core/connmgr"
|
||||
"github.com/libp2p/go-libp2p/core/peer"
|
||||
@@ -208,8 +208,8 @@ func (syncer *Syncer) InformNewHead(from peer.ID, fts *store.FullTipSet) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
if syncer.consensus.IsEpochBeyondCurrMax(fts.TipSet().Height()) {
|
||||
log.Errorf("Received block with impossibly large height %d", fts.TipSet().Height())
|
||||
if !syncer.consensus.IsEpochInConsensusRange(fts.TipSet().Height()) {
|
||||
log.Infof("received block outside of consensus range at height %d", fts.TipSet().Height())
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -228,7 +228,7 @@ func (syncer *Syncer) InformNewHead(from peer.ID, fts *store.FullTipSet) bool {
|
||||
|
||||
// TODO: IMPORTANT(GARBAGE) this needs to be put in the 'temporary' side of
|
||||
// the blockstore
|
||||
if err := syncer.store.PersistTipset(ctx, fts.TipSet()); err != nil {
|
||||
if err := syncer.store.PersistTipsets(ctx, []*types.TipSet{fts.TipSet()}); err != nil {
|
||||
log.Warn("failed to persist incoming block header: ", err)
|
||||
return false
|
||||
}
|
||||
@@ -1193,17 +1193,16 @@ func (syncer *Syncer) collectChain(ctx context.Context, ts *types.TipSet, hts *t
|
||||
span.AddAttributes(trace.Int64Attribute("syncChainLength", int64(len(headers))))
|
||||
|
||||
if !headers[0].Equals(ts) {
|
||||
log.Errorf("collectChain headers[0] should be equal to sync target. Its not: %s != %s", headers[0].Cids(), ts.Cids())
|
||||
return xerrors.Errorf("collectChain synced %s, wanted to sync %s", headers[0].Cids(), ts.Cids())
|
||||
}
|
||||
|
||||
ss.SetStage(api.StagePersistHeaders)
|
||||
|
||||
for _, ts := range headers {
|
||||
if err := syncer.store.PersistTipset(ctx, ts); err != nil {
|
||||
err = xerrors.Errorf("failed to persist synced tipset to the chainstore: %w", err)
|
||||
ss.Error(err)
|
||||
return err
|
||||
}
|
||||
// Write tipsets from oldest to newest.
|
||||
if err := syncer.store.PersistTipsets(ctx, headers); err != nil {
|
||||
err = xerrors.Errorf("failed to persist synced tipset to the chainstore: %w", err)
|
||||
ss.Error(err)
|
||||
return err
|
||||
}
|
||||
|
||||
ss.SetStage(api.StageMessages)
|
||||
|
||||
@@ -4,8 +4,8 @@ import (
|
||||
"bytes"
|
||||
"math/big"
|
||||
|
||||
block "github.com/ipfs/go-block-format"
|
||||
"github.com/ipfs/go-cid"
|
||||
block "github.com/ipfs/go-libipfs/blocks"
|
||||
"github.com/minio/blake2b-simd"
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
@@ -13,8 +13,6 @@ import (
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
"github.com/filecoin-project/go-state-types/crypto"
|
||||
"github.com/filecoin-project/go-state-types/proof"
|
||||
|
||||
"github.com/filecoin-project/lotus/build"
|
||||
)
|
||||
|
||||
type Ticket struct {
|
||||
@@ -195,36 +193,6 @@ func CidArrsContains(a []cid.Cid, b cid.Cid) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
var blocksPerEpoch = NewInt(build.BlocksPerEpoch)
|
||||
|
||||
const sha256bits = 256
|
||||
|
||||
func IsTicketWinner(vrfTicket []byte, mypow BigInt, totpow BigInt) bool {
|
||||
/*
|
||||
Need to check that
|
||||
(h(vrfout) + 1) / (max(h) + 1) <= e * myPower / totalPower
|
||||
max(h) == 2^256-1
|
||||
which in terms of integer math means:
|
||||
(h(vrfout) + 1) * totalPower <= e * myPower * 2^256
|
||||
in 2^256 space, it is equivalent to:
|
||||
h(vrfout) * totalPower < e * myPower * 2^256
|
||||
|
||||
*/
|
||||
|
||||
h := blake2b.Sum256(vrfTicket)
|
||||
|
||||
lhs := BigFromBytes(h[:]).Int
|
||||
lhs = lhs.Mul(lhs, totpow.Int)
|
||||
|
||||
// rhs = sectorSize * 2^256
|
||||
// rhs = sectorSize << 256
|
||||
rhs := new(big.Int).Lsh(mypow.Int, sha256bits)
|
||||
rhs = rhs.Mul(rhs, blocksPerEpoch.Int)
|
||||
|
||||
// h(vrfout) * totalPower < e * sectorSize * 2^256?
|
||||
return lhs.Cmp(rhs) < 0
|
||||
}
|
||||
|
||||
func (t *Ticket) Equals(ot *Ticket) bool {
|
||||
return bytes.Equal(t.VRFProof, ot.VRFProof)
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package types
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
)
|
||||
@@ -14,10 +15,13 @@ type BlockMsg struct {
|
||||
|
||||
func DecodeBlockMsg(b []byte) (*BlockMsg, error) {
|
||||
var bm BlockMsg
|
||||
if err := bm.UnmarshalCBOR(bytes.NewReader(b)); err != nil {
|
||||
data := bytes.NewReader(b)
|
||||
if err := bm.UnmarshalCBOR(data); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if l := data.Len(); l != 0 {
|
||||
return nil, fmt.Errorf("extraneous data in BlockMsg CBOR encoding: got %d unexpected bytes", l)
|
||||
}
|
||||
return &bm, nil
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
package types
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestDecodeBlockMsg(t *testing.T) {
|
||||
type args struct {
|
||||
b []byte
|
||||
}
|
||||
tests := []struct {
|
||||
name string
|
||||
data []byte
|
||||
want *BlockMsg
|
||||
wantErr bool
|
||||
}{
|
||||
{"decode empty BlockMsg with extra data at the end", []byte{0x83, 0xf6, 0x80, 0x80, 0x20}, nil, true},
|
||||
{"decode valid empty BlockMsg", []byte{0x83, 0xf6, 0x80, 0x80}, new(BlockMsg), false},
|
||||
{"decode invalid cbor", []byte{0x83, 0xf6, 0x80}, nil, true},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
data := tt.data
|
||||
want := tt.want
|
||||
wantErr := tt.wantErr
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
got, err := DecodeBlockMsg(data)
|
||||
if wantErr {
|
||||
assert.Errorf(t, err, "DecodeBlockMsg(%x)", data)
|
||||
return
|
||||
}
|
||||
assert.NoErrorf(t, err, "DecodeBlockMsg(%x)", data)
|
||||
assert.Equalf(t, want, got, "DecodeBlockMsg(%x)", data)
|
||||
serialized, err := got.Serialize()
|
||||
assert.NoErrorf(t, err, "DecodeBlockMsg(%x)", data)
|
||||
assert.Equalf(t, serialized, data, "DecodeBlockMsg(%x)", data)
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -100,6 +100,7 @@ func polyval(p []*big.Int, x *big.Int) *big.Int {
|
||||
|
||||
// computes lambda in Q.256
|
||||
func lambda(power, totalPower *big.Int) *big.Int {
|
||||
blocksPerEpoch := NewInt(build.BlocksPerEpoch)
|
||||
lam := new(big.Int).Mul(power, blocksPerEpoch.Int) // Q.0
|
||||
lam = lam.Lsh(lam, precision) // Q.256
|
||||
lam = lam.Div(lam /* Q.256 */, totalPower /* Q.0 */) // Q.256
|
||||
|
||||
@@ -238,6 +238,30 @@ func (c *EthCall) UnmarshalJSON(b []byte) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
type EthSyncingResult struct {
|
||||
DoneSync bool
|
||||
StartingBlock EthUint64
|
||||
CurrentBlock EthUint64
|
||||
HighestBlock EthUint64
|
||||
}
|
||||
|
||||
func (sr EthSyncingResult) MarshalJSON() ([]byte, error) {
|
||||
if sr.DoneSync {
|
||||
// when done syncing, the json response should be '"result": false'
|
||||
return []byte("false"), nil
|
||||
}
|
||||
|
||||
// need to do an anonymous struct to avoid infinite recursion
|
||||
return json.Marshal(&struct {
|
||||
StartingBlock EthUint64 `json:"startingblock"`
|
||||
CurrentBlock EthUint64 `json:"currentblock"`
|
||||
HighestBlock EthUint64 `json:"highestblock"`
|
||||
}{
|
||||
StartingBlock: sr.StartingBlock,
|
||||
CurrentBlock: sr.CurrentBlock,
|
||||
HighestBlock: sr.HighestBlock})
|
||||
}
|
||||
|
||||
const (
|
||||
EthAddressLength = 20
|
||||
EthHashLength = 32
|
||||
@@ -548,12 +572,12 @@ func (h EthSubscriptionID) String() string {
|
||||
}
|
||||
|
||||
type EthFilterSpec struct {
|
||||
// Interpreted as an epoch or one of "latest" for last mined block, "earliest" for first,
|
||||
// Interpreted as an epoch (in hex) or one of "latest" for last mined block, "earliest" for first,
|
||||
// "pending" for not yet committed messages.
|
||||
// Optional, default: "latest".
|
||||
FromBlock *string `json:"fromBlock,omitempty"`
|
||||
|
||||
// Interpreted as an epoch or one of "latest" for last mined block, "earliest" for first,
|
||||
// Interpreted as an epoch (in hex) or one of "latest" for last mined block, "earliest" for first,
|
||||
// "pending" for not yet committed messages.
|
||||
// Optional, default: "latest".
|
||||
ToBlock *string `json:"toBlock,omitempty"`
|
||||
|
||||
@@ -5,8 +5,8 @@ import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
|
||||
block "github.com/ipfs/go-block-format"
|
||||
"github.com/ipfs/go-cid"
|
||||
block "github.com/ipfs/go-libipfs/blocks"
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
@@ -220,12 +220,17 @@ func (m *Message) ValidForBlockInclusion(minGas int64, version network.Version)
|
||||
}
|
||||
|
||||
// EffectiveGasPremium returns the effective gas premium claimable by the miner
|
||||
// given the supplied base fee.
|
||||
// given the supplied base fee. This method is not used anywhere except the Eth API.
|
||||
//
|
||||
// Filecoin clamps the gas premium at GasFeeCap - BaseFee, if lower than the
|
||||
// specified premium.
|
||||
// specified premium. Returns 0 if GasFeeCap is less than BaseFee.
|
||||
func (m *Message) EffectiveGasPremium(baseFee abi.TokenAmount) abi.TokenAmount {
|
||||
available := big.Sub(m.GasFeeCap, baseFee)
|
||||
// It's possible that storage providers may include messages with gasFeeCap less than the baseFee
|
||||
// In such cases, their reward should be viewed as zero
|
||||
if available.LessThan(big.NewInt(0)) {
|
||||
available = big.NewInt(0)
|
||||
}
|
||||
if big.Cmp(m.GasPremium, available) <= 0 {
|
||||
return m.GasPremium
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user