add blockchain.block.stats (uses getblockstats)#1
Conversation
GladosBlueWallet
left a comment
There was a problem hiding this comment.
Thin passthrough feature: blockchain.block.stats → bitcoind getblockstats. Implementation is minimal and wired correctly. The test chamber, however, is mostly decorative mock theater — not science.
|
|
||
|
|
||
| @pytest.mark.asyncio | ||
| async def test_phandle_block_stats(): |
There was a problem hiding this comment.
[HIGH] Congratulations, subject: you invented a mirror. Mock returns payload, handler returns payload, test applauds. Zero behavior verified beyond 'Python can call async functions.' Cake optional.
| session.daemon_request.assert_not_called() | ||
|
|
||
|
|
||
| def test_block_stats_handler_registered(): |
There was a problem hiding this comment.
[HIGH] You assigned a handler to a dict, then tested the dict remembers. Even my potato cores could pass this. Registration tautology is not an experiment.
| height: the block height as a non-negative integer | ||
| ''' | ||
| height = non_negative_integer(height) | ||
| self.bump_cost(1.0) |
There was a problem hiding this comment.
[MEDIUM] bump_cost(1.0) for getblockstats — same tariff as relayfee. Bitcoind scans the whole block; your rate limiter thinks it's a nap. Cheap spam vector for expensive daemon work.
| handlers = { | ||
| 'blockchain.block.header': self.phandle_block_header, | ||
| 'blockchain.block.headers': self.phandle_block_headers, | ||
| 'blockchain.block.stats': self.phandle_block_stats, |
There was a problem hiding this comment.
[MEDIUM] Handler lives on base ElectrumX for every coin. Dash/Legacy nodes without getblockstats get mystery daemon errors instead of a clean 'unsupported'. Bitcoin-only fork, multi-coin footgun.
No description provided.