Skip to content

Commit f5f05a3

Browse files
authored
new blog article - partner chains
1 parent e634e2b commit f5f05a3

File tree

5 files changed

+117
-0
lines changed

5 files changed

+117
-0
lines changed
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
---
2+
slug: local-testing-partner-chains
3+
title: 'Partner Chains Development Lifecycle: Our CI Evolution'
4+
authors: [christos, skylar]
5+
tags: [Quality Strategy]
6+
---
7+
8+
## Testing requirements: the need for a smaller epoch Cardano network
9+
10+
The partner chains project revealed the criticality of a fast-epoch network for rapid code testing and result analysis.
11+
12+
<!-- truncate -->
13+
14+
## First iteration: private testnet
15+
16+
The first solution involved a private testnet with two-hour epochs, in contrast to the preview network's 24-hour epochs or the mainnet's five days. This approach, while faster, introduced substantial operational overheads. With only one site reliability engineer (SRE) responsible for both testnet maintenance and other critical partner chains infrastructure, the system proved unsustainable. The private testnet was ultimately decommissioned during the migration from a Scala node implementation to a Substrate-based Rust node.
17+
18+
## Second iteration: preview testnet and increased complexity
19+
20+
Shifting to the preview testnet introduced new complexities in the testing framework. The 24-hour epoch length meant that test operations requiring an epoch change could no longer complete in a single run. This required us to:
21+
22+
Save the state of the test run
23+
Obtain the result the next time the test would run after the epoch change
24+
Add database functionality for state management
25+
Implement time management methods.
26+
27+
These requirements significantly increased both system complexity and test execution time.
28+
29+
## Third iteration: Cardano local cluster breakthrough
30+
31+
The introduction of the Cardano local cluster represented a breakthrough in our testing infrastructure. This solution offered epoch times of two minutes or less and full local network control. With support from the Cardano node team, we managed to get a local network up and running very quickly. Many new possibilities promptly emerged.
32+
33+
<img align="center" width="100%" src={require("@site/static/img/blog/003-local-testing-partner-chains.png").default} alt="Local testing partner chains" />
34+
The partner chains local environment. Note that partner-chains-node-3 (Charlie) and partner-chains-node-5 (Eve) are by default passive nodes. If desired for the local testing environment, the tester could add Charlie as permissioned or register Eve.
35+
36+
## Implementation
37+
38+
Containerized partner chain demo environment
39+
First, we developed a Docker-based demonstration environment packaging all dependencies and nodes into the following 10 containers:
40+
41+
* 1x Cardano node
42+
* 1x DB-Sync instance
43+
* 1x Kupo indexer
44+
* 1x Ogmios interface
45+
* 1x for partner chain smart contracts, and
46+
* 5x partner chain nodes.
47+
48+
The setup process features an interactive CLI with binary (Y/N) configuration options. Once the artifacts are downloaded, it takes less than 10 minutes to have a functional partner chain from genesis.
49+
50+
<img align="center" width="100%" src={require("@site/static/img/blog/003-local-testing-partner-chains-2.png").default} alt="Local testing partner chains" />
51+
52+
### Testing framework evolution
53+
54+
The local environment dramatically improved our testing capabilities. Instead of waiting for two days to get the results of a complete test run on a partner chain following the preview testnet, we could now use the local environment and get results within 15 minutes, opening the way for improvements to continuous integration (CI) and continuous deployment (CD).
55+
56+
Previous approach (observing the Cardano preview testnet):
57+
Complete test run: 48 hours
58+
Limited by epoch boundaries
59+
Required state management between runs.
60+
61+
Current approach (observing local Cardano environment):
62+
Complete test run: 15 minutes
63+
No epoch-related constraints
64+
Stateless test execution.
65+
66+
### CI improvements
67+
68+
For CI, we replaced a smoke test upon a pull request (PR) with the full suite of tests on the local environment. The local environment enabled a significant enhancement of our CI pipeline:
69+
70+
Previous approach:
71+
Limited smoke tests on PRs
72+
A subset of tests constrained by epoch boundaries.
73+
74+
Enhanced approach:
75+
Full test suite execution on PRs
76+
Minimal overhead (two to three minutes additional runtime).
77+
78+
### CD improvements
79+
80+
Similarly, the local environment also transformed our CD and delivery strategy. With a new deployment flow, we automatically test each release candidate in the local environment first, then progressively deploy across other environments.
81+
82+
### Hard fork protocol upgrades
83+
84+
While the progress hitherto was significant, the local environment truly demonstrated its highest value during protocol upgrades, specifically during the Chang and Plomin hard forks.
85+
86+
When the Chang hard fork was announced, we didn’t yet have the local partner chain environment ready. We had to upgrade our dependencies to use the latest hard fork compatible Cardano node.
87+
88+
Each iteration took a long time to be tested, as we had to wait for a public environment to be forked, usually SanchoNet first, and we also had to wait 24 hours for any test result. That left us with a very tight deadline before the preview testnet was forked to fix any bugs.
89+
90+
However, with the next hard fork, we could fork our local environment to the protocol version we desired and upgrade our dependencies, even before SanchoNet was forked. We could also start a local partner chain in the previous Cardano era, perform the hard fork locally, and observe and validate the normal operation. This saved much time.
91+
92+
This new workflow transformed hard fork upgrades from high-risk operations with limited testing windows into controlled and thoroughly validated protocol transitions.
93+
94+
### Dependency management evolution
95+
96+
Previously, we had to deploy the new version to some nodes in our infrastructure and test. Local environments have transformed our approach to dependency management and version control.
97+
98+
The system has evolved from an experimental suggestion into a critical component of our development infrastructure, fundamentally improving our ability to manage and validate system dependencies with confidence.
99+
100+
Now, we can simply choose any version with which we want to generate a new environment and perform the test. The response times were slashed from days to minutes. Not only that, but we now have confidence in changing a version of our infrastructure, as we have already verified that it works locally.
101+
102+
All in all, this marked a very significant improvement in our software development lifecycle. It was implemented and tested once the team understood its importance and value, and quickly adopted by the whole tribe.
103+
104+
To learn more, [view the code and read the documentation](https://github.com/input-output-hk/partner-chains/blob/master/dev/local-environment/README.md).

blog/authors.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
11
dorin:
22
name: Dorin Solomon
33
title: Head of Quality Engineering
4+
5+
christos:
6+
name: Christos Palaskas
7+
title: Software Engineer in Test Lead | Partner chains
8+
9+
skylar:
10+
name: Skylar Simoncelli
11+
title: Site Reliability Engineer | Partner chains

blog/tags.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,8 @@ release-strategy:
77
label: Release Strategy
88
permalink: /release-strategy
99
description: Release Strategy tag
10+
11+
quality-strategy:
12+
label: Quality Strategy
13+
permalink: /quality-strategy
14+
description: Quality Strategy tag
153 KB
Loading
388 KB
Loading

0 commit comments

Comments
 (0)