{"id":"XE-2445","kind":"bounty","visibility":"public","source":"github","source_repo":"xeprotocol/xe","source_ref":"319","source_url":"https://github.com/xeprotocol/xe/issues/319","reporter_id":568,"title":"[Minor] Deterministic block rejections return HTTP 503 with retryable:true","area":"node-api","claimed_tier":"minor","assessed_tier":null,"verdict":"duplicate","duplicate_of":"XE-0014","tracked":true,"internal_ref":"#1063","internal_url":"https://github.com/xeprotocol/core/issues/1063","status":"closed","closed_reason":"duplicate","github_state":"closed","disclosed_at":null,"award_xe":null,"award_approved":false,"paid_ref":"","created_at":"2026-11-10T00:12:00.509838+00:00","updated_at":"2026-11-16T10:40:12.603890+00:00","source_created_at":"2026-11-09T13:53:51+00:00","told_at":"2026-11-10T12:19:21+00:00","status_changed_at":"2026-11-10T12:19:16.660896+00:00","url":"https://bounty.xe.network/XE-2445","body":"Summary:\nSeveral deterministic, permanent block-validation failures are returned as HTTP 503 (Service Unavailable) with \"retryable\": true, even though resubmitting the identical block will never succeed. Per the API spec, errors should be a JSON object with error.code / error.message / error.hint; these responses carry no code/hint, and the 503/retryable semantics incorrectly signal a transient server problem.\n\nAffected component:\n- HTTP API block ingestion (POST /api/v1/blocks/send, POST /api/v1/blocks/receive) on testnet node (https://test.network/api/v1)\n- Scope per program: HTTP API\n\nEvidence (reproduced 2026-11-09, testnet-0005):\n\nCase 1 — \"previous mismatch\" (permanent client error) → 503 + retryable:true\nSubmitting a valid, correctly signed send block whose previous references a hash that is not the account's frontier:\n{\"error\":\"block rejected: previous mismatch: block references 3f681f61... but account frontier is 967416ba...\",\"retryable\":true}\n\nHTTP status: 503\n\nCase 2 — \"source send not pending\" → 503 + retryable:true\nSubmitting a receive block whose source send is not pending (e.g. replayed claim, or non-existent source):\n{\"error\":\"block rejected: source send not pending: abababababab...\",\"retryable\":true}\n\nHTTP status: 503\n\nIn both cases the identical block resubmitted later returns the same permanent rejection — the error is not transient. For comparison, correctly-classified permanent errors on the same endpoints return 400 with \"retryable\": false (e.g. \"block rejected: invalid proof of work\"), so classification is inconsistent between error paths.\n\nImpact:\n1. Incorrect retry semantics: HTTP-aware clients, SDKs, and load balancers treat 503/retryable as transient and will retry with backoff — generating pointless load and \"stuck\" integrations that loop forever on a permanently invalid block.\n2. Monitoring/alerting skew: 503s are typically routed to infrastructure on-call (server health), not to client-side validation bugs.\n3. Inconsistent contract: identical severity of error (permanent validation failure) yields 400/retryable:false on some paths and 503/retryable:true on others.\n\nSuggested fix:\nReturn 400 with retryable: false for deterministic validation failures (previous mismatch, source not pending, conflicts with finalized block), keep 503 only for genuinely transient conditions, and include error.code/error.hint per the documented error schema.\n\nReproduction:\nAny correctly-signed block can be replayed against a stale previous hash:\n1. Submit a valid send block (201).\n2. Resubmit another valid send block built on an older frontier hash → 503, retryable: true, identical result on every retry.\n\nFull PoC scripts (Python, ed25519 signing + canonical v2 encoding) available on request.\n\nProposed tier: Minor (inconsistent/incorrect API error semantics, no direct economic impact)\n\nReporter:\n- XE address for reward: afdc3f26ac9fabbecdfd4130c0c8990cc3ab367c9c4c1c82cda5ddb4d1d23692\n- Only my own accounts were used; no third-party accounts or infrastructure were affected.\n\n---\n\n📍 Address XE : afdc3f26ac9fabbecdfd4130c0c8990cc3ab367c9c4c1c82cda5ddb4d1d23692","patch_refs":[{"id":486,"repo":"xeprotocol/xe","kind":"pr","ref":"320","title":"fix(core,api): classify deterministic block validation failures as non-retryable 400 (#319)","url":"https://github.com/xeprotocol/xe/pull/320","note":"","state":"open","author":"tipprb","added_by":"desk","created_at":"2026-11-10T00:12:01.832547+00:00"}],"thread":[{"id":1547,"source":"github","source_ref":"6744532878","author":"grizelshalom","team":false,"body":"Thanks for the quick fix — I'm the original reporter of #319. The classification\nmatches my suggested fix exactly (400 + retryable:false for deterministic\nrejections, 503 reserved for transient conditions).\n\nFor the record: reproduced on testnet-0005 on 2026-11-09 via signed blocks\n(previous mismatch on POST /blocks/send, source-not-pending on POST\n/blocks/receive). Happy to share the full PoC scripts (Python, ed25519 signing +\ncanonical v2 encoding) if maintainers need them.\n\nPayout addresses:\n- XE L1: afdc3f26ac9fabbecdfd4130c0c8990cc3ab367c9c4c1c82cda5ddb4d1d23692\n- Base USDC: 0xba7015ea1de4b84626dbebece3807a21206642ed","created_at":"2026-11-09T15:54:00+00:00"},{"id":2040,"source":"github","source_ref":"6767119795","author":"Joseph Denne","team":true,"body":"Thanks. This is the same finding as https://bounty.xe.network/XE-0014, which was filed first; the programme pays the\nfirst verifiable submission, so this one closes as a duplicate. If you believe it is a different\nbug, reply with what differs and we will look again.","created_at":"2026-11-10T12:19:21+00:00"}]}