Skip to content
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

Add missing account-related errors for rhp4 #121

Closed
wants to merge 1 commit into from

Conversation

ChrisSchinnerl
Copy link
Member

The renter and host need to agree on errors to return for individual RPCs. This PR adds the expected behavior to the corresponding interface methods.

Right now hostd returns an internal error when an account doesn't exist. That's suboptimal since renterd can't take action based on that. Returning an error for missing accounts seems a bit redundant so I propose just returning a balance of 0 similar to how we do in rhp3.

@ChrisSchinnerl ChrisSchinnerl self-assigned this Nov 22, 2024
rhp/v4/server.go Outdated
@@ -28,6 +28,11 @@ const (
memoryPer100TiB = sectorsPer100TiB * 32
)

var (
ErrBalanceInsufficient = errors.New("ephemeral account balance was insufficient")
ErrMaxBalanceExceeded = errors.New("ephemeral account maximum balance exceeded")
Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure we still need this one. Theoretically with the simplified pricing, we should hopefully not have to worry about that.

@ChrisSchinnerl
Copy link
Member Author

Closing this since it probably belongs into core.

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.

1 participant