Skip to content

Commit f65e92a

Browse files
committed
Merge remote-tracking branch 'origin/main' into javierdiaz72/make-stss-computable
2 parents 899ab97 + f4d877b commit f65e92a

File tree

530 files changed

+7394
-5854
lines changed

Some content is hidden

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

530 files changed

+7394
-5854
lines changed

.github/workflows/ci.yml

Lines changed: 70 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -142,18 +142,80 @@ jobs:
142142
if: matrix.test-set == 'all'
143143
run: cabal test all -j --test-show-details=streaming
144144

145-
- name: Test (NoThunks-safe tests only, part 1)
145+
- name: Test (NoThunks-safe tests only)
146146
if: matrix.test-set == 'no-thunks-safe'
147-
run: cabal test ouroboros-consensus:consensus-test ouroboros-consensus:doctest ouroboros-consensus:infra-test ouroboros-consensus:storage-test ouroboros-consensus-cardano:byron-test -j --test-show-details=streaming
147+
run: cabal test ouroboros-consensus:consensus-test ouroboros-consensus:doctest ouroboros-consensus:infra-test ouroboros-consensus:storage-test ouroboros-consensus-cardano:byron-test ouroboros-consensus-cardano:shelley-test ouroboros-consensus-diffusion:infra-test ouroboros-consensus-protocol:protocol-test -j --test-show-details=streaming
148148

149-
- name: Test (NoThunks-safe tests only, part 2)
150-
if: matrix.test-set == 'no-thunks-safe'
151-
run: cabal test ouroboros-consensus-cardano:shelley-test ouroboros-consensus-diffusion:infra-test ouroboros-consensus-diffusion:mock-test ouroboros-consensus-protocol:protocol-test -j --test-show-details=streaming
149+
- name: Identify benchmark executables
150+
run: |
151+
cp $(cabal list-bin mempool-bench) mempool-bench
152+
153+
- name: Upload benchmark executables
154+
uses: actions/upload-artifact@v4
155+
with:
156+
name: benchmark-exes-${{ runner.os }}-${{ matrix.ghc }}
157+
path: mempool-bench
158+
retention-days: 10
159+
160+
# NB: build the haddocks at the end to avoid unecessary recompilations.
161+
# We build the haddocks only for one GHC version.
162+
- name: Build Haddock documentation
163+
if: |
164+
github.event_name == 'push'
165+
&& github.ref == 'refs/heads/main'
166+
&& matrix.ghc=='9.6.6'
167+
run: |
168+
# need for latex, dvisvgm and standalone
169+
sudo apt install texlive-latex-extra texlive-latex-base
170+
# cabal-docspec doesn't work with XDG https://github.com/phadej/cabal-extras/issues/136
171+
sed -i 's_-- store-dir:_store-dir: /home/runner/.local/state/cabal/store_g' ~/.config/cabal/config
172+
export CABAL_CONFIG=~/.config/cabal/config
173+
174+
./scripts/docs/haddocks.sh
175+
tar vzcf haddocks.tgz ./docs/website/static/haddocks
176+
177+
- name: Upload haddocks as an artifact
178+
if: |
179+
github.event_name == 'push'
180+
&& github.ref == 'refs/heads/main'
181+
&& matrix.ghc=='9.6.6'
182+
uses: actions/upload-artifact@v4
183+
with:
184+
name: haddocks
185+
path: haddocks.tgz
186+
retention-days: 1
187+
188+
benchmarks:
189+
name: Run benchmarks
190+
needs: build-test-bench-haddocks
191+
192+
runs-on: ubuntu-latest
193+
strategy:
194+
fail-fast: false
195+
matrix:
196+
ghc: ["8.10.7", "9.6.6", "9.10.1"]
197+
198+
steps:
199+
- uses: actions/checkout@v4
200+
201+
- name: Install base libraries
202+
uses: input-output-hk/actions/base@latest
203+
with:
204+
use-sodium-vrf: false
205+
206+
- name: Download benchmark executables
207+
uses: actions/download-artifact@v4
208+
with:
209+
name: benchmark-exes-${{ runner.os }}-${{ matrix.ghc }}
210+
211+
- name: Set permissions for benchmark executables
212+
run: |
213+
chmod u+x mempool-bench
152214
153215
- name: Create baseline-benchmark
154216
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
155217
run: |
156-
cabal new-run ouroboros-consensus:mempool-bench -- \
218+
./mempool-bench \
157219
--timeout=60 --csv mempool-benchmarks.csv \
158220
+RTS -T
159221
@@ -167,7 +229,6 @@ jobs:
167229
# then we will save the same results we just restored.
168230
- name: Cache benchmark baseline results
169231
uses: actions/cache@v4
170-
if: matrix.variant == 'default'
171232
with:
172233
path: baseline-mempool-benchmarks.csv
173234
key: baseline-mempool-benchmarks-${{ runner.os }}-${{ matrix.ghc }}-${{ github.run_id }}
@@ -192,7 +253,7 @@ jobs:
192253
if: ${{ github.event_name == 'pull_request' }}
193254
run: |
194255
if [ -f baseline-mempool-benchmarks.csv ]; then
195-
cabal new-run ouroboros-consensus:mempool-bench -- \
256+
./mempool-bench \
196257
--timeout=60 --baseline baseline-mempool-benchmarks.csv \
197258
--fail-if-slower 100 \
198259
+RTS -T
@@ -201,34 +262,6 @@ jobs:
201262
echo "Benchmarks comparison skipped."
202263
fi
203264
204-
# NB: build the haddocks at the end to avoid unecessary recompilations.
205-
# We build the haddocks only for one GHC version.
206-
- name: Build Haddock documentation
207-
if: |
208-
github.event_name == 'push'
209-
&& github.ref == 'refs/heads/main'
210-
&& matrix.ghc=='9.6.6'
211-
run: |
212-
# need for latex, dvisvgm and standalone
213-
sudo apt install texlive-latex-extra texlive-latex-base
214-
# cabal-docspec doesn't work with XDG https://github.com/phadej/cabal-extras/issues/136
215-
sed -i 's_-- store-dir:_store-dir: /home/runner/.local/state/cabal/store_g' ~/.config/cabal/config
216-
export CABAL_CONFIG=~/.config/cabal/config
217-
218-
./scripts/docs/haddocks.sh
219-
tar vzcf haddocks.tgz ./docs/website/static/haddocks
220-
221-
- name: Upload haddocks as an artifact
222-
if: |
223-
github.event_name == 'push'
224-
&& github.ref == 'refs/heads/main'
225-
&& matrix.ghc=='9.6.6'
226-
uses: actions/upload-artifact@v4
227-
with:
228-
name: haddocks
229-
path: haddocks.tgz
230-
retention-days: 1
231-
232265
deploy-documentation:
233266
name: Deploy documentation to GitHub Pages
234267
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
@@ -248,7 +281,7 @@ jobs:
248281
cache: yarn
249282
cache-dependency-path: './docs/website/yarn.lock'
250283

251-
- uses: cachix/install-nix-action@V27
284+
- uses: cachix/install-nix-action@v29
252285
with:
253286
extra_nix_config: |
254287
accept-flake-config = true

.github/workflows/documentation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
cache: yarn
3434
cache-dependency-path: './docs/website/yarn.lock'
3535

36-
- uses: cachix/install-nix-action@V27
36+
- uses: cachix/install-nix-action@v29
3737
with:
3838
extra_nix_config: |
3939
accept-flake-config = true

.stylish-haskell.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ steps:
424424
# between actual import and closing bracket.
425425
#
426426
# Default: true
427-
align: true
427+
align: false
428428

429429
# stylish-haskell can detect redundancy of some language pragmas. If this
430430
# is set to true, it will remove those redundant pragmas. Default: true.

CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Ouroboros-Consensus
22

33
# These owners will be the default owners for everything in the repository.
4-
* @nfrisby @jasagredo @amesgen @fraser-iohk @dnadales @RenateEilers
4+
* @nfrisby @jasagredo @amesgen @fraser-iohk @dnadales

CONTRIBUTING.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -370,8 +370,6 @@ The core contributors to consensus codebase are:
370370

371371
- [Damian Nadales](https://github.com/dnadales)
372372

373-
- [Renate Eilers](https://github.com/RenateEilers)
374-
375373
# Code of conduct
376374

377375
See [Cardano engineering

SECURITY.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,19 @@
1+
# Security Policy
2+
3+
## Reporting a Vulnerability
4+
5+
Please report (suspected) security vulnerabilities to [email protected]. You will receive a
6+
response from us within 48 hours. If the issue is confirmed, we will release a patch as soon
7+
as possible.
8+
9+
Please provide a clear and concise description of the vulnerability, including:
10+
11+
* the affected version(s) of OSC-documentation,
12+
* steps that can be followed to exercise the vulnerability,
13+
* any workarounds or mitigations
14+
15+
If you have developed any code or utilities that can help demonstrate the suspected
16+
vulnerability, please mention them in your email but ***DO NOT*** attempt to include them as
17+
attachments as this may cause your Email to be blocked by spam filters.
18+
119
See the security file in the [Cardano engineering handbook](https://github.com/input-output-hk/cardano-engineering-handbook/blob/main/SECURITY.md).

cabal.project

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ repository cardano-haskell-packages
1414
-- update either of these.
1515
index-state:
1616
-- Bump this if you need newer packages from Hackage
17-
, hackage.haskell.org 2024-07-23T00:03:37Z
17+
, hackage.haskell.org 2024-08-26T10:41:44Z
1818
-- Bump this if you need newer packages from CHaP
19-
, cardano-haskell-packages 2024-08-27T16:28:01Z
19+
, cardano-haskell-packages 2024-09-03T00:18:11Z
2020

2121
packages:
2222
ouroboros-consensus
Lines changed: 66 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,66 @@
1-
{-# OPTIONS --safe #-}
2-
3-
open import Agda.Primitive renaming (Set to Type)
4-
5-
module Data.Rational.Ext where
6-
7-
open import Function using (_∘_; _$_)
8-
open import Data.Rational
9-
open import Data.Rational.Properties
10-
open import Data.Product using (_×_; ∃-syntax)
11-
open import Data.Nat as ℕ using (ℕ)
12-
open import Data.Integer as ℤ using (ℤ; +_)
13-
open import Data.Integer.GCD using (gcd)
14-
import Data.Integer.Properties as ℤ
15-
open import Relation.Binary.PropositionalEquality.Core using (_≡_; _≢_; refl)
16-
open import Relation.Binary.PropositionalEquality using (cong; sym; module ≡-Reasoning)
17-
open import Relation.Nullary.Negation using (contradiction)
18-
19-
-- The interval (0, 1]
20-
PosUnitInterval : Type
21-
PosUnitInterval = ∃[ p ] Positive p × p ≤ 1ℚ
22-
23-
record RationalExtStructure : Type where
24-
field
25-
exp :
26-
ln : (p : ℚ) ⦃ Positive p ⦄
27-
28-
p≢1⇒1-p≢0 : {p : ℚ} p ≢ 1ℚ 1ℚ - p ≢ 0ℚ
29-
p≢1⇒1-p≢0 {p} p≢1 1-p≡0 = contradiction p≡1 p≢1
30-
where
31-
open ≡-Reasoning
32-
p≡1 = sym $ begin
33-
1ℚ ≡⟨ sym $ +-identityʳ 1ℚ ⟩
34-
1ℚ + 0ℚ ≡⟨ cong (λ i 1ℚ + i) (sym $ +-inverseˡ p) ⟩
35-
1ℚ + (- p + p) ≡⟨ sym $ +-assoc 1ℚ (- p) p ⟩
36-
(1ℚ - p) + p ≡⟨ cong (_+ p) 1-p≡0 ⟩
37-
0ℚ + p ≡⟨ +-identityˡ p ⟩
38-
p ∎
39-
40-
p≤1⇒1-p≥0 : {p : ℚ} p ≤ 1ℚ 1ℚ - p ≥ 0ℚ
41-
p≤1⇒1-p≥0 {p} p≤1 = +-monoʳ-≤ 1ℚ -p≥-1
42-
where
43-
-p≥-1 = neg-antimono-≤ p≤1
44-
45-
drop-≢ : {p q : ℚ} p ≢ q ↥ p ℤ.* ↧ q ≢ ↥ q ℤ.* ↧ p
46-
drop-≢ p≢q = p≢q ∘ ≃⇒≡ ∘ *≡*
47-
48-
≤∧≢⇒< : {p q : ℚ} p ≤ q p ≢ q p < q
49-
≤∧≢⇒< p≤q p≢q = *<* $ ℤ.≤∧≢⇒< (drop-*≤* p≤q) (drop-≢ p≢q)
50-
51-
p≡1⇒↥p≡↧p : {p : ℚ} p ≡ 1ℚ ↥ p ≡ ↧ p
52-
p≡1⇒↥p≡↧p {p} p≡1
53-
rewrite sym (ℤ.*-identityʳ (↥ p))
54-
| drop-*≡* (≡⇒≃ p≡1)
55-
| ℤ.*-identityˡ (↧ p)
56-
= refl
57-
58-
↥p<↧p⇒p≢1 : {p : ℚ} ↥ p ℤ.< ↧ p p ≢ 1ℚ
59-
↥p<↧p⇒p≢1 n<m n/m≡1 = (ℤ.<⇒≢ n<m) (p≡1⇒↥p≡↧p n/m≡1)
60-
61-
n<m⇒↥[n/m]<↧[n/m] : {n m : ℕ} ⦃ _ : ℕ.NonZero m ⦄ n ℕ.< m ↥ (+ n / m) ℤ.< ↧ (+ n / m)
62-
n<m⇒↥[n/m]<↧[n/m] {n} {m} n<m = ℤ.*-cancelʳ-<-nonNeg g $ begin-strict
63-
(↥ (+ n / m)) ℤ.* g ≡⟨ ↥-/ (+ n) m ⟩
64-
+ n <⟨ ℤ.+<+ n<m ⟩
65-
+ m ≡⟨ sym (↧-/ (+ n) m) ⟩
66-
↧ (+ n / m) ℤ.* g ∎ where open ℤ.≤-Reasoning; g = gcd (+ n) (+ m)
1+
{-# OPTIONS --safe #-}
2+
3+
open import Agda.Primitive renaming (Set to Type)
4+
5+
module Data.Rational.Ext where
6+
7+
open import Function using (_∘_; _$_)
8+
open import Data.Rational
9+
open import Data.Rational.Properties
10+
open import Data.Product using (_×_; ∃-syntax)
11+
open import Data.Nat as ℕ using (ℕ)
12+
open import Data.Integer as ℤ using (ℤ; +_)
13+
open import Data.Integer.GCD using (gcd)
14+
import Data.Integer.Properties as ℤ
15+
open import Relation.Binary.PropositionalEquality.Core using (_≡_; _≢_; refl)
16+
open import Relation.Binary.PropositionalEquality using (cong; sym; module ≡-Reasoning)
17+
open import Relation.Nullary.Negation using (contradiction)
18+
19+
-- The interval (0, 1]
20+
PosUnitInterval : Type
21+
PosUnitInterval = ∃[ p ] Positive p × p ≤ 1ℚ
22+
23+
record RationalExtStructure : Type where
24+
field
25+
exp :
26+
ln : (p : ℚ) ⦃ Positive p ⦄
27+
28+
p≢1⇒1-p≢0 : {p : ℚ} p ≢ 1ℚ 1ℚ - p ≢ 0ℚ
29+
p≢1⇒1-p≢0 {p} p≢1 1-p≡0 = contradiction p≡1 p≢1
30+
where
31+
open ≡-Reasoning
32+
p≡1 = sym $ begin
33+
1ℚ ≡⟨ sym $ +-identityʳ 1ℚ ⟩
34+
1ℚ + 0ℚ ≡⟨ cong (λ i 1ℚ + i) (sym $ +-inverseˡ p) ⟩
35+
1ℚ + (- p + p) ≡⟨ sym $ +-assoc 1ℚ (- p) p ⟩
36+
(1ℚ - p) + p ≡⟨ cong (_+ p) 1-p≡0 ⟩
37+
0ℚ + p ≡⟨ +-identityˡ p ⟩
38+
p ∎
39+
40+
p≤1⇒1-p≥0 : {p : ℚ} p ≤ 1ℚ 1ℚ - p ≥ 0ℚ
41+
p≤1⇒1-p≥0 {p} p≤1 = +-monoʳ-≤ 1ℚ -p≥-1
42+
where
43+
-p≥-1 = neg-antimono-≤ p≤1
44+
45+
drop-≢ : {p q : ℚ} p ≢ q ↥ p ℤ.* ↧ q ≢ ↥ q ℤ.* ↧ p
46+
drop-≢ p≢q = p≢q ∘ ≃⇒≡ ∘ *≡*
47+
48+
≤∧≢⇒< : {p q : ℚ} p ≤ q p ≢ q p < q
49+
≤∧≢⇒< p≤q p≢q = *<* $ ℤ.≤∧≢⇒< (drop-*≤* p≤q) (drop-≢ p≢q)
50+
51+
p≡1⇒↥p≡↧p : {p : ℚ} p ≡ 1ℚ ↥ p ≡ ↧ p
52+
p≡1⇒↥p≡↧p {p} p≡1
53+
rewrite sym (ℤ.*-identityʳ (↥ p))
54+
| drop-*≡* (≡⇒≃ p≡1)
55+
| ℤ.*-identityˡ (↧ p)
56+
= refl
57+
58+
↥p<↧p⇒p≢1 : {p : ℚ} ↥ p ℤ.< ↧ p p ≢ 1ℚ
59+
↥p<↧p⇒p≢1 n<m n/m≡1 = (ℤ.<⇒≢ n<m) (p≡1⇒↥p≡↧p n/m≡1)
60+
61+
n<m⇒↥[n/m]<↧[n/m] : {n m : ℕ} ⦃ _ : ℕ.NonZero m ⦄ n ℕ.< m ↥ (+ n / m) ℤ.< ↧ (+ n / m)
62+
n<m⇒↥[n/m]<↧[n/m] {n} {m} n<m = ℤ.*-cancelʳ-<-nonNeg g $ begin-strict
63+
(↥ (+ n / m)) ℤ.* g ≡⟨ ↥-/ (+ n) m ⟩
64+
+ n <⟨ ℤ.+<+ n<m ⟩
65+
+ m ≡⟨ sym (↧-/ (+ n) m) ⟩
66+
↧ (+ n / m) ℤ.* g ∎ where open ℤ.≤-Reasoning; g = gcd (+ n) (+ m)

docs/agda-spec/src/Interface/HasOrder/Instance.agda

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,6 @@ instance
2626

2727
open import Data.Rational using (ℚ)
2828
import Data.Rational.Properties as Rat hiding (_≟_)
29-
30-
ℚ-Dec-≤ = ⁇² Rat._≤?_
31-
ℚ-Dec-< = ⁇² Rat._<?_
32-
3329
ℚ-hasPreorder = hasPreorderFromNonStrict Rat.≤-isPreorder _≟_
3430
ℚ-hasPartialOrder = HasPartialOrder ∋ record { ≤-antisym = Rat.≤-antisym }
3531
ℚ-hasDecPartialOrder = HasDecPartialOrder {A = ℚ} ∋ record {}

0 commit comments

Comments
 (0)