Skip to content

Read unsigned_int the same way as nodeos - #391

Open
heifner wants to merge 1 commit into
AntelopeIO:mainfrom
heifner:fix/unsigned-int-decode-limit
Open

heifner wants to merge 1 commit into
AntelopeIO:mainfrom
heifner:fix/unsigned-int-decode-limit

Conversation

@heifner

@heifner heifner commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

unsigned_int decoding now reads at most five bytes and keeps the low 32 bits, the same as fc::raw::unpack in Spring (libraries/libfc/include/fc/io/raw.hpp); the loop condition is now identical to fc's. Encodings written by operator<<, cleos and the SDKs decode as before.

unsigned_int_decode_test (tests/unit/varint_tests.cpp) covers the shortest encoding at every width, longer encodings up to five bytes, the five-byte limit, discarded high bits and truncated input.

Contracts rebuilt with this change get new WASM; their ABIs do not change.

`unsigned_int` decoding reads at most five bytes and keeps the low 32 bits, the same as `fc::raw::unpack` in Spring. Adds `unsigned_int_decode_test`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant