Skip to content

Cardano blueprint handshake tests#587

Closed
ch1bo wants to merge 5 commits intotxpipe:mainfrom
cardano-scaling:cardano-blueprint-handshake-tests
Closed

Cardano blueprint handshake tests#587
ch1bo wants to merge 5 commits intotxpipe:mainfrom
cardano-scaling:cardano-blueprint-handshake-tests

Conversation

@ch1bo
Copy link
Copy Markdown
Contributor

@ch1bo ch1bo commented Jan 30, 2025

This demonstrates how we could test against test vectors in a common repository from multiple implementations of the ouroboros protocols.

For that matter, simple serialization roundtrip tests against the handshake protocol cddl are added in this PR.

The cardano-blueprint is added as a submodule, but tests using data from it are gated by a blueprint feature flag.

This means, new contributors would experience this workflow:

  • git clone git@github.com:txpipe/pallas.git && cd pallas
  • cargo test -> works, while tests using cardano-blueprint are not run
    • Contributor starts hacking on things
    • NOTE: Any changes are checked in CI including the blueprint tests!
  • After a CI failure or when deliberately wanting to run the blueprint tests:
    • cargo test --features blueprint -> fails because submodule not checked out
    • git submodule update --init checks out submodule
    • cargo test --features blueprint -> works now

@ch1bo ch1bo marked this pull request as draft January 30, 2025 13:10
@ch1bo ch1bo marked this pull request as ready for review January 30, 2025 17:46
@ch1bo
Copy link
Copy Markdown
Contributor Author

ch1bo commented Jan 30, 2025

Happy to remove the flake.nix stuff from this PR.

Also not sure yet about the test data this uses. Right now it's just the first 4 messages created by the Haskell implementation (on one run, it's probabilistic)

@ch1bo ch1bo force-pushed the cardano-blueprint-handshake-tests branch from b82f9bf to 9915040 Compare March 31, 2025 12:44
@ch1bo
Copy link
Copy Markdown
Contributor Author

ch1bo commented Mar 31, 2025

@scarmuega Any opinion on this general approach?

@ch1bo ch1bo force-pushed the cardano-blueprint-handshake-tests branch 2 times, most recently from cfdbaba to 6d370c6 Compare April 1, 2025 18:46
@ch1bo
Copy link
Copy Markdown
Contributor Author

ch1bo commented Apr 1, 2025

Moved the nix bits into an own repository I can easily pull into my workflow for pallas (https://github.com/ch1bo/rust-flake)

I will look into this cargo xtask stuff to make the submodule invisible to first time contributors who just want to git clone and cargo test pallas.

@ch1bo ch1bo moved this to In Review in Cardano Blueprint Apr 1, 2025
@ch1bo ch1bo moved this from In Review to In Progress in Cardano Blueprint Apr 1, 2025
@ch1bo ch1bo moved this from In Progress to In Review in Cardano Blueprint Apr 1, 2025
@ch1bo
Copy link
Copy Markdown
Contributor Author

ch1bo commented Apr 2, 2025

@scarmuega: @KtorZ and me discussed this briefly and we thought putting the cardano-blueprint tests behind a feature flag would work too? What do you think?

ch1bo added 4 commits April 17, 2025 09:28
This is using example test data extracted from the Haskell
implementations test of handshake n2n for v13+
This makes new users not worry about the cardano-blueprint submodule
when they first checkout and `cargo test` the whole project.
@ch1bo ch1bo force-pushed the cardano-blueprint-handshake-tests branch from f6b4f1d to a65c81d Compare April 17, 2025 07:28
@ch1bo
Copy link
Copy Markdown
Contributor Author

ch1bo commented Apr 17, 2025

@scarmuega This should be ready now. The CI action seems not to run on pull_request (I changed that in this PR too)

I also updated the PR description to explain how the feature flag works.

@ch1bo
Copy link
Copy Markdown
Contributor Author

ch1bo commented Apr 25, 2025

Was merged by closing #638

@ch1bo ch1bo closed this Apr 25, 2025
@github-project-automation github-project-automation Bot moved this to ✅ Done in Development Apr 25, 2025
@github-project-automation github-project-automation Bot moved this from In Review to Done in Cardano Blueprint Apr 25, 2025
@ch1bo ch1bo deleted the cardano-blueprint-handshake-tests branch April 25, 2025 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects
Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

1 participant