diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index 4052ac74..b25be2c9 100644 --- a/.github/workflows/haskell-ci.yml +++ b/.github/workflows/haskell-ci.yml @@ -165,7 +165,7 @@ jobs: uses: actions/checkout@v6 with: repository: tweag/CIPs - ref: 5a4f49835b01695583830e01e2dfd11e9e582efc + ref: c92a3b5db78268e7f0db5f24c80ed6f49cf4b149 path: cips - name: set env for reference CDDL run: | diff --git a/flake.lock b/flake.lock index bd5fde29..06ea2a99 100644 --- a/flake.lock +++ b/flake.lock @@ -69,17 +69,17 @@ "cips": { "flake": false, "locked": { - "lastModified": 1774517331, - "narHash": "sha256-Iu6jgcoa/WZcruKaym/3Y5/1awx53eKgvI0l6/+fMIQ=", + "lastModified": 1776254122, + "narHash": "sha256-MmXsGDMGnZayYZEt40Y5a54Pis31plBQt2/hbdUTaos=", "owner": "tweag", "repo": "CIPs", - "rev": "5a4f49835b01695583830e01e2dfd11e9e582efc", + "rev": "c92a3b5db78268e7f0db5f24c80ed6f49cf4b149", "type": "github" }, "original": { "owner": "tweag", "repo": "CIPs", - "rev": "5a4f49835b01695583830e01e2dfd11e9e582efc", + "rev": "c92a3b5db78268e7f0db5f24c80ed6f49cf4b149", "type": "github" } }, diff --git a/flake.nix b/flake.nix index 59874068..ab2381f8 100644 --- a/flake.nix +++ b/flake.nix @@ -18,7 +18,7 @@ inputs.nixpkgs.follows = "nixpkgs"; }; inputs.cips = { - url = "github:tweag/CIPs?rev=5a4f49835b01695583830e01e2dfd11e9e582efc"; + url = "github:tweag/CIPs?rev=c92a3b5db78268e7f0db5f24c80ed6f49cf4b149"; flake = false; }; outputs = { self, nixpkgs, flake-utils, haskellNix, git-hooks, treefmt-nix diff --git a/scls-cardano/cddl-src/Cardano/SCLS/CDDL.hs b/scls-cardano/cddl-src/Cardano/SCLS/CDDL.hs index d8ccbcc3..365ce565 100644 --- a/scls-cardano/cddl-src/Cardano/SCLS/CDDL.hs +++ b/scls-cardano/cddl-src/Cardano/SCLS/CDDL.hs @@ -10,6 +10,7 @@ module Cardano.SCLS.CDDL ( import Cardano.SCLS.Namespace.Blocks qualified as Blocks import Cardano.SCLS.Namespace.EntitiesCommittee qualified as EntitiesCommittee +import Cardano.SCLS.Namespace.EntitiesStakePoolsVRFKeyHashes qualified as EntitiesStakePoolsVRFKeyHashes import Cardano.SCLS.Namespace.GovCommittee qualified as GovCommittee import Cardano.SCLS.Namespace.GovConstitution qualified as GovConstitution import Cardano.SCLS.Namespace.GovPParams qualified as GovPParams @@ -55,6 +56,9 @@ instance KnownSpec "nonces/v0" where instance KnownSpec "entities/committee/v0" where namespaceSpec _ = mkDefinition EntitiesCommittee.record_entry +instance KnownSpec "entities/stake_pools/vrf_key_hashes/v0" where + namespaceSpec _ = mkDefinition EntitiesStakePoolsVRFKeyHashes.record_entry + instance KnownSpec "gov/committee/v0" where namespaceSpec _ = mkDefinition GovCommittee.record_entry @@ -83,6 +87,7 @@ knownNamespaces = , mkNamespaceSymbol @"snapshots/go/v0" , mkNamespaceSymbol @"nonces/v0" , mkNamespaceSymbol @"entities/committee/v0" + , mkNamespaceSymbol @"entities/stake_pools/vrf_key_hashes/v0" , mkNamespaceSymbol @"gov/committee/v0" , mkNamespaceSymbol @"gov/constitution/v0" , mkNamespaceSymbol @"gov/pparams/v0" @@ -96,6 +101,7 @@ type instance Spec.NamespaceKeySize "snapshots/mark/v0" = 31 -- 1 byte for hash type instance Spec.NamespaceKeySize "snapshots/set/v0" = 31 -- 1 byte for hash type, 29 bytes for key hash (including 1-byte discriminator/padding; cred 29, key 28+1), 1 byte for value type type instance Spec.NamespaceKeySize "snapshots/go/v0" = 31 -- 1 byte for hash type, 29 bytes for key hash (including 1-byte discriminator/padding; cred 29, key 28+1), 1 byte for value type type instance Spec.NamespaceKeySize "entities/committee/v0" = 8 +type instance Spec.NamespaceKeySize "entities/stake_pools/vrf_key_hashes/v0" = 32 type instance Spec.NamespaceKeySize "gov/committee/v0" = 8 type instance Spec.NamespaceKeySize "gov/constitution/v0" = 8 type instance Spec.NamespaceKeySize "gov/pparams/v0" = 4 diff --git a/scls-cardano/cddl-src/Cardano/SCLS/Namespace/EntitiesStakePoolsVRFKeyHashes.hs b/scls-cardano/cddl-src/Cardano/SCLS/Namespace/EntitiesStakePoolsVRFKeyHashes.hs new file mode 100644 index 00000000..396bab0b --- /dev/null +++ b/scls-cardano/cddl-src/Cardano/SCLS/Namespace/EntitiesStakePoolsVRFKeyHashes.hs @@ -0,0 +1,32 @@ +{-# LANGUAGE ImportQualifiedPost #-} +{-# LANGUAGE OverloadedLists #-} +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE QuasiQuotes #-} +{-# LANGUAGE TypeApplications #-} +{-# LANGUAGE NoImplicitPrelude #-} +{-# OPTIONS_GHC -Wno-unrecognised-pragmas #-} + +{-# HLINT ignore "Use camelCase" #-} +module Cardano.SCLS.Namespace.EntitiesStakePoolsVRFKeyHashes where + +import Cardano.SCLS.Common +import Codec.CBOR.Cuddle.Huddle +import Data.Function (($)) +import Text.Heredoc (str) + +record_entry :: Rule +record_entry = + comment + [str| The key for the namespace + | + | ``` + | meta: + | endian: be + | + | seq: + | - id: vrf_keyhash_stakepool + | doc: keyhash of the stake pool VRF + | size: 28 + | ``` + |] + $ "record_entry" =:= positive_int diff --git a/scls-cardano/scls-cardano.cabal b/scls-cardano/scls-cardano.cabal index a997368a..04b931f6 100644 --- a/scls-cardano/scls-cardano.cabal +++ b/scls-cardano/scls-cardano.cabal @@ -32,6 +32,7 @@ library Cardano.SCLS.Common Cardano.SCLS.Namespace.Blocks Cardano.SCLS.Namespace.EntitiesCommittee + Cardano.SCLS.Namespace.EntitiesStakePoolsVRFKeyHashes Cardano.SCLS.Namespace.GovCommittee Cardano.SCLS.Namespace.GovConstitution Cardano.SCLS.Namespace.GovPParams diff --git a/scls-cardano/test/Reference.hs b/scls-cardano/test/Reference.hs index 8822c48c..388d3774 100644 --- a/scls-cardano/test/Reference.hs +++ b/scls-cardano/test/Reference.hs @@ -70,6 +70,7 @@ allReferenceCDDLs = , ("snapshots/go/v0", "snapshots_go_v0.cddl") , ("nonces/v0", "nonces_v0.cddl") , ("entities/committee/v0", "entities_committee_v0.cddl") + , ("entities/stake_pools/vrf_key_hashes/v0", "entities_stake_pools_vrf_key_hashes_v0.cddl") , ("gov/committee/v0", "gov_committee_v0.cddl") , ("gov/constitution/v0", "gov_constitution_v0.cddl") , ("gov/pparams/v0", "gov_pparams_v0.cddl") diff --git a/scls-cardano/testlib/Cardano/SCLS/Testlib.hs b/scls-cardano/testlib/Cardano/SCLS/Testlib.hs index 42217e0a..b48b303a 100644 --- a/scls-cardano/testlib/Cardano/SCLS/Testlib.hs +++ b/scls-cardano/testlib/Cardano/SCLS/Testlib.hs @@ -56,6 +56,7 @@ testAllNS :: , ConstrNS "snapshots/mark/v0" , ConstrNS "snapshots/set/v0" , ConstrNS "entities/committee/v0" + , ConstrNS "entities/stake_pools/vrf_key_hashes/v0" , ConstrNS "gov/committee/v0" , ConstrNS "gov/constitution/v0" , ConstrNS "gov/pparams/v0" @@ -69,6 +70,7 @@ testAllNS = describe "scls/conformance" $ do testNS @"snapshots/mark/v0" testNS @"snapshots/set/v0" testNS @"entities/committee/v0" + testNS @"entities/stake_pools/vrf_key_hashes/v0" testNS @"gov/committee/v0" testNS @"gov/constitution/v0" testNS @"gov/pparams/v0"