Skip to content

Conversation

rvagg
Copy link
Member

@rvagg rvagg commented Jan 21, 2025

Not quite as useful as it should be, I think one problem I'm facing here is the restrictions on running CompactPartitions, so even though we attempt to do 48, ~1/2 of them are locked at any particular period. So it'll only make a difference for sectors that get allocated in the partitions we are compacting.

Also, I think a lot of the messages I try out are on already compact miners, so it's best to try with older miners who are still around and are still submitting messages.

But this is serving as a framework for further experimentation, so I'm parking it here.

lotus-shed gas-sim compact-sectors bafy2bzacebuimgnswbjtb4jf5ub3lzhrfl4i2phleagr5plxewmilvjsk4qwa is one interesting message, results in:

Difference in gas charges for miner msg (without subcalls):
┌─────────────────┬───────┬─────────────┬────────┬─────────────┬────────┬───────────┬────────┐
│ Type            │ Count │ Storage Gas │     S% │ Compute Gas │     C% │ Total Gas │     T% │ 
├─────────────────┼───────┼─────────────┼────────┼─────────────┼────────┼───────────┼────────┤
│ OnBlockCreate   │    -2 │        3016 │   0.10 │        3715 │   0.16 │      6730 │   0.13 │ 
│ OnBlockLink     │    -2 │     1235820 │  42.12 │        7745 │   0.33 │   1243565 │  23.70 │ 
│ OnBlockOpen     │     9 │        7980 │   0.27 │        5400 │   0.23 │     13380 │   0.26 │ 
│ OnBlockOpenBase │     9 │     1686960 │  57.50 │        2700 │   0.12 │   1689660 │  32.20 │ 
│ OnBlockRead     │     9 │           0 │   0.00 │         543 │   0.02 │       543 │   0.01 │ 
│ OnScanIpldLinks │     7 │           0 │   0.00 │       13850 │   0.60 │     13850 │   0.26 │ 
│ OnSyscall       │    14 │           0 │   0.00 │      196000 │   8.47 │    196000 │   3.74 │ 
│ wasm_exec       │    14 │           0 │   0.00 │     2083242 │  90.06 │   2083242 │  39.70 │ 
│ Total           │    58 │     2933776 │ 100.00 │     2313195 │ 100.00 │   5246970 │ 100.00 │ 
└─────────────────┴───────┴─────────────┴────────┴─────────────┴────────┴───────────┴────────┘

CompactPartitions prior to message resulted in:
 • 58 fewer total gas charges
 • 2313195 less compute gas (9.55%)
 • 2933776 less storage gas (3.92%)
 • 5246970 less total gas (5.29%)
 • 9 fewer reads and 2 more writes

rvagg added 2 commits January 21, 2025 21:36
* simulate a CompactSectors prior to a miner message
* improve gas table printing and handling
@rvagg rvagg force-pushed the rvagg/historical-beacon-client branch from 30ca496 to c0fad9d Compare February 4, 2025 05:35
@rvagg rvagg force-pushed the rvagg/historical-beacon-client branch from 153b2cc to f417457 Compare February 17, 2025 11:13
@rvagg rvagg force-pushed the rvagg/historical-beacon-client branch 2 times, most recently from b04bfc3 to 386074a Compare March 4, 2025 23:43
Base automatically changed from rvagg/historical-beacon-client to master March 4, 2025 23:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 📌 Triage
Development

Successfully merging this pull request may close these issues.

1 participant