8000 Cap contract formation at require height by ChrisSchinnerl · Pull Request #1897 · SiaFoundation/renterd · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Cap contract formation at require height #1897

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

Merged
merged 5 commits into from
May 29, 2025
Merged

Conversation

ChrisSchinnerl
Copy link
Member

This is a little check we already have for renewals but not formations. This allows users with contract periods that cover more than a window between allow height and require height to continue to form v1 contracts.

@ChrisSchinnerl ChrisSchinnerl self-assigned this May 28, 2025
@Copilot Copilot AI review requested due to automatic review settings May 28, 2025 12:17
@github-project-automation github-project-automation bot moved this to In Progress in Sia May 28, 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 a guard in formContract to ensure v1 contracts are never formed at or beyond the v2 require height.

  • Introduces logic to cap endHeight to HardforkV2.RequireHeight - 1
  • Adds commentary describing the cap behavior
Comments suppressed due to low confidence (2)

bus/bus.go:648

  • [nitpick] Consider renaming v2ReqHeight to v2RequireHeight for improved clarity.
v2ReqHeight := b.cm.TipState().Network.HardforkV2.RequireHeight

bus/bus.go:646

  • Add unit tests to verify that endHeight is correctly capped to RequireHeight - 1 when it meets or exceeds the v2 require height.
// cap v1 formations to the v2 require height since the host won't allow us to

@ChrisSchinnerl ChrisSchinnerl force-pushed the chris/cap-v2-formation branch from 4cef176 to ec1ae55 Compare May 28, 2025 17:03
@n8maninger n8maninger merged commit fb9b024 into master May 29, 2025
19 checks passed
@n8maninger n8maninger deleted the chris/cap-v2-formation branch May 29, 2025 23:29
@github-project-automation github-project-automation bot moved this from In Progress to Done in Sia May 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants
0