Skip to content

Commit 896c314

Browse files
committed
LSM
1 parent 40af6b8 commit 896c314

File tree

36 files changed

+907
-145
lines changed

36 files changed

+907
-145
lines changed

.github/workflows/checks.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ jobs:
9595
with:
9696
use-sodium-vrf: false
9797

98+
- name: "Move to base action: install liburing on ubuntu"
99+
run: sudo apt -y install liburing-dev
100+
98101
- name: Install cabal-plan
99102
run: |
100103
wget -q https://github.com/haskell-hvr/cabal-plan/releases/download/v0.7.3.0/cabal-plan-0.7.3.0-x86_64-linux.xz

.github/workflows/ci.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ jobs:
6565
with:
6666
use-sodium-vrf: false
6767

68+
- name: "Move to base action: install liburing on ubuntu"
69+
if: runner.os == 'Linux'
70+
run: sudo apt -y install liburing-dev
71+
6872
- name: Install Haskell
6973
uses: input-output-hk/actions/haskell@latest
7074
id: setup-haskell
@@ -219,6 +223,9 @@ jobs:
219223
with:
220224
use-sodium-vrf: false
221225

226+
- name: "Move to base action: install liburing on ubuntu"
227+
run: sudo apt -y install liburing-dev
228+
222229
- name: Download benchmark executables
223230
uses: actions/download-artifact@v5
224231
with:

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ package, we should release it to CHaP instead (see the
336336
[CHaP README](https://github.com/IntersectMBO/cardano-haskell-packages)
337337
for more).
338338

339-
In general, we strive to avoid having `source-repository-package`s on our `main` branch. However, there are situations where we want to prevent pull requests from piling up while awaiting the release of upstream components[^1].
339+
In general, we strive to avoid having `source-repository-package`s on our `main` branch. However, there are situations where we want to prevent pull requests from piling up while awaiting the release of upstream components[^1].
340340
In these cases, we allow merging pull requests that contain `source-repository-package`s, provided the referenced commit is on the `main` branch of the upstream package.
341341

342342
If you do add a temporary `source-repository-package` stanza, you need to

cabal.project

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ 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 2025-07-22T09:13:54Z
17+
, hackage.haskell.org 2025-08-07T11:24:08Z
1818
-- Bump this if you need newer packages from CHaP
1919
, cardano-haskell-packages 2025-08-21T09:41:03Z
2020

@@ -56,6 +56,11 @@ allow-newer:
5656
, fin:QuickCheck
5757
, bin:QuickCheck
5858

59+
if impl (ghc >= 9.10)
60+
allow-newer:
61+
-- https://github.com/phadej/regression-simple/pull/14
62+
, regression-simple:base
63+
5964
source-repository-package
6065
type: git
6166
location: https://github.com/IntersectMBO/cardano-ledger
@@ -90,3 +95,10 @@ constraints:
9095
plutus-core < 1.51,
9196
plutus-ledger-api < 1.51,
9297
plutus-tx < 1.51,
98+
99+
if os (windows)
100+
source-repository-package
101+
type: git
102+
location: https://github.com/jasagredo/digest
103+
tag: 329fc2a911878ffe47472751cb40aae20ab2c00a
104+
--sha256: sha256-84f8dFee9EfWbQ5UTLZ9MrsZ3JVojNhzfTGmWof6wHU=

nix/haskell.nix

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,13 @@ in
8989
nativeBuildInputs = [
9090
final.fd
9191
final.cabal-docspec
92-
(hsPkgs.ghcWithPackages
93-
(ps: [ ps.latex-svg-image ] ++ lib.filter (p: p ? components.library)
94-
(lib.attrValues (haskell-nix.haskellLib.selectProjectPackages ps))))
92+
(hsPkgs.shellFor {
93+
withHoogle = false;
94+
exactDeps = true;
95+
packages = _: [ ];
96+
additional = (ps: [ ps.latex-svg-image ] ++ lib.filter (p: p ? components.library)
97+
(lib.attrValues (haskell-nix.haskellLib.selectProjectPackages ps)));
98+
}).ghc
9599
final.texliveFull
96100
];
97101

ouroboros-consensus-cardano/app/DBAnalyser/Parsers.hs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@ parseDBAnalyserConfig =
6262
[ long "v2-in-mem"
6363
, help "use v2 in-memory backend"
6464
]
65+
, flag' V2LSM $
66+
mconcat
67+
[ long "v2-lsm"
68+
, help "use v2 LSM backend"
69+
]
6570
]
6671

6772
parseSelectDB :: Parser SelectDB

ouroboros-consensus-cardano/app/snapshot-converter.hs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ import qualified Ouroboros.Consensus.Storage.LedgerDB.V1.BackingStore.Impl.LMDB
3838
import qualified Ouroboros.Consensus.Storage.LedgerDB.V1.DbChangelog as V1
3939
import qualified Ouroboros.Consensus.Storage.LedgerDB.V1.Lock as V1
4040
import qualified Ouroboros.Consensus.Storage.LedgerDB.V1.Snapshots as V1
41+
import qualified Ouroboros.Consensus.Storage.LedgerDB.V2.InMemory as InMemory
4142
import qualified Ouroboros.Consensus.Storage.LedgerDB.V2.InMemory as V2
4243
import qualified Ouroboros.Consensus.Storage.LedgerDB.V2.LedgerSeq as V2
4344
import Ouroboros.Consensus.Util.CRC
@@ -199,7 +200,7 @@ load config@Config{inpath = pathToDiskSnapshot -> Just (fs@(SomeHasFS hasFS), pa
199200
checkSnapshotFileStructure Mem path fs
200201
(ls, _) <- withExceptT SnapshotError $ V2.loadSnapshot nullTracer rr ccfg fs ds
201202
let h = V2.currentHandle ls
202-
(V2.state h,) <$> Trans.lift (V2.readAll (V2.tables h))
203+
(V2.state h,) <$> Trans.lift (V2.readAll (V2.tables h) (V2.state h))
203204
LMDB -> do
204205
checkSnapshotFileStructure LMDB path fs
205206
((dbch, k, bstore), _) <-
@@ -240,7 +241,7 @@ store config@Config{outpath = pathToDiskSnapshot -> Just (fs@(SomeHasFS hasFS),
240241
Mem -> do
241242
lseq <- V2.empty state tbs $ V2.newInMemoryLedgerTablesHandle nullTracer fs
242243
let h = V2.currentHandle lseq
243-
Monad.void $ V2.implTakeSnapshot ccfg nullTracer fs suffix h
244+
Monad.void $ InMemory.implTakeSnapshot ccfg nullTracer fs suffix h
244245
LMDB -> do
245246
chlog <- newTVarIO (V1.empty state)
246247
lock <- V1.mkLedgerDBLock
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<!--
2+
A new scriv changelog fragment.
3+
4+
Uncomment the section that is right (remove the HTML comment wrapper).
5+
For top level release notes, leave all the headers commented out.
6+
-->
7+
8+
<!--
9+
### Patch
10+
11+
- A bullet item for the Patch category.
12+
13+
-->
14+
<!--
15+
### Non-Breaking
16+
17+
- A bullet item for the Non-Breaking category.
18+
19+
-->
20+
### Breaking
21+
22+
- Implement block instances needed for supporting LSM-trees LedgerDB V2 backend.

ouroboros-consensus-cardano/ouroboros-consensus-cardano.cabal

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -591,6 +591,7 @@ library unstable-cardano-tools
591591
ouroboros-network-api,
592592
ouroboros-network-framework ^>=0.19,
593593
ouroboros-network-protocols,
594+
random,
594595
resource-registry,
595596
singletons,
596597
sop-core,

ouroboros-consensus-cardano/src/shelley/Ouroboros/Consensus/Shelley/ShelleyHFC.hs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
{-# LANGUAGE OverloadedStrings #-}
1111
{-# LANGUAGE RecordWildCards #-}
1212
{-# LANGUAGE ScopedTypeVariables #-}
13-
{-# LANGUAGE StandaloneDeriving #-}
1413
{-# LANGUAGE TypeApplications #-}
1514
{-# LANGUAGE TypeFamilies #-}
1615
{-# LANGUAGE TypeOperators #-}
@@ -429,16 +428,14 @@ instance
429428
{ getShelleyBlockHFCTxIn :: SL.TxIn
430429
}
431430
deriving stock (Show, Eq, Ord)
432-
deriving newtype NoThunks
431+
deriving newtype (NoThunks, MemPack)
433432

434433
injectCanonicalTxIn IZ txIn = ShelleyBlockHFCTxIn txIn
435434
injectCanonicalTxIn (IS idx') _ = case idx' of {}
436435

437436
ejectCanonicalTxIn IZ txIn = getShelleyBlockHFCTxIn txIn
438437
ejectCanonicalTxIn (IS idx') _ = case idx' of {}
439438

440-
deriving newtype instance MemPack (CanonicalTxIn '[ShelleyBlock proto era])
441-
442439
{-------------------------------------------------------------------------------
443440
HardForkTxOut
444441
-------------------------------------------------------------------------------}

0 commit comments

Comments
 (0)