{"id":"XE-16986","kind":"bounty","visibility":"public","source":"github","source_repo":"xeprotocol/xe","source_ref":"697","source_url":"https://github.com/xeprotocol/xe/issues/697","reporter_id":2920,"title":"[Low] SubmitStateChainBlock returns the gossip-publish error after a successful commit (false API rejection)","area":"node-api","claimed_tier":null,"assessed_tier":null,"verdict":"duplicate","duplicate_of":null,"tracked":false,"internal_ref":"","internal_url":"","status":"closed","closed_reason":"duplicate","github_state":"open","disclosed_at":null,"award_xe":null,"award_approved":false,"paid_ref":"","created_at":"2026-11-17T08:13:52.087245+00:00","updated_at":"2026-11-22T23:26:15.399634+00:00","source_created_at":"2026-11-17T08:12:19+00:00","told_at":"2026-11-22T23:26:15.415858+00:00","status_changed_at":"2026-11-22T23:26:15.406544+00:00","url":"https://bounty.xe.network/XE-16986","body":"## Summary\n\n`SubmitStateChainBlock` returns the gossip-publish error after a successful commit, so the API reports 400 \"block rejected\" for a block that IS committed locally. Deterministic trigger: a block whose re-marshaled JSON is in (262134, 262144] passes the MaxBlockSize check but its gossip envelope adds 10 bytes, exceeding the 256 KiB gossip cap. The caller may retry (getting confusing fork/index errors) or conclude the block is invalid.\n\n## Root Cause\n\n`node/node.go:2365-2370`:\n\n```go\nfunc (n *Node) SubmitStateChainBlock(b *statechain.Block) error {\n\tif err := n.StateChain.AddBlock(b); err != nil {\n\t\treturn err\n\t}\n\treturn n.StateChainGossip.Publish(n.ctx, b)\n}\n```\n\nContrast: `SubmitBlock` (`node/node.go:1323-1332`) and `RegisterAccount` (`:2501-2509`) both swallow publish errors and return nil (\"committed locally but gossip publish failed (sync will propagate)\"). `SubmitStateChainBlock` is the odd one out. The statechain submit path is used by the oracle flow.\n\n## Verification\n\nExecuted PoC (unit-level; a full `SubmitStateChainBlock` call needs a whole Node, so the PoC demonstrates the size window plus the return-path code diff):\n\n```\ntuned block JSON size: 262140 (MaxBlockSize=262144)\nfinal block JSON size: 262140 (<= MaxBlockSize 262144: true)\nAddBlock: OK; tip index=1 (block IS committed)\ngossip envelope (StateChainMsg) size: 262150 (MaxGossipMessageSize=262144, over=true)\n```\n\nA block in the (262134, 262144] window commits locally and then fails publish — and the API reports rejection.\n\n## Note on related reports\n\nSearched \"SubmitStateChainBlock publish error rejected\" and \"SubmitStateChainBlock\" — only #58 (timestamps). No hits on the mechanism.\n\n## Suggested fix\n\nMatch `SubmitBlock`: log the publish failure and return nil after a successful commit.\n","patch_refs":[],"thread":[{"id":18852,"source":"desk","source_ref":"reply:16529","author":"Joseph Denne","team":true,"body":"Thanks. This is the same finding as an earlier report that is not public, 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, file a new report that links https://bounty.xe.network/XE-16986 and says what differs; it is read like any other.","created_at":"2026-11-22T23:26:15.399634+00:00"}]}