Skip to content

feature: serve getblocktemplate from a precomputed block template #11370

Description

@upbqdn

Every getblocktemplate call reads the state and the mempool, runs ZIP-317 transaction selection, and builds a coinbase transaction, which runs a shielded proof when the miner address has a shielded component. Miners short-poll far more often than the chain tip or the mempool change, so each call pays that cost again, and concurrent long-polls each precompute their own next-tip coinbase (#10747).

Zebra should keep a block template for the current chain tip ready in the background and answer getblocktemplate from it, without reading the state or the mempool on the request path. A precomputed template may be a few seconds behind the mempool, since the next call picks up newer transactions. It must never be behind the chain: a template for height n must not be returned once the tip is at height n.

Part of #11310. Subsumes the suggested fix in #10747.

Activity

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions