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

wip: genesis tests #367

Closed
wants to merge 64 commits into from
Closed

wip: genesis tests #367

wants to merge 64 commits into from

Conversation

facundominguez
Copy link
Contributor

@facundominguez facundominguez commented Sep 25, 2023

@Niols Niols added do-not-merge Genesis PRs related to Genesis testing and implementation labels Sep 27, 2023
tek and others added 25 commits October 9, 2023 15:40
`PeerSimulator.ScheduledChainSyncServer` now only implements the
boilerplate of fetching the next item from an STM action (the queue) and
maintaining it as shared state between the handlers, in a
`ChainSyncServer`.

`PeerSimulator.Handlers` contains the logic that determines the
intersection and next header from the block tree.

`PeerSimulator.Run` contains only the scheduler, operating on the minimal
set of resources.

`PeerSimulator.Resources` contains the data types and resource
acquisition constructors.
- New module `Test.Ouroboros.Consensus.Genesis.Setup`
- Move `genChains` from its own module to `Genesis.Setup`
- Move `TestSetup`-related code from `LongRangeAttack` to `Genesis.Setup`
Two bits of it still mattered:

- `defaultCfg` moves to its own file `PeerSimulator.Config`
- `ConnectionThread` moves to `PeerSimulator.Run`
- `PointSchedule` now contains a `NonEmpty Tick` which guarantees at
  least one tick and therefore access to the list of peers.

- Get rid of fragments in both `AdvertisedPoints` and `PointSchedule`.

- Cleanup imports of the `PointSchedule` module
…ulator

Refactors some parts of ChainGenerator to be reused by PeerSimulator

Creates individual functions for the steps involved and removes most of the general logic from the property test

Co-authored-by: Nicolas Jeannerod <nicolas.jeannerod@tweag.io>
Co-authored-by: Facundo Dominguez <facundo.dominguez@tweag.io>
Also move the two `Extras` modules into `Test.Consensus.*`.

Co-authored-by: Torsten Schmits <torsten.schmits@tweag.io>
Co-authored-by: Torsten Schmits <torsten.schmits@tweag.io>
@facundominguez
Copy link
Contributor Author

All the commits here have been squashed in #434

@facundominguez facundominguez deleted the fd/genesis-tests branch October 13, 2023 17:49
github-merge-queue bot pushed a commit that referenced this pull request Dec 5, 2023
This PR introduces an initial implementation of a Peer Simulator for
Genesis tests.

A simulated peer is told how to behave by a list of scheduled events
that is generated for every test. In essence, it is an implementation of
a ChainSync server and a BlockFetch server that behave as prescribed by
the schedule.

The rest of the PR provides support infrastructure in the form of:
 * a Praos client node that plays the role of subject under test,
 * an example test for long range attacks, and
* minimal definitions to generate a schedule from the chain schemas
introduced in #240.

This is a squash of the many commits in the integration branch of #367.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do-not-merge Genesis PRs related to Genesis testing and implementation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants