Merge remote-tracking branch 'origin/release/v1.20.0' into mikers/create2test2

This commit is contained in:
Łukasz Magiera 2023-02-09 18:19:47 +01:00
commit c98093be03
52 changed files with 605 additions and 419 deletions

View File

@ -298,7 +298,7 @@ actors-gen: actors-code-gen fiximports
.PHONY: actors-gen
bundle-gen:
$(GOCC) run ./gen/bundle
$(GOCC) run ./gen/bundle $(RELEASE)
$(GOCC) fmt ./build/...
.PHONY: bundle-gen
@ -354,7 +354,7 @@ docsgen-openrpc-gateway: docsgen-openrpc-bin
fiximports:
./scripts/fiximports
gen: actors-code-gen type-gen cfgdoc-gen docsgen api-gen circleci bundle-gen 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"
.PHONY: gen

View File

@ -52,4 +52,4 @@ popd
echo "Generating metadata..."
make -C ../../ bundle-gen
make -C ../../ RELEASE="$RELEASE" bundle-gen

Binary file not shown.

Binary file not shown.

View File

@ -95,10 +95,11 @@ func loadManifests(netw string) error {
}
type BuiltinActorsMetadata struct {
Network string
Version actorstypes.Version
ManifestCid cid.Cid
Actors map[string]cid.Cid
Network string
Version actorstypes.Version
ManifestCid cid.Cid
Actors map[string]cid.Cid
BundleGitTag string
}
// ReadEmbeddedBuiltinActorsMetadata reads the metadata from the embedded built-in actor bundles.

View File

@ -31,46 +31,42 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet
}, {
Network: "butterflynet",
Version: 9,
ManifestCid: MustParseCid("bafy2bzaceba5qgs4z3imhlxwds5vamahngatvuuglbv5yl3ftfiosj6ud5chs"),
ManifestCid: MustParseCid("bafy2bzacec35by4erhcdgcsgzp7yb3j57utydlxxfc73m3k5pep67ehvvyv6i"),
Actors: map[string]cid.Cid{
"account": MustParseCid("bafk2bzacebd5zetyjtragjwrv2nqktct6u2pmsi4eifbanovxohx3a7lszjxi"),
"cron": MustParseCid("bafk2bzacecrszortqkc7har77ssgajglymv6ftrqvmdko5h2yqqh5k2qospl2"),
"datacap": MustParseCid("bafk2bzacecapjnxnyw4talwqv5ajbtbkzmzqiosztj5cb3sortyp73ndjl76e"),
"eam": MustParseCid("bafk2bzacecflry2dyjqj6fhpovkbcbei377zabectznuxsf6bxggsve7bsxga"),
"ethaccount": MustParseCid("bafk2bzacedl4pmkfxkzoqajs6im3ranmopozsmxjcxsnk3kwvd3vv7mfwwrf4"),
"evm": MustParseCid("bafk2bzacebgzvmvwv7rsnnhp3zhqbiqkumvyrc7pazfovpptgpgtqkalrli74"),
"init": MustParseCid("bafk2bzacecbxp66q3ytjkg37nyv4rmzezbfaigvx4i5yhvqbm5gg4amjeaias"),
"multisig": MustParseCid("bafk2bzacecjltag3mn75dsnmrmopjow27buxqhabissowayqlmavrcfetqswc"),
"paymentchannel": MustParseCid("bafk2bzacednzxg263eqbl2imwz3uhujov63tjkffieyl4hl3dhrgxyhwep6hc"),
"placeholder": MustParseCid("bafk2bzaceaamp2a35vpfml4skap4dffklzae2urcm34mtwwce2lvhaons3a5y"),
"reward": MustParseCid("bafk2bzacectp23cxsbbdrr3uggnw7f263qll5wkkfzqhn5yq37ae2ehdjdzri"),
"storagemarket": MustParseCid("bafk2bzacea45ko3ezkpeujsniovncwnizc4wsxd7kyckskhs7gvzwthzb2mqe"),
"storageminer": MustParseCid("bafk2bzaced74qthwrl3gahcf7o3vrdrodbcqhlplh6fykbgy5sd2iyouhq44c"),
"storagepower": MustParseCid("bafk2bzaceduksv6wqthr5fgp7mx5prv6gzul2oozf3svrjbuggc4bgokdxgfy"),
"system": MustParseCid("bafk2bzacebe6j2ius6clbbr7dypsg54jzmn5xablzunph7ebedw6yhwla4cj2"),
"verifiedregistry": MustParseCid("bafk2bzacebu4joy25gneu2qv3qfm3ktakzalndjrbhekeqrqk3zhotv6nyy2g"),
"account": MustParseCid("bafk2bzaceajsdln7v4chxqoukiw7lxw6aexg5qdsaex2hgelz2sbu24iblhzg"),
"cron": MustParseCid("bafk2bzacecgrwmgnqhybn3l23uvwf2n2vrcfjrprfzgd44uxers2pgr5mhsue"),
"datacap": MustParseCid("bafk2bzacebyier2ceh27acbrq2ccv4efvzotl6qntnlrxdsrik6i4tembz6qw"),
"init": MustParseCid("bafk2bzaceberhto43wnf4pklkd4c7d36kzslngyzyms4op7shxuswv3dtvfxu"),
"multisig": MustParseCid("bafk2bzaceaclpbrhoqdruvsuqqgknvy2k5dywzmjoehk4uarce3uvt3w2rewu"),
"paymentchannel": MustParseCid("bafk2bzacedzp56g5cg73oilloak3kf7u667rdkd5pgnhe2cljmr3o7ykcrzuk"),
"reward": MustParseCid("bafk2bzacebczbwfbbi6mvppbjcozatasjiaohvjjiqcy65ccuuyyw3xiixhk2"),
"storagemarket": MustParseCid("bafk2bzaceawqexy6t2ybzh3jjwhbs7icbg5vqnedbbge4e4r4pfp7spkcadsu"),
"storageminer": MustParseCid("bafk2bzacearemd7pn2jj26fdtqd4di27lfhpng3vp5chepm7qnmdzgiqr6wfi"),
"storagepower": MustParseCid("bafk2bzaceddc7fiaxfobfegqaobf5xinjgmhsa5iu4yi6klvc3jmjimcdvgyg"),
"system": MustParseCid("bafk2bzacedylltr57b2n6zpadh4i2c2kis4fzzvhao3kgvfaggrrbqyacew7q"),
"verifiedregistry": MustParseCid("bafk2bzacecjkesz766626ab4svnzpq3jfs26a75vfktlfaku5fjdao2eyiqyq"),
},
}, {
Network: "butterflynet",
Version: 10,
ManifestCid: MustParseCid("bafy2bzacedsgi3wpyd46hbktrleolnlepzsm6k466fcrxuc7keht4guokgxiy"),
ManifestCid: MustParseCid("bafy2bzacecicijumaz6c5vpqwidz3kmfkn64wp76odwfo6ekvzjbx4gizrara"),
Actors: map[string]cid.Cid{
"account": MustParseCid("bafk2bzacebz7dm3vcuqtzzcf5jwvcubz6ecqk52t5rsd36fyzka2iosy4l4ro"),
"cron": MustParseCid("bafk2bzacea6qtj2wkbe2wq5vxc2knlnj3vdvk4bkjp36xtazgzhnegd2uaj7m"),
"datacap": MustParseCid("bafk2bzacedwxkx3jz7qwv5iwozadz7t5hhw5dtlgdxuwqxdp6oqguas7nakjk"),
"eam": MustParseCid("bafk2bzacedoegh4idwvhjqahfnbqq6aqzgccgjwumudx6ihfut36ng57or7fi"),
"ethaccount": MustParseCid("bafk2bzacebn6l3x7d2i6lv72osbgcl4a37imexh5ou5kvbmj56taetwcyyhgq"),
"evm": MustParseCid("bafk2bzaced5gaxg5mz3hho473aszx5brgjriicqgrcbqctnyyn2e6vcxv3ule"),
"init": MustParseCid("bafk2bzacecbo6ggprh7sz3oy6uu5raykwngqmnjdsiijdrgp4glet3mb65ywo"),
"multisig": MustParseCid("bafk2bzacecmu3bhbg4rh5sqbagjlvrpb6ip5k3pngq22a33ok44yuhk75zenq"),
"paymentchannel": MustParseCid("bafk2bzacebth7fqe5xts6hbm7m6n733qcu6b6atd7ur6l7jhddferjgpxdy4s"),
"account": MustParseCid("bafk2bzacedknkusm7lnhjpfe7djkxu6kwlqclsq7yk3s7h2wqtet2teul7hla"),
"cron": MustParseCid("bafk2bzacecvf4au52ks3btpfedsffhzkjvtogawsmpypjo4ddolszmszj62om"),
"datacap": MustParseCid("bafk2bzacecrgz4pzuonchcpbugavlmdrsakmz2qsjlpbt22yxum5r33tqkrls"),
"eam": MustParseCid("bafk2bzacecb4i45ifsj3kyeoglherbtc4dc37qrfa7meq37qtpio5gr6jcely"),
"ethaccount": MustParseCid("bafk2bzacec4l6ya2bate7r3yv7sutfhp4fmtcoxun36d4ltfdslczdgms2sx2"),
"evm": MustParseCid("bafk2bzacecicn2uu4wkdy23tifrevyferwfirqm2sipmmj3ctxfp3xrqntcvs"),
"init": MustParseCid("bafk2bzaceagvocld6zunqwrky2czyaao2azwbpwq7jcjv3fab5lmgbhxst5mi"),
"multisig": MustParseCid("bafk2bzaceaj27lzwb4le2rnpnughce45msvv2ezjmqiqpeazpgbzqq75jdudq"),
"paymentchannel": MustParseCid("bafk2bzaceaazgcdtp4jwezulxpuzjz76st3lumudwdvwbb5t6xzpssku5i6ha"),
"placeholder": MustParseCid("bafk2bzacedfvut2myeleyq67fljcrw4kkmn5pb5dpyozovj7jpoez5irnc3ro"),
"reward": MustParseCid("bafk2bzaceds7hy7v77k2jsbkfob7b2qor6v5s2oancfxhkuuzwqqg6kxk27xe"),
"storagemarket": MustParseCid("bafk2bzacebqi6ylwfmack3hfzw6eej7r6gwlbxzo33tdkfkpof7wg7h54pjtw"),
"storageminer": MustParseCid("bafk2bzacedsxpkqqiycn5tjydycnlqer4544mpqvtwfamwyq6hwz7yjqd3iry"),
"storagepower": MustParseCid("bafk2bzacedssirrse7ufxti6capgf2qufb6y3oatv2fnnnh7xrgp47x3hfox4"),
"system": MustParseCid("bafk2bzacea2lod7lxod72voxyik5btpzmpvduddr4hwshcsyyy257izh6kut4"),
"verifiedregistry": MustParseCid("bafk2bzacebss7ol4ay6nkg7r3c2355aqpku4yvqipyh3sgdrxkhsrssrsaaig"),
"reward": MustParseCid("bafk2bzacebvqwn475gljvwlklfnmebunhsc6lj2vyr6s5qr4jehzx5de2wils"),
"storagemarket": MustParseCid("bafk2bzaceberatlfjmzke7gd3hlisvhvkduu4fbsbqymt3nyybszd34vbul32"),
"storageminer": MustParseCid("bafk2bzacedjhhhx32aec25jewhk7qhxjhsjzapi3nc2mrqbdls43hj77r3zc2"),
"storagepower": MustParseCid("bafk2bzacedhl3j7b5dzbtu772y3shmdijsiqqv36j5u2jmvb53job6curj7sk"),
"system": MustParseCid("bafk2bzaceakoq47k4ro3x4f7wd46yk6n33g2vuiiwbps5o2e5qhkhraxgvf5c"),
"verifiedregistry": MustParseCid("bafk2bzaced2fw523rkzw5rsca7a3v7isjgqyifpwxbs5dzdz5nipwes6cjdjk"),
},
}, {
Network: "calibrationnet",
@ -110,24 +106,24 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet
}, {
Network: "calibrationnet",
Version: 10,
ManifestCid: MustParseCid("bafy2bzacec4ilfymf3sorrfxp67ruwbax3a4mbqzic63vy2xlfh3ulky3bxvs"),
ManifestCid: MustParseCid("bafy2bzaceafl4uxyttmhccmv3246hzxu6yknal4f7ugsbpcu46kvkf6mvfvri"),
Actors: map[string]cid.Cid{
"account": MustParseCid("bafk2bzacecupizfd6xbts7blvn3ozouy3f2gtehwl7qohjks54nsomtzs3aki"),
"cron": MustParseCid("bafk2bzacedry7eqweymdnybq5jm5slizm67v4ffhv7zqiw2jwevr7ijv25gjc"),
"datacap": MustParseCid("bafk2bzacebq6vigteuwchk7si6y45ogrfu2zpxjbo4a54btnbhp3rc3ifghx6"),
"eam": MustParseCid("bafk2bzacebounosssmuaz35xpyuupvijbcwqyaumbeztqmigbihfw2ysbnx4w"),
"ethaccount": MustParseCid("bafk2bzacebi2ymbi5wo2o3rp2x6cqo55vroixngmpbdcs7el4rq4hvacyzsqy"),
"evm": MustParseCid("bafk2bzaceapklwjzdzkmnfprn5wsjdzjnueuw2ke4kixq46gnbwjncns4dleu"),
"init": MustParseCid("bafk2bzaced7u4zpkxh5ecjo2emwsrk3vnickhmkxy22garqf766nbxcewymy6"),
"multisig": MustParseCid("bafk2bzacedlunqzd3mxslb7zej5fsti2jxredfhtcqqxepng67t4zfiv6lwlc"),
"paymentchannel": MustParseCid("bafk2bzacea4z2yi33rfiiutkmqko33fslikmeqgypkiam5cqpeylyp3oup552"),
"account": MustParseCid("bafk2bzaced5aa6fukm56jrjbhh5sewj2kv5mejrkjhsbx26b4xmg7x42cbkus"),
"cron": MustParseCid("bafk2bzaceautoih7urvvrubgktnmq4oqlsfqyk5mwatkj5dn42d7v7wn4hbi2"),
"datacap": MustParseCid("bafk2bzacectwanemh5tn7ojovprhag6ikvdfs4evzu2tdyg4tx6nr4qdnsyra"),
"eam": MustParseCid("bafk2bzacecxllkzu2hjcqs2br7xq7iplp4ol7ae6k4pxlwy4lzrj2b6dwaucq"),
"ethaccount": MustParseCid("bafk2bzacechpkotxlk342wp5xkpzgcz46me5nm7gdr2krfbf7zkmrgom6j4oq"),
"evm": MustParseCid("bafk2bzacedsaquz6rsixcl4bs4tdemfsxdy6rvv5klwodaetjn7iozwpkqxqa"),
"init": MustParseCid("bafk2bzaceadfoajypcb3ocklgbu6qzad2tpvrz6yrdu7kofd6wq2vssvpqnda"),
"multisig": MustParseCid("bafk2bzacecy7yahpaunojdmaxd2lposejij3sg7orn6du7zqfyuecya3uoije"),
"paymentchannel": MustParseCid("bafk2bzacebxgoj2ql5eft4sbccnj6l3ubm5qagvjmegh2atk5wrjw4xsoqy6e"),
"placeholder": MustParseCid("bafk2bzacedfvut2myeleyq67fljcrw4kkmn5pb5dpyozovj7jpoez5irnc3ro"),
"reward": MustParseCid("bafk2bzacea4dnvun5vwzunhgepejrknukx2di2kmo3x4akz6rollq5icsrl3m"),
"storagemarket": MustParseCid("bafk2bzaceafoon3fsl756rbrih4upar3ayi6746gaj756bk56thncpotl4coa"),
"storageminer": MustParseCid("bafk2bzacea3dj37h74ue2jtief3bj2shxagigygcm2h6purgp42mr6swwfdiw"),
"storagepower": MustParseCid("bafk2bzacebmodckd4tustgfmeilcfi3ovd4wzxz2hnd6vyhkq7hgiojiy3cc6"),
"system": MustParseCid("bafk2bzacebpqirxha42noejsk5miv5kip44eay6lm63pxt26xhlwdmn7tnqaq"),
"verifiedregistry": MustParseCid("bafk2bzaceczf7qrddwt5kh3gvro25wpls346tanffeatk7nsczjnwb7jtd454"),
"reward": MustParseCid("bafk2bzaceac5aeqc7honlhs7do6n37ps56ljgx3gnoalmkz4rfy2as6nmonfu"),
"storagemarket": MustParseCid("bafk2bzacedsorzdsgjblcm7iexzxxcx5u3pqyxefn544klyv4gk357kp5fvb4"),
"storageminer": MustParseCid("bafk2bzacedvaorqhrkr3mootp4ltgzebphpqqyyj5wcyylq5dnlupxeyydagm"),
"storagepower": MustParseCid("bafk2bzacecz2u6772repwsr6x6tbbm2z4bdy4uxxlvwm6r6ggfgox6sp2buiu"),
"system": MustParseCid("bafk2bzaceafo3uoxhi6nebe3nygkmiq532cvt2iq4ikcxnioi5fqnrthnpi2q"),
"verifiedregistry": MustParseCid("bafk2bzacecw3t525evmi4g27wgqr6bowz7jgkzflr6haosej5aa3mide63edk"),
},
}, {
Network: "caterpillarnet",
@ -176,24 +172,24 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet
}, {
Network: "caterpillarnet",
Version: 10,
ManifestCid: MustParseCid("bafy2bzacec36gpvghhgjwa5ya3ocxg33pct2vddegeixgkpqsc6eiyajdjkii"),
ManifestCid: MustParseCid("bafy2bzaceajatwdn4jlfiweb2cuwqtnrdwdxlju2vvejlqsytocnc76xnwm2g"),
Actors: map[string]cid.Cid{
"account": MustParseCid("bafk2bzacebcl3xlk7i6t5tau2rfgxft5pu6qzvjqxo6zs5guerz3xarxztyv6"),
"cron": MustParseCid("bafk2bzacebhoqjvaxtzj3k4tz7c4vtt4or4u3h3jhwxlh3t4l6by2ota3s7by"),
"datacap": MustParseCid("bafk2bzaceb7ttn3d43yb7l5ok5rjgr7325jb6ds4air7mivgoyzp5p4gwgrq4"),
"eam": MustParseCid("bafk2bzacebobuasaev75fge6xg6bekrdvnyox4h7iluupt4wqq2n4expha2oe"),
"ethaccount": MustParseCid("bafk2bzaceaghtv45mm6qx3yrxwy7zz7x7mqj4n4lzw4hx7zxzlij6dcxxuv4c"),
"evm": MustParseCid("bafk2bzacecu7xpnpw27jquvnpfv4rseaal477ml4ouxy37eo7wymgfzkexllg"),
"init": MustParseCid("bafk2bzacea2rnkho4nliqvisiqgtqx66c4xneagpgj52tyqa64grxadggylbk"),
"multisig": MustParseCid("bafk2bzacebak6spthfa23cyqjmpgkgku4gg4egdn2zc6vkikbh5ongadzakma"),
"paymentchannel": MustParseCid("bafk2bzaceb3tib72pwze2rov72ldwlfv3otes3tejgnfpbrzahwb5xi7slhqm"),
"account": MustParseCid("bafk2bzacedqtev5u55huwir5pustw5ixxjzemaq67idea73mhfxb655vn6fba"),
"cron": MustParseCid("bafk2bzacec5f4javbqxjkt5lewqxs5j2it4xbwxqpcm4u5bdo6hhaibpiwad4"),
"datacap": MustParseCid("bafk2bzacec4mswfkqkvuoebimktkb3hnpl4dzclkdqyi5h7skzpl3dm73hwak"),
"eam": MustParseCid("bafk2bzacebqion6rzshb3vou32ohpat4gd2lkrihwswsthtkh3wt3ucvno3z4"),
"ethaccount": MustParseCid("bafk2bzacebnmviobduaxspr5xmmszmibs6fikdjzyxpszweooxxjxez47tr7e"),
"evm": MustParseCid("bafk2bzacebxwy5ktfrhtikwnoklcuvp4znxyh7kf2c6emdedqjtlqqnupfuqc"),
"init": MustParseCid("bafk2bzaceb37ao4tett62uxjklsaewcvauysu5he6flpk74fpfyhs4j4nlmhw"),
"multisig": MustParseCid("bafk2bzacebx6sasdjd5frk75cwcfng752f7hfdllvb5isc37zjzlsgnh2e5lq"),
"paymentchannel": MustParseCid("bafk2bzacediht5lgorndb77tr4ll2qpzziokzyuztunttod73gq6vc4fn7vrc"),
"placeholder": MustParseCid("bafk2bzacedfvut2myeleyq67fljcrw4kkmn5pb5dpyozovj7jpoez5irnc3ro"),
"reward": MustParseCid("bafk2bzaceak3n3orgdraub4bqiy3paio77hu4laaqv4vf7wmwv4ybl5ahgi5o"),
"storagemarket": MustParseCid("bafk2bzacearo7sog7yqbrwyws5o3lbsdsjf2cp5vsoxc4u3s5atgjtwzzh65s"),
"storageminer": MustParseCid("bafk2bzacecrzmjrbqjwknnkybdexspb6gfu4q6dvtaeguxl26yuytsjc3w7ws"),
"storagepower": MustParseCid("bafk2bzaceavlmlu4mt2u7xwnnzf6vwdmh2yo76aauujwlgsbfhafjgxb4zgtg"),
"system": MustParseCid("bafk2bzacec35rgzpiaa4n3r5bzgssk33bhfgozjvgunbwax32dooqqokfe6ag"),
"verifiedregistry": MustParseCid("bafk2bzacebjfkrzihgzlb2jecgm5seoqwf5e656zc22vjoyclioru6vdy2bnm"),
"reward": MustParseCid("bafk2bzacebagt36uxbahizev4pelp4v57duuerqu43ejgi7i2vvofyfpkicre"),
"storagemarket": MustParseCid("bafk2bzaced5fv3zrg4iedwj2vrfzobwyyuecyb6p463pbvz7deqmpftyqpbuc"),
"storageminer": MustParseCid("bafk2bzacebs7w7oy4ef3v6em7w3pqb2ywd44eqkyqm53hqtwhatniblmoiio6"),
"storagepower": MustParseCid("bafk2bzacecbp4h5o3562myp4j7gzznc2txpdijams55kk3ctjat3hfwd64mwy"),
"system": MustParseCid("bafk2bzacea447pmvgz63rvfv3ktxf5pmi5ujq2xf4ognmoe3o7wvn6sq3cs3o"),
"verifiedregistry": MustParseCid("bafk2bzacednk3yfr7kgqfcy3mlowaoaocdcdfc6pv76akiagkircgyesiw7zs"),
},
}, {
Network: "devnet",
@ -233,24 +229,24 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet
}, {
Network: "devnet",
Version: 10,
ManifestCid: MustParseCid("bafy2bzacebemt6rdgtsj5vhv2iimbdvm5g4xllgl7nugxvuuthsedncmfakww"),
ManifestCid: MustParseCid("bafy2bzacedwfwgngpn52a7zzqfun37dl6brh4ue6d7y3kcs5gsz5hzbppo7ic"),
Actors: map[string]cid.Cid{
"account": MustParseCid("bafk2bzaceajmds6zbz235lbjjhv3mxc6x3kqudjkxedh5xqvlemh3f6xslz76"),
"cron": MustParseCid("bafk2bzaceabbv5ej2yd3n7txl3s4pahknb4in5dok57hzwfheqnk6k67zegbk"),
"datacap": MustParseCid("bafk2bzaceayzgq7qpuc5pr4lrh6k3xnvmirlmutffplmgur4pvcaynpxlkph6"),
"eam": MustParseCid("bafk2bzacecrand7mp7q3jm3u5dpqm4o24ki3pk3uzcw4zonjcowq4rxwptsis"),
"ethaccount": MustParseCid("bafk2bzacecpwfxpvqiyiisbfw45v5ottcstxu2vifji3xswxt3jzk4vcrs4g4"),
"evm": MustParseCid("bafk2bzaceajrtntc5urxkwbzdu3khi2eqvarnfx6vh7luqt33gn6z4a4kjkj6"),
"init": MustParseCid("bafk2bzaced6npj5zrjb3lxhgtsq4st66dvde56nftbvchmpid3rcazfvnqkpk"),
"multisig": MustParseCid("bafk2bzacealhbd4slci4o76dpdurkkk3q5busopediwfh7uis4hfh7tzghzni"),
"paymentchannel": MustParseCid("bafk2bzacebvpkvrihus53sdyutsjsbpfefe5gd2amfb6zkztdfp6g2m4ubqrk"),
"account": MustParseCid("bafk2bzacebyyteba37hzusnw6nek4cc2t3tripnpmaqcjyan4jlrosxml4us2"),
"cron": MustParseCid("bafk2bzaceddvv6uvff77qqwar76dhhzgdthsgrt66wy47a4axq2isfsu3isqa"),
"datacap": MustParseCid("bafk2bzaceapgpfwhtarq323r7ccvb2jc4yedgtdjnn5w3jgr75ayh3ctqdilk"),
"eam": MustParseCid("bafk2bzacealsu5v4552tqzwefu6htk43oixucyviwpam2can57tthwzea2erm"),
"ethaccount": MustParseCid("bafk2bzaceasdkzg5t6joexhuqiigagueb4fwkyczod5h4ipabkl5he5p6pss2"),
"evm": MustParseCid("bafk2bzacec2rienkocd7d52htiutyy26zszk5zzu47iqev3v2yca5peqgtcoc"),
"init": MustParseCid("bafk2bzacedq4e2x3zbopkxgvsryrc2lakqac6dhelt6vjqvoxqghzwmhhen2o"),
"multisig": MustParseCid("bafk2bzaceaeqphqg7jeudjwiveugre5spemixlwnvvdywdnd4hv5spj2of4is"),
"paymentchannel": MustParseCid("bafk2bzaceaey7zxzfsallib7bdinlnbysivlithvogz2nmyd2qnxcsbwfolgq"),
"placeholder": MustParseCid("bafk2bzacedfvut2myeleyq67fljcrw4kkmn5pb5dpyozovj7jpoez5irnc3ro"),
"reward": MustParseCid("bafk2bzaceaftaidppnno2dzhpxl5vyti5mcmdhvheieanwvptgacuj5ozzloe"),
"storagemarket": MustParseCid("bafk2bzacea75td2k2cdwc2o4kotdods2thomhcoqg5rf62ty6gkuxojknziae"),
"storageminer": MustParseCid("bafk2bzaceapj5q7egywl3zovwcm4hpbvr4vjtoshj57ncqg3srzseweyclvug"),
"storagepower": MustParseCid("bafk2bzacebbraebsoin6hhmr4na56st4gyg7yd7p2ry2igegnvws7deq32hec"),
"system": MustParseCid("bafk2bzacedtw3mq5zyxxbnybnjegqyrz3ufiboeoipyzynlk6zgyumvl3267g"),
"verifiedregistry": MustParseCid("bafk2bzacecaqciqoky2z7win5rkzd3gkgpa3345adjyiidmg4swmw5celeb3a"),
"reward": MustParseCid("bafk2bzacec7n2iijqcrar6ztbue7sqexvuwwsif6svmzx4qfehppyom4ftyju"),
"storagemarket": MustParseCid("bafk2bzacedmyiyvcbm2zepqib5lrjxzutcc533wbkwfmcwrb5pcjsn7ucsqww"),
"storageminer": MustParseCid("bafk2bzaceai3i4ilksmjc5wmtb2hkrylrn3kfkmcyzp77vn36gc76yqor3h2i"),
"storagepower": MustParseCid("bafk2bzaceccwx5vmarswywl3spmbqfkuw4672ilsv4pyi3ytvz5vrap4ktsyk"),
"system": MustParseCid("bafk2bzacecacjaj6bgwxtywl7leqxusrcwidm6fyfibqanqgli7ueupdbib5c"),
"verifiedregistry": MustParseCid("bafk2bzacedspjal4tdnzfrn6qi4vpsikdhoeqokaizffj6lsru4kap5woyurm"),
},
}, {
Network: "hyperspace",
@ -274,28 +270,6 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet
"system": MustParseCid("bafk2bzacedo2hfopt6gy52goj7fot5qwzhtnysmgo7h25crq4clpugkerjabk"),
"verifiedregistry": MustParseCid("bafk2bzacea7rfkjrixaidksnmjehglmavyt56nyeu3sfxu2e3dcpf62oab6tw"),
},
}, {
Network: "hyperspace",
Version: 9,
ManifestCid: MustParseCid("bafy2bzacedvffumcvf72f2btjqvece3kpcdorxq5tq76iwcmqbzvsiu526cqm"),
Actors: map[string]cid.Cid{
"account": MustParseCid("bafk2bzacecim7uybic2qprbkjhowg7qkniv4zywj5h5g4u4ss72urco2akzuo"),
"cron": MustParseCid("bafk2bzaceahgq64awp4f7li3hdgimc4upqvdvltpmeywckvens33umcxt424a"),
"datacap": MustParseCid("bafk2bzacebkxn52ttooaslkwncijk3bgd3tm2zw7vijdhwvg2cxnxbrzmmq5e"),
"eam": MustParseCid("bafk2bzaceczhgub5anrnaf7ol65mu54gsgwcj6c6m3yhet7rhxm2l6kz4s4ru"),
"ethaccount": MustParseCid("bafk2bzacealn5enbxyxbfs7gbsjbyma2zk3bcr7okvflxhpr753d4eh6ixooa"),
"evm": MustParseCid("bafk2bzacedljkrmazyewawpnddrkzrt55556374dw2pm2hokgkompgzw4vx5y"),
"init": MustParseCid("bafk2bzacec55gyyaqjrw7zughywocgwcjvv6k5fijjpjw4xgckuqz6pjtff5a"),
"multisig": MustParseCid("bafk2bzaceblozbdzybdivvjdiid4jwm2jc6x5a66sunh2vvwsqba6wzqmr7i6"),
"paymentchannel": MustParseCid("bafk2bzacealcyke5a6n24efs6qe4iikynpk2twqssyugy7jcyf6p6shgw2iwa"),
"placeholder": MustParseCid("bafk2bzaceaamp2a35vpfml4skap4dffklzae2urcm34mtwwce2lvhaons3a5y"),
"reward": MustParseCid("bafk2bzacebafzaqhwsm3nmsfwcd6ngvx6ev6zlcpyfljqh4kb77vok6opban6"),
"storagemarket": MustParseCid("bafk2bzacecrjfg4p7fxznsdkoobs4po2ve3ywixrirrk6netgxh63qqaefamg"),
"storageminer": MustParseCid("bafk2bzaceb3ctd4atxwhdkmlg4i63zxo5aopknlj7l5kaiqr22xpcmico6vg4"),
"storagepower": MustParseCid("bafk2bzacecvcix3ugopvby2vah5wwiu5cqjedwzwkanmr34kdoc4f3o6p7nsq"),
"system": MustParseCid("bafk2bzacedo2hfopt6gy52goj7fot5qwzhtnysmgo7h25crq4clpugkerjabk"),
"verifiedregistry": MustParseCid("bafk2bzacea7rfkjrixaidksnmjehglmavyt56nyeu3sfxu2e3dcpf62oab6tw"),
},
}, {
Network: "mainnet",
Version: 8,
@ -334,24 +308,24 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet
}, {
Network: "mainnet",
Version: 10,
ManifestCid: MustParseCid("bafy2bzacec2ggeabyyl2cjaqmcpnyvjirrrm6bfc7d73q4pekm27hybzdqs3q"),
ManifestCid: MustParseCid("bafy2bzaceanax3ruj24in364mbozrpmcyn7jf2vrxshppsgufwxemvzf6fp26"),
Actors: map[string]cid.Cid{
"account": MustParseCid("bafk2bzacebdlwwnd57vd2444wrfe5amtf2f6htqj3hdh4fxblywdbynrurhgy"),
"cron": MustParseCid("bafk2bzacecxmaxh272zhgmayfg7btvq5lshv2cd7njkarlbbikba4otiaboyg"),
"datacap": MustParseCid("bafk2bzaceb64wicovvrjzaotvs64hmdtvolw4l6qanwp5tk56okzqbfttxck2"),
"eam": MustParseCid("bafk2bzacedxs56zywfumzcv7i5fwluku2qevg54cuiuwi5d3pavf3rilfu33g"),
"ethaccount": MustParseCid("bafk2bzacecepsmgsucfebvbwf5vebm7j6zeqaz3ub52warxqobqeymh5vdjik"),
"evm": MustParseCid("bafk2bzacecf6arqbso67nmrhcsjvyradrbbv7hs2noand27fyr4nfilms4znu"),
"init": MustParseCid("bafk2bzaceat2xcem5lko5ot4mmrowtm6ehx5klw7c4ss4vxma55tyfvvxwlge"),
"multisig": MustParseCid("bafk2bzacebz43omxi5vtkidhsxroqtgkpxtftdj6poew3744fayfftgdebe4y"),
"paymentchannel": MustParseCid("bafk2bzaceds4ob3ev2ie2vorhfomddd44otqfau4d4eogfofjjbjjx2h27nh2"),
"account": MustParseCid("bafk2bzacedw7633eh64r7azo5eihahnnshqs6ahfbovqfxijscpirfksw6gfe"),
"cron": MustParseCid("bafk2bzacebka3yrzfzotza5q22weufktf5azw2ew7ui5eeigxqbkzzp4ndkf2"),
"datacap": MustParseCid("bafk2bzaceawihbc7ovxq5ifj2op67u26lakybo63kgl57vyipn5rkfi4rppfq"),
"eam": MustParseCid("bafk2bzacedtzbyjyqvtvbx245uuvf4rndnbyxttavwnfo4l72oxpjiiyldh6a"),
"ethaccount": MustParseCid("bafk2bzaceapcifcyvqnbuqq2zgf4kqoypl2xj4mfqefzfp6upevmqygxayfb4"),
"evm": MustParseCid("bafk2bzaced36v7kakhej6m6jailrnojjtkqxf3ybfw4pttasxtzzczxi5fkks"),
"init": MustParseCid("bafk2bzacebqi3szlok75xn7hhtmtmnvoekwdkuhakhr4dpuxmfxvpcrhr2cog"),
"multisig": MustParseCid("bafk2bzacebsc6qdm5772h7aa6bdf3ujerpihc6cdb2zpqz4sldktk423asq2c"),
"paymentchannel": MustParseCid("bafk2bzacebxuh4n66s6vclyp73k4ee2fdxrnjouozqcf3huprobjdk6sf73g6"),
"placeholder": MustParseCid("bafk2bzacedfvut2myeleyq67fljcrw4kkmn5pb5dpyozovj7jpoez5irnc3ro"),
"reward": MustParseCid("bafk2bzaced7xvqx7n6426lls4ao54exn63pv73m7makxf7ygb575roqxhjuuw"),
"storagemarket": MustParseCid("bafk2bzaceb5piewkvdj4ee6b4qzhimixjzee5z3hsuwdjksncpvef7sgaw6rw"),
"storageminer": MustParseCid("bafk2bzaceacukfushmnsqtdvtdyx2in6o2el7jq46qo7iaxgwytel4oz5srv4"),
"storagepower": MustParseCid("bafk2bzacedi6z45jcms5guns4qxi6rs2e2prc6mpnhkr4klljrra3ayfburss"),
"system": MustParseCid("bafk2bzacedy7ssu2hez3nu7bi4j6ucojty4sfaublxlxhfd3tkgzyrm5sdxbq"),
"verifiedregistry": MustParseCid("bafk2bzacecjgudirfyzyroq3xhf2bldl636w7prexcvo7v3xqdijzcom4rgry"),
"reward": MustParseCid("bafk2bzacebwlo5udozvs7v4wbtwjtg7jdyw5g6kjws4uqfpwsqhvn6d5u6rr6"),
"storagemarket": MustParseCid("bafk2bzacebbzaj2m3hhtnpk3fz67vudb7yfyquscczksny5z2iiztp6qsbemu"),
"storageminer": MustParseCid("bafk2bzacebdb6kxpqnmiyvpgugoqtnshl362titnku6h6nmil7crodv7vjk6i"),
"storagepower": MustParseCid("bafk2bzacebqavpt7iqtcn5rlsi5cpk5l3ocrxcqcakk25hxf2zbffrzifec3w"),
"system": MustParseCid("bafk2bzacec3m3b6kktp43nrf5ow33yaehokvz2zzpa5qsrstoqwh3liv4eyba"),
"verifiedregistry": MustParseCid("bafk2bzacedufe6cnihk5anxwboprfsmbuy7nxo3peqfrdesxhgptoircbt7ca"),
},
}, {
Network: "testing",
@ -391,24 +365,24 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet
}, {
Network: "testing",
Version: 10,
ManifestCid: MustParseCid("bafy2bzacedhivj4zbumou6d3242p3ecqhlqfcjfskdv46uzjchlj3ve23xyoa"),
ManifestCid: MustParseCid("bafy2bzacecdqjm4vzjqna4kvhe6ngpyimlp3qp73gjlbr3ymjaz7udkqm5k64"),
Actors: map[string]cid.Cid{
"account": MustParseCid("bafk2bzacea3vbptmow72euwh2meu2sgwxrxjxg53qba6xxrknltr6j7bgnlhg"),
"cron": MustParseCid("bafk2bzaceclbrnwfgolv5icdknexv3oi3ujzpt5stqabiyshwhtvnijacysjg"),
"datacap": MustParseCid("bafk2bzacebt2gym3ot447unemieakxfep3u2m2zxiqlssbacu3ifsyhtulz4m"),
"eam": MustParseCid("bafk2bzacedmnvhfvt7qc5w3mfr54ikrpwox54ddkxkxp5qka24xudj4vkggjs"),
"ethaccount": MustParseCid("bafk2bzacebnh3oadihryhwgo73ooesgk3x2eg4g5gorps463iirilm5ur4q7w"),
"evm": MustParseCid("bafk2bzacecw2i5bsjymtdblvxh5xte3htff4przqaek673cw5z7ommaptdmqq"),
"init": MustParseCid("bafk2bzacebo6n4pwpwayjsc7cbrmmjy6l6om3wzx5jdldni4wl47a4x4jeazo"),
"multisig": MustParseCid("bafk2bzacecl4mc5esjwfcoirhdeqhms4qquafam4ut424hj2mo3gqzb47n2rs"),
"paymentchannel": MustParseCid("bafk2bzacedsmvdirjuywbg5xz7r5u2pxew7ye4kpy2toksv5nba7dzkcsmu3i"),
"account": MustParseCid("bafk2bzacecfg6coqk3sn7m7g5b5akafe25qd2po4jhp5kmup4htw5iavtrca6"),
"cron": MustParseCid("bafk2bzaceblrexwzuiiqm5u77zx4xapruki3u2wzq3ca5kf72dkkv7xl3zr2a"),
"datacap": MustParseCid("bafk2bzacedbarmlig6u2tioxjqlvmlroz7pdxtqqjugtzdwg33gcsuv4zus7e"),
"eam": MustParseCid("bafk2bzacecnupv35lhealursu4osdtxjerbfqkdbugprnuctkwykmn4mlsob6"),
"ethaccount": MustParseCid("bafk2bzaceduxlxe2sasshmuvw2vzxzkkdg2e2iud6h5omcct2lszyh4xhayr2"),
"evm": MustParseCid("bafk2bzacebwhijcnwtjbyvs4czuxv6ldg3kjpv364ja3omofaacly67k4ri5k"),
"init": MustParseCid("bafk2bzaceckdouclxeccuduf42hx5draalc6iospmndsrey4mjywfv7owbdfa"),
"multisig": MustParseCid("bafk2bzacectozlgryut7dttrd6jx5uhhf5qda7tglgsoq2ccszcu34mgnpdsy"),
"paymentchannel": MustParseCid("bafk2bzacedpmrg2pseig5ollv4e6ymf7357enxflm3thsxbmz5if6anp6xpzw"),
"placeholder": MustParseCid("bafk2bzacedfvut2myeleyq67fljcrw4kkmn5pb5dpyozovj7jpoez5irnc3ro"),
"reward": MustParseCid("bafk2bzaceakq4np44ltnscgff7h3a6s6ao2d43vwx66tce5r57r2amw42pl5i"),
"storagemarket": MustParseCid("bafk2bzacebskzlyhvhrdheslyrez3p4sccr5t42xnqophnvj775roskwzoic4"),
"storageminer": MustParseCid("bafk2bzacecx2fs3ra4ydxvwq6oh73esqy2xjqhwsnfrdl5ctbg26zem77zy3u"),
"storagepower": MustParseCid("bafk2bzacedwfnzestwv7ylleeuk3fhp6jewc4ygw3fgodsciww7gw5ilt4ony"),
"system": MustParseCid("bafk2bzaceaql3e6266ixcbwcdmwuhod4tahhawlvhfkq4qzp7hnmkkybdf7zi"),
"verifiedregistry": MustParseCid("bafk2bzacecibid6xpyu64kaxk2mspouajnenxlh4jkny7d6l5ht3hxg67l32u"),
"reward": MustParseCid("bafk2bzacea6f7fxmfjy6bxo3jojgz7tsrmpag2pvz6yff3d4gs7jt5tr3f7ly"),
"storagemarket": MustParseCid("bafk2bzacedaopo7s23du2xosguopbjhip7zadzaquzeuhlniqgmuplsiamozq"),
"storageminer": MustParseCid("bafk2bzaceam2xfi3g7jjeby6zrauirm3cpbvfun4k2baftogckdgbrfvxsbus"),
"storagepower": MustParseCid("bafk2bzaceaeytro4ruhhhtyeatggxqpoxeqcjzg2qvutthkk4hl3wmz4xc66w"),
"system": MustParseCid("bafk2bzacedteuhprsuwcz5hqoomhy2ozyh5afmmcgughjfbak2mux3da3izvu"),
"verifiedregistry": MustParseCid("bafk2bzacedfmjez4jrix3sgpy3c3iuwemmsl446tfwwzmw7rag3imwomayzes"),
},
}, {
Network: "testing-fake-proofs",
@ -446,25 +420,26 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet
"verifiedregistry": MustParseCid("bafk2bzaceatmqip2o3ausbntvdhj7yemu6hb3b5yqv6hm42gylbbmz7geocpm"),
},
}, {
Network: "testing-fake-proofs",
Version: 10,
ManifestCid: MustParseCid("bafy2bzaceav36pezxhapk6vlgohdp6jiydk44o6xowltjnyhu3nrhpfcby5zs"),
Network: "testing-fake-proofs",
Version: 10,
BundleGitTag: "dev/20230114-pre-rc.2",
ManifestCid: MustParseCid("bafy2bzacedc2lel545tjyh66n4mrrpiomx557xeatmo2nzig3b3l22dnaxhbg"),
Actors: map[string]cid.Cid{
"account": MustParseCid("bafk2bzacea3vbptmow72euwh2meu2sgwxrxjxg53qba6xxrknltr6j7bgnlhg"),
"cron": MustParseCid("bafk2bzaceclbrnwfgolv5icdknexv3oi3ujzpt5stqabiyshwhtvnijacysjg"),
"datacap": MustParseCid("bafk2bzacebt2gym3ot447unemieakxfep3u2m2zxiqlssbacu3ifsyhtulz4m"),
"eam": MustParseCid("bafk2bzacedmnvhfvt7qc5w3mfr54ikrpwox54ddkxkxp5qka24xudj4vkggjs"),
"ethaccount": MustParseCid("bafk2bzacebnh3oadihryhwgo73ooesgk3x2eg4g5gorps463iirilm5ur4q7w"),
"evm": MustParseCid("bafk2bzacecw2i5bsjymtdblvxh5xte3htff4przqaek673cw5z7ommaptdmqq"),
"init": MustParseCid("bafk2bzacebo6n4pwpwayjsc7cbrmmjy6l6om3wzx5jdldni4wl47a4x4jeazo"),
"multisig": MustParseCid("bafk2bzacecl4mc5esjwfcoirhdeqhms4qquafam4ut424hj2mo3gqzb47n2rs"),
"paymentchannel": MustParseCid("bafk2bzacedsmvdirjuywbg5xz7r5u2pxew7ye4kpy2toksv5nba7dzkcsmu3i"),
"account": MustParseCid("bafk2bzacecfg6coqk3sn7m7g5b5akafe25qd2po4jhp5kmup4htw5iavtrca6"),
"cron": MustParseCid("bafk2bzaceblrexwzuiiqm5u77zx4xapruki3u2wzq3ca5kf72dkkv7xl3zr2a"),
"datacap": MustParseCid("bafk2bzacedbarmlig6u2tioxjqlvmlroz7pdxtqqjugtzdwg33gcsuv4zus7e"),
"eam": MustParseCid("bafk2bzacecnupv35lhealursu4osdtxjerbfqkdbugprnuctkwykmn4mlsob6"),
"ethaccount": MustParseCid("bafk2bzaceduxlxe2sasshmuvw2vzxzkkdg2e2iud6h5omcct2lszyh4xhayr2"),
"evm": MustParseCid("bafk2bzacebwhijcnwtjbyvs4czuxv6ldg3kjpv364ja3omofaacly67k4ri5k"),
"init": MustParseCid("bafk2bzaceckdouclxeccuduf42hx5draalc6iospmndsrey4mjywfv7owbdfa"),
"multisig": MustParseCid("bafk2bzacectozlgryut7dttrd6jx5uhhf5qda7tglgsoq2ccszcu34mgnpdsy"),
"paymentchannel": MustParseCid("bafk2bzacedpmrg2pseig5ollv4e6ymf7357enxflm3thsxbmz5if6anp6xpzw"),
"placeholder": MustParseCid("bafk2bzacedfvut2myeleyq67fljcrw4kkmn5pb5dpyozovj7jpoez5irnc3ro"),
"reward": MustParseCid("bafk2bzaceakq4np44ltnscgff7h3a6s6ao2d43vwx66tce5r57r2amw42pl5i"),
"storagemarket": MustParseCid("bafk2bzacebskzlyhvhrdheslyrez3p4sccr5t42xnqophnvj775roskwzoic4"),
"storageminer": MustParseCid("bafk2bzacebp3rj6d4g2ppngw2xp7okzqx6oapfk6xi54n3aqenadqvptlk45g"),
"storagepower": MustParseCid("bafk2bzacedhwtksxb6orm63doxx2bgcy6fpy5li5prjb3twsxdh75anjbmdug"),
"system": MustParseCid("bafk2bzaceaql3e6266ixcbwcdmwuhod4tahhawlvhfkq4qzp7hnmkkybdf7zi"),
"verifiedregistry": MustParseCid("bafk2bzacecibid6xpyu64kaxk2mspouajnenxlh4jkny7d6l5ht3hxg67l32u"),
"reward": MustParseCid("bafk2bzacea6f7fxmfjy6bxo3jojgz7tsrmpag2pvz6yff3d4gs7jt5tr3f7ly"),
"storagemarket": MustParseCid("bafk2bzacedaopo7s23du2xosguopbjhip7zadzaquzeuhlniqgmuplsiamozq"),
"storageminer": MustParseCid("bafk2bzacecweqgs7k452vertmz66hjz2ymrgdbn4ycduyho3znoqv56ay4xlw"),
"storagepower": MustParseCid("bafk2bzaceapnz6icrfdgjcr7d2rknak5wirxxbh7mmo7kfutacxys22xrapbe"),
"system": MustParseCid("bafk2bzacedteuhprsuwcz5hqoomhy2ozyh5afmmcgughjfbak2mux3da3izvu"),
"verifiedregistry": MustParseCid("bafk2bzacedfmjez4jrix3sgpy3c3iuwemmsl446tfwwzmw7rag3imwomayzes"),
},
}}

View File

@ -17,7 +17,13 @@ func TestEmbeddedMetadata(t *testing.T) {
metadata, err := build.ReadEmbeddedBuiltinActorsMetadata()
require.NoError(t, err)
require.Equal(t, metadata, build.EmbeddedBuiltinActorsMetadata)
for i, v1 := range metadata {
v2 := build.EmbeddedBuiltinActorsMetadata[i]
require.Equal(t, v1.Network, v2.Network)
require.Equal(t, v1.Version, v2.Version)
require.Equal(t, v1.ManifestCid, v2.ManifestCid)
require.Equal(t, v1.Actors, v2.Actors)
}
}
// Test that we're registering the manifest correctly.

Binary file not shown.

View File

@ -19,7 +19,7 @@ var DrandSchedule = map[abi.ChainEpoch]DrandEnum{
0: DrandMainnet,
}
const GenesisNetworkVersion = network.Version16
const GenesisNetworkVersion = network.Version17
var NetworkBundle = "butterflynet"
var BundleOverrides map[actorstypes.Version]string

View File

@ -49,4 +49,8 @@ type State interface {
Nonce() (uint64, error)
GetState() interface{}
GetBytecode() ([]byte, error)
GetBytecodeCID() (cid.Cid, error)
GetBytecodeHash() ([32]byte, error)
}

View File

@ -49,4 +49,8 @@ type State interface {
Nonce() (uint64, error)
GetState() interface{}
GetBytecode() ([]byte, error)
GetBytecodeCID() (cid.Cid, error)
GetBytecodeHash() ([32]byte, error)
}

View File

@ -21,12 +21,12 @@ func load{{.v}}(store adt.Store, root cid.Cid) (State, error) {
func make{{.v}}(store adt.Store, bytecode cid.Cid) (State, error) {
out := state{{.v}}{store: store}
s, err := evm{{.v}}.ConstructState(store, bytecode)
if err != nil {
return nil, err
}
s, err := evm{{.v}}.ConstructState(store, bytecode)
if err != nil {
return nil, err
}
out.State = *s
out.State = *s
return &out, nil
}
@ -43,3 +43,25 @@ func (s *state{{.v}}) Nonce() (uint64, error) {
func (s *state{{.v}}) GetState() interface{} {
return &s.State
}
func (s *state{{.v}}) GetBytecodeCID() (cid.Cid, error) {
return s.State.Bytecode, nil
}
func (s *state{{.v}}) GetBytecodeHash() ([32]byte, error) {
return s.State.BytecodeHash, nil
}
func (s *state{{.v}}) GetBytecode() ([]byte, error) {
bc, err := s.GetBytecodeCID()
if err != nil {
return nil, err
}
var byteCode abi.CborBytesTransparent
if err := s.store.Get(s.store.Context(), bc, &byteCode); err != nil {
return nil, err
}
return byteCode, nil
}

View File

@ -3,6 +3,7 @@ package evm
import (
"github.com/ipfs/go-cid"
"github.com/filecoin-project/go-state-types/abi"
evm10 "github.com/filecoin-project/go-state-types/builtin/v10/evm"
"github.com/filecoin-project/lotus/chain/actors/adt"
@ -43,3 +44,25 @@ func (s *state10) Nonce() (uint64, error) {
func (s *state10) GetState() interface{} {
return &s.State
}
func (s *state10) GetBytecodeCID() (cid.Cid, error) {
return s.State.Bytecode, nil
}
func (s *state10) GetBytecodeHash() ([32]byte, error) {
return s.State.BytecodeHash, nil
}
func (s *state10) GetBytecode() ([]byte, error) {
bc, err := s.GetBytecodeCID()
if err != nil {
return nil, err
}
var byteCode abi.CborBytesTransparent
if err := s.store.Get(s.store.Context(), bc, &byteCode); err != nil {
return nil, err
}
return byteCode, nil
}

View File

@ -105,18 +105,9 @@ func (f *EventFilter) CollectEvents(ctx context.Context, te *TipSetEvents, rever
continue
}
entries := make([]types.EventEntry, len(ev.Entries))
for i, entry := range ev.Entries {
entries[i] = types.EventEntry{
Flags: entry.Flags,
Key: entry.Key,
Value: entry.Value,
}
}
// event matches filter, so record it
cev := &CollectedEvent{
Entries: entries,
Entries: ev.Entries,
EmitterAddr: addr,
EventIdx: evIdx,
Reverted: revert,

View File

@ -287,6 +287,7 @@ func fakeEvent(emitter abi.ActorID, indexed []kv, unindexed []kv) *types.Event {
ev.Entries = append(ev.Entries, types.EventEntry{
Flags: 0x01,
Key: in.k,
Codec: cid.Raw,
Value: in.v,
})
}
@ -295,6 +296,7 @@ func fakeEvent(emitter abi.ActorID, indexed []kv, unindexed []kv) *types.Event {
ev.Entries = append(ev.Entries, types.EventEntry{
Flags: 0x00,
Key: in.k,
Codec: cid.Raw,
Value: in.v,
})
}

View File

@ -47,6 +47,7 @@ var ddls = []string{
indexed INTEGER NOT NULL,
flags BLOB NOT NULL,
key TEXT NOT NULL,
codec INTEGER,
value BLOB NOT NULL
)`,
@ -67,8 +68,8 @@ const (
VALUES(?, ?, ?, ?, ?, ?, ?, ?)`
insertEntry = `INSERT OR IGNORE INTO event_entry
(event_id, indexed, flags, key, value)
VALUES(?, ?, ?, ?, ?)`
(event_id, indexed, flags, key, codec, value)
VALUES(?, ?, ?, ?, ?, ?)`
)
type EventIndex struct {
@ -194,6 +195,7 @@ func (ei *EventIndex) CollectEvents(ctx context.Context, te *TipSetEvents, rever
isIndexedValue(entry.Flags), // indexed
[]byte{entry.Flags}, // flags
entry.Key, // key
entry.Codec, // codec
entry.Value, // value
)
if err != nil {
@ -251,7 +253,7 @@ func (ei *EventIndex) PrefillFilter(ctx context.Context, f *EventFilter) error {
subclauses := []string{}
for _, val := range vals {
subclauses = append(subclauses, fmt.Sprintf("%s.value=?", joinAlias))
values = append(values, trimLeadingZeros(val))
values = append(values, val)
}
clauses = append(clauses, "("+strings.Join(subclauses, " OR ")+")")
}
@ -270,6 +272,7 @@ func (ei *EventIndex) PrefillFilter(ctx context.Context, f *EventFilter) error {
event.reverted,
event_entry.flags,
event_entry.key,
event_entry.codec,
event_entry.value
FROM event JOIN event_entry ON event.id=event_entry.event_id`
@ -319,6 +322,7 @@ func (ei *EventIndex) PrefillFilter(ctx context.Context, f *EventFilter) error {
reverted bool
flags []byte
key string
codec uint64
value []byte
}
@ -334,6 +338,7 @@ func (ei *EventIndex) PrefillFilter(ctx context.Context, f *EventFilter) error {
&row.reverted,
&row.flags,
&row.key,
&row.codec,
&row.value,
); err != nil {
return xerrors.Errorf("read prefill row: %w", err)
@ -378,6 +383,7 @@ func (ei *EventIndex) PrefillFilter(ctx context.Context, f *EventFilter) error {
ce.Entries = append(ce.Entries, types.EventEntry{
Flags: row.flags[0],
Key: row.key,
Codec: row.codec,
Value: row.value,
})
@ -398,12 +404,3 @@ func (ei *EventIndex) PrefillFilter(ctx context.Context, f *EventFilter) error {
return nil
}
func trimLeadingZeros(b []byte) []byte {
for i := range b {
if b[i] != 0 {
return b[i:]
}
}
return []byte{}
}

View File

@ -1943,7 +1943,7 @@ func (t *Event) UnmarshalCBOR(r io.Reader) (err error) {
return nil
}
var lengthBufEventEntry = []byte{131}
var lengthBufEventEntry = []byte{132}
func (t *EventEntry) MarshalCBOR(w io.Writer) error {
if t == nil {
@ -1974,6 +1974,12 @@ func (t *EventEntry) MarshalCBOR(w io.Writer) error {
return err
}
// t.Codec (uint64) (uint64)
if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.Codec)); err != nil {
return err
}
// t.Value ([]uint8) (slice)
if len(t.Value) > cbg.ByteArrayMaxLen {
return xerrors.Errorf("Byte array in field t.Value was too long")
@ -2008,7 +2014,7 @@ func (t *EventEntry) UnmarshalCBOR(r io.Reader) (err error) {
return fmt.Errorf("cbor input should be of type array")
}
if extra != 3 {
if extra != 4 {
return fmt.Errorf("cbor input had wrong number of fields")
}
@ -2035,6 +2041,20 @@ func (t *EventEntry) UnmarshalCBOR(r io.Reader) (err error) {
t.Key = string(sval)
}
// t.Codec (uint64) (uint64)
{
maj, extra, err = cr.ReadHeader()
if err != nil {
return err
}
if maj != cbg.MajUnsignedInt {
return fmt.Errorf("wrong type for uint64 field")
}
t.Codec = uint64(extra)
}
// t.Value ([]uint8) (slice)
maj, extra, err = cr.ReadHeader()

View File

@ -155,8 +155,11 @@ type EthBlock struct {
Uncles []EthHash `json:"uncles"`
}
const EthBloomSize = 2048
var (
EmptyEthBloom = [256]byte{}
EmptyEthBloom = [EthBloomSize / 8]byte{}
FullEthBloom = [EthBloomSize / 8]byte{}
EmptyEthHash = EthHash{}
EmptyUncleHash = must.One(ParseEthHash("0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347")) // Keccak-256 of an RLP of an empty array
EmptyRootHash = must.One(ParseEthHash("0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421")) // Keccak-256 hash of the RLP of null
@ -164,6 +167,12 @@ var (
EmptyEthNonce = [8]byte{0, 0, 0, 0, 0, 0, 0, 0}
)
func init() {
for i := range FullEthBloom {
FullEthBloom[i] = 0xff
}
}
func NewEthBlock(hasTransactions bool) EthBlock {
b := EthBlock{
Sha3Uncles: EmptyUncleHash, // Sha3Uncles set to a hardcoded value which is used by some clients to determine if has no uncles.
@ -171,7 +180,7 @@ func NewEthBlock(hasTransactions bool) EthBlock {
TransactionsRoot: EmptyRootHash, // TransactionsRoot set to a hardcoded value which is used by some clients to determine if has no transactions.
ReceiptsRoot: EmptyEthHash,
Difficulty: EmptyEthInt,
LogsBloom: EmptyEthBloom[:],
LogsBloom: FullEthBloom[:],
Extradata: []byte{},
MixHash: EmptyEthHash,
Nonce: EmptyEthNonce,
@ -440,6 +449,17 @@ func EthHashFromTxBytes(b []byte) EthHash {
return ethHash
}
func EthBloomSet(f EthBytes, data []byte) {
hasher := sha3.NewLegacyKeccak256()
hasher.Write(data)
hash := hasher.Sum(nil)
for i := 0; i < 3; i++ {
n := binary.BigEndian.Uint16(hash[i*2:]) % EthBloomSize
f[(EthBloomSize/8)-(n/8)-1] |= 1 << (n % 8)
}
}
type EthFeeHistory struct {
OldestBlock EthUint64 `json:"oldestBlock"`
BaseFeePerGas []EthBigInt `json:"baseFeePerGas"`

View File

@ -30,7 +30,10 @@ type EventEntry struct {
// The key of this event entry
Key string
// Any DAG-CBOR encodeable type.
// The event value's codec
Codec uint64
// The event value
Value []byte
}

View File

@ -454,8 +454,9 @@ var chainBalanceStateCmd = &cli.Command{
Description: "Produces a csv file of all account balances from a given stateroot",
Flags: []cli.Flag{
&cli.StringFlag{
Name: "repo",
Value: "~/.lotus",
Name: "repo",
Value: "~/.lotus",
EnvVars: []string{"LOTUS_PATH"},
},
&cli.BoolFlag{
Name: "miner-info",
@ -677,8 +678,9 @@ var chainPledgeCmd = &cli.Command{
Description: "Calculate sector pledge numbers",
Flags: []cli.Flag{
&cli.StringFlag{
Name: "repo",
Value: "~/.lotus",
Name: "repo",
Value: "~/.lotus",
EnvVars: []string{"LOTUS_PATH"},
},
},
ArgsUsage: "[stateroot epoch]",

View File

@ -41,6 +41,11 @@ var datastoreListCmd = &cli.Command{
Name: "list",
Description: "list datastore keys",
Flags: []cli.Flag{
&cli.StringFlag{
Name: "repo",
Value: "~/.lotus",
EnvVars: []string{"LOTUS_PATH"},
},
&cli.StringFlag{
Name: "repo-type",
Usage: "node type (FullNode, StorageMiner, Worker, Wallet)",
@ -110,6 +115,11 @@ var datastoreGetCmd = &cli.Command{
Name: "get",
Description: "list datastore keys",
Flags: []cli.Flag{
&cli.StringFlag{
Name: "repo",
Value: "~/.lotus",
EnvVars: []string{"LOTUS_PATH"},
},
&cli.StringFlag{
Name: "repo-type",
Usage: "node type (FullNode, StorageMiner, Worker, Wallet)",
@ -123,7 +133,7 @@ var datastoreGetCmd = &cli.Command{
},
ArgsUsage: "[namespace key]",
Action: func(cctx *cli.Context) error {
logging.SetLogLevel("badger", "ERROR") // nolint:errcheck
_ = logging.SetLogLevel("badger", "ERROR")
r, err := repo.NewFS(cctx.String("repo"))
if err != nil {

View File

@ -24,8 +24,9 @@ var dealLabelCmd = &cli.Command{
Usage: "Scrape state to report on how many deals have non UTF-8 labels",
Flags: []cli.Flag{
&cli.StringFlag{
Name: "repo",
Value: "~/.lotus",
Name: "repo",
Value: "~/.lotus",
EnvVars: []string{"LOTUS_PATH"},
},
},
Action: func(cctx *cli.Context) error {

View File

@ -33,8 +33,9 @@ var diffMinerStates = &cli.Command{
ArgsUsage: "<stateCidA> <stateCidB>",
Flags: []cli.Flag{
&cli.StringFlag{
Name: "repo",
Value: "~/.lotus",
Name: "repo",
Value: "~/.lotus",
EnvVars: []string{"LOTUS_PATH"},
},
},
Action: func(cctx *cli.Context) error {

View File

@ -35,8 +35,9 @@ var exportCarCmd = &cli.Command{
Description: "Export a car from repo",
Flags: []cli.Flag{
&cli.StringFlag{
Name: "repo",
Value: "~/.lotus",
Name: "repo",
Value: "~/.lotus",
EnvVars: []string{"LOTUS_PATH"},
},
},
ArgsUsage: "[outfile] [root cid]",

View File

@ -42,8 +42,9 @@ var exportChainCmd = &cli.Command{
Description: "Export chain from repo (requires node to be offline)",
Flags: []cli.Flag{
&cli.StringFlag{
Name: "repo",
Value: "~/.lotus",
Name: "repo",
Value: "~/.lotus",
EnvVars: []string{"LOTUS_PATH"},
},
&cli.StringFlag{
Name: "tipset",
@ -146,8 +147,9 @@ var exportRawCmd = &cli.Command{
Description: "Export raw blocks from repo (requires node to be offline)",
Flags: []cli.Flag{
&cli.StringFlag{
Name: "repo",
Value: "~/.lotus",
Name: "repo",
Value: "~/.lotus",
EnvVars: []string{"LOTUS_PATH"},
},
&cli.StringFlag{
Name: "car-size",

View File

@ -58,12 +58,6 @@ var fip36PollCmd = &cli.Command{
Name: "fip36poll",
Usage: "Process the FIP0036 FilPoll result",
ArgsUsage: "[state root, votes]",
Flags: []cli.Flag{
&cli.StringFlag{
Name: "repo",
Value: "~/.lotus",
},
},
Subcommands: []*cli.Command{
finalResultCmd,
},
@ -75,8 +69,9 @@ var finalResultCmd = &cli.Command{
ArgsUsage: "[state root] [height] [votes json]",
Flags: []cli.Flag{
&cli.StringFlag{
Name: "repo",
Value: "~/.lotus",
Name: "repo",
Value: "~/.lotus",
EnvVars: []string{"LOTUS_PATH"},
},
},

View File

@ -42,8 +42,9 @@ var gasTraceCmd = &cli.Command{
ArgsUsage: "[migratedStateRootCid networkVersion messageCid]",
Flags: []cli.Flag{
&cli.StringFlag{
Name: "repo",
Value: "~/.lotus",
Name: "repo",
Value: "~/.lotus",
EnvVars: []string{"LOTUS_PATH"},
},
},
Action: func(cctx *cli.Context) error {
@ -146,8 +147,9 @@ var replayOfflineCmd = &cli.Command{
ArgsUsage: "[messageCid]",
Flags: []cli.Flag{
&cli.StringFlag{
Name: "repo",
Value: "~/.lotus",
Name: "repo",
Value: "~/.lotus",
EnvVars: []string{"LOTUS_PATH"},
},
&cli.Int64Flag{
Name: "lookback-limit",

View File

@ -19,6 +19,13 @@ import (
var importCarCmd = &cli.Command{
Name: "import-car",
Description: "Import a car file into node chain blockstore",
Flags: []cli.Flag{
&cli.StringFlag{
Name: "repo",
Value: "~/.lotus",
EnvVars: []string{"LOTUS_PATH"},
},
},
Action: func(cctx *cli.Context) error {
r, err := repo.NewFS(cctx.String("repo"))
if err != nil {
@ -96,6 +103,13 @@ var importCarCmd = &cli.Command{
var importObjectCmd = &cli.Command{
Name: "import-obj",
Usage: "import a raw ipld object into your datastore",
Flags: []cli.Flag{
&cli.StringFlag{
Name: "repo",
Value: "~/.lotus",
EnvVars: []string{"LOTUS_PATH"},
},
},
Action: func(cctx *cli.Context) error {
r, err := repo.NewFS(cctx.String("repo"))
if err != nil {

View File

@ -35,8 +35,9 @@ var invariantsCmd = &cli.Command{
ArgsUsage: "[StateRootCid, height]",
Flags: []cli.Flag{
&cli.StringFlag{
Name: "repo",
Value: "~/.lotus",
Name: "repo",
Value: "~/.lotus",
EnvVars: []string{"LOTUS_PATH"},
},
},
Action: func(cctx *cli.Context) error {

View File

@ -146,9 +146,14 @@ var keyinfoImportCmd = &cli.Command{
Examples
env LOTUS_PATH=/var/lib/lotus lotus-shed keyinfo import libp2p-host.keyinfo`,
Flags: []cli.Flag{
&cli.StringFlag{
Name: "repo",
Value: "~/.lotus",
EnvVars: []string{"LOTUS_PATH"},
},
},
Action: func(cctx *cli.Context) error {
flagRepo := cctx.String("repo")
var input io.Reader
if cctx.NArg() == 0 {
input = os.Stdin
@ -177,7 +182,7 @@ var keyinfoImportCmd = &cli.Command{
return err
}
fsrepo, err := repo.NewFS(flagRepo)
fsrepo, err := repo.NewFS(cctx.String("repo"))
if err != nil {
return err
}

View File

@ -1,7 +1,6 @@
package main
import (
"fmt"
"os"
logging "github.com/ipfs/go-log/v2"
@ -89,19 +88,6 @@ func main() {
Version: build.UserVersion(),
Commands: local,
Flags: []cli.Flag{
&cli.StringFlag{
Name: "repo",
EnvVars: []string{"LOTUS_PATH"},
Hidden: true,
Value: "~/.lotus", // TODO: Consider XDG_DATA_HOME
},
&cli.StringFlag{
Name: "miner-repo",
Aliases: []string{"storagerepo"},
EnvVars: []string{"LOTUS_MINER_PATH", "LOTUS_STORAGE_PATH"},
Value: "~/.lotusminer", // TODO: Consider XDG_DATA_HOME
Usage: fmt.Sprintf("Specify miner repo path. flag storagerepo and env LOTUS_STORAGE_PATH are DEPRECATION, will REMOVE SOON"),
},
&cli.StringFlag{
Name: "log-level",
Value: "info",

View File

@ -124,8 +124,9 @@ var marketExportDatastoreCmd = &cli.Command{
Description: "export markets datastore key/values to a file",
Flags: []cli.Flag{
&cli.StringFlag{
Name: "repo",
Usage: "path to the repo",
Name: "repo",
Value: "~/.lotus",
EnvVars: []string{"LOTUS_PATH"},
},
&cli.StringFlag{
Name: "backup-dir",
@ -241,8 +242,9 @@ var marketImportDatastoreCmd = &cli.Command{
Description: "import markets datastore key/values from a backup file",
Flags: []cli.Flag{
&cli.StringFlag{
Name: "repo",
Usage: "path to the repo",
Name: "repo",
Value: "~/.lotus",
EnvVars: []string{"LOTUS_PATH"},
},
&cli.StringFlag{
Name: "backup-path",

View File

@ -54,8 +54,9 @@ var migrationsCmd = &cli.Command{
ArgsUsage: "[new network version, block to look back from]",
Flags: []cli.Flag{
&cli.StringFlag{
Name: "repo",
Value: "~/.lotus",
Name: "repo",
Value: "~/.lotus",
EnvVars: []string{"LOTUS_PATH"},
},
&cli.BoolFlag{
Name: "skip-pre-migration",

View File

@ -26,10 +26,12 @@ import (
var minerPeeridCmd = &cli.Command{
Name: "miner-peerid",
Usage: "Scrape state to find a miner based on peerid", Flags: []cli.Flag{
Usage: "Scrape state to find a miner based on peerid",
Flags: []cli.Flag{
&cli.StringFlag{
Name: "repo",
Value: "~/.lotus",
Name: "repo",
Value: "~/.lotus",
EnvVars: []string{"LOTUS_PATH"},
},
},
Action: func(cctx *cli.Context) error {

View File

@ -28,10 +28,12 @@ import (
var minerTypesCmd = &cli.Command{
Name: "miner-types",
Usage: "Scrape state to report on how many miners of each WindowPoStProofType exist", Flags: []cli.Flag{
Usage: "Scrape state to report on how many miners of each WindowPoStProofType exist",
Flags: []cli.Flag{
&cli.StringFlag{
Name: "repo",
Value: "~/.lotus",
Name: "repo",
Value: "~/.lotus",
EnvVars: []string{"LOTUS_PATH"},
},
},
Action: func(cctx *cli.Context) error {

View File

@ -43,8 +43,9 @@ var multisigGetAllCmd = &cli.Command{
ArgsUsage: "[state root]",
Flags: []cli.Flag{
&cli.StringFlag{
Name: "repo",
Value: "~/.lotus",
Name: "repo",
Value: "~/.lotus",
EnvVars: []string{"LOTUS_PATH"},
},
},
Action: func(cctx *cli.Context) error {

View File

@ -17,12 +17,6 @@ import (
var noncefix = &cli.Command{
Name: "noncefix",
Flags: []cli.Flag{
&cli.StringFlag{
Name: "repo",
EnvVars: []string{"LOTUS_PATH"},
Hidden: true,
Value: "~/.lotus", // TODO: Consider XDG_DATA_HOME
},
&cli.Uint64Flag{
Name: "start",
},

View File

@ -86,8 +86,9 @@ var stateTreePruneCmd = &cli.Command{
Description: "Deletes old state root data from local chainstore",
Flags: []cli.Flag{
&cli.StringFlag{
Name: "repo",
Value: "~/.lotus",
Name: "repo",
Value: "~/.lotus",
EnvVars: []string{"LOTUS_PATH"},
},
&cli.Int64Flag{
Name: "keep-from-lookback",

View File

@ -39,8 +39,9 @@ var splitstoreRollbackCmd = &cli.Command{
Description: "rollbacks a splitstore installation",
Flags: []cli.Flag{
&cli.StringFlag{
Name: "repo",
Value: "~/.lotus",
Name: "repo",
Value: "~/.lotus",
EnvVars: []string{"LOTUS_PATH"},
},
&cli.BoolFlag{
Name: "gc-coldstore",
@ -129,8 +130,9 @@ var splitstoreClearCmd = &cli.Command{
Description: "clears a splitstore installation for restart from snapshot",
Flags: []cli.Flag{
&cli.StringFlag{
Name: "repo",
Value: "~/.lotus",
Name: "repo",
Value: "~/.lotus",
EnvVars: []string{"LOTUS_PATH"},
},
&cli.BoolFlag{
Name: "keys-only",

View File

@ -33,8 +33,9 @@ var terminationsCmd = &cli.Command{
ArgsUsage: "[block to look back from] [lookback period (epochs)]",
Flags: []cli.Flag{
&cli.StringFlag{
Name: "repo",
Value: "~/.lotus",
Name: "repo",
Value: "~/.lotus",
EnvVars: []string{"LOTUS_PATH"},
},
},
Action: func(cctx *cli.Context) error {

View File

@ -644,6 +644,7 @@ Response:
{
"Flags": 7,
"Key": "string value",
"Codec": 42,
"Value": "Ynl0ZSBhcnJheQ=="
}
]

2
extern/filecoin-ffi vendored

@ -1 +1 @@
Subproject commit 0c792ee1d1f062377033d7d37442d18f765be467
Subproject commit 32df7d1f15e46406c5efafb5de5c2c70ec34d685

View File

@ -20,6 +20,7 @@ var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMet
{{- range . }} {
Network: {{printf "%q" .Network}},
Version: {{.Version}},
{{if .BundleGitTag}} BundleGitTag: {{printf "%q" .BundleGitTag}}, {{end}}
ManifestCid: MustParseCid({{printf "%q" .ManifestCid}}),
Actors: map[string]cid.Cid {
{{- range $name, $cid := .Actors }}
@ -37,6 +38,12 @@ func main() {
panic(err)
}
if len(os.Args) > 1 {
for _, m := range metadata {
m.BundleGitTag = os.Args[1]
}
}
fi, err := os.Create("./build/builtin_actors_gen.go")
if err != nil {
panic(err)

View File

@ -0,0 +1 @@
60806040523460405161001190610073565b6040518091039082f090508015801561002e573d6000803e3d6000fd5b506000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061007f565b60c78061031683390190565b6102888061008e6000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c80630e3608df146100465780634313b53114610064578063b0d22c6214610082575b600080fd5b61004e6100a0565b60405161005b919061017d565b60405180910390f35b61006c610137565b60405161007991906101d9565b60405180910390f35b61008a61015b565b604051610097919061017d565b60405180910390f35b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166312065fe06040518163ffffffff1660e01b8152600401602060405180830381865afa15801561010e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101329190610225565b905090565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006007905090565b6000819050919050565b61017781610164565b82525050565b6000602082019050610192600083018461016e565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006101c382610198565b9050919050565b6101d3816101b8565b82525050565b60006020820190506101ee60008301846101ca565b92915050565b600080fd5b61020281610164565b811461020d57600080fd5b50565b60008151905061021f816101f9565b92915050565b60006020828403121561023b5761023a6101f4565b5b600061024984828501610210565b9150509291505056fea2646970667358221220c24abd10dbe58d92bfe62cb351771fcdc45d54241a8ce7085f2a75179c67cd8a64736f6c63430008110033608060405260b5806100126000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c806312065fe014602d575b600080fd5b60336047565b604051603e91906066565b60405180910390f35b600047905090565b6000819050919050565b606081604f565b82525050565b6000602082019050607960008301846059565b9291505056fea26469706673582212207123972a300833ee01aebf99e4bdf8ecf9f01c0d3dd776048bd41803c6855c0e64736f6c63430008110033

View File

@ -0,0 +1,29 @@
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.17;
contract DeployValueTest {
address public newContract;
constructor() payable {
newContract = address(new NewContract{value: msg.value}());
}
function getConst() public view returns (uint) {
return 7;
}
function getNewContractBalance() public view returns (uint) {
return NewContract(newContract).getBalance();
}
}
contract NewContract {
constructor() payable {
}
function getBalance() public view returns (uint) {
return address(this).balance;
}
}

View File

@ -12,7 +12,7 @@ find . -name \*.sol -print0 |
#for these contracts we have 2 contracts in the same solidity file
#this command grabs the correct bytecode for us
for filename in Constructor TestApp ValueSender Create2Factory; do
for filename in Constructor TestApp ValueSender Create2Factory DeployValueTest; do
echo $filename
solc --bin $filename.sol | tail -n5|head -n1 | tr -d "\n" > $filename.hex
done

View File

@ -11,12 +11,16 @@ import (
"time"
"github.com/stretchr/testify/require"
"golang.org/x/crypto/sha3"
"github.com/filecoin-project/go-state-types/big"
"github.com/filecoin-project/go-state-types/manifest"
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/builtin/evm"
"github.com/filecoin-project/lotus/chain/types"
"github.com/filecoin-project/lotus/chain/types/ethtypes"
"github.com/filecoin-project/lotus/itests/kit"
@ -219,4 +223,32 @@ func TestDeployment(t *testing.T) {
require.NoError(t, err)
client.AssertActorType(ctx, contractAddr, "evm")
// Check bytecode and bytecode hash match.
contractAct, err := client.StateGetActor(ctx, contractAddr, types.EmptyTSK)
require.NoError(t, err)
bs := blockstore.NewAPIBlockstore(client)
ctxStore := gstStore.WrapBlockStore(ctx, bs)
evmSt, err := evm.Load(ctxStore, contractAct)
require.NoError(t, err)
byteCodeCid, err := evmSt.GetBytecodeCID()
require.NoError(t, err)
byteCode, err := bs.Get(ctx, byteCodeCid)
require.NoError(t, err)
byteCodeHashChain, err := evmSt.GetBytecodeHash()
require.NoError(t, err)
hasher := sha3.NewLegacyKeccak256()
hasher.Write(byteCode.RawData())
byteCodeHash := hasher.Sum(nil)
require.Equal(t, byteCodeHashChain[:], byteCodeHash)
byteCodeSt, err := evmSt.GetBytecode()
require.NoError(t, err)
require.Equal(t, byteCode.RawData(), byteCodeSt)
}

View File

@ -7,6 +7,7 @@ import (
"encoding/hex"
"encoding/json"
"fmt"
"math/bits"
"os"
"sort"
"strconv"
@ -16,7 +17,6 @@ import (
"github.com/ipfs/go-cid"
"github.com/stretchr/testify/require"
cbg "github.com/whyrusleeping/cbor-gen"
"golang.org/x/xerrors"
"github.com/filecoin-project/go-address"
@ -291,7 +291,7 @@ func TestEthNewFilterDefaultSpec(t *testing.T) {
paddedEthBytes([]byte{0x33, 0x33}),
paddedEthBytes([]byte{0x44, 0x44}),
},
Data: paddedEthBytes([]byte{0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88}),
Data: []byte{0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88},
},
{
Address: ethContractAddr,
@ -301,7 +301,7 @@ func TestEthNewFilterDefaultSpec(t *testing.T) {
paddedEthBytes([]byte{0x33, 0x33}),
paddedEthBytes([]byte{0x44, 0x44}),
},
Data: paddedEthBytes([]byte{0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88}),
Data: []byte{0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88},
},
{
Address: ethContractAddr,
@ -311,7 +311,7 @@ func TestEthNewFilterDefaultSpec(t *testing.T) {
paddedEthBytes([]byte{0x33, 0x33}),
paddedEthBytes([]byte{0x44, 0x44}),
},
Data: paddedEthBytes([]byte{0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88}),
Data: []byte{0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88},
},
}
@ -350,7 +350,7 @@ func TestEthGetLogsBasic(t *testing.T) {
paddedEthBytes([]byte{0x33, 0x33}),
paddedEthBytes([]byte{0x44, 0x44}),
},
Data: paddedEthBytes([]byte{0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88}),
Data: []byte{0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88},
},
}
@ -415,7 +415,7 @@ func TestEthSubscribeLogsNoTopicSpec(t *testing.T) {
paddedEthBytes([]byte{0x33, 0x33}),
paddedEthBytes([]byte{0x44, 0x44}),
},
Data: paddedEthBytes([]byte{0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88}),
Data: []byte{0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88},
}
}
@ -424,6 +424,51 @@ func TestEthSubscribeLogsNoTopicSpec(t *testing.T) {
AssertEthLogs(t, elogs, expected, messages)
}
func TestTxReceiptBloom(t *testing.T) {
blockTime := 50 * time.Millisecond
client, _, ens := kit.EnsembleMinimal(
t,
kit.MockProofs(),
kit.ThroughRPC())
ens.InterconnectAll().BeginMining(blockTime)
ctx, cancel := context.WithTimeout(context.Background(), time.Minute)
defer cancel()
fromAddr, idAddr := client.EVM().DeployContractFromFilename(ctx, "contracts/EventMatrix.hex")
_, ml, err := client.EVM().InvokeContractByFuncName(ctx, fromAddr, idAddr, "logEventZeroData()", nil)
require.NoError(t, err)
th, err := client.EthGetTransactionHashByCid(ctx, ml.Message)
require.NoError(t, err)
require.NotNil(t, th)
receipt, err := client.EthGetTransactionReceipt(ctx, *th)
require.NoError(t, err)
require.NotNil(t, receipt)
require.Len(t, receipt.Logs, 1)
// computed by calling EventMatrix/logEventZeroData in remix
// note this only contains topic bits
matchMask := "0x00000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
maskBytes, err := hex.DecodeString(matchMask[2:])
require.NoError(t, err)
bitsSet := 0
for i, maskByte := range maskBytes {
bitsSet += bits.OnesCount8(receipt.LogsBloom[i])
if maskByte > 0 {
require.True(t, maskByte&receipt.LogsBloom[i] > 0)
}
}
// 3 bits from the topic, 3 bits from the address
require.Equal(t, 6, bitsSet)
}
func TestEthGetLogs(t *testing.T) {
require := require.New(t)
kit.QuietAllLogsExcept("events", "messagepool")
@ -563,19 +608,13 @@ func TestEthSubscribeLogs(t *testing.T) {
var elogs []*ethtypes.EthLog
for resp := range responseCh {
rlist, ok := resp.Result.([]interface{})
require.True(ok, "expected subscription result to be []interface{}, but was %T", resp.Result)
rmap, ok := resp.Result.(map[string]interface{})
require.True(ok, "expected subscription result entry to be map[string]interface{}, but was %T", resp.Result)
for _, rentry := range rlist {
rmap, ok := rentry.(map[string]interface{})
require.True(ok, "expected subscription result entry to be map[string]interface{}, but was %T", resp.Result)
elog, err := ParseEthLog(rmap)
require.NoError(err)
elogs = append(elogs, elog)
}
elog, err := ParseEthLog(rmap)
require.NoError(err)
elogs = append(elogs, elog)
}
AssertEthLogs(t, elogs, tc.expected, messages)
})
@ -1874,6 +1913,7 @@ type ExpectedEthLog struct {
}
func AssertEthLogs(t *testing.T, actual []*ethtypes.EthLog, expected []ExpectedEthLog, messages map[ethtypes.EthHash]msgInTipset) {
t.Helper()
require := require.New(t)
t.Logf("got %d ethlogs, wanted %d", len(actual), len(expected))
@ -1943,7 +1983,7 @@ func AssertEthLogs(t *testing.T, actual []*ethtypes.EthLog, expected []ExpectedE
buf.WriteString(fmt.Sprintf("event %d\n", i))
buf.WriteString(fmt.Sprintf(" emitter: %v\n", ev.Emitter))
for _, en := range ev.Entries {
buf.WriteString(fmt.Sprintf(" %s=%x\n", en.Key, decodeLogBytes(en.Value)))
buf.WriteString(fmt.Sprintf(" %s=%x\n", en.Key, en.Value))
}
}
@ -1966,23 +2006,16 @@ func AssertEthLogs(t *testing.T, actual []*ethtypes.EthLog, expected []ExpectedE
func parseEthLogsFromSubscriptionResponses(subResponses []ethtypes.EthSubscriptionResponse) ([]*ethtypes.EthLog, error) {
elogs := make([]*ethtypes.EthLog, 0, len(subResponses))
for i := range subResponses {
rlist, ok := subResponses[i].Result.([]interface{})
rmap, ok := subResponses[i].Result.(map[string]interface{})
if !ok {
return nil, xerrors.Errorf("expected subscription result to be []interface{}, but was %T", subResponses[i].Result)
return nil, xerrors.Errorf("expected subscription result entry to be map[string]interface{}, but was %T", subResponses[i].Result)
}
for _, r := range rlist {
rmap, ok := r.(map[string]interface{})
if !ok {
return nil, xerrors.Errorf("expected subscription result entry to be map[string]interface{}, but was %T", r)
}
elog, err := ParseEthLog(rmap)
if err != nil {
return nil, err
}
elogs = append(elogs, elog)
elog, err := ParseEthLog(rmap)
if err != nil {
return nil, err
}
elogs = append(elogs, elog)
}
return elogs, nil
@ -2167,14 +2200,3 @@ func unpackUint64Values(data []byte) []uint64 {
}
return vals
}
func decodeLogBytes(orig []byte) []byte {
if len(orig) == 0 {
return orig
}
decoded, err := cbg.ReadByteArray(bytes.NewReader(orig), uint64(len(orig)))
if err != nil {
return orig
}
return decoded
}

View File

@ -58,7 +58,7 @@ func buildInputFromuint64(number uint64) []byte {
// recursive delegate calls that fail due to gas limits are currently getting to 229 iterations
// before running out of gas
func recursiveDelegatecallFail(ctx context.Context, t *testing.T, client *kit.TestFullNode, filename string, count uint64) {
expectedIterationsBeforeFailing := int(228)
expectedIterationsBeforeFailing := int(229)
fromAddr, idAddr := client.EVM().DeployContractFromFilename(ctx, filename)
t.Log("recursion count - ", count)
inputData := buildInputFromuint64(count)
@ -151,24 +151,26 @@ func TestFEVMRecursive2(t *testing.T) {
require.Equal(t, 2, len(events))
}
// TestFEVMRecursiveDelegateCall tests the maximum delegatecall recursion depth. It currently
// succeeds succeeds up to 228 times.
func TestFEVMRecursiveDelegatecall(t *testing.T) {
// TestFEVMRecursiveDelegatecallCount tests the maximum delegatecall recursion depth. It currently
// succeeds succeeds up to 237 times.
func TestFEVMRecursiveDelegatecallCount(t *testing.T) {
ctx, cancel, client := kit.SetupFEVMTest(t)
defer cancel()
highestSuccessCount := uint64(235)
filename := "contracts/RecursiveDelegeatecall.hex"
recursiveDelegatecallSuccess(ctx, t, client, filename, uint64(1))
recursiveDelegatecallSuccess(ctx, t, client, filename, uint64(2))
recursiveDelegatecallSuccess(ctx, t, client, filename, uint64(10))
recursiveDelegatecallSuccess(ctx, t, client, filename, uint64(100))
recursiveDelegatecallSuccess(ctx, t, client, filename, highestSuccessCount)
//success with 228 or fewer calls
for i := uint64(1); i <= 228; i += 30 {
recursiveDelegatecallSuccess(ctx, t, client, filename, i)
}
recursiveDelegatecallSuccess(ctx, t, client, filename, uint64(228))
recursiveDelegatecallFail(ctx, t, client, filename, highestSuccessCount+1)
recursiveDelegatecallFail(ctx, t, client, filename, uint64(1000))
recursiveDelegatecallFail(ctx, t, client, filename, uint64(10000000))
for i := uint64(239); i <= 800; i += 40 {
recursiveDelegatecallFail(ctx, t, client, filename, i)
}
}
// TestFEVMBasic does a basic fevm contract installation and invocation
@ -600,10 +602,10 @@ func TestFEVMRecursiveActorCall(t *testing.T) {
t.Run("n=200,r=32", testN(200, 32, exitcode.Ok))
t.Run("n=251,r=32", testN(251, 32, exitcode.Ok))
t.Run("n=0,r=254", testN(0, 254, exitcode.Ok))
t.Run("n=0,r=252", testN(0, 252, exitcode.Ok))
t.Run("n=251,r=166", testN(251, 166, exitcode.Ok))
t.Run("n=0,r=256-fails", testN(0, 256, exitcode.ExitCode(33))) // 33 means transaction reverted
t.Run("n=0,r=253-fails", testN(0, 253, exitcode.ExitCode(33))) // 33 means transaction reverted
t.Run("n=251,r=167-fails", testN(251, 167, exitcode.ExitCode(33)))
}
@ -704,6 +706,32 @@ func TestFEVMRecursiveActorCallEstimate(t *testing.T) {
t.Run("n=100", testN(100))
}
// TestFEVM deploys a contract while sending value to it
func TestFEVMDeployWithValue(t *testing.T) {
ctx, cancel, client := kit.SetupFEVMTest(t)
defer cancel()
//testValue is the amount sent when the contract is created
//at the end we check that the new contract has a balance of testValue
testValue := big.NewInt(20)
// deploy DeployValueTest which creates NewContract
// testValue is sent to DeployValueTest and that amount is
// also sent to NewContract
filenameActor := "contracts/DeployValueTest.hex"
fromAddr, idAddr := client.EVM().DeployContractFromFilenameWithValue(ctx, filenameActor, testValue)
//call getNewContractBalance to find the value of NewContract
ret, _, err := client.EVM().InvokeContractByFuncName(ctx, fromAddr, idAddr, "getNewContractBalance()", []byte{})
require.NoError(t, err)
contractBalance, err := decodeOutputToUint64(ret)
require.NoError(t, err)
//require balance of NewContract is testValue
require.Equal(t, testValue.Uint64(), contractBalance)
}
func TestFEVMDestroyCreate2(t *testing.T) {
ctx, cancel, client := kit.SetupFEVMTest(t)
defer cancel()

View File

@ -5,6 +5,7 @@ import (
"context"
"encoding/binary"
"encoding/hex"
"errors"
"fmt"
"os"
"testing"
@ -42,19 +43,18 @@ func (f *TestFullNode) EVM() *EVM {
return &EVM{f}
}
func (e *EVM) DeployContract(ctx context.Context, sender address.Address, bytecode []byte) eam.CreateReturn {
var err error
func (e *EVM) DeployContractWithValue(ctx context.Context, sender address.Address, bytecode []byte, value big.Int) eam.CreateReturn {
require := require.New(e.t)
method := builtintypes.MethodsEAM.CreateExternal
initcode := abi.CborBytes(bytecode)
params, err := actors.SerializeParams(&initcode)
require.NoError(err)
params, errActors := actors.SerializeParams(&initcode)
require.NoError(errActors)
msg := &types.Message{
To: builtintypes.EthereumAddressManagerActorAddr,
From: sender,
Value: big.Zero(),
Value: value,
Method: method,
Params: params,
}
@ -76,8 +76,11 @@ func (e *EVM) DeployContract(ctx context.Context, sender address.Address, byteco
return result
}
func (e *EVM) DeployContract(ctx context.Context, sender address.Address, bytecode []byte) eam.CreateReturn {
return e.DeployContractWithValue(ctx, sender, bytecode, big.Zero())
}
func (e *EVM) DeployContractFromFilename(ctx context.Context, binFilename string) (address.Address, address.Address) {
func (e *EVM) DeployContractFromFilenameWithValue(ctx context.Context, binFilename string, value big.Int) (address.Address, address.Address) {
contractHex, err := os.ReadFile(binFilename)
require.NoError(e.t, err)
@ -90,12 +93,15 @@ func (e *EVM) DeployContractFromFilename(ctx context.Context, binFilename string
fromAddr, err := e.WalletDefaultAddress(ctx)
require.NoError(e.t, err)
result := e.DeployContract(ctx, fromAddr, contract)
result := e.DeployContractWithValue(ctx, fromAddr, contract, value)
idAddr, err := address.NewIDAddress(result.ActorID)
require.NoError(e.t, err)
return fromAddr, idAddr
}
func (e *EVM) DeployContractFromFilename(ctx context.Context, binFilename string) (address.Address, address.Address) {
return e.DeployContractFromFilenameWithValue(ctx, binFilename, big.Zero())
}
func (e *EVM) InvokeSolidity(ctx context.Context, sender address.Address, target address.Address, selector []byte, inputData []byte) (*api.MsgLookup, error) {
params := append(selector, inputData...)
@ -126,7 +132,11 @@ func (e *EVM) InvokeSolidity(ctx context.Context, sender address.Address, target
if err != nil {
return nil, err
}
if !wait.Receipt.ExitCode.IsSuccess() {
result, err := e.StateReplay(ctx, types.EmptyTSK, wait.Message)
require.NoError(e.t, err)
e.t.Log(result.Error)
}
return wait, nil
}
@ -244,7 +254,9 @@ func (e *EVM) InvokeContractByFuncName(ctx context.Context, fromAddr address.Add
return nil, wait, err
}
if !wait.Receipt.ExitCode.IsSuccess() {
return nil, wait, fmt.Errorf("contract execution failed - %v", wait.Receipt.ExitCode)
result, err := e.StateReplay(ctx, types.EmptyTSK, wait.Message)
require.NoError(e.t, err)
return nil, wait, errors.New(result.Error)
}
result, err := cbg.ReadByteArray(bytes.NewBuffer(wait.Receipt.Return), uint64(len(wait.Receipt.Return)))
if err != nil {

View File

@ -12,7 +12,7 @@ import (
"github.com/filecoin-project/lotus/chain/types/ethtypes"
)
var ErrModuleDisabled = errors.New("module disabled, enable with Fevm.EnableEthRPC / LOTUS_FEVM_ENABLEETHPRC")
var ErrModuleDisabled = errors.New("module disabled, enable with Fevm.EnableEthRPC / LOTUS_FEVM_ENABLEETHRPC")
type EthModuleDummy struct{}

View File

@ -1371,14 +1371,14 @@ func ethFilterResultFromEvents(evs []*filter.CollectedEvent, sa StateAPI) (*etht
var err error
for _, entry := range ev.Entries {
value, err := cborDecodeTopicValue(entry.Value)
if err != nil {
return nil, err
// Skip all events that aren't "raw" data.
if entry.Codec != cid.Raw {
continue
}
if entry.Key == ethtypes.EthTopic1 || entry.Key == ethtypes.EthTopic2 || entry.Key == ethtypes.EthTopic3 || entry.Key == ethtypes.EthTopic4 {
log.Topics = append(log.Topics, value)
log.Topics = append(log.Topics, entry.Value)
} else {
log.Data = value
log.Data = entry.Value
}
}
@ -1517,45 +1517,50 @@ func (e *ethSubscription) addFilter(ctx context.Context, f filter.Filter) {
e.filters = append(e.filters, f)
}
func (e *ethSubscription) send(ctx context.Context, v interface{}) {
resp := ethtypes.EthSubscriptionResponse{
SubscriptionID: e.id,
Result: v,
}
outParam, err := json.Marshal(resp)
if err != nil {
log.Warnw("marshaling subscription response", "sub", e.id, "error", err)
return
}
if err := e.out(ctx, outParam); err != nil {
log.Warnw("sending subscription response", "sub", e.id, "error", err)
return
}
}
func (e *ethSubscription) start(ctx context.Context) {
for {
select {
case <-ctx.Done():
return
case v := <-e.in:
resp := ethtypes.EthSubscriptionResponse{
SubscriptionID: e.id,
}
var err error
switch vt := v.(type) {
case *filter.CollectedEvent:
resp.Result, err = ethFilterResultFromEvents([]*filter.CollectedEvent{vt}, e.StateAPI)
evs, err := ethFilterResultFromEvents([]*filter.CollectedEvent{vt}, e.StateAPI)
if err != nil {
continue
}
for _, r := range evs.Results {
e.send(ctx, r)
}
case *types.TipSet:
eb, err := newEthBlockFromFilecoinTipSet(ctx, vt, true, e.Chain, e.StateAPI)
ev, err := newEthBlockFromFilecoinTipSet(ctx, vt, true, e.Chain, e.StateAPI)
if err != nil {
break
}
resp.Result = eb
e.send(ctx, ev)
default:
log.Warnf("unexpected subscription value type: %T", vt)
}
if err != nil {
continue
}
outParam, err := json.Marshal(resp)
if err != nil {
log.Warnw("marshaling subscription response", "sub", e.id, "error", err)
continue
}
if err := e.out(ctx, outParam); err != nil {
log.Warnw("sending subscription response", "sub", e.id, "error", err)
continue
}
}
}
}
@ -1890,11 +1895,6 @@ func newEthTxReceipt(ctx context.Context, tx ethtypes.EthTx, lookup *api.MsgLook
}
if len(events) > 0 {
// TODO return a dummy non-zero bloom to signal that there are logs
// need to figure out how worth it is to populate with a real bloom
// should be feasible here since we are iterating over the logs anyway
receipt.LogsBloom[255] = 0x01
receipt.Logs = make([]ethtypes.EthLog, 0, len(events))
for i, evt := range events {
l := ethtypes.EthLog{
@ -1907,14 +1907,15 @@ func newEthTxReceipt(ctx context.Context, tx ethtypes.EthTx, lookup *api.MsgLook
}
for _, entry := range evt.Entries {
value, err := cborDecodeTopicValue(entry.Value)
if err != nil {
return api.EthTxReceipt{}, xerrors.Errorf("failed to decode event log value: %w", err)
// Ignore any non-raw values/keys.
if entry.Codec != cid.Raw {
continue
}
if entry.Key == ethtypes.EthTopic1 || entry.Key == ethtypes.EthTopic2 || entry.Key == ethtypes.EthTopic3 || entry.Key == ethtypes.EthTopic4 {
l.Topics = append(l.Topics, value)
ethtypes.EthBloomSet(receipt.LogsBloom, entry.Value)
l.Topics = append(l.Topics, entry.Value)
} else {
l.Data = value
l.Data = entry.Value
}
}
@ -1928,6 +1929,7 @@ func newEthTxReceipt(ctx context.Context, tx ethtypes.EthTx, lookup *api.MsgLook
return api.EthTxReceipt{}, xerrors.Errorf("failed to resolve Ethereum address: %w", err)
}
ethtypes.EthBloomSet(receipt.LogsBloom, l.Address[:])
receipt.Logs = append(receipt.Logs, l)
}
}
@ -2013,45 +2015,6 @@ func EthTxHashGC(ctx context.Context, retentionDays int, manager *EthTxHashManag
}
}
func leftpad32(orig []byte) []byte {
needed := 32 - len(orig)
if needed <= 0 {
return orig
}
ret := make([]byte, 32)
copy(ret[needed:], orig)
return ret
}
func trimLeadingZeros(b []byte) []byte {
for i := range b {
if b[i] != 0 {
return b[i:]
}
}
return []byte{}
}
func cborEncodeTopicValue(orig []byte) ([]byte, error) {
var buf bytes.Buffer
err := cbg.WriteByteArray(&buf, trimLeadingZeros(orig))
if err != nil {
return nil, err
}
return buf.Bytes(), nil
}
func cborDecodeTopicValue(orig []byte) ([]byte, error) {
if len(orig) == 0 {
return orig, nil
}
decoded, err := cbg.ReadByteArray(bytes.NewReader(orig), uint64(len(orig)))
if err != nil {
return nil, err
}
return leftpad32(decoded), nil
}
func parseEthTopics(topics ethtypes.EthTopicSpec) (map[string][][]byte, error) {
keys := map[string][][]byte{}
for idx, vals := range topics {
@ -2061,11 +2024,8 @@ func parseEthTopics(topics ethtypes.EthTopicSpec) (map[string][][]byte, error) {
// Ethereum topics are emitted using `LOG{0..4}` opcodes resulting in topics1..4
key := fmt.Sprintf("t%d", idx+1)
for _, v := range vals {
encodedVal, err := cborEncodeTopicValue(v[:])
if err != nil {
return nil, xerrors.Errorf("failed to encode topic value")
}
keys[key] = append(keys[key], encodedVal)
v := v // copy the ethhash to avoid repeatedly referencing the same one.
keys[key] = append(keys[key], v[:])
}
}
return keys, nil