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

Integration with CLB emulator and bet-ref example #1655

Draft
wants to merge 21 commits into
base: develop
Choose a base branch
from

Conversation

euonymos
Copy link
Contributor

@euonymos euonymos commented Oct 31, 2024

This PR is done as the main part of Milestone 5 of the Catalyst project PSM(CLB).

List of features:

  • brings up CLB emulator
  • bump Ogmios
  • fix era summary parsing
  • bet-ref example
  • update docs on testnet testing

@errfrom I am not sure we have to merge this into CTL in the long-term perspective as we discussed we want to continue further splitting it up into smaller pieces. This way I think the whole testnet suite should be a separate package.

Regarding the original testnet tests - as CHANGELOG.md says some are red. They are out of the scope, but I would like to figure out what is wrong there if I have a couple of spare hours.

Pre-review checklist

  • All code has been formatted using our config (make format)
  • Any new API features or modification of existing behavior are covered with tests
  • The template (templates/ctl-scaffold) has been updated
  • The changelog has been updated under the ## Unreleased header, using the appropriate sub-headings (### Added, ### Changed, ### Removed, ### Fixed), and the links to the appropriate issues/PRs have been included

@euonymos euonymos changed the title Use CLB emulator CLB emulator integration; bet-ref example Nov 22, 2024
@euonymos euonymos changed the title CLB emulator integration; bet-ref example Integration with CLB emulator and bet-ref example Nov 23, 2024
Copy link
Collaborator

@errfrom errfrom left a comment

Choose a reason for hiding this comment

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

Nice PR!

I would not merge it into develop just yet until the issues listed in the changelog are addressed, and all integration tests run successfully against the new testing environment (cardano-testnet + CLB). It's nice to see that both options are briefly compared in the docs, but ideally we should also include benchmarks and a clear description of any shortcomings of CLB (if any), so that users are able to make an informed decision.

As for the other changes (new tests, updated documentation, etc.), let's cherry-pick them into a separate PR.

Regarding the CLB-specific changes, I would suggest merging them into a separate upstream branch for now, until the aforementioned concerns are addressed.

Comment on lines +57 to +59
# it stopped working for later commits on main somehow, so here is the merge
# commit for branch that brings support for ogmios 6.8.0
url = "github:mlabs-haskell/cardano.nix?rev=422b9398d7a7ca1f109900781c7d029db107c8c0";
Copy link
Collaborator

Choose a reason for hiding this comment

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

It is probably because they have removed support for multiple versions in more recent commits - we should make our nix configuration compatible with the latest cardano-nix.

@@ -17,6 +17,7 @@
"blockfrost-local-test": "source ./test/blockfrost-local.env && spago run --main Test.Ctl.Blockfrost.Contract",
"unit-test": "spago run --main Test.Ctl.Unit",
"testnet-test": "spago run --main Test.Ctl.Testnet",
"bet-ref-test": "spago run --main Test.Ctl.BetRef",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's make this test suite part of the testnet-test. I think it's nice to have a more involved example assuming it is stable and takes reasonable time to execute.

Comment on lines +531 to +536
end'' <- getFieldOptional o "end"
end <- case end'' of
Nothing -> pure Nothing
Just end' ->
if isNull end' then pure Nothing
else Just <$> decodeEraSummaryTime end'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
end'' <- getFieldOptional o "end"
end <- case end'' of
Nothing -> pure Nothing
Just end' ->
if isNull end' then pure Nothing
else Just <$> decodeEraSummaryTime end'
end <- traverse decodeEraSummaryTime =<< getFieldOptional' o "end"

Also the comment is obsolete now.

Comment on lines +285 to 295
envP = Object.fromFoldable
[ "TMPDIR" /\ workdir
]
env' = Object.fromFoldable
[ "CARDANO_CLI" /\ "cardano-cli"
, "CARDANO_NODE" /\ "cardano-node"
, "TMPDIR" /\ workdir
]
opts = defaultSpawnOptions
{ cwd = Just workdir
, env = Just $ Object.union env' env
, env = Just $ Object.union envP $ Object.union env env'
, detached = true
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is this rewrite necessary?

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.

2 participants