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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve native script handling #3765

Merged
merged 1 commit into from
Sep 29, 2023
Merged

Conversation

lehins
Copy link
Contributor

@lehins lehins commented Sep 28, 2023

Description

  • Remove redundant script hash verification. Script Hashes are not transmitted over the wire, they are computed upon deserialization. This means there is no point in recomputing and verifying those hashes as a predicate check in the rules
  • Short circuit multisig and timelock verification for RequireMOf as soon as necessary number of scripts have been validated. Previously it was validating all scripts, regardless of how many was needed.
  • Remove the whole Phased distinction, since it was not used nor is it needed for phase2 scripts. It was only necessary for native, phase1 scripts. That is why a simpler interface was added that deals with native scripts only. Addition of NativeScript, getNativeScript and validateNativeScript

Checklist

  • Commit sequence broadly makes sense and commits have useful messages
  • New tests are added if needed and existing tests are updated
  • When applicable, versions are updated in .cabal and CHANGELOG.md files according to the
    versioning process.
  • The version bounds in .cabal files for all affected packages are updated. If you change the bounds in a cabal file, that package itself must have a version increase. (See RELEASING.md)
  • All visible changes are prepended to the latest section of a CHANGELOG.md for the affected packages. New section is never added with the code changes. (See RELEASING.md)
  • Code is formatted with fourmolu (use scripts/fourmolize.sh)
  • Cabal files are formatted (use scripts/cabal-format.sh)
  • hie.yaml has been updated (use scripts/gen-hie.sh)
  • Self-reviewed the diff

@lehins lehins changed the title Improve native script handling: Improve native script handling Sep 28, 2023
Copy link
Contributor

@TimSheard TimSheard left a comment

Choose a reason for hiding this comment

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

Seems like a better approach. using 'go' seems a bit too obtuse though.

* Remove redundant script hash verification. Script Hashes are not
  transmitted over the wire, they are computed upon deserialization.
  This means there is no point in recomputing and verifying those
  hashes as a predicate check in the rules
* Short circuit multisig and timelock verification for `RequireMOf`
  as soon as necessary number of scripts have been validated. Previously
  it was validating all scripts, regardless of how many was needed.
* Remove the whole Phased distinction, since it was not used nor is it
  needed for phase2 scripts. It was only necessary for native, phase1
  scripts. That is why a simpler interface was added that deals with
  native scripts only.
  Addition of `NativeScript`, `getNativeScript` and `validateNativeScript`
@lehins lehins force-pushed the lehins/simplify-phased-scripts branch from 71bf6ae to 7df6421 Compare September 29, 2023 16:24
@lehins lehins merged commit 537f1e3 into master Sep 29, 2023
11 of 12 checks passed
@iohk-bors iohk-bors bot deleted the lehins/simplify-phased-scripts branch September 29, 2023 18:05
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

2 participants