Skip to content

Instantly share code, notes, and snippets.

@ZenGround0
ZenGround0 / FIL__FIL.txt
Created August 30, 2023 01:22
A plan for FIL__FIL
Fil_Fil Product:
a small incentivized data network overlay on top of filecoin specifically for filecoin snapshots
User requirement: snapshots are incentivized to be stored for a long time, ~2-5 years with replication
User requirement: snapshots are committed in real time < 1 hour after they are generated
User nice-to-have: snapshots are available for content delivery on the saturn network
Big idea: providers participate in the network for an incentive. Users of the network get guarantee that snapshot data is stored and (ideally) a reliable way to get the snapshot data out if they pay. Basically it is like filecoin but for a tiny subset of specific data.
Users: 1. People installing lotus who need to sync (ideally FilecoinFoundation would subsiize saturn payments for people downloading from lotus-chain management website within reason 2. SPs who are out of sync 3. Devs / analysts who need historical data
@ZenGround0
ZenGround0 / AMT-Churn.md
Created July 31, 2023 22:49
Summary of findings related to AMT churn and the nv18-nv19 market cron disruption

AMT Churn Explanation

Background

Market Churn

Churn is defined to be the size in bytes of the data in a datastructure that is overwritten over some period of time. Because GC in lotus is somewhat difficult lots of churn in filecoin state has a high system cost

We learned after nv19 that AMT churn is > 100x higher than optimal

@ZenGround0
ZenGround0 / cron-data.sh
Last active July 21, 2023 19:50
Commands for analyzing miner cron
#!/bin/bash
# Use a trailing slash in directory if not provided
[[ "$2" != */ ]] && dir="$2"/ || dir="$2"
./lotus state --tipset=@$1 compute-state --json | jq --argjson height "$1" '. + {Height: $height}' > "${dir}"gas-trace-"$1".json
cat "${dir}"gas-trace-$1.json | jq -c '.Trace | .[] | select( .Msg | .To== "f03") | .ExecutionTrace | .Subcalls | .[] | select( .Msg | .To == "f04") | .Subcalls | .[] | select( .Msg | .Method == 12) | {"To":( .Msg | .To) , "Gas": (reduce (.. | .GasCharges? | select(.) | .[]) as $gas ({tg: 0}; {tg: ($gas.tg + .tg)}))} ' | jq --argjson height "$1" -s '[.[] | . + {Height: $height}]' > "${dir}"crongas-"$1".json
cat "${dir}"gas-trace-$1.json | jq -c '.Trace | .[] | select( .Msg | .To== "f03") | .ExecutionTrace | .Subcalls | .[] | select( .Msg | .To == "f04") | .Subcalls | .[] | select( .Msg | .Method == 12) | {"To":( .Msg | .To) , "Gas": (reduce (.. | .GasCharges? | select(.) | .[] | select(.Name == "wasm_exec") ) as $gas ({tt: 0}; {tt: ($gas.tt + .tt)}))} ' | jq --argjs
@ZenGround0
ZenGround0 / MessageContract.md
Last active November 4, 2022 12:23
A statement of purpose and system overview of the Filecoin Message Contract

Contract as a Deal Client for Archiving Filecoin Blockchain Message Data

Motivation

  1. Use web3 infrastructure to solve the filecoin message archive problem currently solved with web2 clouds
  2. Provide an EVM contract template for contract as a client data storage on the filecoin network
  3. Identify sticking points in the current model of data preparation, data transfer and deal negotiation for contract as a client storage deals. For example learn how the ask protocol should change to support this model.
  4. Demonstrate a new model for FIL+ auditing with significantly better fraud resilience properties

The core idea is that as system and protocol developers we will benefit from building a small application to understand how to adapt the network to similar applications. The nice thing is that fil infrastructure has a concrete application today which serves PLs broader goal of using our own tech.

@ZenGround0
ZenGround0 / devnet-clean.fish
Last active January 18, 2023 21:50
Fish scripts for an easy local devnet (mostly plagiarized and adapted from scripts of @jennijuju)
function devnet-clean
rm -rf ~/.lotus
rm -rf ~/.lotusminer
rm -rf ~/.genesis-sectors
end
@ZenGround0
ZenGround0 / miner-power-lf-ab.csv
Created October 9, 2020 19:54
Balance and power info for all miners with power
miner_addr locked_fund available_balance percentage_power
f02767 24696253356480328192907 3448319756017030661503 0.7425%
f03482 1865243360901916413517 284784336988146748135 0.0810%
f024468 0 6487534081779092886 0.0001%
f01287 7776632751493145606495 37962621493834690048 0.3178%
f08403 0 8749842251001152016 0.0005%
f07709 0 28493585174620871928 0.0085%
f010048 159954177664607847768 1532512088095547333 0.0094%
f014701 234878149345434458855 2197893315693632270 0.0063%
f010558 208996663265050539014 9403947183209253002 0.0006%
addr,power_summary,power_percentage,debt,locked_funds,debt_minus_locked_funds,debt_minus_locked_funds_in_rounded_FIL
f01155,(454.9 TiB / 489.9 PiB),0.0906%,738165819535979446420,163461236877981722109,574704582657997724311,575FIL
f015902,(1.312 TiB / 489.9 PiB),0.0002%,15892725699167755436,0,15892725699167755436,16FIL
f08385,(288 GiB / 489.9 PiB),0.0000%,1124620050307575561,0,1124620050307575561,1FIL
f02419,(2.312 TiB / 489.9 PiB),0.0004%,178541895364964059964,0,178541895364964059964,179FIL
f022970,(384 GiB / 489.9 PiB),0.0000%,157040318843098910,0,157040318843098910,0FIL
f015799,(32 GiB / 489.9 PiB),0.0000%,15771041290578916234,0,15771041290578916234,16FIL
f08399,(1.156 TiB / 489.9 PiB),0.0002%,4363625856165831805,0,4363625856165831805,4FIL
f015805,(1.344 TiB / 489.9 PiB),0.0002%,16892993524550778769,0,16892993524550778769,17FIL
f022791,(384 GiB / 489.9 PiB),0.0000%,2328995567473538653,0,2328995567473538653,2FIL
@ZenGround0
ZenGround0 / gist:da85b63fd2fc725dc8cddf6a04399321
Last active October 9, 2020 17:27
miner-debt-refined.txt
f01155,500174711422976(454.9 TiB) / 551568221367435264(489.9 PiB) ~= 0.0906%,738165819535979446420
f015902,1443109011456(1.312 TiB) / 551568221367435264(489.9 PiB) ~= 0.0002%,15892725699167755436
f08385,309237645312(288 GiB) / 551568221367435264(489.9 PiB) ~= 0.0000%,1124620050307575561
f02419,2542620639232(2.312 TiB) / 551568221367435264(489.9 PiB) ~= 0.0004%,178541895364964059964
f022970,412316860416(384 GiB) / 551568221367435264(489.9 PiB) ~= 0.0000%,157040318843098910,
f015799,34359738368(32 GiB) / 551568221367435264(489.9 PiB) ~= 0.0000%,15771041290578916234
f08399,1271310319616(1.156 TiB) / 551568221367435264(489.9 PiB) ~= 0.0002%,4363625856165831805
f015805,1477468749824(1.344 TiB) / 551568221367435264(489.9 PiB) ~= 0.0002%,16892993524550778769
f022791,412316860416(384 GiB) / 551568221367435264(489.9 PiB) ~= 0.0000%,2328995567473538653
f022912,3710851743744(3.375 TiB) / 551568221367435264(489.9 PiB) ~= 0.0006%,12613886471293363612
@ZenGround0
ZenGround0 / miner-debt.txt
Created October 9, 2020 16:20
All miners in debt at block ~130000
miner f021483 397208579410456432
miner f021428 17236087276879207763
miner f08109 15263818717091973697
miner f014632 4154068213564960491
miner f01001 3492002270556227911190
miner f022313 610473114191155236
miner f09731 17380000573712836851
miner f015903 15776832867967329746
miner f021580 167815608280463667
miner f07956 11719853651097569161
@ZenGround0
ZenGround0 / power-for-debts.txt
Created October 9, 2020 16:18
Filecoin miners in debt as of block ~130000
0(0 B) / 551568221367435264(489.9 PiB) ~= 0.0000%
0(0 B) / 551568221367435264(489.9 PiB) ~= 0.0000%
0(0 B) / 551568221367435264(489.9 PiB) ~= 0.0000%
0(0 B) / 551568221367435264(489.9 PiB) ~= 0.0000%
0(0 B) / 551568221367435264(489.9 PiB) ~= 0.0000%
0(0 B) / 551568221367435264(489.9 PiB) ~= 0.0000%
0(0 B) / 551568221367435264(489.9 PiB) ~= 0.0000%
0(0 B) / 551568221367435264(489.9 PiB) ~= 0.0000%
0(0 B) / 551568221367435264(489.9 PiB) ~= 0.0000%
0(0 B) / 551568221367435264(489.9 PiB) ~= 0.0000%