Skip to content
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

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

tediou5
Copy link

@tediou5 tediou5 commented Mar 28, 2024

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.

@tediou5 tediou5 mentioned this pull request Mar 28, 2024
Copy link
Member

@anorth anorth left a 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.

@anorth
Copy link
Member

anorth commented Apr 4, 2024

should we allow users to use the deposit as an initial pledge

I don't think this is worth the complexity it will involve to implement it. I suggest not doing that for now.

@tediou5
Copy link
Author

tediou5 commented Apr 7, 2024

@anorth

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.

Yeah, I'm just want an early exit here. I will fix this.


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.

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.

@anorth
Copy link
Member

anorth commented Apr 9, 2024

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.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants