Skip to content

Add partial refreshes #300

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

n8maninger
Copy link
Member

@n8maninger n8maninger commented Jul 18, 2025

Alternative to #298 and #299.

The main concern here is that devs will need to explicitly check the host is on a protocol version that supports it instead of it being implicit.

@Copilot 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
Copy link

@Copilot 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 support for partial refreshes in contract refreshes, providing an alternative to full rollover behavior. The change introduces a new RPCRefreshContractPartialRollover function that allows renters to set the allowance of the new contract explicitly without forcing an increase, bringing refresh behavior in line with form and renew operations.

Key changes:

  • Adds RPCRefreshContractPartialRollover function alongside the existing full rollover mechanism
  • Modifies server handler to support both partial and full refresh modes via a new RPC ID
  • Updates the core dependency to include new refresh contract functions

Reviewed Changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
rhp/v4/server.go Adds partial parameter to refresh handler and routes new RPC ID to partial refresh
rhp/v4/rpc.go Implements new partial/full rollover functions and deprecates original refresh function
rhp/v4/rpc_test.go Splits tests into separate partial and full rollover test functions
go.mod Updates core dependency to version with new refresh contract functions
.changeset/add_rpcrefreshpartialrollover.md Documents the breaking change and new functionality
Comments suppressed due to low confidence (1)

rhp/v4/rpc_test.go:462

  • The original TestRPCRefresh test was renamed to TestRPCRefreshPartialRollover, but there's no test that validates the deprecated RPCRefreshContract function still works. Consider adding a test that ensures backward compatibility.
func TestRPCRefreshPartialRollover(t *testing.T) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

1 participant