Skip to content

fix(split): reject invalid runtime ratio legs - #1024

Open
woahwhattheheck wants to merge 2 commits into
Stellar-split:mainfrom
woahwhattheheck:sol56/split1012-runtime-ratio-guard-20261007
Open

woahwhattheheck wants to merge 2 commits into
Stellar-split:mainfrom
woahwhattheheck:sol56/split1012-runtime-ratio-guard-20261007

Conversation

@woahwhattheheck

Copy link
Copy Markdown

Closes #1012

Summary

  • validate every declared split ratio as a runtime number, finite, and within [0, 1]
  • distinguish an omitted ratio (undefined) from explicit null and other wrong-type values
  • fail closed on malformed/non-finite values without changing the existing SplitRatioSumError code/fields
  • preserve floating-point tolerance, omitted-ratio contribution, and amount-only split behavior
  • add focused regressions proving hostile values fail before the capacity preflight

Scope

Two files only, based on exact upstream main@230fe3f67e806fbd0f0e67a29bd7b90ffec80789:

  • src/payments/splitExecutor.ts
  • test/splitExecutor.invalid-ratios.test.ts

The earlier competing PR #1015 is closed unmerged. This carrier implements the repair already documented and claimed in #1012, including the additional runtime null/wrong-type escape found during source review.

Validation

Immutable branch readback confirms the runtime type guard, finite/range checks, NaN-safe aggregate comparison, explicit null/wrong-type regressions, preflight blocking, and a 2-ahead / 0-behind exact-base branch.

Prior focused validation of the narrower issue-body candidate was 10/10; this environment has not executed the new runtime-type regressions, so no fresh full-suite/CI-green claim is made here. Hosted CI should be treated as authoritative for the published head.

Claim / compensation

The assignment and payment request is already live on issue #1012 under woahwhattheheck. This PR is the implementation carrier for that claimed contribution. Please evaluate it under the issue's applicable reward/bounty process. No award or payment receipt is asserted.

This branch has not been deployed

No deployments
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.

Bug: invalid recipient ratio legs pass split preflight validation

1 participant