oasisprotocol / sapphire-paratime

Oasis Sapphire - the confidential EVM-compatible ParaTime for the Oasis Network
https://oasisprotocol.org/sapphire
Apache License 2.0
37 stars 27 forks source link

use `core.CallDataPublicKey` subcall, not `oasis_callDataPublicKey` RPC call #372

Closed CedarMist closed 1 month ago

CedarMist commented 2 months ago

Fixes #367

This requires Sapphire 0.8 on mainnet before the package can be published.

netlify[bot] commented 2 months ago

Deploy Preview for oasisprotocol-sapphire-paratime canceled.

Name Link
Latest commit b323d9d4a7b081e545230be08a01c505f21ad668
Latest deploy log https://app.netlify.com/sites/oasisprotocol-sapphire-paratime/deploys/66e8139b44fc9800095c3410
CedarMist commented 2 months ago

So, we have a build bug with bigint literals:

Error: src/calldatapublickey.ts(59,46): error TS2737: BigInt literals are not available when targeting lower than ES2020.

e.g.

return bytes.reduce((acc, byte) => (acc << 8n) | BigInt(byte), 0n);

Not sure if we should change the target, or remove the bigint literals. I'm surprised we haven't seen this bug before. The place it's being used is for manual parsing of uint256 from abi results (so as to not pull in a full ABI decoding library). The expected values are going to be small, and certainly within a Javascript Number's safe-int-range

aefhm commented 2 months ago

So, we have a build bug with bigint literals:

Error: src/calldatapublickey.ts(59,46): error TS2737: BigInt literals are not available when targeting lower than ES2020.

e.g.

return bytes.reduce((acc, byte) => (acc << 8n) | BigInt(byte), 0n);

Not sure if we should change the target, or remove the bigint literals. I'm surprised we haven't seen this bug before. The place it's being used is for manual parsing of uint256 from abi results (so as to not pull in a full ABI decoding library). The expected values are going to be small, and certainly within a Javascript Number's safe-int-range

I think I'm comfortable going up.