Skip to content
Merged
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
20 changes: 2 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,24 +132,8 @@ jobs:
docker build -t dashnet-recipe-test -f internal/bootstrap/testdata/Dockerfile .
docker run --rm --network none dashnet-recipe-test

core-contract:
if: github.event_name != 'workflow_dispatch' || inputs.proof_operation == 'none'
runs-on: ubuntu-latest
timeout-minutes: 25
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
with:
persist-credentials: false
- name: Real Core rendered by dashmate; wallet, registration recovery and join
run: |
set -euo pipefail
pin() { docker pull -q "$1" >/dev/null && docker image inspect "$1" --format '{{index .RepoDigests 0}}'; }
core=$(pin dashpay/dashd:23)
helper=$(pin dashpay/dashmate-helper:4.2.0-beta.3)
# The Tor image dashmate 4.2.0-beta.3 selects (digest-pinned by dashmate).
tor=$(pin osminogin/tor-simple:0.4.9.11@sha256:7aef2e7d957e2236d5fac7fca8e67c15fe65e6349eb90099da1cdc26bc4caa69)
sudo env CORE_IMAGE="$core" HELPER_IMAGE="$helper" TOR_IMAGE="$tor" DASHNET_DISPOSABLE_CI=1 python3 internal/node/testdata/core_integration.py
sudo env CORE_IMAGE="$core" HELPER_IMAGE="$helper" TOR_IMAGE="$tor" DASHNET_DISPOSABLE_CI=1 python3 internal/node/testdata/join_contract.py
# The real-Core contract (wallet, registration recovery, join) runs once per
# supported Core major in core-compat.yml.

platform-contract:
if: github.event_name != 'workflow_dispatch' || inputs.proof_operation == 'none'
Expand Down
61 changes: 61 additions & 0 deletions .github/workflows/core-compat.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Core compatibility
run-name: "Core compatibility / ${{ inputs.image || github.sha }}"

# The code that talks to Dash Core, against a real dashd of every supported
# Core major. Dispatch it by hand with any other dashpay/dashd tag (a release
# candidate, a patch release) to check that release before it is deployed.

on:
pull_request:
push:
branches: [main]
workflow_dispatch:
inputs:
image:
description: One dashpay/dashd image to check instead of the supported majors, e.g. dashpay/dashd:24.1.0-rc.1
type: string
required: false

permissions:
contents: read

concurrency:
group: core-compat-${{ github.ref }}-${{ inputs.image || 'supported' }}
cancel-in-progress: ${{ github.event_name != 'workflow_dispatch' }}

jobs:
core:
name: ${{ matrix.image }}
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
image: ${{ fromJSON(inputs.image && format('["{0}"]', inputs.image) || '["dashpay/dashd:23", "dashpay/dashd:24"]') }}
env:
IMAGE: ${{ matrix.image }}
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
with:
persist-credentials: false
- name: Pull the Core image under test
run: |
set -euo pipefail
[[ "$IMAGE" =~ ^(docker\.io/)?dashpay/dashd(:[A-Za-z0-9_][A-Za-z0-9_.-]*)?(@sha256:[0-9a-f]{64})?$ ]] || { echo "not a dashpay/dashd image: $IMAGE"; exit 1; }
docker pull -q "$IMAGE"
docker image inspect "$IMAGE" --format 'Core under test: {{index .RepoDigests 0}}' | tee -a "$GITHUB_STEP_SUMMARY"
- name: Lone regtest node; wallet, spork key, funding, registration and activation
working-directory: internal/node/testdata
run: CORE_COMPAT_IMAGE="$IMAGE" python3 -m unittest -v test_core_compat
# Runs even if the step above failed: the two answer different questions.
- name: Devnet Core rendered by dashmate; wallet, registration recovery and join
if: ${{ !cancelled() }}
run: |
set -euo pipefail
pin() { docker pull -q "$1" >/dev/null && docker image inspect "$1" --format '{{index .RepoDigests 0}}'; }
core=$(pin "$IMAGE")
helper=$(pin dashpay/dashmate-helper:4.2.0-beta.3)
# The Tor image dashmate 4.2.0-beta.3 selects (digest-pinned by dashmate).
tor=$(pin osminogin/tor-simple:0.4.9.11@sha256:7aef2e7d957e2236d5fac7fca8e67c15fe65e6349eb90099da1cdc26bc4caa69)
sudo env CORE_IMAGE="$core" HELPER_IMAGE="$helper" TOR_IMAGE="$tor" DASHNET_DISPOSABLE_CI=1 python3 internal/node/testdata/core_integration.py
sudo env CORE_IMAGE="$core" HELPER_IMAGE="$helper" TOR_IMAGE="$tor" DASHNET_DISPOSABLE_CI=1 python3 internal/node/testdata/join_contract.py
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,12 @@ are not the shared journal; EC2 provisioning stores that separately in DynamoDB.
This does not register a new validator or expand an enrolled fleet implicitly.
- **Container contracts:** real Core wallet/registration/recovery and real
Tenderdash/Envoy/DAPI configuration/TLS/gRPC; no AWS access or fleet-health claim.
- **Core compatibility:** the Core-facing code against a real `dashd` of each
supported Core major (23 and 24): a lone regtest node for the wallet, spork
key, funding, EvoNode registration and spork activation, then the devnet Core
that dashmate renders. Before deploying any other Core release, dispatch it
with that image: `image=dashpay/dashd:<tag>`. It proves the RPC surface this
tool uses, not quorums, ChainLocks or Platform on that Core.

## Development

Expand Down
12 changes: 9 additions & 3 deletions internal/node/testdata/core_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@ def call(action):
call("core-finalize")
# Reload after Core restart before funding (wallet load is explicit).
call("wallet")
call("activate")
# Exercise the live update RPC as well as readback/idempotent resume.
call("activate")
q["requiredBalance"] = 4001
# Premine at minimum difficulty in batches, as a real devnet does.
q["context"]["premineHeight"] = 600
Expand Down Expand Up @@ -125,6 +122,15 @@ def call(action):
assert (
len(w.rpc("listlockunspent", [], True)) == 2
), "Second registration spent first collateral"
# Sporks last, as a deployment does (registrations, then activate).
# With InstantSend on, Core keeps a transaction that has no
# InstantSend lock out of blocks for ten minutes, and this lone
# node has no quorum to lock one. Core 23 skipped that rule on a
# node whose masternode sync is incomplete; Core 24 does not, so
# registering after activation cannot confirm here.
call("activate")
# Exercise the live update RPC as well as readback/idempotent resume.
call("activate")
print(
"Real Core: config, wallet, signed EvoNode registration, idempotent replay, stop/resume passed.",
flush=True,
Expand Down
Loading
Loading