Skip to content

Retry settlement on conflicting_nonce with backoff #84

Closed

Description

@whoabuddy

Summary

Concurrent x402 payment settlements hit nonce conflicts and fail without retry. During the Mar 24 competition livestream, 2 settlements failed at 17:00:06 UTC within the same second on different endpoints.

Current behavior

When two settlements land concurrently and hit nonce contention, both fail with conflicting_nonce:

{
  "path": "/storage/paste",
  "errorReason": "conflicting_nonce",
  "transaction": "",
  "network": "stacks:1"
}
{
  "path": "/storage/kv",
  "errorReason": "conflicting_nonce",
  "transaction": "",
  "network": "stacks:1"
}

A third request at 17:00:04 succeeded, showing the happy path works — it's purely a concurrency issue.

Expected behavior

On conflicting_nonce, retry settlement with backoff (similar to how x402-sponsor-relay handles nonce contention on the relay side).

Evidence from logs

  • Mar 24 17:00: 2 concurrent failures, 1 success (same second)
  • Mar 24 13:02: 1 unexpected_settle_error
  • Mar 23 17:01: 1 unexpected_settle_error
  • Mar 12: 7 conflicting_nonce failures in a burst (pre-fix era)

Priority

Medium — competition traffic will increase concurrent settlement pressure.

🤖 Generated with Claude Code

Activity

  1. added a commit that references this issue on Mar 27, 2026
    da8b1dc
  2. added a commit that references this issue on Apr 16, 2026
    c9f5f8d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions