02Sheet 02.03.023 · Entries

Integer boundaries where reading the low 64 bits as signed goes wrong

i128 2^63, -2^63 and -1, u128 2^64, i256 -2^63, u256 2^127, u32 max, i32 min, timepoint 2^63: values whose low half has its top bit set.

FIG. · Where it sits · inside LedgerCloseMetaCAP-0046 · H-B4
i128 with lo >= 2^63 and other boundary values

The shape

i128 2^63, -2^63 and -1, u128 2^64, i256 -2^63, u256 2^127, u32 max, i32 min, timepoint 2^63: values whose low half has its top bit set.

Variants

VariantProtocolNetworkSourceSizesha256
p30-mainnet-generatedP30mainnet passphrasegenerated by stellar-core v30.0.04,076 B4d08e71c54c7…
p28-mainnet-generatedP28mainnet passphrasegenerated by stellar-core v30.0.04,068 B730b875c8364…
p30-testnet-generatedP30testnet passphrasegenerated by stellar-core v30.0.04,076 B8723c2675cfb…
p28-testnet-generatedP28testnet passphrasegenerated by stellar-core v30.0.04,068 Bedd87d18dd08…

What a correct reader returns

A correct reader findsValueBacked by
i128 hi 0, lo 2^63 is 9223372036854775808.some change where 1 fields matchconstructionsnapshotcorewalker
i128 hi -1, lo 2^63 is -9223372036854775808.some change where 1 fields matchconstructionsnapshotcorewalker
u256 with only bit 127 set is 170141183460469231731687303715884105728.some change where 1 fields matchconstructionsnapshotcorewalker

Check it yourself

make verify   # schema, hashes, the byte-for-byte round trip and every fact above
make oracle   # the facts' values, re-read by stellar-core and the schema walker

Entry id scval.wide-integer-boundaries · compiled from catalog/scval.wide-integer-boundaries.json · entry.json

On this page