Skip to content

Commit b67b723

Browse files
author
Arnaud Bailly
authored
Code restructuring & open-source readiness (#1)
* Unify leios and leios-sim packages * Reformat all code using fourmolu * Add some OSS standard files * Update README with some documentation
1 parent 96541da commit b67b723

File tree

24 files changed

+568
-390
lines changed

24 files changed

+568
-390
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ report/leios-design.pdf
55
report/leios-design.toc
66
*~
77
dist-newstyle/
8+
\#*
9+
.\#*

CODE-OF-CONDUCT.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to making participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, gender identity and expression, level of experience,
9+
education, socio-economic status, nationality, personal appearance, race,
10+
religion, or sexual identity and orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
16+
17+
* Using welcoming and inclusive language
18+
* Being respectful of differing viewpoints and experiences
19+
* Gracefully accepting constructive criticism
20+
* Focusing on what is best for the community
21+
* Showing empathy towards other community members
22+
23+
Examples of unacceptable behavior by participants include:
24+
25+
* The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
* Trolling, insulting/derogatory comments, and personal or political attacks
28+
* Public or private harassment
29+
* Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
* Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
33+
34+
## Our Responsibilities
35+
36+
Project maintainers are responsible for clarifying the standards of acceptable
37+
behavior and are expected to take appropriate and fair corrective action in
38+
response to any instances of unacceptable behavior.
39+
40+
Project maintainers have the right and responsibility to remove, edit, or
41+
reject comments, commits, code, wiki edits, issues, and other contributions
42+
that are not aligned to this Code of Conduct, or to ban temporarily or
43+
permanently any contributor for other behaviors that they deem inappropriate,
44+
threatening, offensive, or harmful.
45+
46+
## Scope
47+
48+
This Code of Conduct applies both within project spaces and in public spaces
49+
when an individual is representing the project or its community. Examples of
50+
representing a project or community include using an official project e-mail
51+
address, posting via an official social media account, or acting as an appointed
52+
representative at an online or offline event. Representation of a project may be
53+
further defined and clarified by project maintainers.
54+
55+
## Enforcement
56+
57+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58+
reported by contacting the project team at {{ email }}. All
59+
complaints will be reviewed and investigated and will result in a response that
60+
is deemed necessary and appropriate to the circumstances. The project team is
61+
obligated to maintain confidentiality with regard to the reporter of an incident.
62+
Further details of specific enforcement policies may be posted separately.
63+
64+
Project maintainers who do not follow or enforce the Code of Conduct in good
65+
faith may face temporary or permanent repercussions as determined by other
66+
members of the project's leadership.
67+
68+
## Attribution
69+
70+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72+
73+
[homepage]: https://www.contributor-covenant.org

CODING-STANDARDS.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Coding Standards
2+
3+
This document provides rules, guidelines, and advices on the structure
4+
of submitted code. As we expect this repository to host code in
5+
various languages, this document will be expanded as needed and we
6+
might link to other relevant documents.
7+
8+
## Haskell
9+
10+
### Code formatting
11+
12+
* Haskell code must be formatted using [fourmolu](https://fourmolu.github.io/) tool, using [provided](fourmolu.yaml) configuration file.
13+
* Cabal files must be formatted using [cabal-fmt](https://github.com/phadej/cabal-fmt).
14+
15+
Check both tools' documentation on how to set it up in your particular environment.
16+
17+
### Testing
18+
19+
We use [hspec](https://hspec.github.io) for writing tests, and we
20+
favour [QuickCheck](https://hackage.haskell.org/package/QuickCheck)
21+
tests over unit tests. All submitted code should be accompanied with
22+
some tests.
23+
24+
## Git
25+
26+
### Commit message format
27+
28+
Here are [seven rules](https://cbea.ms/git-commit/) for great git commit messages:
29+
30+
* Separate subject from body with a blank line
31+
* Limit the subject line to 50 characters (soft limit)
32+
* Capitalize the subject line
33+
* Do not end the subject line with a period
34+
* Use the imperative mood in the subject line and suffix with ticket number if applicable
35+
* Wrap the body at 72 characters (hard limit)
36+
* Use the body to explain what and why vs. how
37+
38+
> [!TIP]
39+
> Git commit messages are our only source of why something was changed the way it was changed. So we better make the readable, concise and detailed (when required).
40+
41+
### Squash & Rebase PRs
42+
43+
When merging accepted Pull Requests, use `Squash & Merge` and ensure the branch has been rebased on top of `main`.
44+
45+
> [!TIP]
46+
> Individual commits history of PRs are mostly useless, and PRs should be small and self-contained.

CONTRIBUTING.md

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
# Contributing to Leios
2+
3+
Thanks for considering contributing and help us on prototyping and
4+
specifying the Mithril protocol for the whole benefit of the Cardano
5+
community!
6+
7+
There are several ways in which you can contribute to this project:
8+
9+
* From reading the [research
10+
paper](https://iohk.io/en/research/library/papers/high-throughput-blockchain-consensus-under-realistic-network-assumptions/),
11+
identify questions that will need to be answered for a practical
12+
implementation of the protocol
13+
* Analyse and document the protocol, its performance profile,
14+
resources requirements, etc.
15+
* Contribute code for prototypes, simulations, numerical analysis, graphing...
16+
* Use the provided prototypes and simulations and provide feedback
17+
18+
## Communication channels
19+
20+
Should you have any questions or need some help in getting set up, you can use
21+
these communication channels to reach the Leios R&D community and get answers in a way
22+
where others can benefit from it as well:
23+
24+
- #leios on the IOG [Discord server]https://discord.gg/Bc6ABMS3)
25+
- GitHub [Discussions](https://github.com/input-output-hk/ouroboros-leios/discussions)
26+
27+
## Your first contribution
28+
29+
Contributing to the documentation, its translation, reporting bugs or proposing features are awesome ways to get started.
30+
31+
### Documentation
32+
33+
We host our documentation / user manual as a website [here](https://leios.cardano-scaling.org/).
34+
35+
Each page has an "Edit this page" button which should take you to the source
36+
file containing the markup. Should you would want to extend the documentation or
37+
find some errors, please file an issue pointing to the mistake or even better,
38+
create a pull request with the changes directly!
39+
40+
### Issues
41+
42+
Whether you found a bug in some code in this repository, or have a specific request to improve it, please [submit an issue](https://github.com/input-output-hk/ouroboros-leios/issues/new).
43+
44+
For bug reports, it's very important to explain
45+
46+
- what version you used (typically a commit SHA or a released version number),
47+
- steps to reproduce (or steps you took),
48+
- what behavior you saw (ideally supported by logs), and
49+
- what behavior you expected.
50+
51+
### Feature ideas
52+
53+
For ideas and questions that need some discussions, we use the [Ideas
54+
discussions
55+
category](https://github.com/input-output-hk/ouroboros-leios/discussions/)
56+
to discuss. Please note that we expect all participants to those
57+
discussions to be mindful of and respect our [Code of
58+
Conduct](CODE-OF-CONDUCT.md).
59+
60+
## Making changes
61+
62+
When contributing code, it helps to have discussed the rationale and (ideally)
63+
how something is implemented in a feature idea or bug ticket beforehand.
64+
65+
### Building & Testing
66+
67+
#### Haskell
68+
69+
To build Haskell code in this repository, you need to install:
70+
71+
* The [GHC](https://www.haskell.org/ghc/) compiler version 9.6.3
72+
* [cabal](https://www.haskell.org/cabal/) build tool
73+
74+
> [!NOTE]
75+
> Installing those tools might depend on your system's details, we suggest two different methods:
76+
>
77+
> * Install [GHCup](https://www.haskell.org/ghcup/) to manage various tools from the Haskell ecosystem
78+
> * Use the provided [Nix shell](shell.nix)
79+
80+
Running `cabal update && cabal build all` at the top-level of the
81+
project should build all the Haskell components. Tests are run with
82+
`cabal test all`.
83+
84+
Besides these general build instructions, some components might document
85+
additional steps and useful tools in their `README.md` files.
86+
87+
### Coding standards
88+
89+
Make sure to read and follow our [Coding
90+
Standards](CODING-STANDARDS.md), it includes guidelines on code
91+
formatting, general style, and some processes. To propose new
92+
standards or changes to the existing standards, file an issue.
93+
94+
### Creating a pull request
95+
96+
Thank you for contributing your changes by opening a pull requests! To get
97+
something merged we usually require:
98+
99+
- Description of the changes - if your commit messages are great, this is less important
100+
- Quality of changes is ensured - through new or updated automated tests in [GitHub Actions](https://github.com/input-output-hk/ouroboros-leios/actions)
101+
- Change is related to an issue, feature (idea) or bug report - ideally discussed beforehand
102+
- Well-scoped - we prefer multiple PRs, rather than a big one
103+
- All your commits must be [signed](https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits) in order to be merged in the `main` branch
104+
105+
### Versioning & Changelog
106+
107+
TBD
108+
109+
### Releasing
110+
111+
TBD

README.md

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,38 @@
1-
This repository is for documentation and tools related to the design and prototyping of Ouroboros Leios.
1+
This repository is home of the _Leios R&D project_ whose purpose is to define a specification of the Ouroboros Leios protocol.
2+
3+
> [!DANGER]
4+
> This project is in its very early stage and is mostly
5+
> experimental and exploratory. All contributions and feedbacks are
6+
> welcome. No warranties of any kind about the current or future
7+
> features of Cardano are to be expected, implicitly and explicitly.
8+
9+
# Getting started
10+
11+
Checkout [CONTRIBUTING.md](CONTRIBUTING.md) document for possible contributions and communication channels
12+
13+
More documentation about Leios can be found in various sources:
14+
15+
* The [Leios CIP](https://github.com/cardano-foundation/CIPs/pull/379) providing rationale and high-level design of the protocol
16+
* The original [Research paper](https://iohk.io/en/research/library/papers/high-throughput-blockchain-consensus-under-realistic-network-assumptions/) is of course the _north star_ of this project
17+
* One of the paper's co-author, Giorgos Panagiotakos, has shot a [video](https://www.youtube.com/watch?v=YEcYVygdhzU) explaining Leios
18+
* [These slides ](https://docs.google.com/presentation/d/1W_KHdvdLNDEStE99D7Af2SRiTqZNnVLQiEPqRHJySqI/edit?usp=sharing) from Sandro Coretti-Drayton, another researcher that worked on Leios might also help getting a good intuition about Leios
219

320
# Content
421

5-
The [Leios CIP](https://github.com/cardano-foundation/CIPs/pull/379) initially proposed in November 2022, yielded the following content:
22+
## Project progress
23+
24+
The [Logbook](Logbook.md) contains a detailed account of problems,
25+
successes, failures, ideas, references and is intended as a tool to
26+
help the team members stay in sync. It's updated frequently with notes
27+
about the day-to-day work, meetings, ideas, etc.
28+
29+
## Archive
30+
31+
The [Leios CIP](https://github.com/cardano-foundation/CIPs/pull/379)
32+
initially proposed in November 2022, yielded the following
33+
content. While the material there is still relevant and useful, it
34+
won't be updated in the future.
635

736
* `report`: the LaTeX source for the design report
837
* `CIP`: the initial version of the Leios CIP
938
* `simulation`: simulation and visualisation code for investigating Leios-like network traffic patterns.
10-
11-
The [Logbook](Logbook.md) contains a detailed account of problems, successes, failures, ideas, references and is intended as a tool to help the team members stay in sync.

docs/leiospaper-submitted.pdf

755 KB
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)