Merge pull request #10629 from filecoin-project/feat/grindability

feat: implement FIP-0061
This commit is contained in:
Aayush Rajasekaran 2023-04-10 12:01:30 -04:00 committed by GitHub
commit 76705b5762
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
23 changed files with 746 additions and 306 deletions

View File

@ -719,14 +719,9 @@ workflows:
target: "./itests/mempool_test.go"
- test:
name: test-itest-migration_nv17
suite: itest-migration_nv17
target: "./itests/migration_nv17_test.go"
- test:
name: test-itest-migration_nv18
suite: itest-migration_nv18
target: "./itests/migration_nv18_test.go"
name: test-itest-migration
suite: itest-migration
target: "./itests/migration_test.go"
- test:
name: test-itest-mpool_msg_uuid

Binary file not shown.

View File

@ -74,25 +74,25 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet
}, {
Network: "butterflynet",
Version: 11,
BundleGitTag: "v10.0.0",
ManifestCid: MustParseCid("bafy2bzaceckjhsggacixv2d377zfdcnuio4hzkveprio3xnhm3gohi3zy3zco"),
BundleGitTag: "fip0061/20230406",
ManifestCid: MustParseCid("bafy2bzaceb7fupcmybvdg7nbdhfhkcfdu3ypca6s6ofhju5knl34orpyj3xmw"),
Actors: map[string]cid.Cid{
"account": MustParseCid("bafk2bzacedkt3uzgugcsdrcsyfvizcpyr5eshltmienbyhjne2t7t3ktkihny"),
"cron": MustParseCid("bafk2bzacecrehknegmfnhmhwy2g43cw52mvl7ptfpp44syus4iph7az7uveuq"),
"datacap": MustParseCid("bafk2bzaced4krgbpj4sywcc453l3pygqr4qocc6nxylhztsm4duvkgfwd7vws"),
"eam": MustParseCid("bafk2bzacebn5lyg5pfhjpdlf3r7lnah4x33bhp5afftdgbr4kbpuioytr4bhe"),
"ethaccount": MustParseCid("bafk2bzaceaxyu24a2tbiacfr4p367xjtptrbang4qrh3fx65cojyrzolwyi4u"),
"evm": MustParseCid("bafk2bzacea5bqaubqeuqmpguxrem2pgocjr43wcfi5e3jpw2e3b4o6tcvs746"),
"init": MustParseCid("bafk2bzaceaufptkdg2gc4eq4ijqxtqp7wxwifusxb6kxay3vdz3wr5epqjbho"),
"multisig": MustParseCid("bafk2bzacedp3c26ccw3l7fci4xhedxhqeqevkubuf5okuslq7o7rcqwqfahci"),
"paymentchannel": MustParseCid("bafk2bzacedlmiqvbutz4ebx2mezy3pqj72x2yt4gwea7sf4dv4a4s7xidelok"),
"account": MustParseCid("bafk2bzacebhrrrqqa36wjxaezbh7b5gh442kp2sjthaaof3nqafob6s76o6qy"),
"cron": MustParseCid("bafk2bzacebzdh47uqkmaptdbpdjetqejzbg246cxkve2pm7ap4xibm2kz47fm"),
"datacap": MustParseCid("bafk2bzacedi4b3dmroeofoikv3jpborq4kdos3ilwgjzmpexcwymmcrguusr4"),
"eam": MustParseCid("bafk2bzacecxxry2lbx7ezi26sugs35r6vhvfuukqq7y3fctjc25z6lblqiwdu"),
"ethaccount": MustParseCid("bafk2bzacebb3q3qwc6mrsfn7blzis6t4j7dmrjxiuezcsv4cbrw7qf6btlbuy"),
"evm": MustParseCid("bafk2bzacebs5heovvujlf7qdjhr6aw5bqq2qegtoeknmo2l6z56a4ygfha3kc"),
"init": MustParseCid("bafk2bzacechqfsh7oorfvt5ua53fawt3jgcjisbiab6ppgy6tyaz734flnhrc"),
"multisig": MustParseCid("bafk2bzaceb5c4ny4cu2cyuieamxn4rgq5ysppuy5ewmjfiupyiaxf2oletrfe"),
"paymentchannel": MustParseCid("bafk2bzacedmo6vzzxyd5dhiff7ukl2okxf5rkv76yzwzpqsr2zfeuiykpltce"),
"placeholder": MustParseCid("bafk2bzacedfvut2myeleyq67fljcrw4kkmn5pb5dpyozovj7jpoez5irnc3ro"),
"reward": MustParseCid("bafk2bzacecrzxiowkhzpgz4rl2pdldzwmmnctuq5zzntqjkgyhyfllo3afb5s"),
"storagemarket": MustParseCid("bafk2bzacebh2q3ofolirt5q2jpx367dfv22aecevsmybba3yhnxfs3foe6c5q"),
"storageminer": MustParseCid("bafk2bzaceavop4j7iwneew6h7p667gvx37baloxilxetwkhsrr26jme6yye5o"),
"storagepower": MustParseCid("bafk2bzacecfblbat4w7jkxx7kjst33lowyb7s6apdnl7fsnpmy5c3jfq5kvye"),
"system": MustParseCid("bafk2bzacebojf25kc5yo7gskdbdgg5f52oppej2jp6nknzlvrww4ue5vkddd2"),
"verifiedregistry": MustParseCid("bafk2bzaceavue3zekq4wmvttck2vgxlcensrsgh5niu5qhna2owejycorftcc"),
"reward": MustParseCid("bafk2bzacedhld6a3dimdvirs7siqbjkwsvcvrgxsuosgtlwjm4nn4xq3igpmk"),
"storagemarket": MustParseCid("bafk2bzacecllt2txfmumxuj3b26a66z7ubluhnu6ufohlbhqfpwpoihvdtl5c"),
"storageminer": MustParseCid("bafk2bzaceb6x4ojvwugfpshof4atv67zf3fv6w5sbrsnzwj2a67o56hcr4su2"),
"storagepower": MustParseCid("bafk2bzacebsccc2m4ns7hvhcaefd5uohjoyppzywtoy23p74hfgbe675dchdg"),
"system": MustParseCid("bafk2bzaceb3jzces4qfkjzkhnxaqysghzcmlfxgsvjnrwonqlvm6g64pyufz6"),
"verifiedregistry": MustParseCid("bafk2bzacebayvz2v4uy4re35s3x6sw6th34kkbibpxiirlj22u4pkexcuq75y"),
},
}, {
Network: "calibrationnet",
@ -157,25 +157,25 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet
}, {
Network: "calibrationnet",
Version: 11,
BundleGitTag: "v10.0.0",
ManifestCid: MustParseCid("bafy2bzacealnejzebicrebew7e3q2u7prkqeclffcyje2q2w4v4vtz5jqzcto"),
BundleGitTag: "fip0061/20230406",
ManifestCid: MustParseCid("bafy2bzacebwjj7rhfwkyuu5qzoxlu7elhm757nnovmq75w6sevggymnzmnm72"),
Actors: map[string]cid.Cid{
"account": MustParseCid("bafk2bzacedmhjxowg3mu3amnrl6pkm35j6xf6kfe2e3yanaw5l5n6fh7426ta"),
"cron": MustParseCid("bafk2bzacear3td3auuvpicn2mqgpodzmiprzjsugdmbnj5w3nwiachh3zjy3o"),
"datacap": MustParseCid("bafk2bzaceaxb3j7yu4w3wixv6t7h7hymtu7xswdrfxo2pgatmajvkmalig7mm"),
"eam": MustParseCid("bafk2bzacecoiy7gqecoag4hpyamfusq4pxjggziiqd6txy566ze4qu7txbfgm"),
"ethaccount": MustParseCid("bafk2bzacebrf2ryqqwzsvtr2q3azyntrhp3okjqyizhqzwce7j4xkv53lpq46"),
"evm": MustParseCid("bafk2bzacedqnoir3exqgjfi5p3s7glqqr54qgussrk6jpv5577rtan463ejm6"),
"init": MustParseCid("bafk2bzacebjkpyrfypyqjiijoceezznhd7gast4zkqpieqlmtl57qxansat6c"),
"multisig": MustParseCid("bafk2bzacebwirewz7usxyclghpo62kfep3lgmhjyabee4hxs5f53vxouli2sk"),
"paymentchannel": MustParseCid("bafk2bzacecoxwjjmpnpkhm3vdqz2o6azo4l5myaktkdn6bga24qdprlqchgck"),
"account": MustParseCid("bafk2bzaceadb5top4yoz4kpboukubrjbjzghfdz7ca5u7dld72ppntogoghgi"),
"cron": MustParseCid("bafk2bzacebzb562tw3ow2vgyjjccqm77svzacpeterxaqe53p6umzmbwzyaz6"),
"datacap": MustParseCid("bafk2bzacebtnait6t2qgfeput6ua5hprtd5bfvuvs3kod2sypzck525y2qfu2"),
"eam": MustParseCid("bafk2bzacebhuewh2pcuz6bhukkhclykm6qejvm23o6wbzhwher7eyo5ggfnvg"),
"ethaccount": MustParseCid("bafk2bzacebmiuff6pdvrr6mcnnamil2xtq5rmisia7foksuskvpxt2pgilqk4"),
"evm": MustParseCid("bafk2bzacedox6kef5ss35trvkxbdtf77dy7d4zc6vyyq5tf2t3vynl74ipzze"),
"init": MustParseCid("bafk2bzacecedo4avyooz4in5j7rimk7wrlslu5hs5l3q3o4alg2g3m7odq5ze"),
"multisig": MustParseCid("bafk2bzaced7axvecndaph72rdy67aw2nj52xczrbnz5tntaluiglnyzo7v7bg"),
"paymentchannel": MustParseCid("bafk2bzacechwowtvfih3gtzr3fbtasdjflagttixt7s5cexgvqab7pfqzdj5w"),
"placeholder": MustParseCid("bafk2bzacedfvut2myeleyq67fljcrw4kkmn5pb5dpyozovj7jpoez5irnc3ro"),
"reward": MustParseCid("bafk2bzacecsdqppgzyt5cveuoafr3a6x2ec5rdtowgh5hs5hr36tjloa3w7ia"),
"storagemarket": MustParseCid("bafk2bzacecalbkp24len5szr7w7yaiah4ajzpqg5kiqqybahgdrazsinfg7ki"),
"storageminer": MustParseCid("bafk2bzacedj2gw7qjccvg6myqyn7fj6noontw2ag574ndj5gtwejs3qhsgsq2"),
"storagepower": MustParseCid("bafk2bzacedw2hcinaswhl2m4quy345i35qfc425ctynukmawrctdxhhauaq5g"),
"system": MustParseCid("bafk2bzaceaved6ikzlaj5is6tadl42b256aghs4fw3u4k33n44ycbcy5zofhk"),
"verifiedregistry": MustParseCid("bafk2bzaceayyax5mvtzs65cuhx4txlt7o2ptqglj3i45sccxxm6mx4g2nsbb6"),
"reward": MustParseCid("bafk2bzaceccouwll3o3k4mlcyeeoz3rlfute2ggyzfpyn5zvxojbpuyaeuzri"),
"storagemarket": MustParseCid("bafk2bzacebi4q7yayn245mwdgsw64xyxai2xjx4n6osm64yoxxmwr5j47noz4"),
"storageminer": MustParseCid("bafk2bzacecl5boweys2bf75htfzx3unbxodn5webdupsnenhdoe7foxrapaii"),
"storagepower": MustParseCid("bafk2bzacebawuegcoc4zo7iv3eemr6adgp7mw7ei2mchpxvwwnh6tlbbxikno"),
"system": MustParseCid("bafk2bzaceaan6xoaagli2sdwowysu7fdhekrdgga3d47zcz6sz3dhbr6odl7s"),
"verifiedregistry": MustParseCid("bafk2bzacedsurcwtxesqtxicb76k6msfajugfbh6ou4ptulvgmygagbnq3myc"),
},
}, {
Network: "caterpillarnet",
@ -249,25 +249,25 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet
}, {
Network: "caterpillarnet",
Version: 11,
BundleGitTag: "v10.0.0",
ManifestCid: MustParseCid("bafy2bzaceajftd7jawqnwf4kzkotksrwy6ag7mu2apkvypzrrmxboheuum5oi"),
BundleGitTag: "fip0061/20230406",
ManifestCid: MustParseCid("bafy2bzaceacd7pk6anenkqog5eikqdeaxenzlxpd7qrie4yjnixz37zkh7nzs"),
Actors: map[string]cid.Cid{
"account": MustParseCid("bafk2bzacecsbx4tovnr5x2ifcpqbpx33oht74mgtvmaauzrqcq2wnm7prr7ak"),
"cron": MustParseCid("bafk2bzacecpzfajba6m4v4ty342jw6lcu6n63bwtldmzko733wpd2q5jzfdvu"),
"datacap": MustParseCid("bafk2bzaceaa5zplkxvguwvnecfen62buhli5rraa3ga74b33a3sbscanzx4ok"),
"eam": MustParseCid("bafk2bzaceaffoa3eqmj7h53lwjatfqrjw63l3czk3vthyjz6oyhgwka3xwp6g"),
"ethaccount": MustParseCid("bafk2bzaceb7suh5m4xagoq6ap5v5x7vrhex2coq6gu6d54jteblm36cxhk5b2"),
"evm": MustParseCid("bafk2bzaceccmwmnb42pn7y7skbjwjur7b2eqxuw4lvm3he2xpvudjzluss4os"),
"init": MustParseCid("bafk2bzaceai72h4hxbgbp6gwm3m24uujscrj4bmbh6pxoerqtduijxt6dchfq"),
"multisig": MustParseCid("bafk2bzacebycdokda2gysqpnl3dwksgidujgsksf4n6qotjq4erj5zd7clkzy"),
"paymentchannel": MustParseCid("bafk2bzaceb5ucvftftiim6cxjusdpsmbht4x33kgexxgv5447gevk47h7jjqk"),
"account": MustParseCid("bafk2bzaceaorq7vk3mqaqveexi237emb7m4widwen4pjnpmosoqnjgv4jarey"),
"cron": MustParseCid("bafk2bzacebcu5kw2ai7tembinsz47viqt7nxzbaq3ftnx3zymkdvy62hln36y"),
"datacap": MustParseCid("bafk2bzaceafag5jlzjrcywe7dkyyhkjyymv6p7dhwu55i6p7fk663yy6ussqw"),
"eam": MustParseCid("bafk2bzacebzew277ktikih2ht2smzw46bt23xz6455tppjq5llqgse7umy6u2"),
"ethaccount": MustParseCid("bafk2bzacecp7jwlcnx7m22mjwxmhrrhl6ti2jtde7jjaure2mvevqrnmjtsry"),
"evm": MustParseCid("bafk2bzacectylupwt7wr56to3tjqhxp5ymgjs5x3tsyq6t7wdda2jpzv3yjru"),
"init": MustParseCid("bafk2bzacedqyh5joid64ihwdhf5dnykq2fmgp4ugl2hr5g2ghtmhff3de3n7o"),
"multisig": MustParseCid("bafk2bzacebm2c6pr3v3ns5bzxvdopwn73yce53mtdd525eokgfqhyz5qe64c2"),
"paymentchannel": MustParseCid("bafk2bzaceboykiffo7axwmlmroivlsowbro5bsrypkdqzjmpto2b6vtkv24fc"),
"placeholder": MustParseCid("bafk2bzacedfvut2myeleyq67fljcrw4kkmn5pb5dpyozovj7jpoez5irnc3ro"),
"reward": MustParseCid("bafk2bzaceajqygfkhamlzfsquqjgoy4p7pc2fruouqajapfucf22rbmtt5yf6"),
"storagemarket": MustParseCid("bafk2bzacednmzko2o5iv5kc6qxvpqfx5rq72krxzvna6cqoqem6flbfukglby"),
"storageminer": MustParseCid("bafk2bzacedayzz5qw7t7ykycf3a2hp666j5hb23a3mnmgp4xbbpvrx3h3ags4"),
"storagepower": MustParseCid("bafk2bzacedd3eiejzp35xuwjf3cvgd43b5ukqhelqmtgzqzqnt2wcy56pb744"),
"system": MustParseCid("bafk2bzacecfivztuulqqv4o5oyvvvrkblwix4hqt24pqru6ivnpioefhuhria"),
"verifiedregistry": MustParseCid("bafk2bzacecdhw6x7dfrxfysmn6tdbn2ny464omgqppxhjuawxauscidppd7pc"),
"reward": MustParseCid("bafk2bzacedy5bmbllb6pdux3zitcp56u4z32sisjg3qlgxvoavdxvzftffyc6"),
"storagemarket": MustParseCid("bafk2bzacednzj3jwcl44xhce4cs3pj5w44cicnx3mpghlfizqxozuxu7uc65g"),
"storageminer": MustParseCid("bafk2bzacebkzvif327362pa6uzfv5nc4xww5m32ltykafjkr6mfxroxptjfyq"),
"storagepower": MustParseCid("bafk2bzacecge2ela4dnojftxsg7p752lia4fz2ni5cu4kuikogujkmttqftks"),
"system": MustParseCid("bafk2bzacec35d2td2jvkdfpgii55k2q2xzjvuju52beu7ldmllagjljwcr6b2"),
"verifiedregistry": MustParseCid("bafk2bzacedokmxtndn7ghzanmwcxrtofp4saqiqtpmounqsdmieqrkj7lddeo"),
},
}, {
Network: "devnet",
@ -332,25 +332,25 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet
}, {
Network: "devnet",
Version: 11,
BundleGitTag: "v10.0.0",
ManifestCid: MustParseCid("bafy2bzacebzz376j5kizfck56366kdz5aut6ktqrvqbi3efa2d4l2o2m653ts"),
BundleGitTag: "fip0061/20230406",
ManifestCid: MustParseCid("bafy2bzacebewyqzuscnusoynys5mq5u3ujt63gxkfktptq5hhjaxc5o6vvmwm"),
Actors: map[string]cid.Cid{
"account": MustParseCid("bafk2bzacedkj5dqs5xxamnlug2d5dyjl6askf7wlmvwzhmsrzcvogv7acqfe6"),
"cron": MustParseCid("bafk2bzaceabslrigld2vshng6sppbp3bsptjtttvbxctwqe5lkyl2efom2wu4"),
"datacap": MustParseCid("bafk2bzaceagg4qklzhhg5oj4shwqpoeykeyxus7xhj2abuot2tycdwsf2oaaa"),
"eam": MustParseCid("bafk2bzaceafttsbglcetxwtzqtdniittwczogkefgnxztgsp7mymcpvdlhdik"),
"ethaccount": MustParseCid("bafk2bzacedypn6tf3yrj4bavmscddygeima3puih37fbkxuhjhlrzbjh3dbo4"),
"evm": MustParseCid("bafk2bzacec5ywczgg73fnwi36nlxso3zduop3fwj3pq6ynn5zltrs4dpcwglg"),
"init": MustParseCid("bafk2bzacebkanlbkwwtniyz4fawevnkoyje67l5nflltmciplqiutekxzzfh4"),
"multisig": MustParseCid("bafk2bzacectxa2izvpaybmmpvearekrybxtglctwnexzzneyn6xrnrmectmpa"),
"paymentchannel": MustParseCid("bafk2bzacectov7vawkhsvq7aobyjq3oppamytq425wpkxejmq65vvcdm4bt2e"),
"account": MustParseCid("bafk2bzacecvslak4qq6plu4g42d7ubd4oydimohd226tezn2iw2z6prevfmui"),
"cron": MustParseCid("bafk2bzaceahmjxdm5m2jzwzdra7gofuyubtcep7c2l4bbwezx7umi2d2civq2"),
"datacap": MustParseCid("bafk2bzacebwiqcbcvuwxz3uqapp7vjuh6v27h27ghuyayyeodoqssnmjj7ln6"),
"eam": MustParseCid("bafk2bzaceafkscfus3xzzeqxpqykoyzoahh2tc7ihnfp7gnvwlfcrocxjzrbq"),
"ethaccount": MustParseCid("bafk2bzacedgpsaw6w3rftnwrrrakjm77g2xtc7cop7afunzhovau6zivt5cou"),
"evm": MustParseCid("bafk2bzacecn5fjkck24lgohtt3qefeyjveq24be7nqhx54of3gj3iyoxje2r6"),
"init": MustParseCid("bafk2bzaceadr35hd5obybzvuxh7rkftocnusrin474izub37dz7or6c2oojp2"),
"multisig": MustParseCid("bafk2bzacea4fte2n65lcr74hqe3lnzf75z63axbxgpv3ar5wt5fncrjin2pgu"),
"paymentchannel": MustParseCid("bafk2bzaceaz45muzvrclsmknxlwwhbozleqj2x3kp27ygrjaai7fdstmemrmo"),
"placeholder": MustParseCid("bafk2bzacedfvut2myeleyq67fljcrw4kkmn5pb5dpyozovj7jpoez5irnc3ro"),
"reward": MustParseCid("bafk2bzacec3xpbrxw2rnpuve4mxfhny44lxbpbwmduy4ula4ohj2bp6wplpvc"),
"storagemarket": MustParseCid("bafk2bzacec5nexsejraoqraywka7zcacjoxgpdbopehdkhiwqwcyghtof4s3w"),
"storageminer": MustParseCid("bafk2bzacecw5xzj6z5b7qxx5xca5py4aoecmqj2pxb6nw673alufy22zckkyo"),
"storagepower": MustParseCid("bafk2bzaceckhnpxoaanjf474wxzkntlnzdofoy75ehyuydfjkuw4swhotws4y"),
"system": MustParseCid("bafk2bzaceairk5qz5hyzt4yyaxa356aszyifswiust5ilxizwxujcmtzvjzoa"),
"verifiedregistry": MustParseCid("bafk2bzaced2mkyqobpgna5jevosym3adv2bvraggigyz2jgn5cxymirxj4x3i"),
"reward": MustParseCid("bafk2bzaceaukxhteoghwm443tg7ee6lo7rrbcsrapuceoludoregi4vv2yick"),
"storagemarket": MustParseCid("bafk2bzacearmlbadowj775ikj5g3yhvws7dgjfgzlmfjhro3mnvjdq2xfanyq"),
"storageminer": MustParseCid("bafk2bzaced4vzru2ex77hoqz4tj5vps56nofnov2p6ixnwjfsnxeh45zekhqq"),
"storagepower": MustParseCid("bafk2bzacedskjtvbp7avhxqkhp2omjfwjx463jaopqwqm53pc2myx5amfmwlc"),
"system": MustParseCid("bafk2bzaced7swl5bxr62s3smnhiuez6e46r67opwmmeblknqegjnsrkpv27lu"),
"verifiedregistry": MustParseCid("bafk2bzacedwnz7ojz6jqr4vgnf3zgm4rgt7e55is4yqlwhacriqyxktojwkpa"),
},
}, {
Network: "hyperspace",
@ -438,25 +438,25 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet
}, {
Network: "mainnet",
Version: 11,
BundleGitTag: "v10.0.0",
ManifestCid: MustParseCid("bafy2bzacecsuyf7mmvrhkx2evng5gnz5canlnz2fdlzu2lvcgptiq2pzuovos"),
BundleGitTag: "fip0061/20230406",
ManifestCid: MustParseCid("bafy2bzaced3kuy53poa42ygdoext34hdiompqihnjja764tsqgezfhb2bdzwc"),
Actors: map[string]cid.Cid{
"account": MustParseCid("bafk2bzaceampw4romta75hyz5p4cqriypmpbgnkxncgxgqn6zptv5lsp2w2bo"),
"cron": MustParseCid("bafk2bzacedcbtsifegiu432m5tysjzkxkmoczxscb6hqpmrr6img7xzdbbs2g"),
"datacap": MustParseCid("bafk2bzacealj5uk7wixhvk7l5tnredtelralwnceafqq34nb2lbylhtuyo64u"),
"eam": MustParseCid("bafk2bzacedrpm5gbleh4xkyo2jvs7p5g6f34soa6dpv7ashcdgy676snsum6g"),
"ethaccount": MustParseCid("bafk2bzaceaqoc5zakbhjxn3jljc4lxnthllzunhdor7sxhwgmskvc6drqc3fa"),
"evm": MustParseCid("bafk2bzaceahmzdxhqsm7cu2mexusjp6frm7r4kdesvti3etv5evfqboos2j4g"),
"init": MustParseCid("bafk2bzaced2f5rhir3hbpqbz5ght7ohv2kgj42g5ykxrypuo2opxsup3ykwl6"),
"multisig": MustParseCid("bafk2bzaceduf3hayh63jnl4z2knxv7cnrdenoubni22fxersc4octlwpxpmy4"),
"paymentchannel": MustParseCid("bafk2bzaceartlg4mrbwgzcwric6mtvyawpbgx2xclo2vj27nna57nxynf3pgc"),
"account": MustParseCid("bafk2bzacecdd47yu6upauyooi2jocrnzxgil33bimt6yidyfqqpfre22ukdns"),
"cron": MustParseCid("bafk2bzacebexampdt6lxfmul5yjshpbob3cmxpoffglfh5vadiefxtla6mya6"),
"datacap": MustParseCid("bafk2bzacedfbb7r63uxruxfwy2yxtorid5r34jocbebf6wmg533mttygm4svq"),
"eam": MustParseCid("bafk2bzaced5up6dr44txobezpvysflihoyabbpnb4wkzf5h6dudyaqyfzssuw"),
"ethaccount": MustParseCid("bafk2bzaceacxkpvgohdxi6wuuzrjn7ttkmiuqeq64bozmfzoxiet52zsuktnm"),
"evm": MustParseCid("bafk2bzacedtiosqcl7wu62k6lzkptoobdufomwz6par2xmndbdun7vk4szkz4"),
"init": MustParseCid("bafk2bzacec5oyystlc7dxf3o3gthd3ycd3bykm2dplqzebr64vb7zu6wfd2ec"),
"multisig": MustParseCid("bafk2bzacecayhieqijc5pfmhahnmk6nk4lltkfd2qo2uqcyuzmmjmnmfaj2hs"),
"paymentchannel": MustParseCid("bafk2bzacec2xalja7zlmkxbeadqpf75tlcp4gkrbtihnhr4o7gaaubf7aftky"),
"placeholder": MustParseCid("bafk2bzacedfvut2myeleyq67fljcrw4kkmn5pb5dpyozovj7jpoez5irnc3ro"),
"reward": MustParseCid("bafk2bzacebnhtaejfjtzymyfmbdrfmo7vgj3zsof6zlucbmkhrvcuotw5dxpq"),
"storagemarket": MustParseCid("bafk2bzaceclejwjtpu2dhw3qbx6ow7b4pmhwa7ocrbbiqwp36sq5yeg6jz2bc"),
"storageminer": MustParseCid("bafk2bzaced4h7noksockro7glnssz2jnmo2rpzd7dvnmfs4p24zx3h6gtx47s"),
"storagepower": MustParseCid("bafk2bzacec4ay4crzo73ypmh7o3fjendhbqrxake46bprabw67fvwjz5q6ixq"),
"system": MustParseCid("bafk2bzacedakk5nofebyup4m7nvx6djksfwhnxzrfuq4oyemhpl4lllaikr64"),
"verifiedregistry": MustParseCid("bafk2bzacedfel6edzqpe5oujno7fog4i526go4dtcs6vwrdtbpy2xq6htvcg6"),
"reward": MustParseCid("bafk2bzacebncfbieltapjca7adcccxecqggu74qgfwq4ugotblbvbeoyqp2cm"),
"storagemarket": MustParseCid("bafk2bzacec4ejaovcgtzkrufv46qatdyvkoa3jaoyapcbfeqo6efwonfq6zvc"),
"storageminer": MustParseCid("bafk2bzaceatcxpwsrbwpzifxe7zmt4mwpboioh4hezxz2p5alwozfcrevojam"),
"storagepower": MustParseCid("bafk2bzacecare6lem5yc3m5l6b4t6rcqvkahfm4i466r4twzo7ufohn5i6bx2"),
"system": MustParseCid("bafk2bzacedyckuohrbrsejxjytnc5jgb3epn2emffkbg3zens6zimxquvfzvq"),
"verifiedregistry": MustParseCid("bafk2bzaceb6t2w4s25yk5xsxesm7l6xt4t24nkmvfvumgcziaculliomsz2vc"),
},
}, {
Network: "testing",
@ -521,25 +521,25 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet
}, {
Network: "testing",
Version: 11,
BundleGitTag: "v10.0.0",
ManifestCid: MustParseCid("bafy2bzacebsp3bkxwsijenqeimhvhtg52d6o76hn6qhzxveqfq7d5hdd5l2ee"),
BundleGitTag: "fip0061/20230406",
ManifestCid: MustParseCid("bafy2bzaceaylgi44inivc774g5ovhgwbrxkvt2sqmk65pgrwmunfefzfhbmy4"),
Actors: map[string]cid.Cid{
"account": MustParseCid("bafk2bzaceazxb6p2xg6caivmie6k2bvutyesngwyvhwv4eemwu7ia4vnqkcuy"),
"cron": MustParseCid("bafk2bzaceax6ym73boyl5zdpbcr6zmbajzylmcdvlapz5zcqgzcshakz44jbq"),
"datacap": MustParseCid("bafk2bzacea63x3v6lvtb4ast5uq3nhrpokvylymvezyr5xyjl6vtlfwkuw6qo"),
"eam": MustParseCid("bafk2bzacebhualcn7fofyqr6lhrel32ud23hcwzeenfqu3rrn5nmt6gugqgo6"),
"ethaccount": MustParseCid("bafk2bzacecgft7e3v4kbpb3tlt5s6hng74ptu3ggcdi4wmt5p4vr6qkmkw2zc"),
"evm": MustParseCid("bafk2bzaceaoqvbqetgicqpvwvcnpjx5aa74kwlhq3u7mwv4yseszxkimwz5pk"),
"init": MustParseCid("bafk2bzaceapmoyg2qppzle24t25ncyycn2uwhnw6crqkqlokkbc7w4mn74wko"),
"multisig": MustParseCid("bafk2bzacecn3dlepgaps3h6iwlq65dx6zyrbfi4pmgdqxphb5idubb6ibflwe"),
"paymentchannel": MustParseCid("bafk2bzaceaanxurr2k3ueolwcnminmdfp3tyxtntqg5fou37smeulb5dxqjzk"),
"account": MustParseCid("bafk2bzacec75wcc3lv2ani5t7xqyiajmwvcp76xnr4kt4flrry3eir4jrvzki"),
"cron": MustParseCid("bafk2bzaced7vu6sc6exfke533lyptxg7ir3em243zb42uprjd2zzuqebjqm5k"),
"datacap": MustParseCid("bafk2bzaceaf7ycru3njyqz6v4qmahxi4rfce3rk2x6mcq2fwagmhotj5ynndg"),
"eam": MustParseCid("bafk2bzacebzxm56qu7zfeqqn52uz7dfwl2bkmji72anzrsnpju66m6arqja64"),
"ethaccount": MustParseCid("bafk2bzacebw6j4zqyumejofau3py4fus6vj2yjtdmkuyeiskuabw367ktqhzw"),
"evm": MustParseCid("bafk2bzacecqf3oanagk2g6cznb4eox4anoqhy66yndspt5xwza5wx2mu4f7wm"),
"init": MustParseCid("bafk2bzacecm2eztvik5jr76k2zd4c53ivfcgdisur2uhv2z67yvbgwywjb3pc"),
"multisig": MustParseCid("bafk2bzacecilj7v4kehkbztorigxmzdy4veg6bsgzlybaio4vmfu4lqbdif3m"),
"paymentchannel": MustParseCid("bafk2bzacea2roncbfn2zzim7ielcuy526acc5nnmvwmty57od4wmrxpkkanti"),
"placeholder": MustParseCid("bafk2bzacedfvut2myeleyq67fljcrw4kkmn5pb5dpyozovj7jpoez5irnc3ro"),
"reward": MustParseCid("bafk2bzacedujdvwk4omjexdnmh2qrkqbw27v4c2g3krajhtzyfzart36bimum"),
"storagemarket": MustParseCid("bafk2bzacecdbjjxvdtltobiu7thwyyr2puunoz3q4vyfnhhxl2sbp4ovwq37s"),
"storageminer": MustParseCid("bafk2bzacebo5q7jrf4qjrhtotwt5ouzlygvml4bzofs2egdnbxyfmuo7tro6c"),
"storagepower": MustParseCid("bafk2bzacebt2ipqnorxbzncwjadkulip6blzksmwd4mmyrfjsmjyf55itra2k"),
"system": MustParseCid("bafk2bzacecf2jimdz7knhngs64ximfz3eaud6s3kiunmkybgrkupdjyo2dw7o"),
"verifiedregistry": MustParseCid("bafk2bzacecdmek2htsgcyoyl35glakyab66cojqo2y335njnm7krleb6yfbps"),
"reward": MustParseCid("bafk2bzaceddqgrgk6jcqp5fujc4r33chhzjxjh4xdp3b2jwsjybng2zzttxmc"),
"storagemarket": MustParseCid("bafk2bzacecrwzwn3nu33oqkzmondgn47tuyenh36ev75wrfftc5ue7bjddty4"),
"storageminer": MustParseCid("bafk2bzacedu4o4hp6jyzivv7ppvuyjl3qhrtm6zbxiufiiztnltye6p3xluru"),
"storagepower": MustParseCid("bafk2bzaceb4p7jn5jpaejkchekppenpjyzdbstt2wzby35h2jfhpwrvqoufbk"),
"system": MustParseCid("bafk2bzacedwrg735yb5sxfqaumidk35uvorfvrx4ckktg7bmtygstwsmf2ckc"),
"verifiedregistry": MustParseCid("bafk2bzacebkjoto2kgwgfn6asssfpeu4cmsd6gcvbb77spobopaxbdchkc4ju"),
},
}, {
Network: "testing-fake-proofs",
@ -604,24 +604,24 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet
}, {
Network: "testing-fake-proofs",
Version: 11,
BundleGitTag: "v10.0.0",
ManifestCid: MustParseCid("bafy2bzacedwap2uuii4luljckrnb4vkur2unb6fyinn7xjie6xlva2wmlygj2"),
BundleGitTag: "fip0061/20230406",
ManifestCid: MustParseCid("bafy2bzaceaksqnaynaq3olbsmq5n5vewnqiklahvyonqbycyngmavj4juhg4g"),
Actors: map[string]cid.Cid{
"account": MustParseCid("bafk2bzaceazxb6p2xg6caivmie6k2bvutyesngwyvhwv4eemwu7ia4vnqkcuy"),
"cron": MustParseCid("bafk2bzaceax6ym73boyl5zdpbcr6zmbajzylmcdvlapz5zcqgzcshakz44jbq"),
"datacap": MustParseCid("bafk2bzacea63x3v6lvtb4ast5uq3nhrpokvylymvezyr5xyjl6vtlfwkuw6qo"),
"eam": MustParseCid("bafk2bzacebhualcn7fofyqr6lhrel32ud23hcwzeenfqu3rrn5nmt6gugqgo6"),
"ethaccount": MustParseCid("bafk2bzacecgft7e3v4kbpb3tlt5s6hng74ptu3ggcdi4wmt5p4vr6qkmkw2zc"),
"evm": MustParseCid("bafk2bzaceaoqvbqetgicqpvwvcnpjx5aa74kwlhq3u7mwv4yseszxkimwz5pk"),
"init": MustParseCid("bafk2bzaceapmoyg2qppzle24t25ncyycn2uwhnw6crqkqlokkbc7w4mn74wko"),
"multisig": MustParseCid("bafk2bzacecn3dlepgaps3h6iwlq65dx6zyrbfi4pmgdqxphb5idubb6ibflwe"),
"paymentchannel": MustParseCid("bafk2bzaceaanxurr2k3ueolwcnminmdfp3tyxtntqg5fou37smeulb5dxqjzk"),
"account": MustParseCid("bafk2bzacec75wcc3lv2ani5t7xqyiajmwvcp76xnr4kt4flrry3eir4jrvzki"),
"cron": MustParseCid("bafk2bzaced7vu6sc6exfke533lyptxg7ir3em243zb42uprjd2zzuqebjqm5k"),
"datacap": MustParseCid("bafk2bzaceaf7ycru3njyqz6v4qmahxi4rfce3rk2x6mcq2fwagmhotj5ynndg"),
"eam": MustParseCid("bafk2bzacebzxm56qu7zfeqqn52uz7dfwl2bkmji72anzrsnpju66m6arqja64"),
"ethaccount": MustParseCid("bafk2bzacebw6j4zqyumejofau3py4fus6vj2yjtdmkuyeiskuabw367ktqhzw"),
"evm": MustParseCid("bafk2bzacecqf3oanagk2g6cznb4eox4anoqhy66yndspt5xwza5wx2mu4f7wm"),
"init": MustParseCid("bafk2bzacecm2eztvik5jr76k2zd4c53ivfcgdisur2uhv2z67yvbgwywjb3pc"),
"multisig": MustParseCid("bafk2bzacecilj7v4kehkbztorigxmzdy4veg6bsgzlybaio4vmfu4lqbdif3m"),
"paymentchannel": MustParseCid("bafk2bzacea2roncbfn2zzim7ielcuy526acc5nnmvwmty57od4wmrxpkkanti"),
"placeholder": MustParseCid("bafk2bzacedfvut2myeleyq67fljcrw4kkmn5pb5dpyozovj7jpoez5irnc3ro"),
"reward": MustParseCid("bafk2bzacedujdvwk4omjexdnmh2qrkqbw27v4c2g3krajhtzyfzart36bimum"),
"storagemarket": MustParseCid("bafk2bzacecdbjjxvdtltobiu7thwyyr2puunoz3q4vyfnhhxl2sbp4ovwq37s"),
"storageminer": MustParseCid("bafk2bzacedc5klueery4fn2voso4u76rgo54uctsculesdbxxbeh6rgp2q4te"),
"storagepower": MustParseCid("bafk2bzacecuz2h2renlfio4xkyrvvro7nwidf7utpjy3oizk2xuszoz3gmea6"),
"system": MustParseCid("bafk2bzacecf2jimdz7knhngs64ximfz3eaud6s3kiunmkybgrkupdjyo2dw7o"),
"verifiedregistry": MustParseCid("bafk2bzacecdmek2htsgcyoyl35glakyab66cojqo2y335njnm7krleb6yfbps"),
"reward": MustParseCid("bafk2bzaceddqgrgk6jcqp5fujc4r33chhzjxjh4xdp3b2jwsjybng2zzttxmc"),
"storagemarket": MustParseCid("bafk2bzacecrwzwn3nu33oqkzmondgn47tuyenh36ev75wrfftc5ue7bjddty4"),
"storageminer": MustParseCid("bafk2bzacedxteto3j3rn5dmnsehzkix6fbh3crybwvfc62o5in5epw2wi3l5i"),
"storagepower": MustParseCid("bafk2bzaceaw55yqsqsajvhxutvop7ofsfpatkmjcgpvmdhobklzboltdnd6nk"),
"system": MustParseCid("bafk2bzacedwrg735yb5sxfqaumidk35uvorfvrx4ckktg7bmtygstwsmf2ckc"),
"verifiedregistry": MustParseCid("bafk2bzacebkjoto2kgwgfn6asssfpeu4cmsd6gcvbb77spobopaxbdchkc4ju"),
},
}}

View File

@ -175,15 +175,15 @@ func PreferredSealProofTypeFromWindowPoStType(nver network.Version, proof abi.Re
}
switch proof {
case abi.RegisteredPoStProof_StackedDrgWindow2KiBV1:
case abi.RegisteredPoStProof_StackedDrgWindow2KiBV1, abi.RegisteredPoStProof_StackedDrgWindow2KiBV1_1:
return abi.RegisteredSealProof_StackedDrg2KiBV1_1, nil
case abi.RegisteredPoStProof_StackedDrgWindow8MiBV1:
case abi.RegisteredPoStProof_StackedDrgWindow8MiBV1, abi.RegisteredPoStProof_StackedDrgWindow8MiBV1_1:
return abi.RegisteredSealProof_StackedDrg8MiBV1_1, nil
case abi.RegisteredPoStProof_StackedDrgWindow512MiBV1:
case abi.RegisteredPoStProof_StackedDrgWindow512MiBV1, abi.RegisteredPoStProof_StackedDrgWindow512MiBV1_1:
return abi.RegisteredSealProof_StackedDrg512MiBV1_1, nil
case abi.RegisteredPoStProof_StackedDrgWindow32GiBV1:
case abi.RegisteredPoStProof_StackedDrgWindow32GiBV1, abi.RegisteredPoStProof_StackedDrgWindow32GiBV1_1:
return abi.RegisteredSealProof_StackedDrg32GiBV1_1, nil
case abi.RegisteredPoStProof_StackedDrgWindow64GiBV1:
case abi.RegisteredPoStProof_StackedDrgWindow64GiBV1, abi.RegisteredPoStProof_StackedDrgWindow64GiBV1_1:
return abi.RegisteredSealProof_StackedDrg64GiBV1_1, nil
default:
return -1, xerrors.Errorf("unrecognized window post type: %d", proof)
@ -192,15 +192,15 @@ func PreferredSealProofTypeFromWindowPoStType(nver network.Version, proof abi.Re
func WinningPoStProofTypeFromWindowPoStProofType(nver network.Version, proof abi.RegisteredPoStProof) (abi.RegisteredPoStProof, error) {
switch proof {
case abi.RegisteredPoStProof_StackedDrgWindow2KiBV1:
case abi.RegisteredPoStProof_StackedDrgWindow2KiBV1, abi.RegisteredPoStProof_StackedDrgWindow2KiBV1_1:
return abi.RegisteredPoStProof_StackedDrgWinning2KiBV1, nil
case abi.RegisteredPoStProof_StackedDrgWindow8MiBV1:
case abi.RegisteredPoStProof_StackedDrgWindow8MiBV1, abi.RegisteredPoStProof_StackedDrgWindow8MiBV1_1:
return abi.RegisteredPoStProof_StackedDrgWinning8MiBV1, nil
case abi.RegisteredPoStProof_StackedDrgWindow512MiBV1:
case abi.RegisteredPoStProof_StackedDrgWindow512MiBV1, abi.RegisteredPoStProof_StackedDrgWindow512MiBV1_1:
return abi.RegisteredPoStProof_StackedDrgWinning512MiBV1, nil
case abi.RegisteredPoStProof_StackedDrgWindow32GiBV1:
case abi.RegisteredPoStProof_StackedDrgWindow32GiBV1, abi.RegisteredPoStProof_StackedDrgWindow32GiBV1_1:
return abi.RegisteredPoStProof_StackedDrgWinning32GiBV1, nil
case abi.RegisteredPoStProof_StackedDrgWindow64GiBV1:
case abi.RegisteredPoStProof_StackedDrgWindow64GiBV1, abi.RegisteredPoStProof_StackedDrgWindow64GiBV1_1:
return abi.RegisteredPoStProof_StackedDrgWinning64GiBV1, nil
default:
return -1, xerrors.Errorf("unknown proof type %d", proof)

View File

@ -229,15 +229,15 @@ func PreferredSealProofTypeFromWindowPoStType(nver network.Version, proof abi.Re
}
switch proof {
case abi.RegisteredPoStProof_StackedDrgWindow2KiBV1:
case abi.RegisteredPoStProof_StackedDrgWindow2KiBV1, abi.RegisteredPoStProof_StackedDrgWindow2KiBV1_1:
return abi.RegisteredSealProof_StackedDrg2KiBV1_1, nil
case abi.RegisteredPoStProof_StackedDrgWindow8MiBV1:
case abi.RegisteredPoStProof_StackedDrgWindow8MiBV1, abi.RegisteredPoStProof_StackedDrgWindow8MiBV1_1:
return abi.RegisteredSealProof_StackedDrg8MiBV1_1, nil
case abi.RegisteredPoStProof_StackedDrgWindow512MiBV1:
case abi.RegisteredPoStProof_StackedDrgWindow512MiBV1, abi.RegisteredPoStProof_StackedDrgWindow512MiBV1_1:
return abi.RegisteredSealProof_StackedDrg512MiBV1_1, nil
case abi.RegisteredPoStProof_StackedDrgWindow32GiBV1:
case abi.RegisteredPoStProof_StackedDrgWindow32GiBV1, abi.RegisteredPoStProof_StackedDrgWindow32GiBV1_1:
return abi.RegisteredSealProof_StackedDrg32GiBV1_1, nil
case abi.RegisteredPoStProof_StackedDrgWindow64GiBV1:
case abi.RegisteredPoStProof_StackedDrgWindow64GiBV1, abi.RegisteredPoStProof_StackedDrgWindow64GiBV1_1:
return abi.RegisteredSealProof_StackedDrg64GiBV1_1, nil
default:
return -1, xerrors.Errorf("unrecognized window post type: %d", proof)
@ -246,15 +246,15 @@ func PreferredSealProofTypeFromWindowPoStType(nver network.Version, proof abi.Re
func WinningPoStProofTypeFromWindowPoStProofType(nver network.Version, proof abi.RegisteredPoStProof) (abi.RegisteredPoStProof, error) {
switch proof {
case abi.RegisteredPoStProof_StackedDrgWindow2KiBV1:
case abi.RegisteredPoStProof_StackedDrgWindow2KiBV1, abi.RegisteredPoStProof_StackedDrgWindow2KiBV1_1:
return abi.RegisteredPoStProof_StackedDrgWinning2KiBV1, nil
case abi.RegisteredPoStProof_StackedDrgWindow8MiBV1:
case abi.RegisteredPoStProof_StackedDrgWindow8MiBV1, abi.RegisteredPoStProof_StackedDrgWindow8MiBV1_1:
return abi.RegisteredPoStProof_StackedDrgWinning8MiBV1, nil
case abi.RegisteredPoStProof_StackedDrgWindow512MiBV1:
case abi.RegisteredPoStProof_StackedDrgWindow512MiBV1, abi.RegisteredPoStProof_StackedDrgWindow512MiBV1_1:
return abi.RegisteredPoStProof_StackedDrgWinning512MiBV1, nil
case abi.RegisteredPoStProof_StackedDrgWindow32GiBV1:
case abi.RegisteredPoStProof_StackedDrgWindow32GiBV1, abi.RegisteredPoStProof_StackedDrgWindow32GiBV1_1:
return abi.RegisteredPoStProof_StackedDrgWinning32GiBV1, nil
case abi.RegisteredPoStProof_StackedDrgWindow64GiBV1:
case abi.RegisteredPoStProof_StackedDrgWindow64GiBV1, abi.RegisteredPoStProof_StackedDrgWindow64GiBV1_1:
return abi.RegisteredPoStProof_StackedDrgWinning64GiBV1, nil
default:
return -1, xerrors.Errorf("unknown proof type %d", proof)

View File

@ -19,6 +19,7 @@ import (
actorstypes "github.com/filecoin-project/go-state-types/actors"
"github.com/filecoin-project/go-state-types/big"
nv18 "github.com/filecoin-project/go-state-types/builtin/v10/migration"
nv19 "github.com/filecoin-project/go-state-types/builtin/v11/migration"
nv17 "github.com/filecoin-project/go-state-types/builtin/v9/migration"
"github.com/filecoin-project/go-state-types/manifest"
"github.com/filecoin-project/go-state-types/migration"
@ -1663,7 +1664,7 @@ func upgradeActorsV10Common(
if stateRoot.Version != types.StateTreeVersion4 {
return cid.Undef, xerrors.Errorf(
"expected state root version 4 for actors v9 upgrade, got %d",
"expected state root version 4 for actors v10 upgrade, got %d",
stateRoot.Version,
)
}
@ -1704,6 +1705,111 @@ func upgradeActorsV10Common(
return newRoot, nil
}
func PreUpgradeActorsV11(ctx context.Context, sm *stmgr.StateManager, cache stmgr.MigrationCache, root cid.Cid, epoch abi.ChainEpoch, ts *types.TipSet) error {
// Use half the CPUs for pre-migration, but leave at least 3.
workerCount := MigrationMaxWorkerCount
if workerCount <= 4 {
workerCount = 1
} else {
workerCount /= 2
}
lbts, lbRoot, err := stmgr.GetLookbackTipSetForRound(ctx, sm, ts, epoch)
if err != nil {
return xerrors.Errorf("error getting lookback ts for premigration: %w", err)
}
config := migration.Config{
MaxWorkers: uint(workerCount),
ProgressLogPeriod: time.Minute * 5,
}
_, err = upgradeActorsV11Common(ctx, sm, cache, lbRoot, epoch, lbts, config)
return err
}
func UpgradeActorsV11(ctx context.Context, sm *stmgr.StateManager, cache stmgr.MigrationCache, cb stmgr.ExecMonitor,
root cid.Cid, epoch abi.ChainEpoch, ts *types.TipSet) (cid.Cid, error) {
// Use all the CPUs except 2.
workerCount := MigrationMaxWorkerCount - 3
if workerCount <= 0 {
workerCount = 1
}
config := migration.Config{
MaxWorkers: uint(workerCount),
JobQueueSize: 1000,
ResultQueueSize: 100,
ProgressLogPeriod: 10 * time.Second,
}
newRoot, err := upgradeActorsV11Common(ctx, sm, cache, root, epoch, ts, config)
if err != nil {
return cid.Undef, xerrors.Errorf("migrating actors v11 state: %w", err)
}
return newRoot, nil
}
func upgradeActorsV11Common(
ctx context.Context, sm *stmgr.StateManager, cache stmgr.MigrationCache,
root cid.Cid, epoch abi.ChainEpoch, ts *types.TipSet,
config migration.Config,
) (cid.Cid, error) {
buf := blockstore.NewTieredBstore(sm.ChainStore().StateBlockstore(), blockstore.NewMemorySync())
store := store.ActorStore(ctx, buf)
// ensure that the manifest is loaded in the blockstore
if err := bundle.LoadBundles(ctx, sm.ChainStore().StateBlockstore(), actorstypes.Version11); err != nil {
return cid.Undef, xerrors.Errorf("failed to load manifest bundle: %w", err)
}
// Load the state root.
var stateRoot types.StateRoot
if err := store.Get(ctx, root, &stateRoot); err != nil {
return cid.Undef, xerrors.Errorf("failed to decode state root: %w", err)
}
if stateRoot.Version != types.StateTreeVersion5 {
return cid.Undef, xerrors.Errorf(
"expected state root version 5 for actors v11 upgrade, got %d",
stateRoot.Version,
)
}
manifest, ok := actors.GetManifest(actorstypes.Version11)
if !ok {
return cid.Undef, xerrors.Errorf("no manifest CID for v11 upgrade")
}
// Perform the migration
newHamtRoot, err := nv19.MigrateStateTree(ctx, store, manifest, stateRoot.Actors, epoch, config,
migrationLogger{}, cache)
if err != nil {
return cid.Undef, xerrors.Errorf("upgrading to actors v11: %w", err)
}
// Persist the result.
newRoot, err := store.Put(ctx, &types.StateRoot{
Version: types.StateTreeVersion5,
Actors: newHamtRoot,
Info: stateRoot.Info,
})
if err != nil {
return cid.Undef, xerrors.Errorf("failed to persist new state root: %w", err)
}
// Persist the new tree.
{
from := buf
to := buf.Read()
if err := vm.Copy(ctx, from, to, newRoot); err != nil {
return cid.Undef, xerrors.Errorf("copying migrated tree: %w", err)
}
}
return newRoot, nil
}
// Example upgrade function if upgrade requires only code changes
//func UpgradeActorsV9(ctx context.Context, sm *stmgr.StateManager, _ stmgr.MigrationCache, _ stmgr.ExecMonitor, root cid.Cid, _ abi.ChainEpoch, _ *types.TipSet) (cid.Cid, error) {
// buf := blockstore.NewTieredBstore(sm.ChainStore().StateBlockstore(), blockstore.NewMemorySync())

View File

@ -17,6 +17,7 @@ import (
actorstypes "github.com/filecoin-project/go-state-types/actors"
"github.com/filecoin-project/go-state-types/big"
builtintypes "github.com/filecoin-project/go-state-types/builtin"
power11 "github.com/filecoin-project/go-state-types/builtin/v11/power"
minertypes "github.com/filecoin-project/go-state-types/builtin/v8/miner"
markettypes "github.com/filecoin-project/go-state-types/builtin/v9/market"
miner9 "github.com/filecoin-project/go-state-types/builtin/v9/miner"
@ -27,6 +28,7 @@ import (
miner0 "github.com/filecoin-project/specs-actors/actors/builtin/miner"
power0 "github.com/filecoin-project/specs-actors/actors/builtin/power"
reward0 "github.com/filecoin-project/specs-actors/actors/builtin/reward"
power2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/power"
reward2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/reward"
power4 "github.com/filecoin-project/specs-actors/v4/actors/builtin/power"
reward4 "github.com/filecoin-project/specs-actors/v4/actors/builtin/reward"
@ -135,14 +137,32 @@ func SetupStorageMiners(ctx context.Context, cs *store.ChainStore, sys vm.Syscal
}
{
constructorParams := &power0.CreateMinerParams{
Owner: m.Worker,
Worker: m.Worker,
Peer: []byte(m.PeerId),
SealProofType: spt,
var params []byte
if nv <= network.Version10 {
constructorParams := &power2.CreateMinerParams{
Owner: m.Worker,
Worker: m.Worker,
Peer: []byte(m.PeerId),
SealProofType: spt,
}
params = mustEnc(constructorParams)
} else {
ppt, err := spt.RegisteredWindowPoStProofByNetworkVersion(nv)
if err != nil {
return cid.Undef, xerrors.Errorf("failed to convert spt to wpt: %w", err)
}
constructorParams := &power11.CreateMinerParams{
Owner: m.Worker,
Worker: m.Worker,
Peer: []byte(m.PeerId),
WindowPoStProofType: ppt,
}
params = mustEnc(constructorParams)
}
params := mustEnc(constructorParams)
rval, err := doExecValue(ctx, genesisVm, power.Address, m.Owner, m.PowerBalance, power.Methods.CreateMiner, params)
if err != nil {
return cid.Undef, xerrors.Errorf("failed to create genesis miner: %w", err)

View File

@ -407,8 +407,18 @@ var sealBenchCmd = &cli.Command{
}
verifyWinningPost2 := time.Now()
ppt, err := sealedSectors[0].SealProof.RegisteredWindowPoStProof()
if err != nil {
return err
}
ppt, err = ppt.ToV1_1PostProof()
if err != nil {
return err
}
log.Info("computing window post snark (cold)")
wproof1, _, err := sb.GenerateWindowPoSt(context.TODO(), mid, extendedSealedSectors, challenge[:])
wproof1, _, err := sb.GenerateWindowPoSt(context.TODO(), mid, ppt, extendedSealedSectors, challenge[:])
if err != nil {
return err
}
@ -416,7 +426,7 @@ var sealBenchCmd = &cli.Command{
windowpost1 := time.Now()
log.Info("computing window post snark (hot)")
wproof2, _, err := sb.GenerateWindowPoSt(context.TODO(), mid, extendedSealedSectors, challenge[:])
wproof2, _, err := sb.GenerateWindowPoSt(context.TODO(), mid, ppt, extendedSealedSectors, challenge[:])
if err != nil {
return err
}

2
extern/filecoin-ffi vendored

@ -1 +1 @@
Subproject commit 28e3cd44d91681c074aba362d1e5c954db110ad9
Subproject commit cec06f7f9d4c8ffd38caf4f7ac97381b453575ef

2
go.mod
View File

@ -46,7 +46,7 @@ require (
github.com/filecoin-project/go-legs v0.4.4
github.com/filecoin-project/go-padreader v0.0.1
github.com/filecoin-project/go-paramfetch v0.0.4
github.com/filecoin-project/go-state-types v0.11.0-alpha-2
github.com/filecoin-project/go-state-types v0.11.0-alpha-3.0.20230410150147-71c769ab29ce
github.com/filecoin-project/go-statemachine v1.0.2
github.com/filecoin-project/go-statestore v0.2.0
github.com/filecoin-project/go-storedcounter v0.1.0

10
go.sum
View File

@ -298,7 +298,6 @@ github.com/filecoin-project/dagstore v0.5.2 h1:Nd6oXdnolbbVhpMpkYT5PJHOjQp4OBSnt
github.com/filecoin-project/dagstore v0.5.2/go.mod h1:mdqKzYrRBHf1pRMthYfMv3n37oOw0Tkx7+TxPt240M0=
github.com/filecoin-project/go-address v0.0.3/go.mod h1:jr8JxKsYx+lQlQZmF5i2U0Z+cGQ59wMIps/8YW/lDj8=
github.com/filecoin-project/go-address v0.0.5/go.mod h1:jr8JxKsYx+lQlQZmF5i2U0Z+cGQ59wMIps/8YW/lDj8=
github.com/filecoin-project/go-address v0.0.6/go.mod h1:7B0/5DA13n6nHkB8bbGx1gWzG/dbTsZ0fgOJVGsM3TE=
github.com/filecoin-project/go-address v1.1.0 h1:ofdtUtEsNxkIxkDw67ecSmvtzaVSdcea4boAmLbnHfE=
github.com/filecoin-project/go-address v1.1.0/go.mod h1:5t3z6qPmIADZBtuE9EIzi0EwzcRy2nVhpo0I/c1r0OA=
github.com/filecoin-project/go-amt-ipld/v2 v2.1.0 h1:t6qDiuGYYngDqaLc2ZUvdtAg4UNxPeOYaXhBWSNsVaM=
@ -354,10 +353,10 @@ github.com/filecoin-project/go-state-types v0.0.0-20200928172055-2df22083d8ab/go
github.com/filecoin-project/go-state-types v0.0.0-20201102161440-c8033295a1fc/go.mod h1:ezYnPf0bNkTsDibL/psSz5dy4B5awOJ/E7P2Saeep8g=
github.com/filecoin-project/go-state-types v0.1.0/go.mod h1:ezYnPf0bNkTsDibL/psSz5dy4B5awOJ/E7P2Saeep8g=
github.com/filecoin-project/go-state-types v0.1.6/go.mod h1:UwGVoMsULoCK+bWjEdd/xLCvLAQFBC7EDT477SKml+Q=
github.com/filecoin-project/go-state-types v0.1.8/go.mod h1:UwGVoMsULoCK+bWjEdd/xLCvLAQFBC7EDT477SKml+Q=
github.com/filecoin-project/go-state-types v0.1.10/go.mod h1:UwGVoMsULoCK+bWjEdd/xLCvLAQFBC7EDT477SKml+Q=
github.com/filecoin-project/go-state-types v0.11.0-alpha-2 h1:LlJHUV0yL5gcP+8QH5JKIEluYC05d6g0DJot3UP47ZE=
github.com/filecoin-project/go-state-types v0.11.0-alpha-2/go.mod h1:aLIas+W8BWAfpLWEPUOGMPBdhcVwoCG4pIQSQk26024=
github.com/filecoin-project/go-state-types v0.11.0-alpha-2.0.20230331142914-3c737db98e58/go.mod h1:aLIas+W8BWAfpLWEPUOGMPBdhcVwoCG4pIQSQk26024=
github.com/filecoin-project/go-state-types v0.11.0-alpha-3.0.20230410150147-71c769ab29ce h1:QWTON/7X/fINO9bov7LExE0+N0kmQhooFbv0ajZrDt0=
github.com/filecoin-project/go-state-types v0.11.0-alpha-3.0.20230410150147-71c769ab29ce/go.mod h1:SyNPwTsU7I22gL2r0OAPcImvLoTVfgRwdK/Y5rR1zz8=
github.com/filecoin-project/go-statemachine v0.0.0-20200925024713-05bd7c71fbfe/go.mod h1:FGwQgZAt2Gh5mjlwJUlVB62JeYdo+if0xWxSEfBD9ig=
github.com/filecoin-project/go-statemachine v1.0.2 h1:421SSWBk8GIoCoWYYTE/d+qCWccgmRH0uXotXRDjUbc=
github.com/filecoin-project/go-statemachine v1.0.2/go.mod h1:jZdXXiHa61n4NmgWFG4w8tnqgvZVHYbJ3yW7+y8bF54=
@ -903,6 +902,7 @@ github.com/ipld/go-ipld-prime v0.11.0/go.mod h1:+WIAkokurHmZ/KwzDOMUuoeJgaRQktHt
github.com/ipld/go-ipld-prime v0.14.0/go.mod h1:9ASQLwUFLptCov6lIYc70GRB4V7UTyLD0IJtrDJe6ZM=
github.com/ipld/go-ipld-prime v0.16.0/go.mod h1:axSCuOCBPqrH+gvXr2w9uAOulJqBPhHPT2PjoiiU1qA=
github.com/ipld/go-ipld-prime v0.17.0/go.mod h1:aYcKm5TIvGfY8P3QBKz/2gKcLxzJ1zDaD+o0bOowhgs=
github.com/ipld/go-ipld-prime v0.19.0/go.mod h1:Q9j3BaVXwaA3o5JUDNvptDDr/x8+F7FG6XJ8WI3ILg4=
github.com/ipld/go-ipld-prime v0.20.0 h1:Ud3VwE9ClxpO2LkCYP7vWPc0Fo+dYdYzgxUJZ3uRG4g=
github.com/ipld/go-ipld-prime v0.20.0/go.mod h1:PzqZ/ZR981eKbgdr3y2DJYeD/8bgMawdGVlJDE8kK+M=
github.com/ipld/go-ipld-prime-proto v0.0.0-20191113031812-e32bd156a1e5/go.mod h1:gcvzoEDBjwycpXt3LBE061wT9f46szXGHAmj9uoP6fU=
@ -1527,6 +1527,7 @@ github.com/multiformats/go-multicodec v0.3.1-0.20210902112759-1539a079fd61/go.mo
github.com/multiformats/go-multicodec v0.3.1-0.20211210143421-a526f306ed2c/go.mod h1:1Hj/eHRaVWSXiSNNfcEPcwZleTmdNP81xlxDLnWU9GQ=
github.com/multiformats/go-multicodec v0.4.1/go.mod h1:1Hj/eHRaVWSXiSNNfcEPcwZleTmdNP81xlxDLnWU9GQ=
github.com/multiformats/go-multicodec v0.5.0/go.mod h1:DiY2HFaEp5EhEXb/iYzVAunmyX/aSFMxq2KMKfWEues=
github.com/multiformats/go-multicodec v0.6.0/go.mod h1:GUC8upxSBE4oG+q3kWZRw/+6yC1BqO550bjhWsJbZlw=
github.com/multiformats/go-multicodec v0.8.0 h1:evBmgkbSQux+Ds2IgfhkO38Dl2GDtRW8/Rp6YiSHX/Q=
github.com/multiformats/go-multicodec v0.8.0/go.mod h1:GUC8upxSBE4oG+q3kWZRw/+6yC1BqO550bjhWsJbZlw=
github.com/multiformats/go-multihash v0.0.1/go.mod h1:w/5tugSrLEbWqlcgJabL3oHFKTwfvkofsjW2Qa1ct4U=
@ -2056,6 +2057,7 @@ golang.org/x/crypto v0.0.0-20210813211128-0a44fdfbc16e/go.mod h1:GvvjBRRGRdwPK5y
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20211209193657-4570a0811e8b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90 h1:Y/gsMcFOcR+6S6f3YeMKl5g+dZMEWqcz5Czj/GWYbkM=
golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=

View File

@ -1,98 +0,0 @@
package itests
import (
"context"
"testing"
"time"
"github.com/stretchr/testify/require"
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
actorstypes "github.com/filecoin-project/go-state-types/actors"
"github.com/filecoin-project/go-state-types/builtin"
"github.com/filecoin-project/go-state-types/manifest"
"github.com/filecoin-project/go-state-types/network"
gstStore "github.com/filecoin-project/go-state-types/store"
"github.com/filecoin-project/lotus/blockstore"
"github.com/filecoin-project/lotus/chain/actors"
builtin2 "github.com/filecoin-project/lotus/chain/actors/builtin"
"github.com/filecoin-project/lotus/chain/consensus/filcns"
"github.com/filecoin-project/lotus/chain/state"
"github.com/filecoin-project/lotus/chain/stmgr"
"github.com/filecoin-project/lotus/chain/types"
"github.com/filecoin-project/lotus/chain/types/ethtypes"
"github.com/filecoin-project/lotus/chain/vm"
"github.com/filecoin-project/lotus/itests/kit"
"github.com/filecoin-project/lotus/node/impl"
)
func TestMigrationNV18(t *testing.T) {
kit.QuietMiningLogs()
nv18epoch := abi.ChainEpoch(100)
testClient, _, ens := kit.EnsembleMinimal(t, kit.MockProofs(),
kit.UpgradeSchedule(stmgr.Upgrade{
Network: network.Version17,
Height: -1,
}, stmgr.Upgrade{
Network: network.Version18,
Height: nv18epoch,
Migration: filcns.UpgradeActorsV10,
},
))
ens.InterconnectAll().BeginMining(10 * time.Millisecond)
clientApi := testClient.FullNode.(*impl.FullNodeAPI)
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
testClient.WaitTillChain(ctx, kit.HeightAtLeast(nv18epoch+5))
// Now that we have upgraded, we need to:
// - the EAM exists, has "empty" state
// - the EthZeroAddress exists
// - all actors have nil Address fields
bs := blockstore.NewAPIBlockstore(testClient)
ctxStore := gstStore.WrapBlockStore(ctx, bs)
currTs, err := clientApi.ChainHead(ctx)
require.NoError(t, err)
newStateTree, err := state.LoadStateTree(ctxStore, currTs.Blocks()[0].ParentStateRoot)
require.NoError(t, err)
require.Equal(t, types.StateTreeVersion5, newStateTree.Version())
codeIDsv10, ok := actors.GetActorCodeIDsFromManifest(actorstypes.Version10)
require.True(t, ok)
// check the EAM actor
EAMActor, err := newStateTree.GetActor(builtin.EthereumAddressManagerActorAddr)
require.NoError(t, err)
require.Equal(t, vm.EmptyObjectCid, EAMActor.Head)
EAMCodeID, ok := codeIDsv10[manifest.EamKey]
require.True(t, ok)
require.Equal(t, EAMCodeID, EAMActor.Code)
// check the EthZeroAddress
ethZeroAddr, err := (ethtypes.EthAddress{}).ToFilecoinAddress()
require.NoError(t, err)
ethZeroAddrID, err := newStateTree.LookupID(ethZeroAddr)
require.NoError(t, err)
ethZeroActor, err := newStateTree.GetActor(ethZeroAddrID)
require.NoError(t, err)
require.True(t, builtin2.IsEthAccountActor(ethZeroActor.Code))
require.Equal(t, vm.EmptyObjectCid, ethZeroActor.Head)
// check all actor's Address fields
require.NoError(t, newStateTree.ForEach(func(address address.Address, actor *types.Actor) error {
if address != ethZeroAddrID {
require.Nil(t, actor.Address)
}
return nil
}))
}

View File

@ -11,19 +11,26 @@ import (
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
actorstypes "github.com/filecoin-project/go-state-types/actors"
"github.com/filecoin-project/go-state-types/big"
"github.com/filecoin-project/go-state-types/builtin"
miner11 "github.com/filecoin-project/go-state-types/builtin/v11/miner"
power11 "github.com/filecoin-project/go-state-types/builtin/v11/power"
adt11 "github.com/filecoin-project/go-state-types/builtin/v11/util/adt"
markettypes "github.com/filecoin-project/go-state-types/builtin/v9/market"
migration "github.com/filecoin-project/go-state-types/builtin/v9/migration/test"
miner9 "github.com/filecoin-project/go-state-types/builtin/v9/miner"
verifregst "github.com/filecoin-project/go-state-types/builtin/v9/verifreg"
"github.com/filecoin-project/go-state-types/crypto"
"github.com/filecoin-project/go-state-types/manifest"
"github.com/filecoin-project/go-state-types/network"
gstStore "github.com/filecoin-project/go-state-types/store"
"github.com/filecoin-project/lotus/api"
"github.com/filecoin-project/lotus/blockstore"
"github.com/filecoin-project/lotus/build"
"github.com/filecoin-project/lotus/chain/actors"
builtin2 "github.com/filecoin-project/lotus/chain/actors/builtin"
"github.com/filecoin-project/lotus/chain/actors/builtin/datacap"
"github.com/filecoin-project/lotus/chain/actors/builtin/market"
"github.com/filecoin-project/lotus/chain/actors/builtin/miner"
@ -32,6 +39,8 @@ import (
"github.com/filecoin-project/lotus/chain/state"
"github.com/filecoin-project/lotus/chain/stmgr"
"github.com/filecoin-project/lotus/chain/types"
"github.com/filecoin-project/lotus/chain/types/ethtypes"
"github.com/filecoin-project/lotus/chain/vm"
"github.com/filecoin-project/lotus/chain/wallet/key"
"github.com/filecoin-project/lotus/itests/kit"
"github.com/filecoin-project/lotus/node/impl"
@ -520,3 +529,236 @@ func TestMigrationNV17(t *testing.T) {
require.Nil(t, dc)
}
func TestMigrationNV18(t *testing.T) {
kit.QuietMiningLogs()
nv18epoch := abi.ChainEpoch(100)
testClient, _, ens := kit.EnsembleMinimal(t, kit.MockProofs(),
kit.UpgradeSchedule(stmgr.Upgrade{
Network: network.Version17,
Height: -1,
}, stmgr.Upgrade{
Network: network.Version18,
Height: nv18epoch,
Migration: filcns.UpgradeActorsV10,
},
))
ens.InterconnectAll().BeginMining(10 * time.Millisecond)
clientApi := testClient.FullNode.(*impl.FullNodeAPI)
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
testClient.WaitTillChain(ctx, kit.HeightAtLeast(nv18epoch+5))
// Now that we have upgraded, we need to:
// - the EAM exists, has "empty" state
// - the EthZeroAddress exists
// - all actors have nil Address fields
bs := blockstore.NewAPIBlockstore(testClient)
ctxStore := gstStore.WrapBlockStore(ctx, bs)
currTs, err := clientApi.ChainHead(ctx)
require.NoError(t, err)
newStateTree, err := state.LoadStateTree(ctxStore, currTs.Blocks()[0].ParentStateRoot)
require.NoError(t, err)
require.Equal(t, types.StateTreeVersion5, newStateTree.Version())
codeIDsv10, ok := actors.GetActorCodeIDsFromManifest(actorstypes.Version10)
require.True(t, ok)
// check the EAM actor
EAMActor, err := newStateTree.GetActor(builtin.EthereumAddressManagerActorAddr)
require.NoError(t, err)
require.Equal(t, vm.EmptyObjectCid, EAMActor.Head)
EAMCodeID, ok := codeIDsv10[manifest.EamKey]
require.True(t, ok)
require.Equal(t, EAMCodeID, EAMActor.Code)
// check the EthZeroAddress
ethZeroAddr, err := (ethtypes.EthAddress{}).ToFilecoinAddress()
require.NoError(t, err)
ethZeroAddrID, err := newStateTree.LookupID(ethZeroAddr)
require.NoError(t, err)
ethZeroActor, err := newStateTree.GetActor(ethZeroAddrID)
require.NoError(t, err)
require.True(t, builtin2.IsEthAccountActor(ethZeroActor.Code))
require.Equal(t, vm.EmptyObjectCid, ethZeroActor.Head)
// check all actor's Address fields
require.NoError(t, newStateTree.ForEach(func(address address.Address, actor *types.Actor) error {
if address != ethZeroAddrID {
require.Nil(t, actor.Address)
}
return nil
}))
}
func TestMigrationNV19(t *testing.T) {
kit.QuietMiningLogs()
blockTime := 5 * time.Millisecond
nv19epoch := abi.ChainEpoch(100)
nv20epoch := nv19epoch + builtin.EpochsInDay
testClient, testMiner, ens := kit.EnsembleMinimal(t, kit.MockProofs(),
kit.UpgradeSchedule(stmgr.Upgrade{
Network: network.Version18,
Height: -1,
}, stmgr.Upgrade{
Network: network.Version19,
Height: nv19epoch,
Migration: filcns.UpgradeActorsV11,
}, stmgr.Upgrade{
Network: network.Version20,
Height: nv20epoch,
Migration: nil,
},
))
ens.InterconnectAll().BeginMining(blockTime)
clientApi := testClient.FullNode.(*impl.FullNodeAPI)
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
testClient.WaitTillChain(ctx, kit.HeightAtLeast(nv19epoch+5))
bs := blockstore.NewAPIBlockstore(testClient)
ctxStore := gstStore.WrapBlockStore(ctx, bs)
postMigrationTs, err := clientApi.ChainHead(ctx)
require.NoError(t, err)
newStateTree, err := state.LoadStateTree(ctxStore, postMigrationTs.Blocks()[0].ParentStateRoot)
require.NoError(t, err)
require.Equal(t, types.StateTreeVersion5, newStateTree.Version())
// Now that we have upgraded, we need to check that:
// - a PoSt is successfully submitted in nv19
// - a PoSt is successfully submitted in nv20
// - all claims in the Power actor are of v1_1 type
// - the miner's info has been updated to the v1_1 type
// Wait for an nv19 PoSt
mi, err := testClient.StateMinerInfo(ctx, testMiner.ActorAddr, types.EmptyTSK)
require.NoError(t, err)
wact19, err := testClient.StateGetActor(ctx, mi.Worker, types.EmptyTSK)
require.NoError(t, err)
en19 := wact19.Nonce
// wait for a new message to be sent from worker address, it will be a PoSt
waitForProof19:
for {
//stm: @CHAIN_STATE_GET_ACTOR_001
wact, err := testClient.StateGetActor(ctx, mi.Worker, types.EmptyTSK)
require.NoError(t, err)
if wact.Nonce > en19 {
break waitForProof19
}
build.Clock.Sleep(blockTime)
}
slm19, err := testClient.StateListMessages(ctx, &api.MessageMatch{To: testMiner.ActorAddr}, types.EmptyTSK, 0)
require.NoError(t, err)
pmr19, err := testClient.StateSearchMsg(ctx, types.EmptyTSK, slm19[0], -1, false)
require.NoError(t, err)
nv19, err := testClient.StateNetworkVersion(ctx, pmr19.TipSet)
require.NoError(t, err)
require.Equal(t, network.Version19, nv19)
require.True(t, pmr19.Receipt.ExitCode.IsSuccess())
slmsg19, err := testClient.ChainGetMessage(ctx, slm19[0])
require.NoError(t, err)
var params19 miner11.SubmitWindowedPoStParams
require.NoError(t, params19.UnmarshalCBOR(bytes.NewBuffer(slmsg19.Params)))
require.Equal(t, abi.RegisteredPoStProof_StackedDrgWindow2KiBV1_1, params19.Proofs[0].PoStProof)
// Wait for nv20
testClient.WaitTillChain(ctx, kit.HeightAtLeast(nv20epoch+5))
// Wait for an nv20 PoSt
wact20, err := testClient.StateGetActor(ctx, mi.Worker, types.EmptyTSK)
require.NoError(t, err)
en20 := wact20.Nonce
// wait for a new message to be sent from worker address, it will be a PoSt
waitForProof20:
for {
//stm: @CHAIN_STATE_GET_ACTOR_001
wact, err := testClient.StateGetActor(ctx, mi.Worker, types.EmptyTSK)
require.NoError(t, err)
if wact.Nonce > en20 {
break waitForProof20
}
build.Clock.Sleep(blockTime)
}
slm20, err := testClient.StateListMessages(ctx, &api.MessageMatch{To: testMiner.ActorAddr}, types.EmptyTSK, 0)
require.NoError(t, err)
pmr20, err := testClient.StateSearchMsg(ctx, types.EmptyTSK, slm20[0], -1, false)
require.NoError(t, err)
nv20, err := testClient.StateNetworkVersion(ctx, pmr20.TipSet)
require.NoError(t, err)
require.Equal(t, network.Version20, nv20)
require.True(t, pmr20.Receipt.ExitCode.IsSuccess())
slmsg20, err := testClient.ChainGetMessage(ctx, slm20[0])
require.NoError(t, err)
var params20 miner11.SubmitWindowedPoStParams
require.NoError(t, params20.UnmarshalCBOR(bytes.NewBuffer(slmsg20.Params)))
require.Equal(t, abi.RegisteredPoStProof_StackedDrgWindow2KiBV1_1, params20.Proofs[0].PoStProof)
// check claims in the Power actor
powerActor, err := newStateTree.GetActor(builtin.StoragePowerActorAddr)
require.NoError(t, err)
var powerSt power11.State
require.NoError(t, ctxStore.Get(ctx, powerActor.Head, &powerSt))
powerClaims, err := adt11.AsMap(ctxStore, powerSt.Claims, builtin.DefaultHamtBitwidth)
require.NoError(t, err)
var claim power11.Claim
require.NoError(t, powerClaims.ForEach(&claim, func(key string) error {
v1proof, err := claim.WindowPoStProofType.ToV1_1PostProof()
require.NoError(t, err)
require.Equal(t, v1proof, claim.WindowPoStProofType)
return nil
}))
// check MinerInfo
minerInfo, err := testClient.StateMinerInfo(ctx, testMiner.ActorAddr, types.EmptyTSK)
require.NoError(t, err)
v1proof, err := minerInfo.WindowPoStProofType.ToV1_1PostProof()
require.NoError(t, err)
require.Equal(t, v1proof, minerInfo.WindowPoStProofType)
}

View File

@ -2,6 +2,7 @@
package itests
import (
"bytes"
"context"
"fmt"
"testing"
@ -12,6 +13,7 @@ import (
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/big"
miner11 "github.com/filecoin-project/go-state-types/builtin/v11/miner"
"github.com/filecoin-project/go-state-types/network"
"github.com/filecoin-project/lotus/api"
@ -343,3 +345,143 @@ waitForProof:
require.NotEqual(t, pmr.GasCost.BaseFeeBurn, big.Zero())
}
// Tests that V1_1 proofs are generated and accepted in nv19, and V1 proofs are accepted
func TestWindowPostV1P1NV19(t *testing.T) {
kit.QuietMiningLogs()
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
blocktime := 2 * time.Millisecond
client, miner, ens := kit.EnsembleMinimal(t, kit.GenesisNetworkVersion(network.Version19))
ens.InterconnectAll().BeginMining(blocktime)
maddr, err := miner.ActorAddress(ctx)
require.NoError(t, err)
mi, err := client.StateMinerInfo(ctx, maddr, types.EmptyTSK)
require.NoError(t, err)
wact, err := client.StateGetActor(ctx, mi.Worker, types.EmptyTSK)
require.NoError(t, err)
en := wact.Nonce
// wait for a new message to be sent from worker address, it will be a PoSt
waitForProof:
for {
wact, err := client.StateGetActor(ctx, mi.Worker, types.EmptyTSK)
require.NoError(t, err)
if wact.Nonce > en {
break waitForProof
}
build.Clock.Sleep(blocktime)
}
slm, err := client.StateListMessages(ctx, &api.MessageMatch{To: maddr}, types.EmptyTSK, 0)
require.NoError(t, err)
pmr, err := client.StateSearchMsg(ctx, types.EmptyTSK, slm[0], -1, false)
require.NoError(t, err)
inclTs, err := client.ChainGetTipSet(ctx, pmr.TipSet)
require.NoError(t, err)
nv, err := client.StateNetworkVersion(ctx, pmr.TipSet)
require.NoError(t, err)
require.Equal(t, network.Version19, nv)
require.True(t, pmr.Receipt.ExitCode.IsSuccess())
slmsg, err := client.ChainGetMessage(ctx, slm[0])
require.NoError(t, err)
var params miner11.SubmitWindowedPoStParams
require.NoError(t, params.UnmarshalCBOR(bytes.NewBuffer(slmsg.Params)))
require.Equal(t, abi.RegisteredPoStProof_StackedDrgWindow2KiBV1_1, params.Proofs[0].PoStProof)
// "Turn" this into a V1 proof -- the proof will be invalid, but won't be validated, and so the call should succeed
params.Proofs[0].PoStProof = abi.RegisteredPoStProof_StackedDrgWindow2KiBV1
v1PostParams := new(bytes.Buffer)
require.NoError(t, params.MarshalCBOR(v1PostParams))
slmsg.Params = v1PostParams.Bytes()
// Simulate call on inclTs's parents, so that the partition isn't already proven
call, err := client.StateCall(ctx, slmsg, inclTs.Parents())
require.NoError(t, err)
require.True(t, call.MsgRct.ExitCode.IsSuccess())
}
// Tests that V1_1 proofs are generated and accepted in nv20, and that V1 proofs are NOT
func TestWindowPostV1P1NV20(t *testing.T) {
kit.QuietMiningLogs()
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
blocktime := 2 * time.Millisecond
client, miner, ens := kit.EnsembleMinimal(t, kit.GenesisNetworkVersion(network.Version20))
ens.InterconnectAll().BeginMining(blocktime)
maddr, err := miner.ActorAddress(ctx)
require.NoError(t, err)
mi, err := client.StateMinerInfo(ctx, maddr, types.EmptyTSK)
require.NoError(t, err)
wact, err := client.StateGetActor(ctx, mi.Worker, types.EmptyTSK)
require.NoError(t, err)
en := wact.Nonce
// wait for a new message to be sent from worker address, it will be a PoSt
waitForProof:
for {
//stm: @CHAIN_STATE_GET_ACTOR_001
wact, err := client.StateGetActor(ctx, mi.Worker, types.EmptyTSK)
require.NoError(t, err)
if wact.Nonce > en {
break waitForProof
}
build.Clock.Sleep(blocktime)
}
slm, err := client.StateListMessages(ctx, &api.MessageMatch{To: maddr}, types.EmptyTSK, 0)
require.NoError(t, err)
pmr, err := client.StateSearchMsg(ctx, types.EmptyTSK, slm[0], -1, false)
require.NoError(t, err)
inclTs, err := client.ChainGetTipSet(ctx, pmr.TipSet)
require.NoError(t, err)
nv, err := client.StateNetworkVersion(ctx, pmr.TipSet)
require.NoError(t, err)
require.Equal(t, network.Version20, nv)
require.True(t, pmr.Receipt.ExitCode.IsSuccess())
slmsg, err := client.ChainGetMessage(ctx, slm[0])
require.NoError(t, err)
var params miner11.SubmitWindowedPoStParams
require.NoError(t, params.UnmarshalCBOR(bytes.NewBuffer(slmsg.Params)))
require.Equal(t, abi.RegisteredPoStProof_StackedDrgWindow2KiBV1_1, params.Proofs[0].PoStProof)
// "Turn" this into a V1 proof -- the proof will be invalid, but we won't get that far
params.Proofs[0].PoStProof = abi.RegisteredPoStProof_StackedDrgWindow2KiBV1
v1PostParams := new(bytes.Buffer)
require.NoError(t, params.MarshalCBOR(v1PostParams))
slmsg.Params = v1PostParams.Bytes()
// Simulate call on inclTs's parents, so that the partition isn't already proven
_, err = client.StateCall(ctx, slmsg, inclTs.Parents())
require.ErrorContains(t, err, "expected proof of type StackedDRGWindow2KiBV1P1, got StackedDRGWindow2KiBV1")
}

View File

@ -97,13 +97,7 @@ func (m *Manager) CheckProvable(ctx context.Context, pp abi.RegisteredPoStProof,
return
}
wpp, err := sector.ProofType.RegisteredWindowPoStProof()
if err != nil {
addBad(sector.ID, fmt.Sprint("can't get proof type"))
return
}
ch, err := ffi.GeneratePoStFallbackSectorChallenges(wpp, sector.ID.Miner, postRand, []abi.SectorNumber{
ch, err := ffi.GeneratePoStFallbackSectorChallenges(pp, sector.ID.Miner, postRand, []abi.SectorNumber{
sector.ID.Number,
})
if err != nil {
@ -126,7 +120,7 @@ func (m *Manager) CheckProvable(ctx context.Context, pp abi.RegisteredPoStProof,
SealedCID: commr,
Challenge: ch.Challenges[sector.ID.Number],
Update: update,
}, wpp)
}, pp)
if err != nil {
log.Warnw("CheckProvable Sector FAULT: generating vanilla proof", "sector", sector, "err", err)
addBad(sector.ID, fmt.Sprintf("generating vanilla proof: %s", err))

View File

@ -190,7 +190,18 @@ func post(t *testing.T, sealer *Sealer, skipped []abi.SectorID, seals ...seal) {
}
}
proofs, skp, err := sealer.GenerateWindowPoSt(context.TODO(), seals[0].ref.ID.Miner, xsis, randomness)
ppt, err := xsis[0].SealProof.RegisteredWindowPoStProof()
if err != nil {
t.Fatalf("%+v", err)
}
ppt, err = ppt.ToV1_1PostProof()
if err != nil {
t.Fatalf("%+v", err)
}
proofs, skp, err := sealer.GenerateWindowPoSt(context.TODO(), seals[0].ref.ID.Miner, ppt, xsis, randomness)
if len(skipped) > 0 {
require.Error(t, err)
require.EqualValues(t, skipped, skp)

View File

@ -18,7 +18,15 @@ import (
func (sb *Sealer) GenerateWinningPoSt(ctx context.Context, minerID abi.ActorID, sectorInfo []proof.ExtendedSectorInfo, randomness abi.PoStRandomness) ([]proof.PoStProof, error) {
randomness[31] &= 0x3f
privsectors, skipped, done, err := sb.pubExtendedSectorToPriv(ctx, minerID, sectorInfo, nil, abi.RegisteredSealProof.RegisteredWinningPoStProof) // TODO: FAULTS?
if len(sectorInfo) == 0 {
return nil, xerrors.Errorf("must provide sectors for winning post")
}
ppt, err := sectorInfo[0].SealProof.RegisteredWinningPoStProof()
if err != nil {
return nil, xerrors.Errorf("failed to convert to winning post proof: %w", err)
}
privsectors, skipped, done, err := sb.pubExtendedSectorToPriv(ctx, minerID, sectorInfo, nil, ppt) // TODO: FAULTS?
if err != nil {
return nil, err
}
@ -30,9 +38,9 @@ func (sb *Sealer) GenerateWinningPoSt(ctx context.Context, minerID abi.ActorID,
return ffi.GenerateWinningPoSt(minerID, privsectors, randomness)
}
func (sb *Sealer) GenerateWindowPoSt(ctx context.Context, minerID abi.ActorID, sectorInfo []proof.ExtendedSectorInfo, randomness abi.PoStRandomness) ([]proof.PoStProof, []abi.SectorID, error) {
func (sb *Sealer) GenerateWindowPoSt(ctx context.Context, minerID abi.ActorID, postProofType abi.RegisteredPoStProof, sectorInfo []proof.ExtendedSectorInfo, randomness abi.PoStRandomness) ([]proof.PoStProof, []abi.SectorID, error) {
randomness[31] &= 0x3f
privsectors, skipped, done, err := sb.pubExtendedSectorToPriv(ctx, minerID, sectorInfo, nil, abi.RegisteredSealProof.RegisteredWindowPoStProof)
privsectors, skipped, done, err := sb.pubExtendedSectorToPriv(ctx, minerID, sectorInfo, nil, postProofType)
if err != nil {
return nil, nil, xerrors.Errorf("gathering sector info: %w", err)
}
@ -55,7 +63,7 @@ func (sb *Sealer) GenerateWindowPoSt(ctx context.Context, minerID abi.ActorID, s
return proof, faultyIDs, err
}
func (sb *Sealer) pubExtendedSectorToPriv(ctx context.Context, mid abi.ActorID, sectorInfo []proof.ExtendedSectorInfo, faults []abi.SectorNumber, rpt func(abi.RegisteredSealProof) (abi.RegisteredPoStProof, error)) (ffi.SortedPrivateSectorInfo, []abi.SectorID, func(), error) {
func (sb *Sealer) pubExtendedSectorToPriv(ctx context.Context, mid abi.ActorID, sectorInfo []proof.ExtendedSectorInfo, faults []abi.SectorNumber, postProofType abi.RegisteredPoStProof) (ffi.SortedPrivateSectorInfo, []abi.SectorID, func(), error) {
fmap := map[abi.SectorNumber]struct{}{}
for _, fault := range faults {
fmap[fault] = struct{}{}
@ -106,12 +114,6 @@ func (sb *Sealer) pubExtendedSectorToPriv(ctx context.Context, mid abi.ActorID,
sealed = paths.Sealed
}
postProofType, err := rpt(s.SealProof)
if err != nil {
done()
return ffi.SortedPrivateSectorInfo{}, nil, nil, xerrors.Errorf("acquiring registered PoSt proof from sector info %+v: %w", s, err)
}
ffiInfo := proof.SectorInfo{
SealProof: s.SealProof,
SectorNumber: s.SectorNumber,

View File

@ -77,15 +77,15 @@ func (m *Manager) generateWinningPoSt(ctx context.Context, minerID abi.ActorID,
return proofs, nil
}
func (m *Manager) GenerateWindowPoSt(ctx context.Context, minerID abi.ActorID, sectorInfo []proof.ExtendedSectorInfo, randomness abi.PoStRandomness) (proof []proof.PoStProof, skipped []abi.SectorID, err error) {
func (m *Manager) GenerateWindowPoSt(ctx context.Context, minerID abi.ActorID, postProofType abi.RegisteredPoStProof, sectorInfo []proof.ExtendedSectorInfo, randomness abi.PoStRandomness) (proof []proof.PoStProof, skipped []abi.SectorID, err error) {
if !m.disableBuiltinWindowPoSt && !m.windowPoStSched.CanSched(ctx) {
// if builtin PoSt isn't disabled, and there are no workers, compute the PoSt locally
log.Info("GenerateWindowPoSt run at lotus-miner")
return m.localProver.GenerateWindowPoSt(ctx, minerID, sectorInfo, randomness)
return m.localProver.GenerateWindowPoSt(ctx, minerID, postProofType, sectorInfo, randomness)
}
return m.generateWindowPoSt(ctx, minerID, sectorInfo, randomness)
return m.generateWindowPoSt(ctx, minerID, postProofType, sectorInfo, randomness)
}
func dedupeSectorInfo(sectorInfo []proof.ExtendedSectorInfo) []proof.ExtendedSectorInfo {
@ -101,7 +101,7 @@ func dedupeSectorInfo(sectorInfo []proof.ExtendedSectorInfo) []proof.ExtendedSec
return out
}
func (m *Manager) generateWindowPoSt(ctx context.Context, minerID abi.ActorID, sectorInfo []proof.ExtendedSectorInfo, randomness abi.PoStRandomness) ([]proof.PoStProof, []abi.SectorID, error) {
func (m *Manager) generateWindowPoSt(ctx context.Context, minerID abi.ActorID, ppt abi.RegisteredPoStProof, sectorInfo []proof.ExtendedSectorInfo, randomness abi.PoStRandomness) ([]proof.PoStProof, []abi.SectorID, error) {
var retErr error = nil
randomness[31] &= 0x3f
@ -113,11 +113,6 @@ func (m *Manager) generateWindowPoSt(ctx context.Context, minerID abi.ActorID, s
spt := sectorInfo[0].SealProof
ppt, err := spt.RegisteredWindowPoStProof()
if err != nil {
return nil, nil, err
}
maxPartitionSize, err := builtin.PoStProofWindowPoStPartitionSectors(ppt) // todo proxy through chain/actors
if err != nil {
return nil, nil, xerrors.Errorf("get sectors count of partition failed:%+v", err)

View File

@ -350,10 +350,15 @@ func (mgr *SectorMgr) GenerateWinningPoSt(ctx context.Context, minerID abi.Actor
}
}
return generateFakePoSt(sectorInfo, abi.RegisteredSealProof.RegisteredWinningPoStProof, randomness), nil
ppt, err := sectorInfo[0].SealProof.RegisteredWinningPoStProof()
if err != nil {
panic(err)
}
return generateFakePoSt(sectorInfo, ppt, randomness), nil
}
func (mgr *SectorMgr) GenerateWindowPoSt(ctx context.Context, minerID abi.ActorID, xSectorInfo []prooftypes.ExtendedSectorInfo, randomness abi.PoStRandomness) ([]prooftypes.PoStProof, []abi.SectorID, error) {
func (mgr *SectorMgr) GenerateWindowPoSt(ctx context.Context, minerID abi.ActorID, ppt abi.RegisteredPoStProof, xSectorInfo []prooftypes.ExtendedSectorInfo, randomness abi.PoStRandomness) ([]prooftypes.PoStProof, []abi.SectorID, error) {
mgr.lk.Lock()
defer mgr.lk.Unlock()
@ -396,7 +401,7 @@ func (mgr *SectorMgr) GenerateWindowPoSt(ctx context.Context, minerID abi.ActorI
}
}
return generateFakePoSt(sectorInfo, abi.RegisteredSealProof.RegisteredWindowPoStProof, randomness), skipped, nil
return generateFakePoSt(sectorInfo, ppt, randomness), skipped, nil
}
func generateFakePoStProof(sectorInfo []prooftypes.SectorInfo, randomness abi.PoStRandomness) []byte {
@ -414,15 +419,10 @@ func generateFakePoStProof(sectorInfo []prooftypes.SectorInfo, randomness abi.Po
}
func generateFakePoSt(sectorInfo []prooftypes.SectorInfo, rpt func(abi.RegisteredSealProof) (abi.RegisteredPoStProof, error), randomness abi.PoStRandomness) []prooftypes.PoStProof {
wp, err := rpt(sectorInfo[0].SealProof)
if err != nil {
panic(err)
}
func generateFakePoSt(sectorInfo []prooftypes.SectorInfo, ppt abi.RegisteredPoStProof, randomness abi.PoStRandomness) []prooftypes.PoStProof {
return []prooftypes.PoStProof{
{
PoStProof: wp,
PoStProof: ppt,
ProofBytes: generateFakePoStProof(sectorInfo, randomness),
},
}

View File

@ -22,7 +22,7 @@ var NoSectorRef = SectorRef{}
type ProverPoSt interface {
GenerateWinningPoSt(ctx context.Context, minerID abi.ActorID, sectorInfo []proof.ExtendedSectorInfo, randomness abi.PoStRandomness) ([]proof.PoStProof, error)
GenerateWindowPoSt(ctx context.Context, minerID abi.ActorID, sectorInfo []proof.ExtendedSectorInfo, randomness abi.PoStRandomness) (proof []proof.PoStProof, skipped []abi.SectorID, err error)
GenerateWindowPoSt(ctx context.Context, minerID abi.ActorID, ppt abi.RegisteredPoStProof, sectorInfo []proof.ExtendedSectorInfo, randomness abi.PoStRandomness) (proof []proof.PoStProof, skipped []abi.SectorID, err error)
GenerateWinningPoStWithVanilla(ctx context.Context, proofType abi.RegisteredPoStProof, minerID abi.ActorID, randomness abi.PoStRandomness, proofs [][]byte) ([]proof.PoStProof, error)
GenerateWindowPoStWithVanilla(ctx context.Context, proofType abi.RegisteredPoStProof, minerID abi.ActorID, randomness abi.PoStRandomness, proofs [][]byte, partitionIdx int) (proof.PoStProof, error)

View File

@ -33,7 +33,7 @@ func (t *testExec) GenerateWinningPoSt(ctx context.Context, minerID abi.ActorID,
panic("implement me")
}
func (t *testExec) GenerateWindowPoSt(ctx context.Context, minerID abi.ActorID, sectorInfo []proof.ExtendedSectorInfo, randomness abi.PoStRandomness) (miner []proof.PoStProof, skipped []abi.SectorID, err error) {
func (t *testExec) GenerateWindowPoSt(ctx context.Context, minerID abi.ActorID, ppt abi.RegisteredPoStProof, sectorInfo []proof.ExtendedSectorInfo, randomness abi.PoStRandomness) (miner []proof.PoStProof, skipped []abi.SectorID, err error) {
panic("implement me")
}

View File

@ -189,12 +189,12 @@ func (s *WindowPoStScheduler) runSubmitPoST(
func (s *WindowPoStScheduler) checkSectors(ctx context.Context, check bitfield.BitField, tsk types.TipSetKey) (bitfield.BitField, error) {
mid, err := address.IDFromAddress(s.actor)
if err != nil {
return bitfield.BitField{}, err
return bitfield.BitField{}, xerrors.Errorf("failed to convert to ID addr: %w", err)
}
sectorInfos, err := s.api.StateMinerSectors(ctx, s.actor, &check, tsk)
if err != nil {
return bitfield.BitField{}, err
return bitfield.BitField{}, xerrors.Errorf("failed to get sector infos: %w", err)
}
type checkSector struct {
@ -218,7 +218,21 @@ func (s *WindowPoStScheduler) checkSectors(ctx context.Context, check bitfield.B
})
}
bad, err := s.faultTracker.CheckProvable(ctx, s.proofType, tocheck, func(ctx context.Context, id abi.SectorID) (cid.Cid, bool, error) {
nv, err := s.api.StateNetworkVersion(ctx, types.EmptyTSK)
if err != nil {
return bitfield.BitField{}, xerrors.Errorf("failed to get network version: %w", err)
}
pp := s.proofType
// TODO: Drop after nv19 comes and goes
if nv >= network.Version19 {
pp, err = pp.ToV1_1PostProof()
if err != nil {
return bitfield.BitField{}, xerrors.Errorf("failed to convert to v1_1 post proof: %w", err)
}
}
bad, err := s.faultTracker.CheckProvable(ctx, pp, tocheck, func(ctx context.Context, id abi.SectorID) (cid.Cid, bool, error) {
s, ok := sectors[id.Number]
if !ok {
return cid.Undef, false, xerrors.Errorf("sealed CID not found")
@ -407,7 +421,12 @@ func (s *WindowPoStScheduler) runPoStCycle(ctx context.Context, manual bool, di
return nil, err
}
postOut, ps, err := s.prover.GenerateWindowPoSt(ctx, abi.ActorID(mid), xsinfos, append(abi.PoStRandomness{}, rand...))
ppt, err := xsinfos[0].SealProof.RegisteredWindowPoStProofByNetworkVersion(nv)
if err != nil {
return nil, xerrors.Errorf("failed to get window post type: %w", err)
}
postOut, ps, err := s.prover.GenerateWindowPoSt(ctx, abi.ActorID(mid), ppt, xsinfos, append(abi.PoStRandomness{}, rand...))
elapsed := time.Since(tsStart)
log.Infow("computing window post", "batch", batchIdx, "elapsed", elapsed, "skip", len(ps), "err", err)
if err != nil {

View File

@ -125,10 +125,10 @@ func (m *mockProver) GenerateWinningPoSt(context.Context, abi.ActorID, []proofty
panic("implement me")
}
func (m *mockProver) GenerateWindowPoSt(ctx context.Context, aid abi.ActorID, sis []prooftypes.ExtendedSectorInfo, pr abi.PoStRandomness) ([]prooftypes.PoStProof, []abi.SectorID, error) {
func (m *mockProver) GenerateWindowPoSt(ctx context.Context, aid abi.ActorID, ppt abi.RegisteredPoStProof, sis []prooftypes.ExtendedSectorInfo, pr abi.PoStRandomness) ([]prooftypes.PoStProof, []abi.SectorID, error) {
return []prooftypes.PoStProof{
{
PoStProof: abi.RegisteredPoStProof_StackedDrgWindow2KiBV1,
PoStProof: ppt,
ProofBytes: []byte("post-proof"),
},
}, nil, nil