Skip to content

[FEATURE REQUEST] ✨ use a BigInt polyfill for Lynx support #71

@gauthieramano

Description

@gauthieramano

Context

Currently, Lynx doesn't support Convex because its JavaScript Engine (PrimJS) doesn't support BigInt for tricky reasons as we can read here:

Request

So, can you consider using a Polyfill for BigInt?
(JSBI's one seems to be a proper one)

Implementation

For instance, this:

// The sign bit is the most significant bit (bit 63)
const v1Sign = (v1Bits & 0x8000000000000000n) !== 0n;

would look like this then:

// outside of the function(s)
const BIT_0 = JSBI.BigInt(0);
const BIT_63 = JSBI.BigInt("0x8000000000000000");

and

// The sign bit is the most significant bit (bit 63)
const v1Sign = JSBI.notEqual(JSBI.bitwiseAnd(v1Bits, BIT_63), BIT_0);

Note

I don't know if there will be extra steps before Lynx fully supports Convex (I hope not), but it seems to be a major (and simple) one.

For instance, I have in mind a potential WebSocket issue, but it seems to be quick & easy to fix:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions