Skip to content

Add partial refreshes#300

Merged
n8mgr merged 3 commits intomasterfrom
nate/refresh-2-electric-boogaloo
Jul 28, 2025
Merged

Add partial refreshes#300
n8mgr merged 3 commits intomasterfrom
nate/refresh-2-electric-boogaloo

Conversation

@n8mgr
Copy link
Member

@n8mgr n8mgr commented Jul 18, 2025

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

Copilot AI review requested due to automatic review settings July 18, 2025 15:55
@github-project-automation github-project-automation bot moved this to In Progress in Sia Jul 18, 2025

This comment was marked as outdated.

@n8mgr n8mgr force-pushed the nate/refresh-2-electric-boogaloo branch from 88cdcdb to 69a61a4 Compare July 25, 2025 18:46
@n8mgr n8mgr requested a review from Copilot July 25, 2025 18:47
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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
peterjan previously approved these changes Jul 28, 2025
ChrisSchinnerl
ChrisSchinnerl previously approved these changes Jul 28, 2025
@n8mgr n8mgr force-pushed the nate/refresh-2-electric-boogaloo branch from baa1bac to 44315db Compare July 28, 2025 15:16
@n8mgr n8mgr dismissed stale reviews from peterjan and ChrisSchinnerl via d102e0f July 28, 2025 15:17
@n8mgr n8mgr merged commit eb13120 into master Jul 28, 2025
11 checks passed
@n8mgr n8mgr deleted the nate/refresh-2-electric-boogaloo branch July 28, 2025 15:19
@github-project-automation github-project-automation bot moved this from In Progress to Done in Sia Jul 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants