-
Notifications
You must be signed in to change notification settings - Fork 79
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/add miner deposit v3 #1535
base: master
Are you sure you want to change the base?
Feat/add miner deposit v3 #1535
Conversation
…posit_should_fail_without_construct
…power::ext::miner
feat: add miner deposit
fix: add create miner deposit into vest table when get vesting funds
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm reviewing this as a high level implementation proposal rather than in detail yet.
There are two decisions here that cause a much larger impact on code and complexity that I think necessary.
- New state for the deposit. We already have a vesting table capable of representing the idea of funds locked until some epoch. Adding new state representing a new type of locked funds means all the calculations about balances need to take that into account. The chance of introducing an error now or later is very high. It requires a state migration. I can't see any advantage of the separate representation.
- A new method for the deposit. The deposit is required at miner creation. It would be simpler to just pass the funds in the call to the miner constructor (which already happens) and compute the lock in that constructor. The duplication of miner logic code in the power actor will not be acceptable (though we could extract it somewhere to share). The power actor is already calling the miner actor once, there's no point calling a second time. The only parameter is the lock amount, which can be computed at the miner, so we don't need to adjust the miner constructor parameters. The constructor can fail if the balance is insufficient for the lock.
I don't think this is worth the complexity it will involve to implement it. I suggest not doing that for now. |
Yeah, I'm just want an early exit here. I will fix this.
Yes, adding a state makes it a lot more complicated. But its very easy and necessary to use the deposit as an initial pledge, if we have an deposit state. Maybe we could give it a try ? Or if you're very adamant here, I can remove the code. |
… create miner deposit
My opinion is that it is not worthwhile to have that feature. I'm open to other opinions, more information etc though. My default stance is that any additional complexity has to bring a lot of benefit. |
Fip: FIP-0077
Fip update: FIP-0077 update
Discussions: discussions
Also, should we allow users to use the deposit as an initial pledge? I think i can do this.