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

Fix binary sv2 proc macro #1502

Merged

Conversation

Shourya742
Copy link
Contributor

Reserve internal field names & enforce checks

  • Introduced a reserved set of field names (__decodable_internal_data, __decodable_internal_offset)
  • Added a compile-time error if a struct contains a reserved field name
  • Replaced all occurrences of data and offset with the reserved identifiers

closes: #1473

Copy link

codecov bot commented Feb 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 18.29%. Comparing base (55c01d2) to head (5d1160d).
Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1502      +/-   ##
==========================================
+ Coverage   18.28%   18.29%   +0.01%     
==========================================
  Files         127      127              
  Lines        9716     9716              
==========================================
+ Hits         1777     1778       +1     
+ Misses       7939     7938       -1     
Flag Coverage Δ
binary_codec_sv2-coverage 0.00% <ø> (ø)
binary_sv2-coverage 6.96% <ø> (ø)
bip32_derivation-coverage 0.00% <ø> (ø)
buffer_sv2-coverage 24.88% <ø> (ø)
codec_sv2-coverage 0.02% <ø> (ø)
common_messages_sv2-coverage 0.17% <ø> (ø)
const_sv2-coverage 0.00% <ø> (ø)
error_handling-coverage 0.00% <ø> (ø)
framing_sv2-coverage 0.37% <ø> (ø)
jd_client-coverage 0.42% <ø> (ø)
jd_server-coverage 13.07% <ø> (ø)
job_declaration_sv2-coverage 0.00% <ø> (ø)
key-utils-coverage 2.38% <ø> (ø)
mining-coverage 3.17% <ø> (+0.02%) ⬆️
mining_device-coverage 0.00% <ø> (ø)
mining_proxy_sv2-coverage 0.82% <ø> (ø)
noise_sv2-coverage 5.79% <ø> (ø)
protocols 23.91% <ø> (+0.01%) ⬆️
roles 7.73% <ø> (ø)
roles_logic_sv2-coverage 11.59% <ø> (ø)
sv2_ffi-coverage 0.00% <ø> (ø)
template_distribution_sv2-coverage 0.00% <ø> (ø)
translator_sv2-coverage 9.58% <ø> (ø)
utils 25.04% <ø> (?)
v1-coverage 3.11% <ø> (ø)

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.

@Shourya742 Shourya742 force-pushed the 2025-02-24-fix-binary-sv2-proc-macro branch 2 times, most recently from 4e409c6 to 5ff1f16 Compare February 25, 2025 12:04
@Shourya742 Shourya742 force-pushed the 2025-02-24-fix-binary-sv2-proc-macro branch from 5ff1f16 to 80c5b5b Compare February 25, 2025 12:10
@plebhash plebhash added the ready-to-be-merged triggers auto rebase bot label Feb 25, 2025
@pavlenex pavlenex force-pushed the 2025-02-24-fix-binary-sv2-proc-macro branch from 80c5b5b to 59efad4 Compare February 25, 2025 21:38
- Introduced a reserved set of field names (`__decodable_internal_data`, `__decodable_internal_offset`)
- Added a compile-time error if a struct contains a reserved field name
- Replaced all occurrences of `data` and `offset` with the reserved identifiers
@pavlenex pavlenex force-pushed the 2025-02-24-fix-binary-sv2-proc-macro branch from 59efad4 to 5d1160d Compare February 25, 2025 22:13
@plebhash plebhash merged commit f32c991 into stratum-mining:main Feb 25, 2025
31 checks passed
@Shourya742 Shourya742 deleted the 2025-02-24-fix-binary-sv2-proc-macro branch February 26, 2025 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-be-merged triggers auto rebase bot
Projects
None yet
Development

Successfully merging this pull request may close these issues.

binary_sv2 procedural macro (in derive_codec_sv2 cannot serialize messages with fields named data)
3 participants