Skip to content

Commit cc3888c

Browse files
committed
Merge branch 'master' into edmund/l2-spv-poc
2 parents b729fcd + 667121e commit cc3888c

Some content is hidden

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

55 files changed

+897
-505
lines changed

.envrc.sample

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
use flake

.github/workflows/applications.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ on:
1919
description: link with -eventlog
2020
default: 'False'
2121
push:
22+
paths:
23+
- '**'
24+
# - '!.github/**'
25+
merge_group:
2226

2327
env:
2428
AWS_ACCESS_KEY_ID: ${{ secrets.kadena_cabal_cache_aws_access_key_id }}

.github/workflows/macos.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ name: Build with MacOS
33
on:
44
workflow_dispatch:
55
push:
6+
# paths-ignore:
7+
# - '.github/**'
68

79
jobs:
810

.github/workflows/nix.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,24 @@ name: Build and cache with Nix
33
on:
44
workflow_dispatch:
55
push:
6+
paths:
7+
- '**'
8+
# - '!.github/**'
69

710
jobs:
811
build-and-cache:
912
runs-on: ${{ matrix.os }}
13+
timeout-minutes: 740
1014
strategy:
15+
fail-fast: false
1116
matrix:
12-
os: [ubuntu-latest, macos-latest]
17+
os: [ubuntu-latest, macos-latest, macos-m1]
1318
steps:
1419
- name: Checkout repository
1520
uses: actions/checkout@v3
1621

1722
- name: Set up Nix with caching
18-
uses: kadena-io/setup-nix-with-cache@v1
23+
uses: kadena-io/setup-nix-with-cache/by-root@v3
1924
with:
2025
cache_url: s3://nixcache.chainweb.com?region=us-east-1
2126
signing_private_key: ${{ secrets.NIX_CACHE_PRIVATE_KEY }}
@@ -27,8 +32,10 @@ jobs:
2732
aws-secret-access-key: ${{ secrets.NIX_CACHE_AWS_SECRET_ACCESS_KEY }}
2833
aws-region: us-east-1
2934

35+
- name: Give root user AWS credentials
36+
uses: kadena-io/setup-nix-with-cache/copy-root-aws-credentials@v3
37+
3038
- name: Build and cache artifacts
31-
timeout-minutes: 740
3239
run: |
3340
echo Building the project and its devShell
3441
nix build .#check --log-lines 500 --show-trace

.github/workflows/release.yml

Lines changed: 272 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,272 @@
1+
name: Release - chainweb-node - binary release scripts
2+
3+
## Release automation for chainweb-node
4+
# Designed to run systems in chainweb/binary-release
5+
6+
## Currently has manual version setting and creates draft releases;
7+
# when we are confident in this process, it can auto-increment and publish non-drafts
8+
# tbd: connect k8s firing mechanism, create and connect chainweb-node-docker update workflow
9+
10+
run-name: "Release chainweb-node ${{ inputs.release_sha }} from ${{ github.sha}}"
11+
on:
12+
workflow_dispatch:
13+
inputs:
14+
release_sha:
15+
description: "hash of chainweb-node release, default to branch running this job"
16+
type: string
17+
required: false
18+
new_tag:
19+
description: "The X.Y.Z tag for the new version"
20+
type: string
21+
required: true
22+
old_tag:
23+
description: "The X.Y.Z of the old version"
24+
type: string
25+
required: true
26+
# tag_default_bump:
27+
# description: "Auto-bump release version id"
28+
# type: choice
29+
# options:
30+
# - patch
31+
# - minor
32+
# - major
33+
# - none
34+
dry_run:
35+
description: "dry run (debugging)"
36+
type: boolean
37+
default: false
38+
39+
jobs:
40+
Finalize-release:
41+
runs-on: ubuntu-latest
42+
steps:
43+
# if this plugin is bad we just override it
44+
# - name: Bump version and push tag
45+
# id: tag_version
46+
# uses: mathieudutour/[email protected]
47+
# with:
48+
# github_token: ${{ secrets.GITHUB_TOKEN }}
49+
# default_bump: ${{ inputs.tag_default_bump }}
50+
# tag_prefix: ""
51+
# commit_sha: ${{ inputs.release_sha }}
52+
# This is up here so we can adjust the way we handle package bumping etc
53+
# might not want to use the above plugin/don't want to depend on its outputs
54+
# yeah that thing is for rapid releasing tbh
55+
56+
- name: Set environment variables for release
57+
run: |
58+
RELEASE_SHA=${{ github.sha }}
59+
if [[ ! -z ${{ inputs.release_sha }} ]]; then
60+
RELEASE_SHA=${{ inputs.release_sha }}
61+
fi
62+
echo "RELEASE_SHA=$RELEASE_SHA" >> $GITHUB_ENV
63+
SHORT_REVISION=$(echo $RELEASE_SHA | cut -c 1-7)
64+
echo "SHORT_REVISION=$SHORT_REVISION" >> $GITHUB_ENV
65+
#echo "VERSION_NEW=${{ steps.tag_version.outputs.new_tag }}" >> $GITHUB_ENV
66+
#echo "VERSION_OLD=${{ steps.tag_version.outputs.old_tag }}" >> $GITHUB_ENV
67+
echo "VERSION_NEW=${{ inputs.new_tag }}" >> $GITHUB_ENV
68+
echo "VERSION_OLD=${{ inputs.old_tag }}" >> $GITHUB_ENV
69+
echo "IMAGE=ghcr.io/kadena-io/chainweb-node:sha-$SHORT_REVISION" >> $GITHUB_ENV
70+
echo $GITHUB_ENV
71+
72+
- uses: actions/checkout@v3
73+
with:
74+
repository: kadena-io/chainweb-node-docker
75+
path: dockerhub
76+
ssh-key: ${{ secrets.GH_DEPLOYKEY_CHAINWEBDOCKER }}
77+
78+
#- name: derive release id from branch name?
79+
# if this was a release branch we'd do this to override the inputs
80+
# first run we are releasing from master (release branch kinda not needed if we just force release build logic during 'freeze')
81+
# The release actions out there sometimes will just do this increment for us
82+
- name: UBUNTU IMAGE bump end-user docker image
83+
working-directory: dockerhub
84+
continue-on-error: true
85+
run: |
86+
echo "DOCKERHUB_SHA=not yet updated" >> $GITHUB_ENV
87+
git clone https://github.com/kadena-io/chainweb-node-docker
88+
sed -i -e "s/ARG REVISION=.*/ARG REVISION=$SHORT_REVISION/" Dockerfile
89+
docker build -t kadena/chainweb-node:$VERSION_NEW .
90+
docker run --rm kadena/chainweb-node:$VERSION_NEW ./chainweb-node --version
91+
92+
git config --local user.name "github-actions[chainweb-node release]"
93+
git config --local user.email "[email protected]"
94+
git add Dockerfile
95+
git commit -m "chainweb-node version $VERSION_NEW"
96+
git tag chainweb-$VERSION_NEW
97+
git push
98+
git push origin chainweb-$VERSION_NEW
99+
100+
echo ${{ secrets.DOCKERHUB_PAT }} | docker login docker.io --username ${{ secrets.DOCKERHUB_USER }} --password-stdin
101+
102+
docker tag kadena/chainweb-node:$VERSION_NEW kadena/chainweb-node:latest
103+
docker image push --all-tags kadena/chainweb-node
104+
105+
## spit these to output
106+
digest1=$(docker inspect kadena/chainweb-node:$VERSION_NEW --format '{{ .RepoDigests }}')
107+
digest2=$(docker inspect kadena/chainweb-node:latest --format '{{ .RepoDigests }}')
108+
if [[ $digest1 != $digest2 ]]; then
109+
echo "DOCKERHUB_SHA=sha mismatches in dockerhub image" >> $GITHUB_ENV
110+
exit 1
111+
fi
112+
echo "DOCKERHUB_SHA=$digest1" >> $GITHUB_ENV
113+
114+
# all of this should really just be a BUMP IMAGE VERSION step in the other repo
115+
# Now in this workflow, trigger the above, spit output into release notes file
116+
117+
- uses: actions/checkout@v3
118+
with:
119+
ref: ${{ env.RELEASE_SHA }}
120+
sparse-checkout: 'CHANGELOG.md'
121+
122+
- name: tag git sha with release version
123+
run: |
124+
git tag ${{ env.VERSION_NEW }} ${{ env.RELEASE_SHA }}
125+
git push --tags
126+
127+
- name: Login to GHCR
128+
uses: docker/login-action@v2
129+
with:
130+
registry: ghcr.io
131+
username: ${{ github.actor }}
132+
password: ${{ secrets.GITHUB_TOKEN }}
133+
134+
- name: retag ghcr docker images
135+
continue-on-error: true
136+
env:
137+
IMAGE: ${{ env.IMAGE }}
138+
SHORT_REVISION: ${{ env.SHORT_REVISION }}
139+
VERSION_NEW: ${{ env.VERSION_NEW }}
140+
run: |
141+
docker pull $IMAGE
142+
docker run --rm $IMAGE --version
143+
docker tag ghcr.io/kadena-io/chainweb-node:sha-$SHORT_REVISION ghcr.io/kadena-io/chainweb-node/ubuntu:$VERSION_NEW
144+
docker tag ghcr.io/kadena-io/chainweb-node:sha-$SHORT_REVISION ghcr.io/kadena-io/chainweb-node/ubuntu:latest
145+
docker tag ghcr.io/kadena-io/chainweb-node:sha-$SHORT_REVISION ghcr.io/kadena-io/chainweb-node:latest
146+
147+
docker image ls
148+
149+
docker image push --all-tags ghcr.io/kadena-io/chainweb-node/ubuntu
150+
docker image push --all-tags ghcr.io/kadena-io/chainweb-node
151+
152+
digest1=$(docker inspect ghcr.io/kadena-io/chainweb-node:sha-$SHORT_REVISION --format '{{ .RepoDigests }}')
153+
digest2=$(docker inspect ghcr.io/kadena-io/chainweb-node/ubuntu:$VERSION_NEW --format '{{ .RepoDigests }}')
154+
digest3=$(docker inspect ghcr.io/kadena-io/chainweb-node/ubuntu:latest --format '{{ .RepoDigests }}')
155+
if [[ "$digest1" != "$digest2" || "$digest2" != "$digest3" ]]; then
156+
echo "GHCR_DIGEST=GHCR digests do not compare correctly" >> $GITHUB_ENV
157+
exit 1
158+
fi
159+
echo "GHCR_DIGEST=$digest2" >> $GITHUB_ENV
160+
161+
- name: run release script to generate images
162+
id: repack-binaries
163+
env:
164+
SHORT_REVISION: ${{ env.SHORT_REVISION }}
165+
VERSION_NEW: ${{ env.VERSION_NEW }}
166+
run: |
167+
168+
GHC_VER=9.6.2
169+
170+
UBUNTU_20_TAR=chainweb.false.$GHC_VER.ubuntu-20.04.$SHORT_REVISION.tar.gz
171+
UBUNTU_22_TAR=chainweb.false.$GHC_VER.ubuntu-22.04.$SHORT_REVISION.tar.gz
172+
173+
UBUNTU_20_NODE=chainweb-$VERSION_NEW.ghc-$GHC_VER.ubuntu-20.04.$SHORT_REVISION.tar.gz
174+
UBUNTU_22_NODE=chainweb-$VERSION_NEW.ghc-$GHC_VER.ubuntu-22.04.$SHORT_REVISION.tar.gz
175+
echo $UBUNTU_22_TAR
176+
echo $UBUNTU_22_NODE
177+
178+
curl "s3.us-east-1.amazonaws.com/kadena-cabal-cache/chainweb-node/$UBUNTU_20_TAR" -o "./$UBUNTU_20_TAR"
179+
curl "s3.us-east-1.amazonaws.com/kadena-cabal-cache/chainweb-node/$UBUNTU_22_TAR" -o "./$UBUNTU_22_TAR"
180+
181+
tar xvfz "$UBUNTU_20_TAR" chainweb/chainweb-node
182+
mv chainweb/chainweb-node .
183+
tar cvfz "$UBUNTU_20_NODE" chainweb-node
184+
rm -fr chainweb-node chainweb
185+
186+
tar xvfz "$UBUNTU_22_TAR" chainweb/chainweb-node
187+
mv chainweb/chainweb-node .
188+
tar cvfz "$UBUNTU_22_NODE" chainweb-node
189+
rm -fr chainweb-node chainweb
190+
191+
echo "UBUNTU_20_SHA=$(shasum -a 256 $UBUNTU_20_NODE)" >> $GITHUB_ENV
192+
echo "UBUNTU_22_SHA=$(shasum -a 256 $UBUNTU_22_NODE)" >> $GITHUB_ENV
193+
shasum -a 256 "$UBUNTU_22_NODE"
194+
echo "UBUNTU_20_NODE=$UBUNTU_20_NODE" >> $GITHUB_ENV
195+
echo "UBUNTU_22_NODE=$UBUNTU_22_NODE" >> $GITHUB_ENV
196+
197+
#- name: generate release message
198+
# could generate this from the changelog.md, though changelog.md could be itself generated...
199+
#oom_score_adj:
200+
201+
- name: Generate release message
202+
continue-on-error: true
203+
env:
204+
UBUNTU_22_NODE: ${{ env.UBUNTU_22_NODE }}
205+
UBUNTU_20_NODE: ${{ env.UBUNTU_20_NODE }}
206+
IMAGE: ${{ env.IMAGE }}
207+
SHORT_REVISION: ${{ env.SHORT_REVISION }}
208+
VERSION_NEW: ${{ env.VERSION_NEW }}
209+
VERSION_OLD: ${{ env.VERSION_OLD }}
210+
GHCR_DIGEST: ${{ env.GHCR_DIGEST }}
211+
run: |
212+
pwd
213+
ls
214+
sed "/$VERSION_OLD\s/,\$d" CHANGELOG.md | sed "/$VERSION_NEW (20/d" | sed '/\sChangelog/d' | tee CHANGELOG.md
215+
echo 'Official release: https://github.com/kadena-io/chainweb-node/releases/tag/${{ env.VERSION_NEW }}
216+
217+
For full details refer to the [Changelog](https://github.com/kadena-io/chainweb-node/blob/master/CHANGELOG.md)
218+
219+
### Container Images:
220+
221+
* [End-user image](https://hub.docker.com/r/kadena/chainweb-node)
222+
Image Digest: `${{ env.DOCKERHUB_SHA }}`
223+
```sh
224+
docker pull kadena/chainweb-node:${{ env.VERSION_NEW }}
225+
```
226+
227+
* [Binary-only Ubuntu-20.04 ](ghcr.io/kadena-io/chainweb-node/ubuntu:${{ env.VERSION_NEW }})
228+
Image Digest: `${{ env.GHCR_DIGEST }}`
229+
```sh
230+
docker pull ghcr.io/kadena-io/chainweb-node/ubuntu:${{ env.VERSION_NEW }}
231+
```
232+
233+
### Ubuntu Binaries:
234+
235+
SHA256 Hashes
236+
237+
```
238+
${{ env.UBUNTU_22_SHA }}
239+
${{ env.UBUNTU_20_SHA }}
240+
```
241+
242+
The following dependencies must be installed on the system:
243+
244+
* ubuntu-22.04:
245+
```sh
246+
apt-get install ca-certificates libgmp10 libssl3 libsnappy1v5 zlib1g liblz4-1 libbz2-1.0 libgflags2.2 zstd
247+
```
248+
* ubuntu-20.04:
249+
```sh
250+
apt-get install ca-certificates libgmp10 libssl1.1 libsnappy1v5 zlib1g liblz4-1 libbz2-1.0 libgflags2.2 zstd
251+
```
252+
' >> CHANGELOG.md
253+
cat CHANGELOG.md
254+
255+
- name: Release
256+
uses: ncipollo/release-action@v1
257+
#if: startsWith(github.ref, 'refs/tags/')
258+
with:
259+
bodyFile: CHANGELOG.md
260+
artifacts: "${{ env.UBUNTU_20_NODE }},${{ env.UBUNTU_22_NODE }}"
261+
token: ${{ github.token }}
262+
tag: ${{ env.VERSION_NEW }}
263+
commit: ${{ env.RELEASE_SHA }}
264+
name: ${{ env.VERSION_NEW }}
265+
omitBodyDuringUpdate: true
266+
skipIfReleaseExists: true
267+
draft: true
268+
269+
270+
- name: Deploy to mainnet api.chainweb.com
271+
run: |
272+
echo "This will be a remote trigger" >> $GITHUB_STEP_SUMMARY

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,6 @@ TAGS
5050
.DS_Store
5151
.vscode/*
5252
rosetta/logs/*
53+
.ghci_history
54+
.direnv/
55+
.envrc

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
11
# `chainweb-node` Changelog
22

3+
## 2.21 (2023-10-05)
4+
5+
This version replaces all previous versions. Any prior version will stop working
6+
on **2023-10-19T00:00:00Z**. Node administrators must upgrade to this version before
7+
that date.
8+
9+
This version will expire on **2023-12-13T:00:00Z**.
10+
11+
To upgrade, pull the latest docker image or download the binary and restart the node.
12+
13+
Changes:
14+
15+
* Support for WebAuthN signatures in Pact keyset guards. (#1729, see [https://github.com/kadena-io/pact](Pact) #1139)
16+
* Updated to Pact 4.9. (numerous, see [Pact
17+
changelog](https://github.com/kadena-io/pact/releases/tag/v4.9))
18+
19+
Internal Changes:
20+
* Updated from tls package version 1.7.1 to 1.9. (#1734)
21+
* Updated from base64-bytestring package version 1.0.0.3 to 1.2.1.0. (#1729)
22+
323
## 2.20 (2023-08-28)
424

525
This version replaces all previous versions. Any prior version will stop working

0 commit comments

Comments
 (0)