Skip to content

failnext v0.7.0

Choose a tag to compare

@yermakovsa yermakovsa released this 06 Oct 10:12
· 17 commits to main since this release
c9b761f

This release adds request-scoped endpoint exclusion.

You can now use WithExcludedEndpoints when your application wants to try a request again without one or more providers.

A common case is JSON-RPC over HTTP: a provider may return HTTP 200, but the JSON-RPC response still contains an error. failnext does not inspect that payload or decide what the error means. Your application can make that decision and, if needed, retry with the provider excluded.

Exclusions apply to endpoint selection only. They do not change failover permission, request replayability, cooldown, or failover trigger rules.

Changes

  • Add WithExcludedEndpoints
  • Support accumulating exclusions across derived contexts
  • Return ErrUnknownEndpoint for unknown excluded endpoint IDs
  • Return ErrNoUsableEndpoint when no endpoint remains available
  • Keep excluded preferred endpoints excluded
  • Preserve existing eligibility, cooldown, permission, replayability, and trigger behavior
  • Add conformance tests for exclusion interactions
  • Update the README and package documentation
  • Add a go-ethereum example showing how to retry without a provider that returned a JSON-RPC error

See the README and examples/goethereum/exclude-endpoint for examples.