Skip to content

Commit 4b96d69

Browse files
committed
Update node version for integration tests
This commit made a few changes: 1. Upgrade cardano-node version to v8.x.x from v1.x.x. This will help with testing when entering Chang hardfork. 2. Upgrade ogmios to 6.x.x because of change 1. 3. Replace built-in ogmios chain context with https://gitlab.com/viperscience/ogmios-python because of change 2. 4. Temporarily disable Kupo in integration test because ogmios-python doesn't support kupo yet.
1 parent 486d97f commit 4b96d69

File tree

11 files changed

+108
-19
lines changed

11 files changed

+108
-19
lines changed

integration-test/configs/local-alonzo/config.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"ByronGenesisFile": "byron-genesis.json",
33
"ShelleyGenesisFile": "shelley-genesis.json",
44
"AlonzoGenesisFile": "alonzo-genesis.json",
5+
"ConwayGenesisFile": "conway-genesis.json",
56
"SocketPath": "db/node.socket",
67
"MaxConcurrencyBulkSync": 1,
78
"MaxConcurrencyDeadline": 2,
@@ -99,6 +100,6 @@
99100
"TestAllegraHardForkAtEpoch": 0,
100101
"TestMaryHardForkAtEpoch": 0,
101102
"TestAlonzoHardForkAtEpoch": 0,
102-
"TestEnableDevelopmentHardForkEras": true,
103-
"TestEnableDevelopmentNetworkProtocols": true
103+
"EnableDevelopmentHardForkEras": true,
104+
"ExperimentalProtocolsEnabled": true
104105
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"poolVotingThresholds": {
3+
"committeeNormal": 0.51,
4+
"committeeNoConfidence": 0.51,
5+
"hardForkInitiation": 0.51,
6+
"motionNoConfidence": 0.51,
7+
"ppSecurityGroup": 0.51
8+
},
9+
"dRepVotingThresholds": {
10+
"motionNoConfidence": 0.51,
11+
"committeeNormal": 0.51,
12+
"committeeNoConfidence": 0.51,
13+
"updateToConstitution": 0.51,
14+
"hardForkInitiation": 0.51,
15+
"ppNetworkGroup": 0.51,
16+
"ppEconomicGroup": 0.51,
17+
"ppTechnicalGroup": 0.51,
18+
"ppGovGroup": 0.51,
19+
"treasuryWithdrawal": 0.51
20+
},
21+
"committeeMinSize": 0,
22+
"committeeMaxTermLength": 200,
23+
"govActionLifetime": 10,
24+
"govActionDeposit": 1000000000,
25+
"dRepDeposit": 2000000,
26+
"dRepActivity": 20,
27+
"constitution": {
28+
"anchor": {
29+
"url": "",
30+
"dataHash": "0000000000000000000000000000000000000000000000000000000000000000"
31+
}
32+
},
33+
"committee": {
34+
"members": {
35+
36+
},
37+
"quorum": 0
38+
}
39+
}

integration-test/configs/local-vasil/config.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"ByronGenesisFile": "byron-genesis.json",
33
"ShelleyGenesisFile": "shelley-genesis.json",
44
"AlonzoGenesisFile": "alonzo-genesis.json",
5+
"ConwayGenesisFile": "conway-genesis.json",
56
"SocketPath": "db/node.socket",
67
"MaxConcurrencyBulkSync": 1,
78
"MaxConcurrencyDeadline": 2,
@@ -100,6 +101,6 @@
100101
"TestMaryHardForkAtEpoch": 0,
101102
"TestAlonzoHardForkAtEpoch": 0,
102103
"TestBabbageHardForkAtEpoch": 10,
103-
"TestEnableDevelopmentHardForkEras": true,
104-
"TestEnableDevelopmentNetworkProtocols": true
104+
"EnableDevelopmentHardForkEras": true,
105+
"ExperimentalProtocolsEnabled": true
105106
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"poolVotingThresholds": {
3+
"committeeNormal": 0.51,
4+
"committeeNoConfidence": 0.51,
5+
"hardForkInitiation": 0.51,
6+
"motionNoConfidence": 0.51,
7+
"ppSecurityGroup": 0.51
8+
},
9+
"dRepVotingThresholds": {
10+
"motionNoConfidence": 0.51,
11+
"committeeNormal": 0.51,
12+
"committeeNoConfidence": 0.51,
13+
"updateToConstitution": 0.51,
14+
"hardForkInitiation": 0.51,
15+
"ppNetworkGroup": 0.51,
16+
"ppEconomicGroup": 0.51,
17+
"ppTechnicalGroup": 0.51,
18+
"ppGovGroup": 0.51,
19+
"treasuryWithdrawal": 0.51
20+
},
21+
"committeeMinSize": 0,
22+
"committeeMaxTermLength": 200,
23+
"govActionLifetime": 10,
24+
"govActionDeposit": 1000000000,
25+
"dRepDeposit": 2000000,
26+
"dRepActivity": 20,
27+
"constitution": {
28+
"anchor": {
29+
"url": "",
30+
"dataHash": "0000000000000000000000000000000000000000000000000000000000000000"
31+
}
32+
},
33+
"committee": {
34+
"members": {
35+
36+
},
37+
"quorum": 0
38+
}
39+
}

integration-test/docker-compose.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ networks:
99
services:
1010

1111
cardano-node:
12-
image: inputoutput/cardano-node:${CARDANO_NODE_VERSION:-1.35.7}
12+
image: ghcr.io/intersectmbo/cardano-node:${CARDANO_NODE_VERSION:-8.9.2}
1313
entrypoint: bash
1414
environment:
1515
NETWORK: "${NETWORK:-local-alonzo}"
@@ -34,7 +34,7 @@ services:
3434
max-file: "10"
3535

3636
cardano-pool:
37-
image: inputoutput/cardano-node:${CARDANO_NODE_VERSION:-1.35.7}
37+
image: ghcr.io/intersectmbo/cardano-node:${CARDANO_NODE_VERSION:-8.9.2}
3838
entrypoint: bash
3939
environment:
4040
NETWORK: "${NETWORK:-local-alonzo}"
@@ -54,7 +54,7 @@ services:
5454
max-file: "10"
5555

5656
ogmios:
57-
image: cardanosolutions/ogmios:v5.6.0-mainnet
57+
image: cardanosolutions/ogmios:v6.2.0
5858
environment:
5959
NETWORK: "${NETWORK:-local-alonzo}"
6060

integration-test/run_tests.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ set -o pipefail
66
ROOT=$(pwd)
77

88
poetry install
9+
poetry run pip install ogmios
910

1011
##########
1112
# Alonzo #

integration-test/test/base.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
from pycardano import *
99

10+
from ogmios import OgmiosChainContext
11+
1012
TEST_RETRIES = 6
1113

1214

@@ -19,11 +21,10 @@ class TestBase:
1921
# Define chain context
2022
NETWORK = Network.TESTNET
2123

22-
OGMIOS_WS = "ws://localhost:1337"
23-
24+
# TODO: Bring back kupo test
2425
KUPO_URL = "http://localhost:1442"
2526

26-
chain_context = OgmiosChainContext(OGMIOS_WS, Network.TESTNET, kupo_url=KUPO_URL)
27+
chain_context = OgmiosChainContext(host="localhost", port=1337, network=Network.TESTNET)
2728

2829
check_chain_context(chain_context)
2930

integration-test/test/test_cardano_cli.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import os
22
from pathlib import Path
3+
from retry import retry
34

45
from pycardano import (
56
CardanoCliChainContext,
@@ -10,6 +11,8 @@
1011
)
1112
from pycardano.backend.cardano_cli import DockerConfig
1213

14+
from .base import TEST_RETRIES
15+
1316

1417
class TestCardanoCli:
1518
network_env = os.getenv("NETWORK", "local-alonzo")
@@ -30,16 +33,16 @@ class TestCardanoCli:
3033
network_magic_number=int(network_magic),
3134
)
3235

36+
@retry(tries=TEST_RETRIES, backoff=1.5, delay=6, jitter=(0, 4))
3337
def test_protocol_param(self):
3438
protocol_param = self.chain_context.protocol_param
3539

3640
assert protocol_param is not None
3741
assert isinstance(protocol_param, ProtocolParameters)
3842

3943
cost_models = protocol_param.cost_models
40-
for _, cost_model in cost_models.items():
41-
assert "addInteger-cpu-arguments-intercept" in cost_model
42-
assert "addInteger-cpu-arguments-slope" in cost_model
44+
for cost_model in cost_models.items():
45+
assert len(cost_model) > 0
4346

4447
def test_genesis_param(self):
4548
genesis_param = self.chain_context.genesis_param

integration-test/test/test_ogmios.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,4 @@ def test_protocol_param_cost_models(self):
1010

1111
cost_models = protocol_param.cost_models
1212
for _, cost_model in cost_models.items():
13-
assert "addInteger-cpu-arguments-intercept" in cost_model
14-
assert "addInteger-cpu-arguments-slope" in cost_model
13+
assert len(cost_model) > 0

integration-test/test/test_plutus.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -370,10 +370,10 @@ def test_get_plutus_script(self):
370370
assert utxos[0].output.script == forty_two_script
371371

372372

373-
class TestPlutusOgmiosOnly(TestPlutus):
374-
@classmethod
375-
def setup_class(cls):
376-
cls.chain_context._kupo_url = None
373+
# class TestPlutusOgmiosOnly(TestPlutus):
374+
# @classmethod
375+
# def setup_class(cls):
376+
# cls.chain_context._kupo_url = None
377377

378378

379379
def evaluate_tx(tx: Transaction) -> Dict[str, ExecutionUnits]:

pycardano/backend/cardano_cli.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,11 @@ def _parse_cost_models(cli_result: JsonDict) -> Dict[str, Dict[str, int]]:
258258
elif "PlutusV2" in cli_cost_models:
259259
cost_models["PlutusV2"] = cli_cost_models["PlutusV2"].copy()
260260

261+
# After 8.x.x, cardano-cli returns cost models as a list
262+
for m in cost_models:
263+
if isinstance(cost_models[m], list):
264+
cost_models[m] = {i: v for i, v in enumerate(cost_models[m])}
265+
261266
return cost_models
262267

263268
def _is_chain_tip_updated(self):

0 commit comments

Comments
 (0)