Skip to content

Support big ints in orchestration in Starlight #477

@lydiagarms

Description

@lydiagarms

Overview

Starlight compiles a Solidity contract into a zApp written in JavaScript. Unlike Solidity's uint256 (which supports integers up to 2^256-1), JavaScript's standard Number type can only safely represent integers up to 9,007,199,254,740,991 (2^53 – 1), known as Number.MAX_SAFE_INTEGER. This means that values above 2^53–1 are not fully supported in the JavaScript output, and large values will lose precision or behave unexpectedly. We should address this by rewriting the orchestration so that we use bigInts. There will still be a limit coming from the field used in the circuits, so make sure to update the Readme with this in mind.

Tasks

  • Rewrite code generator and boilerplates with bigInts instead of using parseInt.
  • Update Readme to reflect this change (make sure to mention new limit coming from zokrates).
  • Test with a number of zolidity contracts with both secret and public variables.

Definition of done

The integer limit should be removed. Contracts should be tested to ensure that integers over 2^53 -1 behave as expected.

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