Skip to content

Normalize rational protocol parameters before comparison - #3854

Merged
mkoura merged 2 commits into
masterfrom
fix/pparam-rational-comparison
Nov 13, 2026
Merged

mkoura merged 2 commits into
masterfrom
fix/pparam-rational-comparison

Conversation

@mkoura

@mkoura mkoura commented Nov 13, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Prevent false failures when equivalent rational values use different representations, such as 8337/16000 and 0.5210625.
  • Move get_rational_pparam() into shared utilities and reuse it for governance thresholds, Leios quorum, Plutus prices, and db-sync checks.
  • Compare committee action-view thresholds numerically while preserving checks of other action fields.
  • Separate fractional unit prices (CostPerUnit) from integer script execution budgets (ExecutionCost) and document both.
  • Add framework regression coverage and extend the committee E2E action-view check.

Testing

  • Framework tests and utility doctests: 661 passed, 1 expected failure.
  • make lint: passed.
  • E2E validation not run because no cluster was running.

Normalize decimal and numerator/denominator protocol parameter values
to fractions before comparing them with proposed updates. Convert
floats through their decimal strings to avoid binary rounding artifacts.

This prevents false failures for equivalent values such as 8337/16000
and 0.5210625.

Validation: make lint passed. E2E validation was not run because no
Cardano node cluster was running.
Move rational parameter conversion into shared helpers and reuse it for
governance thresholds, Leios quorum, Plutus prices and db-sync checks.
Compare committee action thresholds numerically in both JSON forms.

Separate unit prices from integer execution budgets with CostPerUnit,
and document the purpose and fields of both data classes. Add framework
regression tests and extend the committee action-view E2E check.

Validation: 661 framework tests passed, with one expected failure.
Linters passed. E2E validation was not run.
@mkoura
mkoura merged commit 37c8c6a into master Nov 13, 2026
3 checks passed
@mkoura
mkoura deleted the fix/pparam-rational-comparison branch November 13, 2026 16:44
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