Skip to content

Commit ebc8eac

Browse files
committed
Reset leios-prototype to upstream main (chunked recreation follows)
Snapshot-merge: parents are (old leios-prototype tip, origin/main tip) but tree equals origin/main byte-for-byte. The leios-prototype branch ref moves forward without losing the historic prototype commits — they remain reachable as ancestors via the merge's first parent. The chunks of the recreation land as ordinary commits on top of this one.
2 parents 479f0d0 + e0eafca commit ebc8eac

588 files changed

Lines changed: 45083 additions & 28547 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/benchmarks.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
libtool
4545
make
4646
47-
- uses: actions/checkout@v4
47+
- uses: actions/checkout@v6
4848
with:
4949
ref: ${{ github.head_ref }}
5050

@@ -67,14 +67,14 @@ jobs:
6767
cabal build all --dry-run
6868
cat dist-newstyle/cache/plan.json | jq -L .github/workflows/jq-install-plan | sort | uniq > dependencies.txt
6969
70-
- uses: actions/cache@v4
70+
- uses: actions/cache@v5
7171
name: "Restore cache: `cabal store`"
7272
with:
7373
path: ${{ steps.setup-haskell.outputs.cabal-store }}
7474
key: cache-dependencies-${{ env.CABAL_CACHE_VERSION }}-${{ env.CACHE_VERSION }}-${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('dependencies.txt') }}
7575
restore-keys: cache-dependencies-${{ env.CABAL_CACHE_VERSION }}-${{ env.CACHE_VERSION }}-${{ runner.os }}-${{ matrix.ghc }}
7676

77-
- uses: actions/cache@v4
77+
- uses: actions/cache@v5
7878
name: "Cache `dist-newstyle`"
7979
with:
8080
path: |
@@ -86,7 +86,7 @@ jobs:
8686
- name: Build dependencies
8787
run: cabal build --only-dependencies all -j
8888

89-
- uses: actions/cache/save@v4
89+
- uses: actions/cache/save@v5
9090
name: "Save cache: `cabal store`"
9191
with:
9292
path: ${{ steps.setup-haskell.outputs.cabal-store }}

.github/workflows/build.yml

Lines changed: 38 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99
merge_group:
1010
push:
1111
branches:
12+
- main
1213
- "release/*"
1314

1415
jobs:
@@ -18,7 +19,7 @@ jobs:
1819
strategy:
1920
fail-fast: false
2021
matrix:
21-
ghc: ["8.10.7", "9.6", "9.8", "9.10"]
22+
ghc: ["9.6", "9.8", "9.10", "9.12", "9.14"]
2223
os: [windows-latest]
2324

2425
env:
@@ -44,7 +45,7 @@ jobs:
4445
ghc-version: ${{ matrix.ghc }}
4546
cabal-version: "3.12.1.0"
4647

47-
- uses: actions/checkout@v4
48+
- uses: actions/checkout@v6
4849

4950
- name: "Configure cabal.project.local"
5051
run: |
@@ -65,15 +66,15 @@ jobs:
6566
cabal build all --dry-run
6667
cat dist-newstyle/cache/plan.json | jq -L .github/workflows/jq-install-plan | sort | uniq > dependencies.txt
6768
68-
- uses: actions/cache/restore@v4
69+
- uses: actions/cache/restore@v5
6970
name: "Restore cache: `cabal store`"
7071
id: cache-dependencies
7172
with:
7273
path: ${{ steps.setup-haskell.outputs.cabal-store }}
7374
key: cache-dependencies-${{ env.CABAL_CACHE_VERSION }}-${{ env.CACHE_VERSION }}-${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('dependencies.txt') }}
7475
restore-keys: cache-dependencies-${{ env.CABAL_CACHE_VERSION }}-${{ env.CACHE_VERSION }}-${{ runner.os }}-${{ matrix.ghc }}
7576

76-
- uses: actions/cache@v4
77+
- uses: actions/cache@v5
7778
name: "Cache `dist-newstyle`"
7879
with:
7980
path: |
@@ -85,14 +86,14 @@ jobs:
8586
- name: Build dependencies
8687
run: cabal build --only-dependencies all -j
8788

88-
- uses: actions/cache/save@v4
89+
- uses: actions/cache/save@v5
8990
name: "Save cache: `cabal store`"
9091
if: always() && steps.cache-dependencies.outputs.cache-hit != 'true'
9192
with:
9293
path: ${{ steps.setup-haskell.outputs.cabal-store }}
9394
key: ${{ steps.cache-dependencies.outputs.cache-primary-key }}
9495

95-
- name: Build projects [build]
96+
- name: Build all packages
9697
run: cabal build all -j
9798

9899
# Test network packages
@@ -107,26 +108,45 @@ jobs:
107108
# TODO: issue #4635 to enable `+RTS -N`
108109
run: cabal run network-mux:test
109110

110-
- name: ourobors-network-testing [test]
111-
run: cabal run ouroboros-network-testing:test -- +RTS -maxN2 -RTS
111+
- name: ouroboros-network [api-tests]
112+
run: cabal run ouroboros-network:api-tests
112113

113-
- name: ourobors-network-framework [io-tests]
114+
- name: ourobors-network [tests-lib-tests]
115+
run: cabal run ouroboros-network:tests-lib-tests -- +RTS -maxN2 -RTS
116+
117+
- name: ourobors-network [framework-io-tests]
114118
# TODO: enable `+RTS -N`
115-
run: cabal run ouroboros-network-framework:io-tests
119+
run: cabal run ouroboros-network:framework-io-tests
116120

117-
- name: ourobors-network-framework [sim-tests]
121+
- name: ourobors-network [framework-sim-tests]
118122
if: runner.os != 'Windows'
119-
run: cabal run ouroboros-network-framework:sim-tests -- +RTS -maxN2 -RTS
123+
run: cabal run ouroboros-network:framework-sim-tests -- +RTS -maxN2 -RTS
124+
125+
- name: ouroboros-network [protocols-tests]
126+
run: cabal run ouroboros-network:protocols-tests -- +RTS -maxN2 -RTS
120127

121-
- name: ouroboros-network-protocols [test]
122-
run: cabal run ouroboros-network-protocols:test -- +RTS -maxN2 -RTS
128+
- name: ouroboros-network [ouroboros-network-io-tests]
129+
run: cabal run ouroboros-network:ouroboros-network-io-tests -- +RTS -maxN2 -RTS
123130

124-
- name: ouroboros-network [io-tests]
125-
run: cabal run ouroboros-network:io-tests -- +RTS -maxN2 -RTS
131+
- name: ouroboros-network [ouroboros-network-sim-tests]
132+
if: runner.os != 'Windows'
133+
run: cabal run ouroboros-network:ouroboros-network-sim-tests -- +RTS -maxN2 -RTS
134+
135+
- name: cardano-diffusion [protocols-tests]
136+
if: runner.os != 'Windows'
137+
run: cabal run cardano-diffusion:protocols-tests -- +RTS -maxN2 -RTS
138+
139+
- name: cardano-diffusion [api-tests]
140+
if: runner.os != 'Windows'
141+
run: cabal run cardano-diffusion:api-tests -- +RTS -maxN2 -RTS
142+
143+
- name: cardano-diffusion:protocols-tests
144+
if: runner.os != 'Windows'
145+
run: cabal run cardano-diffusion:protocols-tests -- +RTS -maxN2 -RTS
126146

127-
- name: ouroboros-network [sim-tests]
147+
- name: cardano-diffusion [cardano-diffusion-sim-test]
128148
if: runner.os != 'Windows'
129-
run: cabal run ouroboros-network:sim-tests -- +RTS -maxN2 -RTS
149+
run: cabal run cardano-diffusion:cardano-diffusion-sim-tests -- +RTS -maxN2 -RTS
130150

131151
# Uncomment the following back in for debugging. Remember to launch a `pwsh` from
132152
# the tmux session to debug `pwsh` issues. And be reminded that the `/msys2` and

.github/workflows/checks.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ jobs:
2020
- name: Install dependencies
2121
run: sudo apt install -y fd-find
2222

23-
- uses: actions/checkout@v4
23+
- uses: actions/checkout@v6
24+
with:
25+
fetch-depth: 0
2426

2527
- name: Check changelogs
2628
run: ./scripts/ci/check-changelogs.sh

.github/workflows/github-page.yml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ jobs:
3131

3232
steps:
3333
- name: Checkout ouroboros-network repository
34-
uses: actions/checkout@v4
34+
uses: actions/checkout@v6
3535

3636
# we need nix to later build the spec documents
3737
- name: Install Nix
38-
uses: cachix/install-nix-action@v30
38+
uses: cachix/install-nix-action@v31
3939
with:
4040
nix_path: nixpkgs=channel:nixos-unstable
4141
extra_nix_config: |
@@ -44,13 +44,18 @@ jobs:
4444
experimental-features = nix-command flakes
4545
4646
- name: Install Haskell
47-
uses: haskell-actions/setup@v2
47+
uses: input-output-hk/actions/haskell@latest
4848
id: setup-haskell
4949
with:
5050
ghc-version: ${{ matrix.ghc }}
51-
cabal-version: 'head'
51+
cabal-version: '3.14.1.1'
5252

53-
- uses: actions/cache@v4
53+
- name: Install base libraries
54+
uses: input-output-hk/actions/base@latest
55+
with:
56+
use-sodium-vrf: false
57+
58+
- uses: actions/cache@v5
5459
name: Cache cabal store
5560
with:
5661
path: ${{ steps.setup-haskell.outputs.cabal-store }}
@@ -85,10 +90,10 @@ jobs:
8590
done
8691
8792
- name: Upload artifacts
88-
uses: actions/upload-pages-artifact@v3
93+
uses: actions/upload-pages-artifact@v5
8994
with:
9095
path: ./haddocks
9196

9297
- name: Deploy 🚀
9398
id: deployment
94-
uses: actions/deploy-pages@v4
99+
uses: actions/deploy-pages@v5

.github/workflows/nightly.yml

Lines changed: 12 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
strategy:
1717
fail-fast: false
1818
matrix:
19-
ghc: ["8.10", "9.8"]
19+
ghc: ["9.6", "9.8"]
2020
os: [ubuntu-latest]
2121

2222
env:
@@ -57,7 +57,12 @@ jobs:
5757
run: |
5858
gem install cddl -v 0.8.27
5959
60-
- uses: actions/checkout@v4
60+
- name: Install cddlc
61+
if: runner.os == 'Linux'
62+
run: |
63+
gem install cddlc
64+
65+
- uses: actions/checkout@v6
6166

6267
- name: "Configure cabal.project.local"
6368
run: |
@@ -83,15 +88,15 @@ jobs:
8388
cabal build all --dry-run
8489
cat dist-newstyle/cache/plan.json | jq -L .github/workflows/jq-install-plan | sort | uniq > dependencies.txt
8590
86-
- uses: actions/cache/restore@v4
91+
- uses: actions/cache/restore@v5
8792
name: "Restore cache: `cabal store`"
8893
id: restore-cabal-store
8994
with:
9095
path: ${{ steps.setup-haskell.outputs.cabal-store }}
9196
key: cache-dependencies-${{ env.CABAL_CACHE_VERSION }}-${{ env.CACHE_VERSION }}-${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('dependencies.txt') }}
9297
restore-keys: cache-dependencies-${{ env.CABAL_CACHE_VERSION }}-${{ env.CACHE_VERSION }}-${{ runner.os }}-${{ matrix.ghc }}
9398

94-
- uses: actions/cache@v4
99+
- uses: actions/cache@v5
95100
name: "Cache `dist-newstyle`"
96101
with:
97102
path: |
@@ -103,7 +108,7 @@ jobs:
103108
- name: Build dependencies
104109
run: cabal build --only-dependencies all -j
105110

106-
- uses: actions/cache/save@v4
111+
- uses: actions/cache/save@v5
107112
name: "Save cache: `cabal store`"
108113
with:
109114
path: ${{ steps.setup-haskell.outputs.cabal-store }}
@@ -114,39 +119,8 @@ jobs:
114119

115120
# Test network packages
116121

117-
- name: ntp-client [test]
118-
run: cabal run ntp-client:test -- +RTS -maxN2 -RTS
119-
120-
- name: monoidal-synchronisation [test]
121-
run: cabal run monoidal-synchronisation:test -- +RTS -maxN2 -RTS
122-
123-
- name: network-mux [test]
124-
# TODO: issue #4635 to enable `+RTS -N`
125-
run: cabal run network-mux:test
126-
127-
- name: ourobors-network-testing [test]
128-
run: cabal run ouroboros-network-testing:test -- +RTS -maxN2 -RTS
129-
130-
- name: ourobors-network-framework [sim-tests]
131-
# TODO: enable `+RTS -N`
132-
run: cabal run ouroboros-network-framework:sim-tests
133-
134-
- name: ourobors-network-framework [io-tests]
135-
# TODO: enable `+RTS -N`
136-
run: cabal run ouroboros-network-framework:io-tests
137-
138-
- name: ouroboros-network-protocols [test]
139-
run: cabal run ouroboros-network-protocols:test -- +RTS -maxN2 -RTS
140-
141-
- name: ouroboros-netowrk-protocols [cddl]
142-
if: runner.os == 'Linux'
143-
run: cabal run ouroboros-network-protocols:cddl -- +RTS -maxN2 -RTS
144-
145-
- name: ouroboros-network [io-tests]
146-
run: cabal run ouroboros-network:io-tests -- +RTS -maxN2 -RTS
147-
148-
- name: ouroboros-network [sim-tests]
149-
run: cabal run ouroboros-network:sim-tests -- +RTS -maxN2 -RTS
122+
- name: test all components
123+
run: cabal test all
150124

151125
# Uncomment the following back in for debugging. Remember to launch a `pwsh` from
152126
# the tmux session to debug `pwsh` issues. And be reminded that the `/msys2` and

.gitignore

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ haddocks/
1111
dist-newstyle/
1212
dist/
1313

14-
*.swp
15-
*.swo
14+
*.sw?
1615
*~
1716
\#*
1817
**/tags
@@ -77,3 +76,9 @@ cabal.project.consensus
7776
/*.html
7877
/*.eventlog
7978
/*.prof
79+
80+
# neovim Session
81+
*.vim
82+
83+
/mux-leios-tmp-dir
84+
/tx-submission-tmp-dir

AGENTS.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Ouroboros Network
2+
3+
Ouroboros Network implements network protocols and applications for the Cardano blockchain:
4+
- **network-mux**: Multiplexing library
5+
- **ouroboros-network**: Networking layer for the Ouroboros blockchain protocol
6+
- **cardano-diffusion**: Networking layer for the Cardano blockchain protocol
7+
- **cardano-ping**: Utility for pinging Cardano nodes
8+
- **ntp-client**: NTP client
9+
- **monoidal-synchronisation**: Monoidal synchronisation primitives
10+
- **acts-generic**: Generic instances for the `Act` type class
11+
- **quickcheck-monoids**: QuickCheck utilities for monoids
12+
13+
See [CONTRIBUTING.md](CONTRIBUTING.md) for build setup, coding standards, style guides, and contribution workflow.
14+
15+
## Build
16+
17+
```bash
18+
cabal build all
19+
```
20+
21+
Note: `cabal build` (without `all`) fails at the repo root since there is no package there.
22+
23+
## Testing
24+
25+
See CONTRIBUTING.md for test commands and patterns. Example:
26+
27+
```bash
28+
cabal run ouroboros-network:ouroboros-network-sim-tests -- -p "TxSubmission"
29+
```
30+
31+
## Code Formatting
32+
33+
The script runs `stylish-haskell` in-place and then shows a `git diff` of what changed. Only run it on files relevant to your current work — reformatting unrelated files creates noise in your diff.
34+
35+
```bash
36+
./scripts/ci/run-stylish-haskell.sh -u # uncommitted changes only
37+
./scripts/ci/run-stylish-haskell.sh -c # files in HEAD only
38+
```
39+
40+
Do not run the script without flags — that reformats all `.hs` files in the repo.
41+
42+
Config: `.stylish-haskell-network.yaml`. Requires `fd`/`fdfind` and `stylish-haskell`.
43+
44+
## Important Notes
45+
46+
- When using si-timers from io-classes; **`threadDelay`, `timeout`, `registerDelay` take `DiffTime` (seconds), not microseconds.** Using `3_000_000` means three months, not three seconds.
47+
48+
## Key Architectural Patterns
49+
50+
### Typed Protocols
51+
52+
This codebase uses [typed-protocols](https://github.com/input-output-hk/typed-protocols) for protocol state machines. When modifying protocols:
53+
1. Update the protocol type definition first
54+
2. Ensure all state transitions are covered
55+
3. Update `Codec.hs` for CBOR serialization
56+
4. Add tests in the corresponding test module
57+
58+
### STM-based Coordination
59+
60+
Heavy use of `StrictTVar` from `Control.Concurrent.Class.MonadSTM.Strict`. When modifying shared state:
61+
- Keep critical sections minimal
62+
63+
### Tracing
64+
65+
All components use `Control.Tracer`. When adding new trace events:
66+
1. Add constructor to the relevant `Trace*` type
67+
2. Consider performance impact (avoid expensive operations in hot paths)

CLAUDE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@AGENTS.md

0 commit comments

Comments
 (0)