fix(build)!: adjust FilReserved for FIP-0100 for non-mainnet#12938
fix(build)!: adjust FilReserved for FIP-0100 for non-mainnet#12938rvagg merged 2 commits intorvagg/fip-0100from
Conversation
PR title now matches the required format.
Just adding to the history here, that I believe the FILReserved (f090 balance) was set higher on the test networks as hack/workaround to get to the 2B FILBase, instead of adding all types of msig/vesting wallets for different initial investors/FF/PL to these networks. |
|
Having written all of that, I will admit to having second thoughts on changing the FIP or calibnet. 900M makes circulating supply correct on calibnet. 1.1B makes it closer to current mainnet, but not technically correct. We'll still get fees calculated, they'll just be nearly half of what they will be on mainnet. Maybe that's not terrible. I'd still like to make butterfly and 2k closer to mainnet, and as I said, we can easily change those values for these ephemeral networks in the future. |
| // Canceled - See update in: https://github.com/filecoin-project/community/discussions/74#discussioncomment-11549619 | ||
| const UpgradeTeepHeight = 9999999999 | ||
|
|
||
| var UpgradeTeepInitialFilReserved = wholeToNano(1_100_000_000) // FIP-0100: 300M -> 1.1B FIL |
There was a problem hiding this comment.
| var UpgradeTeepInitialFilReserved = wholeToNano(1_100_000_000) // FIP-0100: 300M -> 1.1B FIL | |
| var UpgradeTeepInitialFilReserved = wholeToNano(900_000_000) // FIP-0100: 300M -> 900M FIL |
This would match the current FIP. Need to consider whether it's better to be correct, or make it closer to mainnet just to test fee calculation. 🤔
There was a problem hiding this comment.
I think one of the goals for Calibnet is to try to mirror Mainnet. While it has achieved that with regards to SP hardware usage, block times, and proofs, the economics has been really skewed.
I'm in favor of aligning Calibnet more closely with Mainnet's economic conditions. Although we may never fully replicate Mainnet econ due to differences in scale and miner numbers, adjusting the circulating supply to be more accurate to what Mainnet is a positive step forward in my opinion.
There was a problem hiding this comment.
filecoin-project/FIPs#1133 & filecoin-project/FIPs#1105
Proposing another 100M FIL to get us to an almost exact match with mainnet. I'm still not sure about it, but these really are just test networks so we can tweak them as we need and it would be nice to have equations resolving to very similar values as mainnet.
fc484bf to
ef5a486
Compare
|
Latest commit fixes some things and adjusts the numbers a little bit more to get us closer to 700M which is really what the target should be if we're matching mainnet. I'm still a little torn on accuracy vs matching mainnet, but it would be nice to have a better testing environment. We'll see if filecoin-project/FIPs#1133 gets merged. @rjan90 re testing - I've not done anything to actively test butterflynet but I did get on to the currently running one to inspect the state and calculations, which is where my numbers are coming from in here. 2k testing I can do locally through itests, and you can see in my latest commit I had to fix the nv24 migration test because it was breaking with my changes, the |
8cc349b to
8941d88
Compare
|
Took the branch for a spin on my calibration network node, and set the upgrade epoch to Circulating supply before the upgrade: Migrations: Circulating supply after the migration: Which is right on target/according to the calculations above |
rjan90
left a comment
There was a problem hiding this comment.
Changes look good to me. Guess the outstanding question is some signal on the accuracy vs matching mainnet CS.
08af2c4 to
0041cb6
Compare
6ab5711 to
3f15f22
Compare
69ad783 to
28e6193
Compare
28e6193 to
33c6ba5
Compare
33c6ba5 to
17ef76e
Compare
17ef76e to
9d65e33
Compare
|
filecoin-project/FIPs#1133 merged |
This is the calibnet fix mentioned in FIP-0100, but it's also for 2k and butterfly. It's a PR into the
rvagg/fip-0100branch, for independent reviewing because this one needs explaining.Bear with me while I explain the logic here, I want to get this on the historical record without having to put it all in the code.
The aim is to bring circulating supply to a positive value (well, nonzero), and to push it into the millions so we can have comparative values to mainnet. Mainnet is currently at 698M FIL. The FIP states that we're going to bring Calibnet up to 300M but I'm going to change that and push everything closer to 600M just so we have very comparable numbers for fee calculation to mainnet (I'll update the FIP text for calibnet).
The basic equation for circulating supply is:
FilReserveDisbursedis the thing we're going to tinker with, it's further broken down as:InitialFilReservedis fixed in Lotus as 300M FIL. But we have differentFilReserved(f090balance) values across our network configs. On mainnet it's 282M, but seems to be set to 900M (or thereabouts) in genesis on butterfly and calibnet (currently 869M on calibnet), and 700M when you start a 2k network, or even an itest without the 2k tag. I don't have an explanation for these numbers, I'm just rolling with it. Butterfly and 2k are easy to adjust in the future, calibnet less so.For mainnet, calculate CS by filling in:
For calibnet:
Butterfly is a bit weirder because it starts off with a
FilVestedof ~10M FIL, at height 1 we work it out as:2k starts off with a ~0 vested and a mining reserve of 700M FIL; something like this:
So, with this PR, we introduce a switch at Teep (nv25) upgrade height, so that the Circulating Supply value that gets passed into the FVM will flip. For mainnet we leave it alone, but we make the following changes:
Calibnet 300M -> 1.2B
Butterfly 300M -> 1.6B
2k 300M -> 1.4B
The diff isn't super clean because I also moved some variables around in the params files to put the auxiliary settings with their upgrades because they were getting a bit too separated.
I also need to manually fix the itest ensemble because it's not normally run with
-tags 2k, so I copy in the 2k settings that I care about to each ensemble build.I'm removing
buildconstants.FilReservedandbuildconstants.FilAllocStorageMiningentirely, we don't use them internally and you can extract them from the other variables that are exposed in there.(Also, sorry, my brain hurts too if it's any consolation when reviewing this)
(Edit: updated original numbers to get closer to 700M on each)