graph: replace to_signed_u256 with fallible to_i256#6560
Open
incrypto32 wants to merge 1 commit intomasterfrom
Open
graph: replace to_signed_u256 with fallible to_i256#6560incrypto32 wants to merge 1 commit intomasterfrom
incrypto32 wants to merge 1 commit intomasterfrom
Conversation
d2f276b to
280850c
Compare
to_signed_u256 panicked on values outside the int256 range, killing the runner thread silently. The replacement to_i256 returns Result and is plumbed through both reachable call sites (declared-call entity triggers in data_source/common.rs, WASM ABI conversion in runtime/wasm) via the existing Deterministic failure path. to_unsigned_u256 had the symmetric latent panic for values >= 2^256 (via ruint's from_le_slice); add an explicit length check there too. Removes the redundant U256-as-signed-transport API now that alloy provides I256 directly.
280850c to
5bbe22d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
to_signed_u256panicked when given aBigIntoutsideint256range. The reachable call sites (declared-call entity triggers indata_source/common.rs, WASM ABI conversion inruntime/wasm) had no protection, so an out-of-range entity value would kill the runner thread instead of failing the deployment cleanly.Replace it with
to_i256returningResult<I256, _>. Also adds the missing length check into_unsigned_u256(same shape of latent panic via ruint for values>= 2^256).BigInt::to_i256/BigInt::from_i256returningI256directly; oldto_signed_u256/from_signed_u256removed?propagation at the two reachable call sitesto_unsigned_u256now errors instead of panicking on out-of-range positives