Skip to content

Commit 2fdefb4

Browse files
committed
Merge branch 'master' of github.com:input-output-hk/partner-chains into beefy_poc
2 parents 0a6a867 + 501b9bf commit 2fdefb4

Some content is hidden

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

66 files changed

+935
-961
lines changed

.github/workflows/e2e-tests.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,6 @@ jobs:
4444
contents: read
4545
runs-on: eks
4646
steps:
47-
- name: set ssh-agent to binary host
48-
uses: webfactory/[email protected]
49-
with:
50-
ssh-private-key: ${{ secrets.SSH_KEY_BINARY_HOST }}
51-
5247
- name: Acquire AWS Credentials
5348
uses: aws-actions/configure-aws-credentials@v2
5449
with:
@@ -98,18 +93,21 @@ jobs:
9893
XRAY_CLIENT_SECRET: ${{ secrets.XRAY_CLIENT_SECRET }}
9994
XRAY_API_BASE_URL: ${{ secrets.XRAY_API_BASE_URL }}
10095
JIRA_URL: ${{ secrets.JIRA_URL }}
96+
K8S_SERVER: ${{ secrets.K8S_SERVER }}
97+
K8S_SA_TOKEN: ${{ secrets.K8S_SA_TOKEN }}
10198
run: |
10299
cd e2e-tests
103100
earthly \
104101
--secret AWS_SESSION_TOKEN="$AWS_SESSION_TOKEN" \
105102
--secret AWS_ACCESS_KEY_ID="$AWS_ACCESS_KEY_ID" \
106103
--secret AWS_SECRET_ACCESS_KEY="$AWS_SECRET_ACCESS_KEY" \
104+
--secret K8S_SERVER="$K8S_SERVER" \
105+
--secret K8S_SA_TOKEN="$K8S_SA_TOKEN" \
107106
--secret SLACK_WEBHOOK_URL="$SLACK_WEBHOOK_URL" \
108107
--secret XRAY_CLIENT_ID="$XRAY_CLIENT_ID" \
109108
--secret XRAY_CLIENT_SECRET="$XRAY_CLIENT_SECRET" \
110109
--secret XRAY_API_BASE_URL="$XRAY_API_BASE_URL" \
111110
--secret JIRA_URL="$JIRA_URL" \
112-
--ssh-auth-sock="$SSH_AUTH_SOCK" \
113111
+report \
114112
--log_level="${LOG_LEVEL:-"info"}" \
115113
--env=${{ inputs.env }} \

.github/workflows/staging.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,6 @@ jobs:
4646
TEST_ENVIRONMENT: staging
4747

4848
steps:
49-
- name: set ssh-agent to binary host
50-
uses: webfactory/[email protected]
51-
with:
52-
ssh-private-key: ${{ secrets.SSH_KEY_BINARY_HOST }}
53-
5449
- name: Acquire AWS Credentials
5550
uses: aws-actions/configure-aws-credentials@v2
5651
with:
@@ -102,18 +97,21 @@ jobs:
10297
XRAY_CLIENT_SECRET: ${{ secrets.XRAY_CLIENT_SECRET }}
10398
XRAY_API_BASE_URL: ${{ secrets.XRAY_API_BASE_URL }}
10499
JIRA_URL: ${{ secrets.JIRA_URL }}
100+
K8S_SERVER: ${{ secrets.K8S_SERVER }}
101+
K8S_SA_TOKEN: ${{ secrets.K8S_SA_TOKEN }}
105102
run: |
106103
cd e2e-tests
107104
earthly \
108105
--secret AWS_SESSION_TOKEN="$AWS_SESSION_TOKEN" \
109106
--secret AWS_ACCESS_KEY_ID="$AWS_ACCESS_KEY_ID" \
110107
--secret AWS_SECRET_ACCESS_KEY="$AWS_SECRET_ACCESS_KEY" \
108+
--secret K8S_SERVER="$K8S_SERVER" \
109+
--secret K8S_SA_TOKEN="$K8S_SA_TOKEN" \
111110
--secret SLACK_WEBHOOK_URL="$SLACK_WEBHOOK_URL" \
112111
--secret XRAY_CLIENT_ID="$XRAY_CLIENT_ID" \
113112
--secret XRAY_CLIENT_SECRET="$XRAY_CLIENT_SECRET" \
114113
--secret XRAY_API_BASE_URL="$XRAY_API_BASE_URL" \
115114
--secret JIRA_URL="$JIRA_URL" \
116-
--ssh-auth-sock="$SSH_AUTH_SOCK" \
117115
+report \
118116
--log_level="${LOG_LEVEL:-"info"}" \
119117
--env=${{ env.TEST_ENVIRONMENT }} \

changelog.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,16 @@ This changelog is based on [Keep A Changelog](https://keepachangelog.com/en/1.1.
66

77
## Changed
88

9+
## Added
10+
11+
## Fixed
12+
13+
## Removed
14+
15+
# v1.7.0
16+
17+
## Changed
18+
919
* `partner-chains-db-sync-data-sources` and `partner-chains-mock-data-sources` crates now exports all its public members from the root
1020
* `partner-chains-db-sync-data-sources` crate now exports all its public members from the root
1121
* `smart-contracts` commands can accept parameter to configure Ogmios requests timeout

dev/docker/chain-spec/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The runtime WebAssembly (WASM) binary compiled by default may not be determinist
88

99
Utilizing a Docker image for the build process ensures a consistent build environment and deterministic WASM builds.
1010

11-
## Do I need to run it everytime?
11+
## Do I need to run it every time?
1212

1313
It is not necessary to use this Docker image for every build. For local development and testing, using the hardcoded chain spec is sufficient. However, a deterministic chain spec becomes crucial when initiating a new partner chain:
1414

docs/intro.md

Lines changed: 161 additions & 102 deletions
Large diffs are not rendered by default.

e2e-tests/Earthfile

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,19 @@ ARG --global pytest_cmd=pytest --blockchain $blockchain --env $env --log-cli-lev
3333

3434
build:
3535
ARG USERARCH
36-
RUN mkdir -m 0700 ~/.ssh && cat config/substrate/known_hosts >> ~/.ssh/known_hosts
36+
IF [ "$USERARCH" = "arm64" ]
37+
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip" -o "awscliv2.zip"
38+
ELSE
39+
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
40+
END
41+
RUN unzip -q awscliv2.zip
42+
RUN ./aws/install
43+
RUN curl -LO --silent https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/${USERARCH}/kubectl
44+
RUN install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
45+
RUN --secret K8S_SERVER kubectl config set-cluster my-cluster --server=${K8S_SERVER} --insecure-skip-tls-verify=true
46+
RUN --secret K8S_SA_TOKEN kubectl config set-credentials github-actions --token=${K8S_SA_TOKEN}
47+
RUN kubectl config set-context my-context --cluster=my-cluster --user=github-actions --namespace=default
48+
RUN kubectl config use-context my-context
3749
RUN curl -L --silent https://github.com/getsops/sops/releases/download/v3.7.3/sops_3.7.3_${USERARCH}.deb > sops.deb && dpkg -i sops.deb && rm sops.deb
3850
RUN pip install -r requirements.txt
3951

@@ -44,9 +56,9 @@ test:
4456
FROM +build
4557
ARG CI_RUN
4658
IF [ "$CI_RUN" = "true" ]
47-
RUN --secret AWS_SECRET_ACCESS_KEY --secret AWS_ACCESS_KEY_ID --secret AWS_SESSION_TOKEN --no-cache --ssh eval $pytest_cmd --ci-run || true
59+
RUN --secret AWS_SECRET_ACCESS_KEY --secret AWS_ACCESS_KEY_ID --secret AWS_SESSION_TOKEN --no-cache eval $pytest_cmd --ci-run || true
4860
ELSE
49-
RUN --mount=type=secret,target=/root/.aws/credentials,id=aws --no-cache --ssh eval $pytest_cmd || true
61+
RUN --mount=type=secret,target=/root/.aws/credentials,id=aws --mount=type=secret,target=/root/.kube/config,id=kube --no-cache eval $pytest_cmd || true
5062
END
5163

5264
test-artifacts:

e2e-tests/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ All test layers upload full logs, metrics, and test reports to GitHub Artifacts
142142
| Block Production Advances | `test_block_producing` | Validate that node produces new blocks over time | Block height increases after 1.5x block duration sleep | Ensures block authoring is active and chain is progressing | Python SDK call to `get_latest_pc_block_number()` with timing validation |
143143
| Basic Transaction Execution | `test_transaction` | Send transaction and verify state change | Receiver balance increases; sender balance decreases by amount + fee | Verifies signing, submission, and state application of transactions | SDK with internal signing + submit logic, validates balance changes |
144144
| Chain Status Matches Cardano Tip | `test_get_status` | Validate that `getStatus()` aligns with Cardano CLI tip | Epoch/slot data close to Cardano tip; timestamps and sidechain data present | Confirms sync between mainchain and sidechain | `curl -d '{"jsonrpc":"2.0","method":"sidechain_getStatus","params":[],"id":1}' http://localhost:9933` with Cardano CLI comparison |
145-
| Genesis Params Returned | `test_get_params` | Confirm genesis config is available via RPC | `genesis_utxo` returned and correct | Ensures sidechain is initialized with correct bootstrap parameters | `curl -d '{"jsonrpc":"2.0","method":"partner_chain_getParams","params":[],"id":1}' http://localhost:9933` with genesis validation |
145+
| Genesis Params Returned | `test_get_params` | Confirm genesis config is available via RPC | `genesis_utxo` returned and correct | Ensures chain genesis_utxo can be retreived | `curl -d '{"jsonrpc":"2.0","method":"partner_chain_getParams","params":[],"id":1}' http://localhost:9933` with genesis validation |
146146

147147
#### **RPC Interface Tests**
148148

@@ -197,4 +197,3 @@ test_categories:
197197
```
198198

199199
Each category is run with appropriate test markers and configurations to ensure comprehensive coverage of the Partner Chain functionality.
200-

e2e-tests/config/api_config.py

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -64,19 +64,36 @@ class MainchainAccount:
6464

6565

6666
@dataclass
67-
class SSH:
68-
username: str = MISSING
69-
host: str = MISSING
70-
port: int = MISSING
71-
host_keys_path: Optional[str] = None
72-
private_key_path: Optional[str] = None
67+
class KubernetesConfig:
68+
pod: str = MISSING
69+
namespace: str = MISSING
70+
container: str = MISSING
71+
72+
73+
@dataclass
74+
class DockerConfig:
75+
container: str = MISSING
76+
77+
78+
@dataclass
79+
class RunnerConfig:
80+
copy_secrets: bool = False
81+
workdir: Optional[str] = None
82+
docker: Optional[DockerConfig] = None
83+
kubernetes: Optional[KubernetesConfig] = None
7384

7485

7586
@dataclass
7687
class Tool:
77-
cli: str = MISSING
78-
ssh: Optional[SSH] = None
79-
shell: Optional[str] = SI("${...tools_shell}")
88+
path: str = MISSING
89+
runner: RunnerConfig = SI("${..runner}")
90+
91+
92+
@dataclass
93+
class Tools:
94+
runner: RunnerConfig = MISSING
95+
cardano_cli: Tool = MISSING
96+
node: Tool = MISSING
8097

8198

8299
@dataclass
@@ -115,16 +132,11 @@ class StackApiConfig:
115132
ogmios_host: str = MISSING
116133
ogmios_port: int = MISSING
117134
ogmios_url: str = SI("${.ogmios_scheme}://${.ogmios_host}:${.ogmios_port}")
118-
tools: dict[str, Tool] = MISSING
119-
tools_host: str = MISSING
120-
tools_shell: Optional[str] = None
121-
ssh: Optional[SSH] = None
135+
tools: Tools = MISSING
122136

123137

124138
@dataclass
125139
class ApiConfig:
126-
genesis_utxo: str = MISSING
127-
atms_kind: str = MISSING
128140
committee_epoch_slippage: int = MISSING
129141
committee_participation_tolerance: float = MISSING
130142
max_validators: int = MISSING

e2e-tests/config/config.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
2-
"atms_kind": "plain-ecdsa-secp256k1",
32
"committee_epoch_slippage": 0,
43
"committee_participation_tolerance": 0.05,
54
"max_validators": 32,

e2e-tests/config/substrate/ci-ci.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,5 @@
2222
"port": "${nodes_config[default_port]}"
2323
}
2424
}
25-
},
26-
"stack_config": {
27-
"tools_host": "binary-host-service.sc.svc.cluster.local"
2825
}
2926
}

0 commit comments

Comments
 (0)