1 suggestion
Optional improvements
[suggestion] · Signet serving adds a redundant solution check and caller precondition
The Signet-only branch retains a check that other raw block reads skip, although blocks are checked before storage and the current caller is guarded.
Location: src/node/blockstorage.cpp:1158 (head).
Details and suggested fix
ReadBlockWithoutWitness skips ReadBlock's Signet solution check. Its Assume(!GetConsensus().signet_blocks) does not enforce the precondition in release builds; the current caller is instead guarded by the Signet check in ProcessGetBlockData.
The extra serving-time check can only detect local corruption of transaction bytes: blocks are checked by CheckBlock before they are written, and the expected-hash check pins the header. Other raw block reads, including MSG_WITNESS_BLOCK, /rest/block, and getblock, already skip this check. If the serving-time check is unnecessary, remove the Signet clause, Assume, and header precondition so both message types use the same path. If it is needed, have ReadBlockWithoutWitness call ReadBlock on Signet and serialize with TX_NO_WITNESS; this removes the caller precondition and lets net_processing use the method for every disk-backed MSG_BLOCK.