Conversation
88cdcdb to
69a61a4
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR adds partial refresh functionality to contract refresh operations, allowing more efficient fund management. Instead of requiring full rollover of all funds when refreshing a contract, this change introduces a new partial rollover option where renters can set their spendable allowance without forcing increases, and hosts only need to rollover existing risked collateral and revenue.
- Updates protocol version from 4.0.0 to 5.0.0
- Adds new partial rollover RPC handling in the server
- Refactors client-side RPC refresh functions with partial rollover support
Reviewed Changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| rhp/v4/server.go | Updates protocol version and adds partial refresh RPC handling |
| rhp/v4/rpc_test.go | Comprehensive test suite for partial rollover functionality |
| rhp/v4/rpc.go | Refactors refresh contract functions to support both full and partial rollover |
| go.mod | Updates core dependency to v0.15.0 |
| .changeset/add_rpcrefreshpartialrollover.md | Documents the new partial rollover feature |
peterjan
previously approved these changes
Jul 28, 2025
ChrisSchinnerl
previously approved these changes
Jul 28, 2025
baa1bac to
44315db
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously, renters and hosts had to rollover all funds when refreshing a contract. With this change, renters can set their spendable allowance without forcing an increase and hosts only have to rollover their existing risked collateral and revenue. This change increases efficiency of refreshing without compromising the collateral guarantees of existing data or forcing hosts to lock additional collateral that won't be utilized.
Implementers are required to check whether the host is on protocol 5.0.0 before calling RPCRefreshPartial