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 1 commit 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.

@tediou5 tediou5 force-pushed the feat/add_miner_deposit_v3 branch 5 times, most recently from 5e08d67 to 7c0795f Compare January 7, 2025 10:25
@rjan90
Copy link
Contributor

rjan90 commented Jan 8, 2025

Hey! 👋

As part of our cleanup to kick off the year, I'm reviewing all open non-draft pull requests. Could you please do one of the following for your PR?

1. Close it: If it's no longer needed.
2. Mark as Draft: If it needs more work, and add the next steps.
3. Ready for Review: If it's good to go, let me know, and I'll assign a reviewer.

If there's no response in a week, I'll assume it's option 1 and close the PR. If you have any questions, just let me know.

Thanks for your help in keeping things organized, and I appreciate your contributions!

@tediou5
Copy link
Author

tediou5 commented Jan 13, 2025

Hey! 👋

As part of our cleanup to kick off the year, I'm reviewing all open non-draft pull requests. Could you please do one of the following for your PR?

1. Close it: If it's no longer needed. 2. Mark as Draft: If it needs more work, and add the next steps. 3. Ready for Review: If it's good to go, let me know, and I'll assign a reviewer.

If there's no response in a week, I'll assume it's option 1 and close the PR. If you have any questions, just let me know.

Thanks for your help in keeping things organized, and I appreciate your contributions!

@rjan90 Thank you for your work. This PR has been cleaned up and re-implemented according to our previous discussions. It is now ready for review.

@tediou5 tediou5 force-pushed the feat/add_miner_deposit_v3 branch from 7c0795f to fb28a97 Compare January 13, 2025 02:34
@tediou5 tediou5 force-pushed the feat/add_miner_deposit_v3 branch from fb28a97 to 5888f50 Compare January 13, 2025 02:37
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.

3 participants