Skip to content

update typicalMaximumVmNumberByteLength & update conditionals #153

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

Draft
wants to merge 1 commit into
base: next
Choose a base branch
from

Conversation

mr-zwets
Copy link
Contributor

@mr-zwets mr-zwets commented Mar 3, 2025

We noticed that in libauth v3.1.0-next.4 the function vmNumberToBigInt still has the following logic

const typicalMaximumVmNumberByteLength = 8;

where this maximum is the default for maximumVmNumberByteLength which then later triggers the error:

  if (bytes.length > maximumVmNumberByteLength) {
    return VmNumberError.outOfRange;
  }

@bitjson suggested setting the typicalMaximumVmNumberByteLength to zero to disable maximum length checks

maximumVmNumberByteLength appears 144 times in the codebase, sometimes with custom high number value overrides for the BCH consensus for 2025.

I simply updated the defaults and the three inequality checks I found, i did not dive further into the remaining occurrences.

Copy link

changeset-bot bot commented Mar 3, 2025

⚠️ No Changeset found

Latest commit: e9654ec

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

codecov bot commented Mar 3, 2025

Codecov Report

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

Project coverage is 94.22%. Comparing base (489cac0) to head (e9654ec).

Files with missing lines Patch % Lines
src/lib/vm/instruction-sets/common/format.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             next     #153   +/-   ##
=======================================
  Coverage   94.22%   94.22%           
=======================================
  Files         159      159           
  Lines       53320    53327    +7     
  Branches     1626     1626           
=======================================
+ Hits        50239    50246    +7     
  Misses       3080     3080           
  Partials        1        1           

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

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.

1 participant