-
Notifications
You must be signed in to change notification settings - Fork 83
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
feat: refactor vesting funds into a head and a tail #1636
Conversation
Built on #1635. |
c0f87e1
to
c1c4df2
Compare
d4e6f8f
to
8c53bc7
Compare
This is significantly more than just "fixing #1594" so it probably requires a FIP update to FIP-0100. But, IMO, we should strongly consider this because without it, we'll be re-writing the vesting queue every deadline. I guess that isn't terrible in the grand scheme of things but.... it's not great. |
accd9fc
to
9565521
Compare
242e68e
to
dfd6787
Compare
I think I've addressed all the feedback so far. |
I've also changed the `LoadVestingFunds` to return a `[]VestingFund` so we can abstract across the different underlying representations. related to filecoin-project/builtin-actors#1636
I've also changed the `LoadVestingFunds` to return a `[]VestingFund` so we can abstract across the different underlying representations. related to filecoin-project/builtin-actors#1636
I've also changed the `LoadVestingFunds` to return a `[]VestingFund` so we can abstract across the different underlying representations. related to filecoin-project/builtin-actors#1636
Re-do of filecoin-project/go-state-types#353, merging in the correct order. |
I've also changed the `LoadVestingFunds` to return a `[]VestingFund` so we can abstract across the different underlying representations. related to filecoin-project/builtin-actors#1636
I've also changed the `LoadVestingFunds` to return a `[]VestingFund` so we can abstract across the different underlying representations. related to filecoin-project/builtin-actors#1636
1. In the test harness, check if we should vest every epoch. The queue should already be quantized. 2. Correctly handle the fact that we vest at the _end_ of an epoch in the cron vesting test.
I've done another pass and this lgtm but I'll wait to see it squashed and rebased on |
c1f75c1
to
ed4ca0e
Compare
e350902
to
5d619b6
Compare
This lets us efficiently take fees from vesting funds without loading/storing this object each time. It also lets us check if there are funds to vest without having to load any additional state, because the "next" batch of vesting funds are always stored in the root state object. If FIP-0100 passes, we'll likely want this change as we'll otherwise read/write the vesting funds queue on every deadline for every miner. fixes #1594
5d619b6
to
ee568a7
Compare
All good, but:
|
You're right. The real issue was that the test was using stale state (which I also fixed). |
* test: correctly handle cron vesting in tests 1. In the test harness, check if we should vest every epoch. The queue should already be quantized. 2. Correctly handle the fact that we vest at the _end_ of an epoch in the cron vesting test. * feat: refactor vesting funds into a head and a tail This lets us efficiently take fees from vesting funds without loading/storing this object each time. It also lets us check if there are funds to vest without having to load any additional state, because the "next" batch of vesting funds are always stored in the root state object. If FIP-0100 passes, we'll likely want this change as we'll otherwise read/write the vesting funds queue on every deadline for every miner. fixes #1594 * doc: explain deadline alignment * review: simplify test
I've also changed the `LoadVestingFunds` to return a `[]VestingFund` so we can abstract across the different underlying representations. related to filecoin-project/builtin-actors#1636
This lets us efficiently take fees from vesting funds without loading/storing this object each time. It also lets us check if there are funds to vest without having to load any additional state, because the "next" batch of vesting funds are always stored in the root state object.
If FIP-0100 passes, we'll likely want this change as we'll otherwise read/write the vesting funds queue on every deadline for every miner.
fixes #1594