HomePhabricator

[64-bit ints] Allow 63+sign-bit ints in ParseScript

Description

[64-bit ints] Allow 63+sign-bit ints in ParseScript

Summary:
After D17300, 63+sign-bit integers are now allowed in Script, if the script flag SCRIPT_ENABLE_63_BIT_INTS is enabled (currently always off).

Currently, we cannot add tests to script_tests.json, as parsing 63+sign-bit numbers fails.

This diff allows parsing all valid decimal numbers in ParseScript, i.e. any number between (including) -9223372036854775807 and +9223372036854775807.

Note: It seems like atoi64 (strtoll under the hood) makes it hard to detect faulty numbers, therefore we use our ParseInt64, which returns a boolean.

Partial backport of lotusd#71.

Test Plan: ninja check

Reviewers: Fabien, #bitcoin_abc

Reviewed By: Fabien, #bitcoin_abc

Differential Revision: https://reviews.bitcoinabc.org/D18460

Details

Provenance
tobias_ruckAuthored on Aug 8 2025, 10:11
tobias_ruckPushed on Aug 12 2025, 10:23
Reviewer
Restricted Project
Differential Revision
D18460: [64-bit ints] Allow 63+sign-bit ints in ParseScript
Parents
rABC04b7566e3ec8: [e.cash] Place common sections
Branches
Unknown
Tags
Unknown