Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weird increase in genesis block size #12415

Closed
5 of 11 tasks
ZenGround0 opened this issue Aug 26, 2024 · 4 comments
Closed
5 of 11 tasks

Weird increase in genesis block size #12415

ZenGround0 opened this issue Aug 26, 2024 · 4 comments
Labels
kind/bug Kind: Bug P2 P2: Should be resolved

Comments

@ZenGround0
Copy link
Contributor

Checklist

  • This is not a security-related bug/issue. If it is, please follow please follow the security policy.
  • I have searched on the issue tracker and the lotus forum, and there is no existing related issue or discussion.
  • I am running the Latest release, the most recent RC(release canadiate) for the upcoming release or the dev branch(master), or have an issue updating to any of these.
  • I did not make any code changes to lotus.

Lotus component

  • lotus daemon - chain sync
  • lotus fvm/fevm - Lotus FVM and FEVM interactions
  • lotus miner/worker - sealing
  • lotus miner - proving(WindowPoSt/WinningPoSt)
  • lotus JSON-RPC API
  • lotus message management (mpool)
  • Other

Lotus Version

na

Repro Steps

No response

Describe the Bug

https://filecoinproject.slack.com/archives/CP50PPW2X/p1724568641784129

Logging Information

git ls-tree -rl v1.28.2:build/genesis
 
100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391       0    .gitkeep
100644 blob 910e7629156f78d26e1e57bd0ba7fa07535d58bc 8768236    butterflynet.car
100644 blob 775cdf7907eb2f4a840ce8b2a0d78a7bdcaf312b 1101066    calibnet.car
100644 blob 2dadae61eb35879531acbac551fbf75a08967feb 2200632    interopnet.car
100644 blob f1b3f342a6ca53e3398a3826a0368fb34dd8d0aa 1104195    mainnet.car
$ for i in $(ls build/genesis/*.car); do echo "$i: $(car ls $i | wc -l) blocks"; done
build/genesis/butterflynet.car: 7157 blocks
build/genesis/calibnet.car: 1207 blocks
build/genesis/interopnet.car: 13757 blocks
build/genesis/mainnet.car: 1222 blocks
@ZenGround0 ZenGround0 added the kind/bug Kind: Bug label Aug 26, 2024
@ZenGround0
Copy link
Contributor Author

The blowup in testing genesis sizes is odd. We should look into it to understand what is happening.

@rjan90 rjan90 added this to FilOz Aug 26, 2024
@rjan90 rjan90 moved this to 📌 Triage in FilOz Aug 26, 2024
@rjan90 rjan90 moved this from 📌 Triage to 🐱Todo in FilOz Aug 28, 2024
@BigLep BigLep added the P2 P2: Should be resolved label Aug 28, 2024
@BigLep
Copy link
Member

BigLep commented Aug 28, 2024

2024-08-28 triage note: it was agreed this seems odd and we should timebox a couple of hours to investigate to try and understand what's happening. We're thinking to do this over the next month when in the "make migrations great again" workstream. Cc @rvagg so its on your radar, but understood we'll need to do some stack ranking.

@rvagg
Copy link
Member

rvagg commented Sep 9, 2024

Did a quick bit of inspecting of the CAR and the reason it's so big for butterflynet is that it's a newer actors version base where the builtin actors are WASM embedded blocks in the state tree, while all the other genesis CARs are older actors versions which just have the versioned inline string that points to the old specs actors versions.

There's 16 raw blocks in the CAR, all WASM, here's their CIDs and byte sizes:

bafk2bzacebedx7iaa2ruspxvghkg46ez7un5b7oiijjtnvddq2aot5wk7p7ry 1577952
bafk2bzacedl533kwbzouqxibejpwp6syfdekvmzy4vmmno6j4iaydbdmv4xek 218876
bafk2bzacebpdd4ctavhs7wkcykfahpifct3p4hbptgtf4jfrqcp2trtlygvow 579040
bafk2bzacebs5muoq7ft2wgqojhjio7a4vltbyprqkmlr43ojlzbil4nwvj3jg 680986
bafk2bzacebvne7m2l3hxxw4xa6oujol75x35yqpnlqiwx74jilyrop4cs7cse 601638
bafk2bzacecimv5xnuwyoqgxk26qt4xqpgntleret475pnh35s3vvhqtdct4ow 207587
bafk2bzaceahw5rrgj7prgbnmn237di7ymjz2ssea32wr525jydpfrwpuhs67m 215951
bafk2bzaceacjmlxrvydlud77ilpzbscez46yedx6zjsj6olxsdeuv6d4x4cwe 146318
bafk2bzacedgj6hawhdw2ot2ufisci374o2bq6bfkvlvdt6q7s3uoe5ffyv43k 308883
bafk2bzaced3zmxsmlhp2nsiwkxcp2ugonbsebcd53t7htzo2jcoidvu464xmm 991853
bafk2bzaceckhx44jawhzhkz6k23gfnv2gcutgb4j4ekhonj2plwaent4b2tpk 356014
bafk2bzacectnnnpwyqiccaymy3h6ghu74ghjrqyhtqv5odfd4opivzebjj6to 472378
bafk2bzacebbs3rlg7y3wbvxrj4wgbsqmasw4ksbbr3lyqbkaxj2t25qz6zzuy 322875
bafk2bzacedfvut2myeleyq67fljcrw4kkmn5pb5dpyozovj7jpoez5irnc3ro 143
bafk2bzaced5smz4lhpem4mbr7igcskv3e5qopbdp7dqshww2qs4ahacgzjzo4 726758
bafk2bzacebrslcbew5mq3le2zsn36xqxd4gt5hryeoslxnuqwgw3rhuwh6ygu 116046

They match up with what we have in ../builtin_actors_gen.go for actors version 13.

I think that it would be safe to strip out those particular blocks because I think they get loaded from the bundle that ships with lotus anyway.

$ car ls build/genesis/butterflynet.car | grep bafk2bz > /tmp/actors.cids
$ car filter --cid-file /tmp/actors.cids --version 1 --inverse build/genesis/butterflynet.car build/genesis/butterflynet.trim.car
filtering out 16 cids
$ ls -alh build/genesis/butterflynet.*car
-rw-rw-r-- 1 rvagg rvagg 8.4M Aug  1 17:44 build/genesis/butterflynet.car
-rw-rw-r-- 1 rvagg rvagg 1.2M Sep  9 20:43 build/genesis/butterflynet.trim.car
$ car ls build/genesis/butterflynet.car | wc
   7157    7157  450888
$ car ls build/genesis/butterflynet.trim.car | wc
   7141    7141  449880

Mainnet and calibnet are ~1.1M, so this is on par with those.

We could also be compressing these files, we already have a zstd library here for the bundle files that get included in the lotus binary, the same could be done for each of these and it would shrink them down quite a bit.

I guess we should test this somehow? I'm actually not sure how that would be done easily outside of the whole lotus-infra stuff.

@rjan90 @ZenGround0 thoughts on testing a genesis CAR without actors builds in it?

@rjan90
Copy link
Contributor

rjan90 commented Sep 12, 2024

Closing as completed as #12439 has been merged

@rjan90 rjan90 closed this as completed Sep 12, 2024
@github-project-automation github-project-automation bot moved this from 🐱Todo to 🎉 Done in FilOz Sep 12, 2024
@rjan90 rjan90 moved this from 🎉 Done to ☑️ Done (Archive) in FilOz Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Kind: Bug P2 P2: Should be resolved
Projects
Status: ☑️ Done (Archive)
Development

No branches or pull requests

5 participants
@BigLep @rvagg @ZenGround0 @rjan90 and others