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

Jshooks [DO NOT MERGE] #318

Open
wants to merge 113 commits into
base: dev
Choose a base branch
from
Open

Jshooks [DO NOT MERGE] #318

wants to merge 113 commits into from

Conversation

RichardAH
Copy link
Contributor

@RichardAH RichardAH commented May 24, 2024

High Level Overview of Change

Context of Change

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor (non-breaking change that only restructures code)
  • Tests (you added tests for code that already exists, or your new feature included in this PR)
  • Documentation update
  • Chore (no impact to binary, e.g. .gitignore, formatting, dropping support for older tooling)
  • Release

API Impact

  • Public API: New feature (new methods and/or new fields)
  • Public API: Breaking change (in general, breaking changes should only impact the next api_version)
  • libxrpl change (any change that may affect libxrpl or dependents of libxrpl)
  • Peer protocol change (must be backward compatible or bump the peer protocol version)

RichardAH and others added 30 commits May 24, 2024 10:07
…ubfield slot_type slot_float compiling not tested
… float_sum float_sto float_sto_set float_invert float_divide float_one float_mantissa float_sign float_int float_log float_root
RETURNJS_IF_INVALID_FLOAT(*f1);

if (*f1 == 0)
returnJS(0);
Copy link
Collaborator

@tequdev tequdev Mar 3, 2025

Choose a reason for hiding this comment

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

float_mantissa

The success value should be returned by XFL(bigint).

Suggested change
returnJS(0);
returnJSXFL(0);

int32_t exp = *e;

if (mantissa == 0)
returnJS(0);
Copy link
Collaborator

@tequdev tequdev Mar 3, 2025

Choose a reason for hiding this comment

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

float_set

The success value should be returned by XFL.

Suggested change
returnJS(0);
returnJSXFL(0);

returnJS(INVALID_ARGUMENT);

if (*float1 == 0)
returnJS(0);
Copy link
Collaborator

@tequdev tequdev Mar 3, 2025

Choose a reason for hiding this comment

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

float_negate

The success value should be returned by XFL.

Suggested change
returnJS(0);
returnJSXFL(0);

Comment on lines +346 to +348
JSVM_ERROR = 4,
LEDGER_ERROR =
5, // if the ledger contained for example a nonsense hookapi number
Copy link
Collaborator

Choose a reason for hiding this comment

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

If the Instruction Limit is reached, the ExitType is currently set to UNSET, but it may be worth adding a new ExitType(INSTRUCTION_LIMIT_REACHED) for this case.

Copy link
Collaborator

@tequdev tequdev left a comment

Choose a reason for hiding this comment

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

https://github.com/Xahau/xahaud/blob/jshooks/src/quickjs/quickjs.c#L43359

Either Math.random() should not be used, or the implementation should be changed to give deterministic results.

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.

5 participants