Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove assumption that coinbase scriptSig prefix contains only BIP34 #1461

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

plebhash
Copy link
Collaborator

@plebhash plebhash commented Feb 6, 2025

close #1460

builds on top of #1442

this is a more generic name, as this extra data could be used for other things and not only pool signature

note: this renaming only happens on `roles_logic_sv2`, but not on SRI application layer (`roles`), where the field remains called `pool_signature`
@plebhash plebhash force-pushed the dont-assume-script-sig-bip34 branch 3 times, most recently from 7e085b6 to b0f0257 Compare February 6, 2025 14:25
@plebhash plebhash force-pushed the dont-assume-script-sig-bip34 branch from b0f0257 to e59e1e7 Compare February 6, 2025 14:28
Copy link

codecov bot commented Feb 6, 2025

Codecov Report

Attention: Patch coverage is 93.75000% with 1 line in your changes missing coverage. Please review.

Project coverage is 18.84%. Comparing base (0d00daa) to head (e59e1e7).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
roles/jd-client/src/lib/upstream_sv2/upstream.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1461      +/-   ##
==========================================
+ Coverage   16.71%   18.84%   +2.13%     
==========================================
  Files         155      157       +2     
  Lines       11133    11217      +84     
==========================================
+ Hits         1861     2114     +253     
+ Misses       9272     9103     -169     
Flag Coverage Δ
binary_codec_sv2-coverage 0.00% <ø> (ø)
binary_serde_sv2-coverage 3.40% <ø> (ø)
binary_sv2-coverage 5.11% <ø> (ø)
bip32_derivation-coverage 0.00% <ø> (?)
buffer_sv2-coverage 25.02% <ø> (?)
codec_sv2-coverage 0.01% <ø> (ø)
common_messages_sv2-coverage 0.12% <ø> (ø)
const_sv2-coverage 0.00% <ø> (ø)
error_handling-coverage 0.00% <ø> (?)
framing_sv2-coverage 0.27% <ø> (ø)
jd_client-coverage 0.42% <0.00%> (ø)
jd_server-coverage 9.02% <ø> (ø)
job_declaration_sv2-coverage 0.00% <ø> (ø)
key-utils-coverage 2.39% <ø> (ø)
mining-coverage 2.32% <ø> (-0.02%) ⬇️
mining_device-coverage 0.00% <ø> (ø)
mining_proxy_sv2-coverage 0.82% <ø> (ø)
noise_sv2-coverage 4.25% <ø> (ø)
protocols 23.78% <100.00%> (-0.08%) ⬇️
roles 6.43% <0.00%> (ø)
roles_logic_sv2-coverage 8.62% <100.00%> (-0.09%) ⬇️
sv2_ffi-coverage 0.00% <ø> (ø)
template_distribution_sv2-coverage 0.00% <ø> (ø)
translator_sv2-coverage 9.53% <ø> (ø)
utils 25.13% <ø> (?)
v1-coverage 2.31% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

// witness
let witness = match bip34_bytes.len() {
) -> Result<Transaction, Error> {
// outside of test environments, we need to make sure the BIP34 data is sane
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would remove this test, I don't see why we need to check this here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this is to make sure TP sent the correct BIP34 bytes

otherwise, what's the purpose of the Error::InvalidBip34Bytes variant?

and most importantly: what happens if TP sends a scriptSig with bad BIP34 bytes?

Copy link
Collaborator

Choose a reason for hiding this comment

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

mmm not sure that we should verify if a coin-base is valid or not here. The TP must send valid data otherwise nothing work, so we should assume that is valid IMO. Still IMO is the TP task make sure that templates are good not downstream task.

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.

SRI should not assume that coinbase scriptSig prefix contains only BIP34
2 participants