Skip to content

add blockchain.block.stats (uses getblockstats)#1

Open
Overtorment wants to merge 1 commit into
masterfrom
add-getblockstats
Open

add blockchain.block.stats (uses getblockstats)#1
Overtorment wants to merge 1 commit into
masterfrom
add-getblockstats

Conversation

@Overtorment

Copy link
Copy Markdown
Member

No description provided.

@GladosBlueWallet GladosBlueWallet left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread tests/server/test_api.py


@pytest.mark.asyncio
async def test_phandle_block_stats():

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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.

Comment thread tests/server/test_api.py
session.daemon_request.assert_not_called()


def test_block_stats_handler_registered():

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants