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

Imp Bootstrap address support #4114

Merged
merged 13 commits into from
Feb 28, 2024
Merged

Imp Bootstrap address support #4114

merged 13 commits into from
Feb 28, 2024

Conversation

lehins
Copy link
Contributor

@lehins lehins commented Feb 24, 2024

Description

This PR has a few important changes to ImpSpec:

  • Fix arbitrary going into an infinite loop
  • Bootstrap address fixup support
  • Avoid overwriting witnesses. Instead only missing key witnesses are added.
  • Hashes and keys are generated at random using QuickCheck, instead of relying on an index.
  • Collateral is now injected on demand, instead of a fixed number upon initialization
  • Migration of a couple of Bootstrap address witness tests from cardano-ledger-shelley-test

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 force-pushed the lehins/transition-shelley-test-1 branch 3 times, most recently from 36504e8 to 58fb889 Compare February 25, 2024 01:19
@lehins lehins marked this pull request as ready for review February 25, 2024 01:19
@lehins lehins force-pushed the lehins/transition-shelley-test-1 branch 3 times, most recently from a62c3f4 to 42d7ed5 Compare February 26, 2024 13:21
@lehins lehins force-pushed the lehins/transition-shelley-test-1 branch 2 times, most recently from 7c00166 to 3d45adf Compare February 27, 2024 12:46
Copy link
Contributor

@teodanciu teodanciu left a comment

Choose a reason for hiding this comment

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

Looks good to me (I admit, the keypair generation logic eludes me in some places though)

Copy link
Contributor

@Soupstraw Soupstraw left a comment

Choose a reason for hiding this comment

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

Awesome!

@lehins lehins force-pushed the lehins/transition-shelley-test-1 branch from 3d45adf to 10447e3 Compare February 27, 2024 15:00
@lehins lehins force-pushed the lehins/transition-shelley-test-1 branch 3 times, most recently from 12e2a38 to ae09f90 Compare February 28, 2024 14:01
`addRootTxIn` already takes care of that step
* Add `Uniform` instances for `ByronKeyPair` and `KeyPair`
* Add `mkKeyPairWithSeed`. Reduce duplication
* Add `mkBootKeyPairWithSeed`
* Move `genByronVKeyAddr` and `genByronAddrFromVKey` from
  `cardano-ledger-shelley-test`
* Change how we initialize ImpState. Utilize randomness.

* Starte generating collateral inputs on demand instead of precreating
them during initialization

* Remove usage of a hacky hash index in favor of randomly generated
  hashes and key pairs

* Add random bootstrap address generation

* Stop overwriting existing witnesses. This is useful for supplying
  knowingly invalid witnesses.

* Avoid requiring key witnesses for native scripts that were already
provided
* Tests equivalent to `testBootstrapSpending` and `testBootstrapNotSpending`
where implemented in
`cardano-ledger-shelley:teslib:Test.Cardano.Ledger.Shelley.Imp.UtxowSpec`
* `bootstrapHashTest` has been migrated to `cardano-ledger-core:test`
* Moved `genBootstrapAddress` to
`cardano-ledger-core:testlib:Test.Cardano.Ledger.Core.KeyPairs`
@lehins lehins force-pushed the lehins/transition-shelley-test-1 branch from ae09f90 to 1ae999e Compare February 28, 2024 17:06
@lehins lehins merged commit d3e92cf into master Feb 28, 2024
16 checks passed
@neilmayhew neilmayhew deleted the lehins/transition-shelley-test-1 branch March 8, 2024 21:07
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

3 participants