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

consensus: Rename SiafundPool -> SiafundTaxRevenue #235

Merged
merged 4 commits into from
Dec 3, 2024
Merged

Conversation

lukechampine
Copy link
Member

"Pool" was always a bit of a misnomer, because making a siafund claim doesn't subtract value from the "pool." Its actual function is to record the total revenue at specific points in time, so that we can calculate the delta between two points and thereby determine the value of the dividend.

I also slightly tweaked how dividends are calculated in v2. Previously, all file contract taxes were rounded down to a multiple of 10,000 H, so that they would be evenly divisible by the number of siafunds. But this isn't actually necessary; you can just divide when you calculate the claim value, and the rounding will occur then. This is slightly more fair anyway: as an extreme example, if all contract taxes had a value of 9999 H, siafund holders would never receive any dividends, no matter how many contracts were formed.

n8maninger
n8maninger previously approved these changes Nov 21, 2024
@n8maninger
Copy link
Member

n8maninger commented Nov 21, 2024

The field name is fine, but I'm split on the tax change. On one hand, it's objectively more correct. On the other, it will require us to reset Anagami for minimal benefit 😓

I'm approving since there's nothing technically wrong and leave it up to you and Chris, but would advise caution on whether the tax change is worth it at this point in the hardfork.

@lukechampine
Copy link
Member Author

I suppose we could make a separate branch for changes that should wait until the testnet is reset 🤔

Copy link
Member

@ChrisSchinnerl ChrisSchinnerl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably discuss this on a call but my initial gut feeling it to not touch the tax code because

  • generally speaking I'd like to draw the line at what we have right now and not introduce any new breaking changes. There will always be stuff to tweak.
  • the benefits don't outweigh the risks imo
  • the fact that changing this code didn't cause any tests to fail doesn't spark joy xD

@lukechampine
Copy link
Member Author

Harumph. Ok, I'm fine leaving it out of this PR, but I do think we should accumulate any breaking changes in a separate branch. We'll almost certainly end up resetting Anagami once or twice before releasing the final v2 binaries; I think it'd be wasteful not to use those opportunities to deploy breaking changes.

btw, the reason all these consensus changes are coming now is because I'm throwing myself into the new v2 documentation, and thoroughly documenting something has a way of revealing subtle errors and inspiring new ideas. So, the sooner I finish the docs, the better. 😅

Copy link
Member

@n8maninger n8maninger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would like to see a test that the pool is updated correctly and claiming works as expected.

n8maninger
n8maninger previously approved these changes Dec 2, 2024
@n8maninger n8maninger merged commit 866a892 into master Dec 3, 2024
9 checks passed
@n8maninger n8maninger deleted the siafund-pool branch December 3, 2024 03:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants