diff --git a/.github/workflows/cabal.project.local.ci.Darwin b/.github/workflows/cabal.project.local.ci similarity index 100% rename from .github/workflows/cabal.project.local.ci.Darwin rename to .github/workflows/cabal.project.local.ci diff --git a/.github/workflows/cabal.project.local.ci.Linux b/.github/workflows/cabal.project.local.ci.Linux deleted file mode 100644 index 415a21c29c..0000000000 --- a/.github/workflows/cabal.project.local.ci.Linux +++ /dev/null @@ -1,5 +0,0 @@ -package cardano-crypto-praos - flags: -external-libsodium-vrf - -package HsOpenSSL - flags: +use-pkg-config diff --git a/.github/workflows/cabal.project.local.ci.MINGW64_NT-10.0-20348 b/.github/workflows/cabal.project.local.ci.MINGW64_NT-10.0-20348 deleted file mode 100644 index 415a21c29c..0000000000 --- a/.github/workflows/cabal.project.local.ci.MINGW64_NT-10.0-20348 +++ /dev/null @@ -1,5 +0,0 @@ -package cardano-crypto-praos - flags: -external-libsodium-vrf - -package HsOpenSSL - flags: +use-pkg-config diff --git a/.github/workflows/haskell.yml b/.github/workflows/haskell.yml index 27e785cdbc..a06400170c 100644 --- a/.github/workflows/haskell.yml +++ b/.github/workflows/haskell.yml @@ -6,21 +6,37 @@ on: jobs: build: - runs-on: ${{ matrix.os }} + runs-on: ${{ matrix.sys.os }} strategy: fail-fast: false matrix: - ghc: ["8.10.7", "9.2.7", "9.6.2"] + ghc: ["8.10.7", "9.2.8", "9.6.2"] cabal: ["3.10.1.0"] os: [ubuntu-latest, macos-latest, windows-latest] + sys: + - { os: windows-latest, shell: 'C:/msys64/usr/bin/bash.exe -e {0}' } + - { os: macos-latest, shell: bash } + - { os: ubuntu-latest, shell: bash } exclude: - - ghc: "9.2.7" - os: macos-latest + - ghc: "9.2.8" + sys.os: macos-latest + + defaults: + run: + shell: ${{ matrix.sys.shell }} env: + MSYSTEM: MINGW64 + + # do not ever change to $HOME by yourself. + CHERE_INVOKING: 1 + + # do we want to inherit the path? + MSYS2_PATH_TYPE: inherit + # Modify this value to "invalidate" the cabal cache. - CABAL_CACHE_VERSION: "2023-07-12" + CABAL_CACHE_VERSION: "2023-08-01" concurrency: group: > @@ -29,7 +45,7 @@ jobs: c+${{ github.job }} d+${{ matrix.ghc }} e+${{ matrix.cabal }} - f+${{ matrix.os }} + f+${{ matrix.sys.os }} g+${{ (startsWith(github.ref, 'refs/heads/gh-readonly-queue/') && github.run_id) || github.event.pull_request.number || github.ref }} cancel-in-progress: true @@ -42,26 +58,44 @@ jobs: c+${{ github.job }} d+${{ matrix.ghc }} e+${{ matrix.cabal }} - f+${{ matrix.os }} + f+${{ matrix.sys.os }} g+${{ (startsWith(github.ref, 'refs/heads/gh-readonly-queue/') && github.run_id) || github.event.pull_request.number || github.ref }} + - name: Install Base libs + uses: input-output-hk/actions/base@latest + with: + use-sodium-vrf: false + - name: Install Haskell - uses: input-output-hk/actions/haskell@latest id: setup-haskell + uses: input-output-hk/actions/haskell@latest with: ghc-version: ${{ matrix.ghc }} cabal-version: ${{ matrix.cabal }} - - - name: Install system dependencies - uses: input-output-hk/actions/base@latest - with: - use-sodium-vrf: true # default is true - uses: actions/checkout@v3 - + + - name: Install lmdb + run: | + if [[ ${{ runner.os }} == "Windows" ]]; then + /usr/bin/pacman --noconfirm -S mingw-w64-x86_64-lmdb + elif [[ ${{ runner.os }} == "macOS" ]]; then + brew install lmdb + sudo cp ./.github/workflows/lmdb.pc /usr/local/lib/pkgconfig + else + sudo apt install liblmdb-dev + fi + - name: Cabal update run: cabal update + - name: Configure build + shell: bash + run: | + cp .github/workflows/cabal.project.local.ci cabal.project.local + echo "# cabal.project.local" + cat cabal.project.local + - name: Build dry run run: cabal build all --dry-run --minimize-conflict-set @@ -109,9 +143,6 @@ jobs: - name: Run tests env: - # these two are msys2 env vars, they have no effect on non-msys2 installs. - MSYS2_PATH_TYPE: inherit - MSYSTEM: MINGW64 TMPDIR: ${{ runner.temp }} TMP: ${{ runner.temp }} KEEP_WORKSPACE: 1 @@ -137,7 +168,7 @@ jobs: - name: Save Artifact uses: actions/upload-artifact@v1 with: - name: artifacts-${{ matrix.os }}-${{ matrix.ghc }} + name: artifacts-${{ matrix.sys.os }}-${{ matrix.ghc }} path: ./artifacts # Uncomment the following back in for debugging. Remember to launch a `pwsh` from diff --git a/.github/workflows/lmdb.pc b/.github/workflows/lmdb.pc new file mode 100644 index 0000000000..fc4838ed47 --- /dev/null +++ b/.github/workflows/lmdb.pc @@ -0,0 +1,11 @@ +prefix=/usr/local +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${exec_prefix}/include + +Name: liblmdb +Description: Lightning Memory-Mapped Database +URL: https://symas.com/products/lightning-memory-mapped-database/ +Version: 0.9.29 +Libs: -L${libdir} -llmdb +Cflags: -I${includedir} \ No newline at end of file diff --git a/cabal.project b/cabal.project index a224037470..aee50f8aad 100644 --- a/cabal.project +++ b/cabal.project @@ -13,17 +13,14 @@ repository cardano-haskell-packages -- See CONTRIBUTING for information about these, including some Nix commands -- you need to run if you change them index-state: - , hackage.haskell.org 2023-07-10T22:41:49Z - , cardano-haskell-packages 2023-07-12T13:59:36Z + , hackage.haskell.org 2023-07-26T23:47:54Z + , cardano-haskell-packages 2023-08-02T11:20:00Z packages: cardano-api cardano-api-gen -package cardano-api - ghc-options: -Werror - -package cardano-api-gen +program-options ghc-options: -Werror package cryptonite @@ -38,14 +35,19 @@ test-show-details: direct -- Always write GHC env files, because they are needed for ghci. write-ghc-environment-files: always -if impl(ghc >= 9.6) - allow-newer: - -- Only really needed because `cardano-ledger-byron-test` has not yet been released to CHaP - -- and its not possible to specify `cardano-ledger-byron-test:base` because the dependencies - -- of `cardano-ledger-byron-test` also do not permit the version of `base` that `ghc-9.6` - -- provides. - , *:base - -- IMPORTANT -- Do NOT add more source-repository-package stanzas here unless they are strictly -- temporary! Please read the section in CONTRIBUTING about updating dependencies. + +-- utxo-hd +source-repository-package + type: git + location: https://github.com/input-output-hk/ouroboros-consensus + tag: 5f94982bd6400b2dca3cfc3619e6bb9896775e68 + --sha256: 1prkxx0bwfcy8ss61hxnxk94zfkyx653l28h6bhc08hsg7pbd58z + subdir: + ouroboros-consensus + ouroboros-consensus-cardano + ouroboros-consensus-cardano-legacy-block + ouroboros-consensus-protocol + ouroboros-consensus-diffusion diff --git a/cardano-api/cardano-api.cabal b/cardano-api/cardano-api.cabal index 0bf45ad217..1c27c8558e 100644 --- a/cardano-api/cardano-api.cabal +++ b/cardano-api/cardano-api.cabal @@ -161,6 +161,7 @@ library internal , optparse-applicative-fork , ouroboros-consensus >= 0.9 , ouroboros-consensus-cardano >= 0.7 + , ouroboros-consensus-cardano-legacy-block , ouroboros-consensus-diffusion >= 0.7 , ouroboros-consensus-protocol >= 0.5.0.4 , ouroboros-network diff --git a/cardano-api/internal/Cardano/Api/LedgerState.hs b/cardano-api/internal/Cardano/Api/LedgerState.hs index 33b2217a20..60f46b2def 100644 --- a/cardano-api/internal/Cardano/Api/LedgerState.hs +++ b/cardano-api/internal/Cardano/Api/LedgerState.hs @@ -157,9 +157,9 @@ import qualified Ouroboros.Consensus.Protocol.Abstract as Consensus import qualified Ouroboros.Consensus.Protocol.Praos.Common as Consensus import Ouroboros.Consensus.Protocol.Praos.VRF (mkInputVRF, vrfLeaderValue) import qualified Ouroboros.Consensus.Protocol.TPraos as TPraos -import qualified Ouroboros.Consensus.Shelley.Eras as Shelley +import qualified Ouroboros.Consensus.Shelley.Eras as Shelley hiding (StandardCrypto) import qualified Ouroboros.Consensus.Shelley.Ledger.Block as Shelley -import qualified Ouroboros.Consensus.Shelley.Ledger.Ledger as Shelley +import qualified Ouroboros.Consensus.Shelley.Ledger.Ledger as Shelley hiding (LedgerState) import qualified Ouroboros.Consensus.Shelley.Node.Praos as Consensus import Ouroboros.Consensus.TypeFamilyWrappers (WrapLedgerEvent (WrapLedgerEvent)) import qualified Ouroboros.Network.Block @@ -192,7 +192,8 @@ import Data.Sequence (Seq) import qualified Data.Sequence as Seq import Data.Set (Set) import qualified Data.Set as Set -import Data.SOP.Strict (K (..), NP (..), fn, (:.:) (Comp)) +import Data.SOP.Functors (Flip (..)) +import Data.SOP.Strict (Compose, K (..), NP (..), fn, hcmap, (:.:) (Comp)) import Data.Text (Text) import qualified Data.Text as Text import qualified Data.Text.Encoding as Text @@ -205,6 +206,8 @@ import Lens.Micro ((^.)) import Network.TypedProtocol.Pipelined (Nat (..)) import System.FilePath +import qualified Legacy.Convert as Legacy + data InitialLedgerStateError = ILSEConfigFile Text -- ^ Failed to read or parse the network config file. @@ -292,37 +295,37 @@ applyBlock env oldState validationMode block ShelleyBasedEraConway -> Consensus.BlockConway shelleyBlock pattern LedgerStateByron - :: Ledger.LedgerState Byron.ByronBlock + :: Ledger.LedgerState Byron.ByronBlock mk -> LedgerState pattern LedgerStateByron st <- LedgerState (Consensus.LedgerStateByron st) pattern LedgerStateShelley - :: Ledger.LedgerState (Shelley.ShelleyBlock protocol (Shelley.ShelleyEra Shelley.StandardCrypto)) + :: Ledger.LedgerState (Shelley.ShelleyBlock protocol (Shelley.ShelleyEra Consensus.StandardCrypto)) mk -> LedgerState pattern LedgerStateShelley st <- LedgerState (Consensus.LedgerStateShelley st) pattern LedgerStateAllegra - :: Ledger.LedgerState (Shelley.ShelleyBlock protocol (Shelley.AllegraEra Shelley.StandardCrypto)) + :: Ledger.LedgerState (Shelley.ShelleyBlock protocol (Shelley.AllegraEra Consensus.StandardCrypto)) mk -> LedgerState pattern LedgerStateAllegra st <- LedgerState (Consensus.LedgerStateAllegra st) pattern LedgerStateMary - :: Ledger.LedgerState (Shelley.ShelleyBlock protocol (Shelley.MaryEra Shelley.StandardCrypto)) + :: Ledger.LedgerState (Shelley.ShelleyBlock protocol (Shelley.MaryEra Consensus.StandardCrypto)) mk -> LedgerState pattern LedgerStateMary st <- LedgerState (Consensus.LedgerStateMary st) pattern LedgerStateAlonzo - :: Ledger.LedgerState (Shelley.ShelleyBlock protocol (Shelley.AlonzoEra Shelley.StandardCrypto)) + :: Ledger.LedgerState (Shelley.ShelleyBlock protocol (Shelley.AlonzoEra Consensus.StandardCrypto)) mk -> LedgerState pattern LedgerStateAlonzo st <- LedgerState (Consensus.LedgerStateAlonzo st) pattern LedgerStateBabbage - :: Ledger.LedgerState (Shelley.ShelleyBlock protocol (Shelley.BabbageEra Shelley.StandardCrypto)) + :: Ledger.LedgerState (Shelley.ShelleyBlock protocol (Shelley.BabbageEra Consensus.StandardCrypto)) mk -> LedgerState pattern LedgerStateBabbage st <- LedgerState (Consensus.LedgerStateBabbage st) pattern LedgerStateConway - :: Ledger.LedgerState (Shelley.ShelleyBlock protocol (Shelley.ConwayEra Shelley.StandardCrypto)) + :: Ledger.LedgerState (Shelley.ShelleyBlock protocol (Shelley.ConwayEra Consensus.StandardCrypto)) mk -> LedgerState pattern LedgerStateConway st <- LedgerState (Consensus.LedgerStateConway st) @@ -914,7 +917,15 @@ readByteString fp cfgType = ExceptT $ initLedgerStateVar :: GenesisConfig -> LedgerState initLedgerStateVar genesisConfig = LedgerState - { clsState = Ledger.ledgerState $ Consensus.pInfoInitLedger $ fst protocolInfo + { clsState = + HFC.HardForkLedgerState + $ hcmap + (Proxy @(Compose Ledger.CanStowLedgerTables Ledger.LedgerState)) + (Flip . Ledger.stowLedgerTables . unFlip) + $ HFC.hardForkLedgerStatePerEra + $ Ledger.ledgerState + $ Consensus.pInfoInitLedger + $ fst protocolInfo } where protocolInfo = mkProtocolInfoCardano genesisConfig @@ -922,7 +933,7 @@ initLedgerStateVar genesisConfig = LedgerState newtype LedgerState = LedgerState { clsState :: Ledger.LedgerState (HFC.HardForkBlock - (Consensus.CardanoEras Consensus.StandardCrypto)) + (Consensus.CardanoEras Consensus.StandardCrypto)) Ledger.EmptyMK } encodeLedgerState :: LedgerState -> CBOR.Encoding @@ -931,43 +942,44 @@ encodeLedgerState (LedgerState (HFC.HardForkLedgerState st)) = (byron :* shelley :* allegra :* mary :* alonzo :* babbage :* conway :* Nil) st where - byron = fn (K . Byron.encodeByronLedgerState) - shelley = fn (K . Shelley.encodeShelleyLedgerState) - allegra = fn (K . Shelley.encodeShelleyLedgerState) - mary = fn (K . Shelley.encodeShelleyLedgerState) - alonzo = fn (K . Shelley.encodeShelleyLedgerState) - babbage = fn (K . Shelley.encodeShelleyLedgerState) - conway = fn (K . Shelley.encodeShelleyLedgerState) + byron = fn (K . Byron.encodeByronLedgerState . unFlip) + shelley = fn (K . Shelley.encodeShelleyLedgerState . unFlip) + allegra = fn (K . Shelley.encodeShelleyLedgerState . unFlip) + mary = fn (K . Shelley.encodeShelleyLedgerState . unFlip) + alonzo = fn (K . Shelley.encodeShelleyLedgerState . unFlip) + babbage = fn (K . Shelley.encodeShelleyLedgerState . unFlip) + conway = fn (K . Shelley.encodeShelleyLedgerState . unFlip) decodeLedgerState :: forall s. CBOR.Decoder s LedgerState decodeLedgerState = LedgerState . HFC.HardForkLedgerState <$> HFC.decodeTelescope (byron :* shelley :* allegra :* mary :* alonzo :* babbage :* conway :* Nil) where - byron = Comp Byron.decodeByronLedgerState - shelley = Comp Shelley.decodeShelleyLedgerState - allegra = Comp Shelley.decodeShelleyLedgerState - mary = Comp Shelley.decodeShelleyLedgerState - alonzo = Comp Shelley.decodeShelleyLedgerState - babbage = Comp Shelley.decodeShelleyLedgerState - conway = Comp Shelley.decodeShelleyLedgerState + byron = Comp $ Flip <$> Byron.decodeByronLedgerState + shelley = Comp $ Flip <$> Shelley.decodeShelleyLedgerState + allegra = Comp $ Flip <$> Shelley.decodeShelleyLedgerState + mary = Comp $ Flip <$> Shelley.decodeShelleyLedgerState + alonzo = Comp $ Flip <$> Shelley.decodeShelleyLedgerState + babbage = Comp $ Flip <$> Shelley.decodeShelleyLedgerState + conway = Comp $ Flip <$> Shelley.decodeShelleyLedgerState type LedgerStateEvents = (LedgerState, [LedgerEvent]) toLedgerStateEvents :: LedgerResult - ( Shelley.LedgerState - (HFC.HardForkBlock (Consensus.CardanoEras Shelley.StandardCrypto)) + ( Ledger.LedgerState + (HFC.HardForkBlock (Consensus.CardanoEras Consensus.StandardCrypto)) ) - ( Shelley.LedgerState - (HFC.HardForkBlock (Consensus.CardanoEras Shelley.StandardCrypto)) + ( Ledger.LedgerState + (HFC.HardForkBlock (Consensus.CardanoEras Consensus.StandardCrypto)) + Ledger.EmptyMK ) -> LedgerStateEvents toLedgerStateEvents lr = (ledgerState, ledgerEvents) where ledgerState = LedgerState (lrResult lr) ledgerEvents = mapMaybe (toLedgerEvent - . WrapLedgerEvent @(HFC.HardForkBlock (Consensus.CardanoEras Shelley.StandardCrypto))) + . WrapLedgerEvent @(HFC.HardForkBlock (Consensus.CardanoEras Consensus.StandardCrypto))) $ lrEvents lr -- Usually only one constructor, but may have two when we are preparing for a HFC event. @@ -977,7 +989,7 @@ data GenesisConfig !Cardano.Chain.Genesis.Config !ShelleyConfig !AlonzoGenesis - !(ConwayGenesis Shelley.StandardCrypto) + !(ConwayGenesis Consensus.StandardCrypto) newtype LedgerStateDir = LedgerStateDir { unLedgerStateDir :: FilePath @@ -1123,7 +1135,7 @@ readAlonzoGenesisConfig enc = do readConwayGenesisConfig :: NodeConfig - -> ExceptT GenesisConfigError IO (ConwayGenesis Shelley.StandardCrypto) + -> ExceptT GenesisConfigError IO (ConwayGenesis Consensus.StandardCrypto) readConwayGenesisConfig enc = do let file = ncConwayGenesisFile enc firstExceptT (NEConwayConfig (unFile file) . renderConwayGenesisError) @@ -1227,7 +1239,7 @@ renderAlonzoGenesisError sge = readConwayGenesis :: ConwayGenesisFile 'In -> GenesisHashConway - -> ExceptT ConwayGenesisError IO (ConwayGenesis Shelley.StandardCrypto) + -> ExceptT ConwayGenesisError IO (ConwayGenesis Consensus.StandardCrypto) readConwayGenesis (File file) expectedGenesisHash = do content <- handleIOExceptT (ConwayGenesisReadError file . textShow) $ BS.readFile file let genesisHash = GenesisHashConway (Cardano.Crypto.Hash.Class.hashWith id content) @@ -1279,8 +1291,8 @@ newtype StakeCred deriving (Eq, Ord) data Env = Env - { envLedgerConfig :: HFC.HardForkLedgerConfig (Consensus.CardanoEras Shelley.StandardCrypto) - , envProtocolConfig :: TPraos.ConsensusConfig (HFC.HardForkProtocol (Consensus.CardanoEras Shelley.StandardCrypto)) + { envLedgerConfig :: HFC.HardForkLedgerConfig (Consensus.CardanoEras Consensus.StandardCrypto) + , envProtocolConfig :: TPraos.ConsensusConfig (HFC.HardForkProtocol (Consensus.CardanoEras Consensus.StandardCrypto)) } envSecurityParam :: Env -> Word64 @@ -1305,7 +1317,7 @@ applyBlock' :: Env -> LedgerState -> ValidationMode - -> HFC.HardForkBlock + -> HFC.HardForkBlock (Consensus.CardanoEras Consensus.StandardCrypto) -> Either LedgerStateError LedgerStateEvents applyBlock' env oldState validationMode block = do @@ -1334,16 +1346,22 @@ applyBlockWithEvents env oldState enableValidation block = do -- the block matches the head hash of the ledger state. tickThenReapplyCheckHash :: HFC.HardForkLedgerConfig - (Consensus.CardanoEras Shelley.StandardCrypto) + (Consensus.CardanoEras Consensus.StandardCrypto) -> Consensus.CardanoBlock Consensus.StandardCrypto - -> Shelley.LedgerState + -> Ledger.LedgerState (HFC.HardForkBlock - (Consensus.CardanoEras Shelley.StandardCrypto)) + (Consensus.CardanoEras Consensus.StandardCrypto)) + Ledger.EmptyMK -> Either LedgerStateError LedgerStateEvents tickThenReapplyCheckHash cfg block lsb = if Consensus.blockPrevHash block == Ledger.ledgerTipHash lsb - then Right . toLedgerStateEvents - $ Ledger.tickThenReapplyLedgerResult cfg block lsb + then Right + . toLedgerStateEvents + . Legacy.convertLedgerResult + $ Ledger.tickThenReapplyLedgerResult + (Legacy.convertLedgerConfig cfg) + (Legacy.convertBlock block) + (Ledger.convertMapKind . Legacy.convertLedgerState $ lsb) else Left $ ApplyBlockHashMismatch $ mconcat [ "Ledger state hash mismatch. Ledger head is slot " , textShow @@ -1369,16 +1387,20 @@ tickThenReapplyCheckHash cfg block lsb = -- the block matches the head hash of the ledger state. tickThenApply :: HFC.HardForkLedgerConfig - (Consensus.CardanoEras Shelley.StandardCrypto) + (Consensus.CardanoEras Consensus.StandardCrypto) -> Consensus.CardanoBlock Consensus.StandardCrypto - -> Shelley.LedgerState + -> Ledger.LedgerState (HFC.HardForkBlock - (Consensus.CardanoEras Shelley.StandardCrypto)) + (Consensus.CardanoEras Consensus.StandardCrypto)) + Ledger.EmptyMK -> Either LedgerStateError LedgerStateEvents tickThenApply cfg block lsb - = either (Left . ApplyBlockError) (Right . toLedgerStateEvents) + = either (Left . ApplyBlockError . Legacy.convertLedgerError) (Right . toLedgerStateEvents . Legacy.convertLedgerResult) $ runExcept - $ Ledger.tickThenApplyLedgerResult cfg block lsb + $ Ledger.tickThenApplyLedgerResult + (Legacy.convertLedgerConfig cfg) + (Legacy.convertBlock block) + (Ledger.convertMapKind . Legacy.convertLedgerState $ lsb) renderByteArray :: ByteArrayAccess bin => bin -> Text renderByteArray = @@ -1434,7 +1456,7 @@ nextEpochEligibleLeadershipSlots => FromCBOR (Consensus.ChainDepState (Api.ConsensusProtocol era)) => Consensus.PraosProtocolSupportsNode (Api.ConsensusProtocol era) => ShelleyBasedEra era - -> ShelleyGenesis Shelley.StandardCrypto + -> ShelleyGenesis Consensus.StandardCrypto -> SerialisedCurrentEpochState era -- ^ We need the mark stake distribution in order to predict -- the following epoch's leadership schedule @@ -1496,9 +1518,9 @@ nextEpochEligibleLeadershipSlots sbe sGen serCurrEpochState ptclState poolid (Vr CurrentEpochState cEstate <- first LeaderErrDecodeProtocolEpochStateFailure $ decodeCurrentEpochState sbe serCurrEpochState - let snapshot :: ShelleyAPI.SnapShot Shelley.StandardCrypto + let snapshot :: ShelleyAPI.SnapShot Consensus.StandardCrypto snapshot = ShelleyAPI.ssStakeMark $ withShelleyBasedEraConstraintsForLedger sbe $ ShelleyAPI.esSnapshots cEstate - markSnapshotPoolDistr :: Map (SL.KeyHash 'SL.StakePool Shelley.StandardCrypto) (SL.IndividualPoolStake Shelley.StandardCrypto) + markSnapshotPoolDistr :: Map (SL.KeyHash 'SL.StakePool Consensus.StandardCrypto) (SL.IndividualPoolStake Consensus.StandardCrypto) markSnapshotPoolDistr = ShelleyAPI.unPoolDistr . ShelleyAPI.calculatePoolDistr $ snapshot let slotRangeOfInterest :: Core.EraPParams ledgerera => Core.PParams ledgerera -> Set SlotNo @@ -1538,7 +1560,7 @@ isLeadingSlotsTPraos :: forall v. () => Crypto.ContextVRF v ~ () => Set SlotNo -> PoolId - -> Map (SL.KeyHash 'SL.StakePool Shelley.StandardCrypto) (SL.IndividualPoolStake Shelley.StandardCrypto) + -> Map (SL.KeyHash 'SL.StakePool Consensus.StandardCrypto) (SL.IndividualPoolStake Consensus.StandardCrypto) -> Consensus.Nonce -> Crypto.SignKeyVRF v -> Ledger.ActiveSlotCoeff @@ -1558,9 +1580,9 @@ isLeadingSlotsTPraos slotRangeOfInterest poolid snapshotPoolDistr eNonce vrfSkey isLeadingSlotsPraos :: () => Set SlotNo -> PoolId - -> Map (SL.KeyHash 'SL.StakePool Shelley.StandardCrypto) (SL.IndividualPoolStake Shelley.StandardCrypto) + -> Map (SL.KeyHash 'SL.StakePool Consensus.StandardCrypto) (SL.IndividualPoolStake Consensus.StandardCrypto) -> Consensus.Nonce - -> SL.SignKeyVRF Shelley.StandardCrypto + -> SL.SignKeyVRF Consensus.StandardCrypto -> Ledger.ActiveSlotCoeff -> Either LeadershipError (Set SlotNo) isLeadingSlotsPraos slotRangeOfInterest poolid snapshotPoolDistr eNonce vrfSkey activeSlotCoeff' = do @@ -1571,7 +1593,7 @@ isLeadingSlotsPraos slotRangeOfInterest poolid snapshotPoolDistr eNonce vrfSkey let isLeader slotNo = checkLeaderNatValue certifiedNatValue stakePoolStake activeSlotCoeff' where rho = VRF.evalCertified () (mkInputVRF slotNo eNonce) vrfSkey - certifiedNatValue = vrfLeaderValue (Proxy @Shelley.StandardCrypto) rho + certifiedNatValue = vrfLeaderValue (Proxy @Consensus.StandardCrypto) rho Right $ Set.filter isLeader slotRangeOfInterest @@ -1580,9 +1602,9 @@ isLeadingSlotsPraos slotRangeOfInterest poolid snapshotPoolDistr eNonce vrfSkey currentEpochEligibleLeadershipSlots :: forall era. () => Consensus.PraosProtocolSupportsNode (Api.ConsensusProtocol era) => FromCBOR (Consensus.ChainDepState (Api.ConsensusProtocol era)) - => Shelley.EraCrypto (ShelleyLedgerEra era) ~ Shelley.StandardCrypto + => Shelley.EraCrypto (ShelleyLedgerEra era) ~ Consensus.StandardCrypto => ShelleyBasedEra era - -> ShelleyGenesis Shelley.StandardCrypto + -> ShelleyGenesis Consensus.StandardCrypto -> EpochInfo (Either Text) -> BundledProtocolParameters era -> ProtocolState era @@ -1640,7 +1662,7 @@ currentEpochEligibleLeadershipSlots sbe sGen eInfo bpp ptclState poolid (VrfSign f = activeSlotCoeff globals constructGlobals - :: ShelleyGenesis Shelley.StandardCrypto + :: ShelleyGenesis Consensus.StandardCrypto -> EpochInfo (Either Text) -> ProtocolParameters -> Globals diff --git a/flake.lock b/flake.lock index 6f152dfc79..68d3ec057f 100644 --- a/flake.lock +++ b/flake.lock @@ -3,11 +3,11 @@ "CHaP": { "flake": false, "locked": { - "lastModified": 1688739041, - "narHash": "sha256-1ji5gb5c7e/dMvwMIGjNfkDF1AOCMVdiFrSN+xUQpzw=", + "lastModified": 1690980715, + "narHash": "sha256-yqUWb4v+ddfVsYJNHkW3kDGgBLY2H2JJ8AelL1DklqI=", "owner": "input-output-hk", "repo": "cardano-haskell-packages", - "rev": "ba9bfea00fa468dc4c18de2ab0b7d3c7cb4a35ef", + "rev": "0ced21474b5c8a4ce8320c1f61d5b9fcef3e3029", "type": "github" }, "original": { @@ -221,11 +221,11 @@ "hackage": { "flake": false, "locked": { - "lastModified": 1688603318, - "narHash": "sha256-rXEPjf6pecyl0mIpK6xk3Vp/lKxWiCUfw6PMU+7utjY=", + "lastModified": 1690935861, + "narHash": "sha256-CxYnaxQudPKOoSPOtpQ9ZVogjDWz3B+ZgL4YumEBY9g=", "owner": "input-output-hk", "repo": "hackage.nix", - "rev": "a5604f20c9446451d4f1fd3ad4c160240069833a", + "rev": "4e6c3592ff197354762f3272515245ca862608ca", "type": "github" }, "original": {