Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix enforce-pact-version decimal parser #1334

Merged
merged 3 commits into from
Feb 13, 2024

Conversation

emilypi
Copy link
Member

@emilypi emilypi commented Feb 10, 2024

enforce-pact-version was actually using lexicographic comparison due to the fact that the digit-parser is a stringy parser:

The problem:

> AP.parseOnly (AP.many1 AP.digit) "10"
Right "10"

Which leads to the following case for the first time in Pact's history, now that it has a double-digit version part:

pact> (enforce-pact-version "4.3.1" "4.10.1")
<interactive>:0:0:Error: Invalid pact version 4.10, minimum allowed: 4.3.1
 at <interactive>:0:0: (enforce-pact-version "4.3.1" "4.10.1")

馃帀

This PR uses integer parsing on the version segments:

pact> (enforce-pact-version "4.3.1" "4.10.1")
true

PR checklist:

  • Test coverage for the proposed changes
  • PR description contains example output from repl interaction or a snippet from unit test output
    * [ ] Documentation has been updated if new natives or FV properties have been added. To generate new documentation, issue cabal run tests. If they pass locally, docs are generated.
    * [ ] Any changes that could be relevant to users have been recorded in the changelog
    * [ ] In case of changes to the Pact trace output (pact -t), make sure pact-lsp is in sync.

Additionally, please justify why you should or should not do the following:

  • Confirm replay/back compat
  • Benchmark regressions
  • (For Kadena engineers) Run integration-tests against a Chainweb built with this version of Pact

Copy link
Contributor

@0xd34df00d 0xd34df00d left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this change be under a flag?

It probably shouldn't, since there is no difference in behavior for the already running nodes, and the version where it'd make a difference isn't deployed yet, so it's OK.

@rsoeldner
Copy link
Member

This PR closed #1334

tests/pact/versions.repl Show resolved Hide resolved
tests/pact/versions.repl Show resolved Hide resolved
tests/pact/versions.repl Outdated Show resolved Hide resolved
emilypi and others added 2 commits February 10, 2024 09:39
Co-authored-by: rsoeldner <r.soeldner@gmail.com>
Co-authored-by: rsoeldner <r.soeldner@gmail.com>
@emilypi
Copy link
Member Author

emilypi commented Feb 10, 2024

Fixes #1327

@jmcardon jmcardon merged commit 3fefa52 into master Feb 13, 2024
8 checks passed
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.

None yet

4 participants