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(core/weighting): remove optional and define correct rounding for usize::MAX #5490

Conversation

sdbondi
Copy link
Member

@sdbondi sdbondi commented Jun 23, 2023

Description

make features_and_scripts_byte_per_gram mandatory and update the weighting code

Motivation and Context

The optional features_and_scripts_bytes_per_gram was previously optional to keep compatibility with a previous block/tx weighting calculation which did not account for metadata bytes (i.e. features_and_scripts_bytes_per_gram is None). This is no longer needed.

How Has This Been Tested?

Existing tests, updated a unit test

What process can a PR reviewer use to test or verify this change?

Mine blocks containing transactions

Breaking Changes

  • None (assuming no existing transaction metadata is big enough to exceed usize::MAX)
  • Requires data directory on base node to be deleted
  • Requires hard fork
  • Other - Please specify

@sdbondi sdbondi force-pushed the core-weighting-redefine-features_and_script_bytes_per_gram branch 2 times, most recently from 80b0187 to 5433a12 Compare June 23, 2023 09:27
@github-actions
Copy link

github-actions bot commented Jun 23, 2023

Test Results (CI)

1 170 tests   1 170 ✔️  12m 59s ⏱️
     37 suites         0 💤
       1 files           0

Results for commit d5d8a33.

♻️ This comment has been updated with latest results.

@ghpbot-tari-project ghpbot-tari-project added P-acks_required Process - Requires more ACKs or utACKs P-reviews_required Process - Requires a review from a lead maintainer to be merged labels Jun 23, 2023
@github-actions
Copy link

github-actions bot commented Jun 23, 2023

Test Results (Integration tests)

  2 files  11 suites   16m 39s ⏱️
26 tests 25 ✔️ 0 💤 1
27 runs  26 ✔️ 0 💤 1

For more details on these failures, see this check.

Results for commit d5d8a33.

♻️ This comment has been updated with latest results.

@sdbondi sdbondi force-pushed the core-weighting-redefine-features_and_script_bytes_per_gram branch from 5433a12 to d5d8a33 Compare June 23, 2023 12:33
@ghpbot-tari-project ghpbot-tari-project removed the P-reviews_required Process - Requires a review from a lead maintainer to be merged label Jun 23, 2023
@SWvheerden SWvheerden merged commit 38c399a into tari-project:development Jun 23, 2023
@sdbondi sdbondi deleted the core-weighting-redefine-features_and_script_bytes_per_gram branch June 23, 2023 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P-acks_required Process - Requires more ACKs or utACKs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants