thehubbleproject / hubble-contracts

Hubble optimistic rollup
https://thehubbleproject.github.io/docs/
MIT License
133 stars 28 forks source link

StorageEngine cannot index values over Number.MAX_SAFE_INTEGER #661

Closed jacque006 closed 2 years ago

jacque006 commented 2 years ago

Problem

When adding or retrieving an item using a StorageEngine, a value over Number.MAX_SAFE_INTEGER cannot be used as the itemID is a number. This is possible with Hubble as L1 ID values are uint256.

Solution

jacque006 commented 2 years ago

Closing as @kautukkundan and I determined that current max ID (stateID, pubkeyID) of trees is (2^32) - 1, and JS has us covered up to (2^53) - 1. This issue can be re-opened/revisited if we substantially increase the ID space.