Skip to content

Commit c97d2ba

Browse files
Etcm 9058 remove pc contracts cli from tests (#434)
* test: use node binary for smart contracts operations * add e2e deps to nix * remove all traces of pc-contracts-cli * ci: removing PCSC leftovers from local-env * remove all traces of kupo --------- Co-authored-by: Krisztian Pinter <[email protected]>
1 parent 260c5cc commit c97d2ba

File tree

52 files changed

+373
-1019
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+373
-1019
lines changed

.envrc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ export DATA_DIR="$RUN_DIR/data"
66
mkdir -p $DATA_DIR
77
chmod 777 $RUN_DIR $DATA_DIR
88
export CARDANO_CONFIG_DIR="$(pwd)/dev/docker/config"
9-
export KUPO_WORKDIR="$RUN_DIR/kupo-db"
10-
mkdir -p $KUPO_WORKDIR
119

1210
source dev/envs/devnet/.envrc
1311

.github/actions/tests/local-environment-tests/action.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,12 @@ runs:
3232
uses: docker/login-action@v3
3333
with:
3434
registry: ${{ env.ECR_REGISTRY_SECRET }}
35-
- name: Download partner-chains-node artifact
36-
uses: actions/download-artifact@v4
37-
with:
38-
name: partner-chains-node-artifact
39-
path: dev/local-environment/configurations/pc-contracts-cli/overrides/
40-
- name: Deploy local environment with overrides
35+
- name: Deploy local environment
4136
run: |
42-
mv dev/local-environment/configurations/pc-contracts-cli/overrides/partner-chains-node-artifact dev/local-environment/configurations/pc-contracts-cli/overrides/partner-chains-node
4337
mkdir -p dev/local-environment/configurations/tests/e2e-tests
4438
cp -r E2E-tests/* dev/local-environment/configurations/tests/e2e-tests
4539
cd dev/local-environment
46-
bash setup.sh --non-interactive --overrides --postgres-password azMpOp4mTqhlKDmgCVQr --node-image ${{ inputs.image }} --tests
40+
bash setup.sh --non-interactive --postgres-password azMpOp4mTqhlKDmgCVQr --node-image ${{ inputs.image }} --tests
4741
docker compose up -d
4842
cd ../../
4943
shell: bash

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,6 @@ dev/local-environment/.env.bak
3333
dev/local-environment/docker-compose.yml
3434
dev/local-environment/docker-compose.yml.bak
3535
dev/local-environment/configurations/tests/e2e-tests
36-
dev/local-environment/configurations/pc-contracts-cli/overrides
36+
dev/local-environment/configurations/partner-chains-node/overrides
3737

3838
ogmios_client.log

E2E-tests/config/api_config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,10 @@ class NodesApiConfig:
131131

132132
@dataclass
133133
class StackApiConfig:
134+
ogmios_scheme: str = "http"
134135
ogmios_host: str = MISSING
135136
ogmios_port: int = MISSING
136-
kupo_host: str = MISSING
137-
kupo_port: int = MISSING
137+
ogmios_url: str = SI("${.ogmios_scheme}://${.ogmios_host}:${.ogmios_port}")
138138
tools: dict[str, Tool] = MISSING
139139
tools_host: str = MISSING
140140
tools_shell: Optional[str] = None

E2E-tests/config/substrate/ci_stack.json

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
"stack_config": {
33
"ogmios_host": "devnet-services-service",
44
"ogmios_port": 1337,
5-
"kupo_host": "devnet-services-service",
6-
"kupo_port": 1442,
75
"tools_host": "10.0.12.126",
86
"ssh": {
97
"username": "root",
@@ -17,11 +15,7 @@
1715
"cli": "export CARDANO_NODE_SOCKET_PATH=/ipc/node.socket && /tools/cardano-cli",
1816
"ssh": "${stack_config[ssh]}"
1917
},
20-
"sidechain_main_cli": {
21-
"cli": "/tools/partner-chains-smart-contracts-6.1.0/sidechain-cli",
22-
"ssh": "${stack_config[ssh]}"
23-
},
24-
"generate_signatures_cli": {
18+
"partner_chains_node": {
2519
"cli": "/tools/partner-chains-node",
2620
"ssh": "${stack_config[ssh]}"
2721
},

E2E-tests/config/substrate/devnet_nodes.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"public_key": "0x020a1091341fe5664bfa1782d5e04779689068c916b04cb365ec3153755684d9a1",
1616
"aura_public_key": "0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d",
1717
"grandpa_public_key": "0x88dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee",
18-
"permissioned_candidate": false,
18+
"permissioned_candidate": true,
1919
"block_rewards_id": "0x0000000000000000000000000000000000000000000000000000000000000001"
2020
},
2121
"bob": {
@@ -26,7 +26,7 @@
2626
"public_key": "0x0390084fdbf27d2b79d26a4f13f0ccd982cb755a661969143c37cbc49ef5b91f27",
2727
"aura_public_key": "0x8eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a48",
2828
"grandpa_public_key": "0xd17c2d7823ebf260fd138f2d7e27d114c0145d968b5ff5006125f2414fadae69",
29-
"permissioned_candidate": false,
29+
"permissioned_candidate": true,
3030
"block_rewards_id": "0x0000000000000000000000000000000000000000000000000000000000000002"
3131
},
3232
"charlie": {

E2E-tests/config/substrate/devnet_stack.json

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
"stack_config": {
33
"ogmios_host": "devnet-services-service",
44
"ogmios_port": 1337,
5-
"kupo_host": "devnet-services-service",
6-
"kupo_port": 1442,
75
"tools_host": "10.0.12.126",
86
"ssh": {
97
"username": "root",
@@ -17,11 +15,7 @@
1715
"cli": "export CARDANO_NODE_SOCKET_PATH=/ipc/node.socket && /tools/cardano-cli",
1816
"ssh": "${stack_config[ssh]}"
1917
},
20-
"sidechain_main_cli": {
21-
"cli": "/tools/partner-chains-smart-contracts-7.0.2/pc-contracts-cli",
22-
"ssh": "${stack_config[ssh]}"
23-
},
24-
"generate_signatures_cli": {
18+
"partner_chains_node": {
2519
"cli": "/tools/partner-chains-node",
2620
"ssh": "${stack_config[ssh]}"
2721
},

E2E-tests/config/substrate/local_nodes.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"public_key": "0x020a1091341fe5664bfa1782d5e04779689068c916b04cb365ec3153755684d9a1",
2020
"aura_public_key": "0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d",
2121
"grandpa_public_key": "0x88dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee",
22-
"permissioned_candidate": false,
22+
"permissioned_candidate": true,
2323
"block_rewards_id": "0x0000000000000000000000000000000000000000000000000000000000000001"
2424
},
2525
"bob": {

E2E-tests/config/substrate/local_stack.json

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,19 @@
22
"stack_config": {
33
"ogmios_host": "ogmios",
44
"ogmios_port": 1337,
5-
"kupo_host": "kupo",
6-
"kupo_port": 1442,
75
"tools_shell": "/bin/bash",
86
"tools": {
97
"cardano_cli": {
108
"cli": "cardano-cli",
119
"shell": "docker exec cardano-node-1 bash -c"
1210
},
13-
"sidechain_main_cli": {
14-
"cli": "./pc-contracts-cli",
15-
"shell": "docker exec pc-contracts-cli bash -c"
16-
},
17-
"generate_signatures_cli": {
11+
"partner_chains_node": {
1812
"cli": "./partner-chains-node",
19-
"shell": "docker exec pc-contracts-cli bash -c"
13+
"shell": "docker exec partner-chains-setup bash -c"
2014
},
2115
"bech32": {
2216
"cli": "bech32"
2317
}
2418
}
2519
}
26-
}
20+
}

E2E-tests/config/substrate/staging_nodes.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@
8686
"public_key": "0x03f38a062a4b372c045c1dddc4fe98a2c9cb1d6eec8bf02f973fd29b1096cd8155",
8787
"aura_public_key": "0x500d7ff6d903c85db5ee5624df9510c2a085cf30da260166bd370010d0bdc97a",
8888
"grandpa_public_key": "0xa04d74c1539550876d04e4d2de4e0531087c3b6810ce96ddc16d78ccf4ac4f11",
89+
"permissioned_candidate": true,
8990
"cardano_payment_addr": "addr_test1vqqm36dcg5xeeqgc29r8gu6wujlmr4fyrdrvuzq4qnem2vs7g2kvj",
9091
"keys_files": {
9192
"cardano_payment_key": "./secrets/substrate/staging/keys/validator-5/payment.skey.json.decrypted",

E2E-tests/config/substrate/staging_stack.json

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
"stack_config": {
33
"ogmios_host": "staging-preview-services-service.staging-preview.svc.cluster.local",
44
"ogmios_port": 1337,
5-
"kupo_host": "staging-preview-services-service.staging-preview.svc.cluster.local",
6-
"kupo_port": 1442,
75
"tools_host": "10.0.12.157",
86
"ssh": {
97
"username": "root",
@@ -17,11 +15,7 @@
1715
"cli": "export CARDANO_NODE_SOCKET_PATH=/ipc/node.socket && /tools/cardano-cli",
1816
"ssh": "${stack_config[ssh]}"
1917
},
20-
"sidechain_main_cli": {
21-
"cli": "/tools/partner-chains-smart-contracts-7.0.2/pc-contracts-cli",
22-
"ssh": "${stack_config[ssh]}"
23-
},
24-
"generate_signatures_cli": {
18+
"partner_chains_node": {
2519
"cli": "/tools/partner-chains-node",
2620
"ssh": "${stack_config[ssh]}"
2721
},

E2E-tests/docs/configure-stack.md

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
Partner chains tests require a set of binaries for test execution:
66
- [partner-chains-node](https://github.com/input-output-hk/partner-chains) to generate signatures
77
- [cardano-cli](https://github.com/IntersectMBO/cardano-node?tab=readme-ov-file#using-cardano-cli) to query the tip of the Cardano main chain
8-
- [pc-contracts-cli](https://github.com/input-output-hk/partner-chains-smart-contracts) to execute register commands for candidates
98

109
As a user, you can choose where to place those services and binaries: on the test runner machine or a separate remote host.
1110

@@ -14,8 +13,7 @@ As a user, you can choose where to place those services and binaries: on the tes
1413
In case of the test runner machine (and local execution), you will need to update the binaries path in `stack_config.tools` for `<env>-stack.json` file in the `config/<blockchain>/<env>` folder:
1514

1615
- `cardano_cli`
17-
- `sidechain_main_cli`
18-
- `generate_signatures_cli`
16+
- `partner_chains_node`
1917

2018
## Set up stack on remote host
2119

@@ -30,8 +28,7 @@ To configure the stack, you will need to do the following:
3028
3. Set `stack_config.ssh.host_keys_path` to the file added at step 3
3129
4. Set `stack_config.ssh.private_key_path` to the file added at step 4
3230
6. Set `tools.cardano_cli.cli` to the path to the cardano-cli binary. Do not forget about exposing CARDANO_NODE_SOCKET_PATH. E.g. `export CARDANO_NODE_SOCKET_PATH=/ipc/node.socket && /cardano-cli`
33-
7. Set `tools.sidechain_main_cli` to the path to the `partner-chains-smart-contracts` binary
34-
8. Set `tools.generate_signatures_cli` to the path to the `partner-chains-node` binary
31+
7. Set `tools.partner_chains_node` to the path to the `partner-chains-node` binary
3532

3633
### `<env>-stack.json` template:
3734

@@ -52,11 +49,7 @@ To configure the stack, you will need to do the following:
5249
"cli": <STRING>,
5350
"ssh": "${stack_config[ssh]}"
5451
},
55-
"sidechain_main_cli": {
56-
"cli": <STRING>,
57-
"ssh": "${stack_config[ssh]}"
58-
},
59-
"generate_signatures_cli": {
52+
"partner_chains_node": {
6053
"cli": <STRING>,
6154
"ssh": "${stack_config[ssh]}"
6255
},
@@ -67,6 +60,3 @@ To configure the stack, you will need to do the following:
6760
}
6861
}
6962
}
70-
71-
72-

E2E-tests/docs/run-tests-on-new-env.md

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
* A partner chain node with JSON-RPC API available
66
* A node with Postgres SQL (for automated test data)
77
* A node with [cardano-node](https://github.com/IntersectMBO/cardano-node) + [cardano-db-sync](https://github.com/IntersectMBO/cardano-db-sync) + [postgres](https://www.postgresql.org/) (running locally OR on one of the partner-chains nodes)
8-
* [ogmios](https://github.com/CardanoSolutions/ogmios) and [kupo](https://github.com/CardanoSolutions/kupo) (running locally OR on the remote host)
9-
* [partner-chains-node](https://github.com/input-output-hk/partner-chains) and [pc-contracts-cli](https://github.com/input-output-hk/partner-chains-smart-contracts) (running locally OR on the remote tools host)
8+
* [ogmios](https://github.com/CardanoSolutions/ogmios) (running locally OR on the remote host)
9+
* [partner-chains-node](https://github.com/input-output-hk/partner-chains) (running locally OR on the remote tools host)
1010
* cardano-cli (from a local cardano-node OR on the remote tools host)
1111

1212
**NOTE:**
@@ -58,7 +58,9 @@ Add payment signing key of the governance authority as `init.skey` to `secrets/<
5858
- `public_key` - ECDSA public key (hex) for partner chain
5959
- `aura_public_key` - Sr25519 public key (hex)
6060
- `grandpa_public_key` - Ed25519 public key (hex)
61-
- `permissioned_candidate` - indicator whether this node is permissioned candidate (true|false)
61+
- `permissioned_candidate` - set to true if you want this node to participate in block production as permissioned candidate (true|false)
62+
random candidate will be removed each execution to test rotation
63+
use with caution, tests may alter your permissioned candidates resulting in not achieving consensus
6264
- `block_reward_id` - reward id configured at the partner chain startup
6365
- `key_files` - a set of keys for registered candidates
6466
- `cardano_payment_key` - path to payment key of registered candidate (payment.skey from step 1)
@@ -146,10 +148,10 @@ E.g. for Cardano Preview it will be:
146148

147149
### 4. Add `<env>_stack.json` to `config/<blockchain>/<env>` folder
148150

149-
`<env>_stack.json` configuration file represents connection strings to partner chain dependencies (ogmios, kupo) and binaries (partner-chains-node, sidechain-main-cli, cardano-cli).
151+
`<env>_stack.json` configuration file represents connection strings to partner chain dependencies (ogmios) and binaries (partner-chains-node, sidechain-main-cli, cardano-cli).
150152

151153
**NOTE:**
152-
- **ogmios** and **kupo** services can be executed on the remote host or made available on test runner machine
154+
- **ogmios** services can be executed on the remote host or made available on test runner machine
153155
- partner chains binaries can be made available on the test runner machine or on the remote host
154156
- if you want to use the remote host - you need to configure your own SSH keys
155157

@@ -160,8 +162,6 @@ E.g. for Cardano Preview it will be:
160162
"stack_config": {
161163
"ogmios_host": <STRING>,
162164
"ogmios_port": 1337,
163-
"kupo_host": <STRING>,
164-
"kupo_port": 1442,
165165
"tools_shell": "/bin/bash",
166166
"tools_host": <STRING,
167167
"ssh": {
@@ -175,10 +175,7 @@ E.g. for Cardano Preview it will be:
175175
"cardano_cli": {
176176
"cli": <STRING>, // path to cardano-cli binary
177177
},
178-
"sidechain_main_cli": {
179-
"cli": <STRING> // path to sidechain-main-cli binary
180-
},
181-
"generate_signatures_cli": {
178+
"partner_chains_node": {
182179
"cli": <STRING> // path to partner-chains-node binary
183180
},
184181
"bech32": {

E2E-tests/pytest.ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ markers =
44
skip_blockchain: skip test on given blockchain
55
skip_on_new_chain: skip test on new chain (less than 2 MC epochs have passed)
66
candidate_status: active or inactive, used in test_registrations.py
7-
permissioned_candidate_status: active or inactive, used in test_permissioned_registrations.py
87
ariadne: run tests for Ariadne feature
98
probability: run non deterministic tests
109
block_reward: run tests for Block Rewards feature

E2E-tests/src/blockchain_api.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -121,14 +121,14 @@ def get_status(self):
121121
pass
122122

123123
@abstractmethod
124-
def update_d_param(self, permissioned_candidates_count: int, trustless_candidates_count: int) -> dict:
124+
def update_d_param(self, permissioned_candidates_count: int, trustless_candidates_count: int) -> (bool, int):
125125
"""
126126
Update D parameter configuration for the sidechain
127127
Arguments:
128128
permissioned_candidates_count {int} -- Number of permissioned candidates
129129
trustless_candidates_count {int} -- Number of trustless candidates
130130
Returns:
131-
(bool, json response) - True/False, and a json response from the sidechain main cli
131+
(bool, int) - True/False, and a main chain epoch that it will take effect
132132
"""
133133
pass
134134

@@ -145,10 +145,6 @@ def register_candidate(self, candidate_name: str) -> (bool, int):
145145
"""
146146
pass
147147

148-
@abstractmethod
149-
def add_permissioned_candidate(self, candidate_name: str) -> (bool, int):
150-
pass
151-
152148
@abstractmethod
153149
def deregister_candidate(self, candidate: str) -> (bool, int):
154150
"""
@@ -163,7 +159,7 @@ def deregister_candidate(self, candidate: str) -> (bool, int):
163159
pass
164160

165161
@abstractmethod
166-
def remove_permissioned_candidate(self, candidate_name: str) -> (bool, int):
162+
def upsert_permissioned_candidates(self, new_candidates_list: list) -> (bool, int):
167163
pass
168164

169165
@abstractmethod

0 commit comments

Comments
 (0)