feat!: Rails library#476
Conversation
Assisted-by: Claude:claude-sonnet-4-6
…ecated storage slots Assisted-by: Claude:claude-sonnet-4-6
Assisted-by: Claude:claude-sonnet-4-6
| uint256 constant EPOCHS_PER_MONTH = 2880 * 30; | ||
|
|
||
| // USDFC has 18 decimals, so $1 = 10**18 (a.k.a. ether) | ||
| uint256 constant SYBIL_FEE = 0.1 ether; |
There was a problem hiding this comment.
this was originally a const then we exposed it on PDPVerifier and used IPDPVerifier(pdpVerifierAddress).USDFC_SYBIL_FEE() and now we're back to a const here, is this intentional?
There was a problem hiding this comment.
yeah, I think a const in the PriceList is the right way to go. We would run into trouble if the pdp verifier disagreed with this but maybe we can remove the pdp verifier's sybil check once we adopt the cleanup rebate system.
|
SPEC.md needs updating, it still has "Only the contract owner can update pricing by calling updatePricing(newStoragePrice, newMinimumRate) ..."; that'll need fixing. |
|
Oh, and README.md also says "The service uses static global pricing set by the contract owner (default: 2.5 USDFC per TiB/month)". I guess it's still mostly true, just not a setter, we could leave this, your call. |
rvagg
left a comment
There was a problem hiding this comment.
I normally hate per-commit reviewing but this is really nicely separated out, so it was actually a good experience (and I hadn't caught up on GitHub making it a bit easier too); very nice work.
Just a few things to take care of but this is a preemptive approval assuming you'll look at & take care of these things:
- the sybil fee fetcher question
- duplicate
DEFAULT_LOCKUP_PERIODimport - would like somewhere mentioning the calculateRatePerEpoch removal, this is technically a breaking change, we could signal it with
!but calling it out in a commit message would be very helpful too, the commitrefactor: Rails.updateStorageRatescould becomerefactor!: Rails.updateStorageRatesand in the body mention thatcalculateRatePerEpochwas moved off the proxy. - SPEC.md needs updating to talk about how the pricing gets changed now
|
I think we could probably remove calculateRatePerEpoch entirely when we're done here, may not be the worst thing to remove it entirely even from here and just document the breakage |
I'm inclined to keep it for now because it's used to test the pure function. It can be calculated from the information in |
Reviewer @rvagg
Toward #469
I am cutting a PR here in order to help keep the code review digestible.
I think reviewing the changes commit-by-commit might also be helpful.
This reduces contract size from
23939to19857Changes
calculateRatePerEpochto the View contract, update gen to allow pure methods in the view contract.updateServiceCommissionandupdatePricing; these parameters will now be managed by the upgrade path