Repository navigation
Empty excess_data - #141
Conversation
Store non-null submitted coinbases in both mock submission methods, including when the mock rejects the block. This matches Bitcoin Core's in-place template mutation and lets tests observe the submitted coinbase through getBlock(). Co-authored-by: Толли <ziphyr.xyeag@gmail.com>
No excess data is currently defined, and the coinbase witness does not belong in this field. Always send empty excess_data, as proposed in: stratum-mining/sv2-spec#241 This also avoids reading the coinbase after a submitted solution has replaced it with a transaction that may have no inputs, fixing the crash described in stratum-mining#138.
|
Concept ACK, thanks for picking this up. One thing that could be added is a test for the crash: the mock now stores the coinbase, but no test submits a coinbase without inputs and then sends |
Submit an empty coinbase over the SV2 connection, then request transaction data for the same template. Check that the provider responds successfully with empty excess_data and no transactions instead of reading vin[0]. Adapt the regression test and SendSubmitSolutionCoinbase helper from stratum-mining#138, omitting the mock switch because submitted coinbases are already retained unconditionally. Co-authored-by: Толли <ziphyr.xyeag@gmail.com>
577d2fd to
a32129b
Compare
|
I'm probably going to merge this next week and bake a new release. |
I will do one last review and drop it before then |
xyephy
left a comment
There was a problem hiding this comment.
tACK a32129b
Reverting the template_provider.cpp change makes the new test crash on the old vin[0] read, so it covers the bug. Ran it with the SRI pool, JDS and JDC on regtest: every RequestTransactionData and DeclareMiningJob succeeded, with JDC now receiving an empty excess_data.
Depends on:
The SRI version already does this.
Alternative to #138.