Skip to content

Message-Based Testing #42

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

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open

Message-Based Testing #42

wants to merge 11 commits into from

Conversation

yHSJ
Copy link
Collaborator

@yHSJ yHSJ commented Jun 11, 2025

This PR introduces:

  • a new ledger_state type that handles the loading and decoding of a canonical ledger state (to be defined)
  • a new snapshot_bootstrapper module that constructs the above ledger_state and broadcasts SnapshotState messages with each element of the ledger_state
  • logic that allows the spo_state module to load state from a SnapshotState message

TODO:

  • Figure out how to apply blocks and then fetch the state once blocks have been applied
  • Write tests that orchestrate all these components together

@yHSJ yHSJ force-pushed the jshy/test-vectors branch 2 times, most recently from 1f2845d to a87de3c Compare June 11, 2025 20:14
@yHSJ yHSJ force-pushed the jshy/test-vectors branch from 20b0962 to 127f3a7 Compare June 12, 2025 13:52
@@ -109,6 +155,16 @@ impl State {
}
}

/// Returns a reference to the block state at a specified height, if applicable
Copy link
Collaborator

Choose a reason for hiding this comment

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

Worth noting that there will only be (k=2160) blocks in the history - anything older than that is thrown away. So great if you just want to capture the tip without race conditions, but you can't use for historical stuff.

@@ -0,0 +1,12 @@
# Acropolis 'omnibus' process
Copy link
Collaborator

Choose a reason for hiding this comment

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

Update required ;-)

## How to run it

```shell
$ cd processes/omnibus
Copy link
Collaborator

Choose a reason for hiding this comment

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

Update

@@ -0,0 +1,71 @@
#TODO: setup configuration as needed
# Top-level configuration for Acropolis omnibus process
Copy link
Collaborator

Choose a reason for hiding this comment

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

Update

[startup]
topic = "cardano.sequence.start"

[message-bus.external]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Don't need this - generally I wonder if the config should be the minimum necessary to run the tests we've actually implemented so far...

@sandtreader sandtreader linked an issue Jun 17, 2025 that may be closed by this pull request
@@ -0,0 +1,31 @@
; This file contains some some basic, shared types that are used throughout the ledger state specification.

hash_28 = bytes .size 32
Copy link
Collaborator

Choose a reason for hiding this comment

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

Forgive my ignorance, but is this size a typo?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, this size is absolutely a typo 🤦

No ignorance there lol

@yHSJ yHSJ force-pushed the jshy/test-vectors branch from c8f9992 to b596abc Compare June 24, 2025 18:34
yHSJ added 10 commits June 24, 2025 14:36
This is very incomplete, the UTxO CDDL definition is not complete and
there are some issues we've encountered with cddl-codegen for generating
types around generics, for example. We've discussed a few potential
solutions to these problems in Slack.

Though it's not complete, we're getting everything merged in a state
where at least it's clear what needs to be worked on when we get back to
it, due to priority shifts at IO.

What is left todo in this specific commit:
  - Complete the UTxO definition
  - Once the CDDL is complete that defines the output from the Haskell
    node, write a simple tool that converts from that representation to
    the canonical representation.
  - Provide some initial test data to use (just testing SPO module to
    start)
@yHSJ yHSJ force-pushed the jshy/test-vectors branch from 6e62dff to 2ccff6c Compare June 24, 2025 18:36
@yHSJ yHSJ marked this pull request as ready for review June 24, 2025 18:36
@yHSJ
Copy link
Collaborator Author

yHSJ commented Jun 24, 2025

I've marked this PR as "Ready for Review" now, even though it's clearly not done. I left some notes for whoever picks up this work once we get time to focus back on Acropolis in commit 0e0a742

Merging this will make it easier to pick back up in the future, less "loose ends" to tie up in N months once we forget everything.

@sandtreader If you think there is any other documentation or notes I should leave, please let me know. Otherwise, feel free to merge this whenever you think the time is right.

@yHSJ
Copy link
Collaborator Author

yHSJ commented Jun 24, 2025

It's also worth noting that I included the generated code from cddl-codegen that Simon and I were using as we were debugging/identifying issues with cddl-codegen, as we discussed in Slack. I don't want our definition of a canonical ledger state to be influenced by any particular tool's shortcomings, but I felt it was helpful context to have when we pick things back up in the future.

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.

Method to start modules from a defined state
3 participants