Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -166,3 +166,28 @@ if impl(ghc >= 9.14)
-- Do NOT add more source-repository-package stanzas here unless they are strictly
-- temporary! Please read the section in CONTRIBUTING about updating dependencies.

-- TEMPORARY: ouroboros-consensus 4.2.1.0 plus IntersectMBO/ouroboros-consensus#2167
-- ("Allow hardfork into Dijkstra"), which no 4.x release contains yet. Without it the
-- Conway ledger config uses TriggerHardForkNotDuringThisExecution and the node can never
-- enter the Dijkstra era. On top of that, a fix for the db tools (db-synthesizer and
-- friends) so they accept ExperimentalHardForksEnabled and advertise the Dijkstra
-- protocol versions; without it db-synthesizer forges no blocks on a testnet that
-- starts in Dijkstra. Both changes are already on consensus main (5.0 has them), so
-- this whole stanza goes away with the next consensus bump.
source-repository-package
type: git
location: https://github.com/IntersectMBO/ouroboros-consensus.git
tag: 61cd7cecd8e639a2041e7e100c5ab253fe2f067b
--sha256: sha256-AsWxF+YI6eXdc3FTN0i6M/WwMOWK7TfgKNA8rtdhKqA=


-- TEMPORARY: cardano-api 11.7.0.0 plus IntersectMBO/cardano-api#1362 ("Add support
-- for Dijkstra ledger events"), which no release contains yet. Without it, forcing a
-- Dijkstra block's ledger events (foldBlocks / the EpochStateView fold) dies with a
-- non-exhaustive pattern match. Replace with a released version once available.
source-repository-package
type: git
location: https://github.com/IntersectMBO/cardano-api.git
tag: 216c52563381954a986b0de073e10aa392e6a0fc
subdir: cardano-api
--sha256: sha256-5rF1ntF9hHrQzZtYgUwc/Gi9vig7q/qnmU8xCVksdHM=
8 changes: 6 additions & 2 deletions cardano-testnet/src/Testnet/Defaults.hs
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,8 @@ defaultConwayGenesis = do
-- | The only era supported by cardano-testnet for the moment.
-- It's important to keep the era parameterization everywhere, for ease of development
-- when new eras roll out.
defaultEra :: ShelleyBasedEra Api.ConwayEra
defaultEra = ShelleyBasedEraConway
defaultEra :: ShelleyBasedEra Api.DijkstraEra
defaultEra = ShelleyBasedEraDijkstra

-- | Configuration value that allows you to hardfork to any Cardano era
-- at epoch 0.
Expand Down Expand Up @@ -235,6 +235,10 @@ defaultYamlHardforkViaConfig sbe =
hardforkViaConfig sbe' =
Aeson.fromList $
("ExperimentalProtocolsEnabled", Aeson.Bool True)
-- Dijkstra is still experimental. Without this flag the node declares PV11 as its
-- maximum protocol version, so it cannot forge once the ledger is at PV12 (its own
-- blocks are rejected with ObsoleteNode), and it ignores the Dijkstra genesis file.
: ("ExperimentalHardForksEnabled", Aeson.Bool True)
: (case sbe' of
ShelleyBasedEraShelley ->
[ ("TestShelleyHardForkAtEpoch", Aeson.Number 0) ]
Expand Down
2 changes: 1 addition & 1 deletion cardano-testnet/src/Testnet/Start/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ data TestnetCreationOptions = TestnetCreationOptions
instance Default TestnetCreationOptions where
def = TestnetCreationOptions
{ creationNodes = cardanoDefaultTestnetNodesWithOptions
, creationEra = AnyShelleyBasedEra ShelleyBasedEraConway
, creationEra = AnyShelleyBasedEra ShelleyBasedEraDijkstra
, creationMaxSupply = 100_000_020_000_000
, creationNumDReps = 3
, creationGenesisOptions = def
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
"ByronGenesisFile": "byron-genesis.json",
"ConwayGenesisFile": "conway-genesis.json",
"DijkstraGenesisFile": "dijkstra-genesis.json",
"ExperimentalHardForksEnabled": true,
"ExperimentalProtocolsEnabled": true,
"LastKnownBlockVersion-Alt": 0,
"LastKnownBlockVersion-Major": 9,
"LastKnownBlockVersion-Major": 10,
"LastKnownBlockVersion-Minor": 0,
"MaxConcurrencyBulkSync": 1,
"MaxConcurrencyDeadline": 2,
Expand All @@ -19,6 +20,7 @@
"TestAlonzoHardForkAtEpoch": 0,
"TestBabbageHardForkAtEpoch": 0,
"TestConwayHardForkAtEpoch": 0,
"TestDijkstraHardForkAtEpoch": 0,
"TestMaryHardForkAtEpoch": 0,
"TestShelleyHardForkAtEpoch": 0,
"TraceOptions": {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ hprop_tx_refin_datum = integrationRetryWorkspace 2 "api-tx-refin-dat" $ \tempAbs
conf@Conf{tempAbsPath} <- mkConf tempAbsBasePath'
let tempAbsPath' = unTmpAbsPath tempAbsPath

let era = Exp.ConwayEra
let era = Exp.DijkstraEra
sbe = convert era
ceo = convert era
beo = convert ceo
Expand Down Expand Up @@ -122,7 +122,7 @@ hprop_tx_refin_datum = integrationRetryWorkspace 2 "api-tx-refin-dat" $ \tempAbs

-- prepare txout
let txOutValue = lovelaceToTxOutValue sbe 100_000_000
txOuts :: [TxOut CtxTx ConwayEra]
txOuts :: [TxOut CtxTx DijkstraEra]
txOuts =
[ TxOut addr1 txOutValue txDatum1 ReferenceScriptNone
, TxOut addr1 txOutValue txDatum2 ReferenceScriptNone
Expand All @@ -134,7 +134,7 @@ hprop_tx_refin_datum = integrationRetryWorkspace 2 "api-tx-refin-dat" $ \tempAbs
-- toCtxUTxOTxOut strips the TxOutSupplementalDatum marker, so we must pass
-- supplemental datums explicitly
supplementalDatums = Exp.obtainCommonConstraints era $ M.fromList
[ let ledgerData = toAlonzoData @(ShelleyLedgerEra ConwayEra) sd
[ let ledgerData = toAlonzoData @(ShelleyLedgerEra DijkstraEra) sd
in (hashData ledgerData, ledgerData)
| sd <- [scriptData3]
]
Expand All @@ -150,7 +150,7 @@ hprop_tx_refin_datum = integrationRetryWorkspace 2 "api-tx-refin-dat" $ \tempAbs

(unsignedTx@(Exp.UnsignedTx ledgerTx), _finalContent) <-
H.leftFail $
Exp.makeTransactionBodyAutoBalance @ConwayEra
Exp.makeTransactionBodyAutoBalance @DijkstraEra
systemStart
epochInfo
(unLedgerProtocolParameters pparams)
Expand Down Expand Up @@ -221,7 +221,7 @@ hprop_tx_refin_datum = integrationRetryWorkspace 2 "api-tx-refin-dat" $ \tempAbs
-- add actual datum values for the two reference inputs via supplemental datums
ledgerPparams = unLedgerProtocolParameters pparams
supplementalDatums = Exp.obtainCommonConstraints era $ M.fromList
[ let ledgerData = toAlonzoData @(ShelleyLedgerEra ConwayEra) sd
[ let ledgerData = toAlonzoData @(ShelleyLedgerEra DijkstraEra) sd
in (hashData ledgerData, ledgerData)
| sd <- [scriptData1, scriptData3, scriptData4]
]
Expand Down Expand Up @@ -277,7 +277,7 @@ hprop_tx_refin_datum = integrationRetryWorkspace 2 "api-tx-refin-dat" $ \tempAbs
-- add one reference input with datum hash and its datum, and one superfluous datum
ledgerPparams3 = unLedgerProtocolParameters pparams
supplementalDatums3 = Exp.obtainCommonConstraints era $ M.fromList
[ let ledgerData = toAlonzoData @(ShelleyLedgerEra ConwayEra) sd
[ let ledgerData = toAlonzoData @(ShelleyLedgerEra DijkstraEra) sd
in (hashData ledgerData, ledgerData)
| sd <- [scriptData1, scriptData3]
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ hprop_kes_period_info = integrationRetryWorkspace 2 "kes-period-info" $ \tempAbs
<- mkConf tempAbsBasePath'

let tempBaseAbsPath = makeTmpBaseAbsPath tempAbsPath
ceo = ConwayEraOnwardsConway
ceo = ConwayEraOnwardsDijkstra
sbe = convert ceo
asbe = AnyShelleyBasedEra sbe
eraString = eraToString sbe
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ hprop_leadershipSchedule = integrationRetryWorkspace 2 "leadership-schedule" $ \
H.note_ SYS.os
conf@Conf { tempAbsPath=tempAbsPath@(TmpAbsolutePath work) } <- mkConf tempAbsBasePath'
let tempBaseAbsPath = makeTmpBaseAbsPath tempAbsPath
ceo = ConwayEraOnwardsConway
ceo = ConwayEraOnwardsDijkstra
sbe = convert ceo
asbe = AnyShelleyBasedEra sbe
cTestnetOptions = def
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ hprop_build_raw_ref_script_spend = integrationRetryWorkspace 2 "build-raw-ref-sc
work <- H.createDirectoryIfMissing $ tempAbsPath' </> "work"

let
sbe = ShelleyBasedEraConway
sbe = ShelleyBasedEraDijkstra
era = toCardanoEra sbe
cEra = AnyCardanoEra era
eraName = eraToString era
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ hprop_ref_plutus_cost_calculation = integrationRetryWorkspace 2 "ref-plutus-scri
work <- H.createDirectoryIfMissing $ tempAbsPath' </> "work"

let
sbe = ShelleyBasedEraConway
sbe = ShelleyBasedEraDijkstra
era = toCardanoEra sbe
cEra = AnyCardanoEra era
eraName = eraToString era
Expand Down Expand Up @@ -218,7 +218,7 @@ hprop_included_plutus_cost_calculation = integrationRetryWorkspace 2 "included-p
work <- H.createDirectoryIfMissing $ tempAbsPath' </> "work"

let
sbe = ShelleyBasedEraConway
sbe = ShelleyBasedEraDijkstra
era = toCardanoEra sbe
cEra = AnyCardanoEra era
eraName = eraToString era
Expand Down Expand Up @@ -330,7 +330,7 @@ hprop_included_simple_script_cost_calculation = integrationRetryWorkspace 2 "inc
work <- H.createDirectoryIfMissing $ tempAbsPath' </> "work"

let
sbe = ShelleyBasedEraConway
sbe = ShelleyBasedEraDijkstra
era = toCardanoEra sbe
cEra = AnyCardanoEra era
eraName = eraToString era
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ hprop_collateral_with_tokens = integrationRetryWorkspace 2 "collateral-with-toke

let
tempBaseAbsPath = makeTmpBaseAbsPath $ TmpAbsolutePath tempAbsPath'
ceo = ConwayEraOnwardsConway
ceo = ConwayEraOnwardsDijkstra
sbe = convert ceo
era = toCardanoEra sbe
anyEra = AnyCardanoEra era
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ hprop_plutus_purposes_v3 = integrationRetryWorkspace 2 "all-plutus-script-purpos

let
tempBaseAbsPath = makeTmpBaseAbsPath $ TmpAbsolutePath tempAbsPath'
ceo = ConwayEraOnwardsConway
ceo = ConwayEraOnwardsDijkstra
sbe = convert ceo
era = toCardanoEra sbe
anyEra = AnyCardanoEra era
Expand Down Expand Up @@ -204,6 +204,11 @@ hprop_tx_two_script_certs_v2 = integrationRetryWorkspace 2 "tx-2-script-certs" $

let
tempBaseAbsPath = makeTmpBaseAbsPath $ TmpAbsolutePath tempAbsPath'
-- This test stays on Conway for now: testnets that start directly in Dijkstra
-- lose the PlutusV2 cost model that the Alonzo genesis provides through
-- extraConfig, because cardano-ledger-dijkstra 0.3's injectIntoTestState misses
-- the alonzoInjectCostModels step. This is fixed in cardano-ledger-dijkstra
-- 0.4.0.0, so this test can move to Dijkstra once the node uses ledger 0.4.
ceo = ConwayEraOnwardsConway
sbe = convert ceo
era = toCardanoEra sbe
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ hprop_cli_queries = integrationRetryWorkspace 2 "cli-queries" $ \tempAbsBasePath
<- mkConf tempAbsBasePath'
let tempBaseAbsPath = makeTmpBaseAbsPath tempAbsPath

let sbe = ShelleyBasedEraConway
ceo = ConwayEraOnwardsConway
let sbe = ShelleyBasedEraDijkstra
ceo = ConwayEraOnwardsDijkstra
asbe = AnyShelleyBasedEra sbe
era = toCardanoEra sbe
cEra = AnyCardanoEra era
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ hprop_ref_simple_script_mint = integrationRetryWorkspace 2 "ref-simple-script" $
work <- H.createDirectoryIfMissing $ tempAbsPath' </> "work"

let
sbe = ShelleyBasedEraConway
sbe = ShelleyBasedEraDijkstra
era = toCardanoEra sbe
cEra = AnyCardanoEra era
eraName = eraToString era
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ hprop_simple_script_mint = integrationRetryWorkspace 2 "simple-script-mint" $ \t

let
tempBaseAbsPath = makeTmpBaseAbsPath $ TmpAbsolutePath tempAbsPath'
ceo = ConwayEraOnwardsConway
ceo = ConwayEraOnwardsDijkstra
sbe = convert ceo
era = toCardanoEra sbe
anyEra = AnyCardanoEra era
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ hprop_transaction = integrationRetryWorkspace 2 "simple transaction build" $ \te
work <- H.createDirectoryIfMissing $ tempAbsPath' </> "work"

let
sbe = ShelleyBasedEraConway
sbe = ShelleyBasedEraDijkstra
era = toCardanoEra sbe
cEra = AnyCardanoEra era
tempBaseAbsPath = makeTmpBaseAbsPath $ TmpAbsolutePath tempAbsPath'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ hprop_tx_build_estimate = integrationRetryWorkspace 2 "transaction-build-estimat

work <- H.createDirectoryIfMissing $ tempAbsPath' </> "work"

let ceo = ConwayEraOnwardsConway
let ceo = ConwayEraOnwardsDijkstra
sbe = convert ceo
eraName = eraToString sbe
creationOptions = def
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ hprop_tx_register_deregister_stake_address = integrationRetryWorkspace 2 "regist

work <- H.createDirectoryIfMissing $ tempAbsPath' </> "work"

let ceo = ConwayEraOnwardsConway
let ceo = ConwayEraOnwardsDijkstra
sbe = convert ceo
eraName = eraToString sbe
creationOptions = def
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ hprop_tx_withdrawal_reward = integrationRetryWorkspace 2 "tx-withdrawal-reward"

work <- H.createDirectoryIfMissing $ tempAbsPath' </> "work"

let ceo = ConwayEraOnwardsConway
let ceo = ConwayEraOnwardsDijkstra
sbe = convert ceo
eraName = eraToString sbe
creationOptions = def
Expand Down Expand Up @@ -133,7 +133,7 @@ hprop_tx_withdrawal_reward_plutus_v3 = integrationRetryWorkspace 2 "tx-withdrawa

work <- H.createDirectoryIfMissing $ tempAbsPath' </> "work"

let ceo = ConwayEraOnwardsConway
let ceo = ConwayEraOnwardsDijkstra
sbe = convert ceo
eraName = eraToString sbe
creationOptions = def
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ prop_foldEpochState = integrationRetryWorkspace 2 "foldEpochState" $ \tempAbsBas
conf <- TN.mkConf tempAbsBasePath'

let tempAbsPath' = unTmpAbsPath $ tempAbsPath conf
sbe = ShelleyBasedEraConway
sbe = ShelleyBasedEraDijkstra
creationOptions = def { creationEra = AnyShelleyBasedEra sbe }

runtime@TestnetRuntime{configurationFile} <- createAndRunTestnet creationOptions def conf
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ hprop_constitutional_committee_add_new = integrationRetryWorkspace 2 "constituti
mkVotes votes = zip (concatMap (uncurry replicate) votes) [1..]
nDrepVotes = length drepVotes
nSpos = fromIntegral $ creationNumPools creationOptions
ceo = ConwayEraOnwardsConway
ceo = ConwayEraOnwardsDijkstra
sbe = convert ceo
era = toCardanoEra sbe
cEra = AnyCardanoEra era
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ hprop_check_drep_activity = integrationRetryWorkspace 2 "test-activity" $ \tempA
work <- H.createDirectoryIfMissing $ tempAbsPath' </> "work"

-- Create default testnet with 3 DReps and 3 stake holders delegated, one to each DRep.
let ceo = ConwayEraOnwardsConway
let ceo = ConwayEraOnwardsDijkstra
sbe = convert ceo
creationOptions = def
{ creationEra = AnyShelleyBasedEra sbe
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ hprop_ledger_events_drep_deposits = integrationRetryWorkspace 2 "drep-deposits"

work <- H.createDirectoryIfMissing $ tempAbsPath' </> "work"

let ceo = ConwayEraOnwardsConway
let ceo = ConwayEraOnwardsDijkstra
sbe = convert ceo
era = toCardanoEra sbe
cEra = AnyCardanoEra era
Expand Down Expand Up @@ -88,7 +88,7 @@ hprop_ledger_events_drep_deposits = integrationRetryWorkspace 2 "drep-deposits"
drepSignedRegTx1 <- signTx execConfig cEra drepDir1 "signed-reg-tx"
drepRegTxBody1 [Some drepKeyPair1, Some $ paymentKeyInfoPair wallet0]

failToSubmitTx execConfig cEra drepSignedRegTx1 "ConwayDRepIncorrectDeposit"
failToSubmitTx execConfig cEra drepSignedRegTx1 "DijkstraDRepIncorrectDeposit"

-- DRep 2 (enough deposit)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ import qualified Hedgehog as H
import qualified Hedgehog.Extras as H

-- | The era in which this test runs
sbe :: ShelleyBasedEra ConwayEra
sbe = ShelleyBasedEraConway
sbe :: ShelleyBasedEra DijkstraEra
sbe = ShelleyBasedEraDijkstra

ceo :: ConwayEraOnwards ConwayEra
ceo = ConwayEraOnwardsConway
ceo :: ConwayEraOnwards DijkstraEra
ceo = ConwayEraOnwardsDijkstra

-- Execute this test with:
-- @DISABLE_RETRIES=1 cabal test cardano-testnet-test --test-options '-p "/DRep Retirement/"'@
Expand Down Expand Up @@ -95,14 +95,14 @@ hprop_drep_retirement = integrationRetryWorkspace 2 "drep-retirement" $ \tempAbs
let drepRetirementCertFile = gov </> defaultDRepKeysDir </> "drep1.retirementcert"

H.noteM_ $ execCli' execConfig
[ "conway", "governance", "drep", "retirement-certificate"
[ eraToString sbe, "governance", "drep", "retirement-certificate"
, "--drep-verification-key-file", verificationKeyFp $ defaultDRepKeyPair 1
, "--deposit-amt", show @Int 1_000_000
, "--out-file", drepRetirementCertFile
]

H.noteM_ $ execCli' execConfig
[ "conway", "query", "utxo"
[ eraToString sbe, "query", "utxo"
, "--address", Text.unpack $ paymentKeyInfoAddr wallet0
, "--cardano-mode"
, "--out-file", work </> "utxo-11.json"
Expand All @@ -114,7 +114,7 @@ hprop_drep_retirement = integrationRetryWorkspace 2 "drep-retirement" $ \tempAbs
drepRetirementRegTxSignedFp <- H.note $ work </> "drep.retirement.tx"

H.noteM_ $ execCli' execConfig
[ "conway", "transaction", "build"
[ eraToString sbe, "transaction", "build"
, "--tx-in", Text.unpack $ renderTxIn txin2
, "--change-address", Text.unpack $ paymentKeyInfoAddr wallet0
, "--certificate-file", drepRetirementCertFile
Expand All @@ -123,15 +123,15 @@ hprop_drep_retirement = integrationRetryWorkspace 2 "drep-retirement" $ \tempAbs
]

H.noteM_ $ execCli' execConfig
[ "conway", "transaction", "sign"
[ eraToString sbe, "transaction", "sign"
, "--tx-body-file", drepRetirementRegTxbodyFp
, "--signing-key-file", signingKeyFp $ paymentKeyInfoPair wallet0
, "--signing-key-file", signingKeyFp $ defaultDRepKeyPair 1
, "--out-file", drepRetirementRegTxSignedFp
]

H.noteM_ $ execCli' execConfig
[ "conway", "transaction", "submit"
[ eraToString sbe, "transaction", "submit"
, "--tx-file", drepRetirementRegTxSignedFp
]

Expand Down
Loading
Loading