Page MenuHomePhabricator

Add a simplifygbt option to simplify parsing the block template for miners
Needs RevisionPublic

Authored by Fabien on Tue, Feb 11, 14:22.

Details

Reviewers
roqqit
Group Reviewers
Restricted Project
Summary

The current block template is convoluted for the miner fund and the staking rewards:

  • It is deeply nested, requiring lots of null checks in the miner code
  • The miner fund uses an array for a single value, and address instead of script which requires decoding on the miner code
  • The staking rewards includes a lot of debug information that are irrelevant for miners and causes confusion. E.g. it includes addresses even if any standard script can be used (so address might be absent, or multiple).

This diff adds an option, currently opt-in, to simplify the output for these objects:

  • They now live at the root of the block template object, so coinbasetxn is compliant with bip22
  • They only contain the data which is useful for miners, i.e. the script and the amount to be included in the coinbase output.
Test Plan
ninja check-functional

Diff Detail

Event Timeline

Fabien requested review of this revision.Tue, Feb 11, 14:22
PiRK added inline comments.
doc/release-notes.md
8 ↗(On Diff #52615)
roqqit requested changes to this revision.Tue, Feb 11, 16:32
roqqit added a subscriber: roqqit.

Is there a reason -simplifygbt is a command line arg and not a parameter to getblocktemplate?

This revision now requires changes to proceed.Tue, Feb 11, 16:32