fix: allow a zero slippage tolerance when collecting payments#1236
Open
MoonBoi9001 wants to merge 1 commit into
Open
fix: allow a zero slippage tolerance when collecting payments#1236MoonBoi9001 wants to merge 1 commit into
MoonBoi9001 wants to merge 1 commit into
Conversation
The collection-slippage setting is the indexer's stop-loss when collecting a payment: the most it will accept losing versus the expected amount. Its validator rejected 0, blocking a valid zero-tolerance policy; accept 0 (still capped at 100) so that setting can be used. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
TL;DR
A payment-collection setting that bounds how much the indexer will accept losing versus the expected amount could not be set to zero, even though zero — accept no loss at all — is a valid, strict choice. This change makes the setting accept zero while still capping it at 100.
Motivation
When an indexer collects a payment for indexing work, the payer's on-chain agreement caps can make the amount actually collectable come in below what the indexer expected to earn. A setting bounds the indexer's stop-loss: the largest share of the expected amount it will accept losing before it aborts the collection.
Today that setting's validation rejects a value of zero, so an operator who wants a strict zero-tolerance policy — collect the full expected amount or nothing — cannot configure it and the agent refuses to start. The command-line help already advertises the range as 0 to 100, so the rejection also contradicts the documented range. This change lets the setting accept zero while keeping the cap at 100.
Summary