Bounty
XE-16986 · Bounty

[Low] SubmitStateChainBlock returns the gossip-publish error after a successful commit (false API rejection)

Closed · duplicate — xe#697 filed 2026-11-17 08:12 UTC by kecedanzz77-bit

Report

Summary

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.

Root Cause

node/node.go:2365-2370:

func (n *Node) SubmitStateChainBlock(b *statechain.Block) error {
	if err := n.StateChain.AddBlock(b); err != nil {
		return err
	}
	return n.StateChainGossip.Publish(n.ctx, b)
}

Contrast: 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.

Verification

Executed PoC (unit-level; a full SubmitStateChainBlock call needs a whole Node, so the PoC demonstrates the size window plus the return-path code diff):

tuned block JSON size: 262140 (MaxBlockSize=262144)
final block JSON size: 262140 (<= MaxBlockSize 262144: true)
AddBlock: OK; tip index=1 (block IS committed)
gossip envelope (StateChainMsg) size: 262150 (MaxGossipMessageSize=262144, over=true)

A block in the (262134, 262144] window commits locally and then fails publish — and the API reports rejection.

Note on related reports

Searched "SubmitStateChainBlock publish error rejected" and "SubmitStateChainBlock" — only #58 (timestamps). No hits on the mechanism.

Suggested fix

Match SubmitBlock: log the publish failure and return nil after a successful commit.

Thread

Joseph Denneteam2026-11-22 23:26 UTCdesk

Thanks. This is the same finding as an earlier report that is not public, which was filed first; the programme pays the first verifiable submission, so this one closes as a duplicate. If you believe it is a different bug, file a new report that links https://bounty.xe.network/XE-16986 and says what differs; it is read like any other.