-
Notifications
You must be signed in to change notification settings - Fork 17
feat: terminate all data set rails (storange and CDN) atomically #93
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
Conversation
| // Burn one-time fee to register | ||
| require(msg.value == SP_REGISTRATION_FEE, "Incorrect registration fee"); | ||
| (bool sent, ) = BURN_ADDRESS.call{value: msg.value}(""); | ||
| (bool sent,) = BURN_ADDRESS.call{value: msg.value}(""); |
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.
nit: unrelated
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.
Just a forge fmt
| }); | ||
| } | ||
|
|
||
| function railTerminated(uint256 railId, address terminator, uint256 endEpoch) external override { |
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.
For my understanding: After terminateDataSetPayment, this method will now be called up to three times for one data set, once per payment rail. The first call will change the state paymentEndEpoch = endEpoch, the other two calls will be noops and safe to ignore. Right?
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.
@juliangruber That is correct !
…Ozone#93) Clients & SPs should now call `terminateDataSetPayment` on the service contract to terminate the payment rails for their dataset atomically. The service contract will revert the `railTerminated` callback from the Payments contract if the rail terminator is not the service contract itself. Piece removal is allowed after the payment is terminated for a dataset but piece addition is not as increasing the rate of a terminated rail is not allowed by the payments contract. Once the dataset is beyond it's payment end epoch, all operations other than ownership change and dataset deletion are reverted.
Clients & SPs should now call
terminateDataSetPaymenton the service contract to terminate the payment rails for their dataset atomically. The service contract will revert therailTerminatedcallback from the Payments contract if the rail terminator is not the service contract itself.Piece removal is allowed after the payment is terminated for a dataset but piece addition is not as increasing the rate of a terminated rail is not allowed by the payments contract.
Once the dataset is beyond it's payment end epoch, all operations other than ownership change and dataset deletion are reverted.