Skip to content

Commit c0e8f0d

Browse files
committed
Merge branch next-polkadot-sdk into next
2 parents 0a4b33c + 611aa8c commit c0e8f0d

793 files changed

Lines changed: 40402 additions & 25368 deletions

File tree

Some content is hidden

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

.github/LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2022-2025 Luke Parker
3+
Copyright (c) 2022-2026 Serai Contributors
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

.github/actions/bitcoin/action.yml

Lines changed: 42 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,36 +5,62 @@ inputs:
55
version:
66
description: "Version to download and run"
77
required: false
8-
default: "30.0"
8+
default: "30.2"
99

1010
runs:
1111
using: "composite"
1212
steps:
1313
- name: Bitcoin Daemon Cache
1414
id: cache-bitcoind
15-
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809
15+
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # 5.0.4
1616
with:
17-
path: bitcoin.tar.gz
17+
path: bitcoin-${{ inputs.version }}
1818
key: bitcoind-${{ runner.os }}-${{ runner.arch }}-${{ inputs.version }}
1919

20-
- name: Download the Bitcoin Daemon
20+
- name: Download and Extract the Bitcoin Daemon
2121
if: steps.cache-bitcoind.outputs.cache-hit != 'true'
2222
shell: bash
2323
run: |
24-
RUNNER_OS=linux
25-
RUNNER_ARCH=x86_64
26-
FILE=bitcoin-${{ inputs.version }}-$RUNNER_ARCH-$RUNNER_OS-gnu.tar.gz
24+
OS=${{ runner.os }}
25+
ARCH=${{ runner.arch }}
2726
28-
wget https://bitcoincore.org/bin/bitcoin-core-${{ inputs.version }}/$FILE
29-
mv $FILE bitcoin.tar.gz
27+
OS=$(echo "$OS" | tr "[:upper:]" "[:lower:]")
28+
ARCH=$(echo "$ARCH" | tr "[:upper:]" "[:lower:]")
29+
EXT="tar.gz"
3030
31-
- name: Extract the Bitcoin Daemon
32-
shell: bash
33-
run: |
34-
tar xzvf bitcoin.tar.gz
35-
cd bitcoin-${{ inputs.version }}
36-
sudo mv bin/* /bin && sudo mv lib/* /lib
31+
if [ "$ARCH" = "x64" ]; then
32+
ARCH="x86_64"
33+
fi
34+
35+
if [ "$OS" = "linux" ]; then
36+
OS="-linux-gnu"
37+
fi
38+
if [ "$OS" = "macos" ]; then
39+
OS="-apple-darwin"
40+
fi
41+
if [ "$OS" = "windows" ]; then
42+
ARCH=""
43+
OS="win64"
44+
EXT="zip"
45+
fi
46+
47+
FILE=bitcoin-${{ inputs.version }}-$ARCH$OS.$EXT
48+
49+
curl -L https://bitcoincore.org/bin/bitcoin-core-${{ inputs.version }}/$FILE -o $FILE
50+
51+
if [ "${{ runner.os }}" = "Windows" ]; then
52+
unzip $FILE
53+
mv $(find . -name "bitcoind*") .
54+
else
55+
tar -xf $FILE
56+
cd bitcoin-${{ inputs.version }}
57+
if [ "${{ runner.os }}" = "macOS" ]; then
58+
sudo mv bin/* /usr/local/bin/
59+
else
60+
sudo mv bin/* /usr/bin/
61+
fi
62+
fi
3763
3864
- name: Bitcoin Regtest Daemon
3965
shell: bash
40-
run: PATH=$PATH:/usr/bin ./orchestration/dev/networks/bitcoin/run.sh -txindex -daemon
66+
run: PATH="$PATH:$(pwd)" ./orchestration/dev/networks/bitcoin/run.sh -txindex -daemon

.github/actions/build-dependencies/action.yml

Lines changed: 44 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -40,46 +40,65 @@ runs:
4040
if [ "$RUNNER_OS" == "Linux" ]; then
4141
sudo apt install -y ca-certificates protobuf-compiler libclang-dev
4242
elif [ "$RUNNER_OS" == "Windows" ]; then
43-
choco install protoc
43+
# Use `-gnu` to avoid the installation and licensing headaches of `-msvc`
44+
rustup set default-host x86_64-pc-windows-gnu
45+
choco install llvm protoc
4446
elif [ "$RUNNER_OS" == "macOS" ]; then
4547
brew install protobuf llvm
46-
HOMEBREW_ROOT_PATH=/opt/homebrew # Apple Silicon
47-
if [ $(uname -m) = "x86_64" ]; then HOMEBREW_ROOT_PATH=/usr/local; fi # Intel
48-
ls $HOMEBREW_ROOT_PATH/opt/llvm/lib | grep "libclang.dylib" # Make sure this installed `libclang`
49-
echo "DYLD_LIBRARY_PATH=$HOMEBREW_ROOT_PATH/opt/llvm/lib:$DYLD_LIBRARY_PATH" >> "$GITHUB_ENV"
48+
HOMEBREW_PREFIX=$(brew --prefix)
49+
ls $HOMEBREW_PREFIX/opt/llvm/lib | grep "libclang.dylib" # Make sure this installed `libclang`
50+
echo "DYLD_LIBRARY_PATH=$HOMEBREW_PREFIX/opt/llvm/lib:$DYLD_LIBRARY_PATH" >> "$GITHUB_ENV"
5051
fi
5152
5253
- name: Install solc
5354
shell: bash
5455
run: |
55-
cargo +1.91 install svm-rs --version =0.5.19
56-
svm install 0.8.29
57-
svm use 0.8.29
56+
cargo install svm-rs --version =0.5.23
5857
59-
- name: Remove preinstalled Docker
60-
shell: bash
61-
run: |
62-
docker system prune -a --volumes
63-
sudo apt remove -y *docker*
64-
# Install uidmap which will be required for the explicitly installed Docker
65-
sudo apt install uidmap
66-
if: runner.os == 'Linux'
58+
solc_version() {
59+
# Install the version of `solc` specified in the contracts
60+
# This also checks the specified version is consistent across contracts
61+
cat $(find . -name "*.sol") | grep "pragma solidity" | while read -r line; do
62+
THIS_SOLC_VERSION=$(printf "%s" "$line" | cut -d'^' -f2 | cut -d';' -f1)
63+
if [ "$SOLC_VERSION" = "" ]; then
64+
SOLC_VERSION="$THIS_SOLC_VERSION"
65+
echo $SOLC_VERSION
66+
fi
67+
if [ ! "$line" = "pragma solidity ^$SOLC_VERSION;" ]; then
68+
echo "Inconsistent Solidity requirement in \`.sol\` files"
69+
exit 1
70+
fi
71+
done
72+
}
73+
74+
svm install $(solc_version)
75+
svm use $(solc_version)
76+
77+
# This is a build dependency, not a test dependency, due to being used to build the runtime
78+
- name: Install `docker`
79+
uses: ./.github/actions/docker
6780

6881
- name: Update system dependencies
6982
shell: bash
7083
run: |
7184
sudo apt update -y
7285
sudo apt upgrade -y
7386
sudo apt autoremove -y
74-
sudo apt clean
87+
sudo apt clean -y
7588
if: runner.os == 'Linux'
7689

77-
- name: Install rootless Docker
78-
uses: docker/setup-docker-action@b60f85385d03ac8acfca6d9996982511d8620a19
79-
with:
80-
rootless: true
81-
set-host: true
82-
if: runner.os == 'Linux'
90+
- name: Update system dependencies
91+
shell: bash
92+
run: |
93+
brew upgrade
94+
rm -rf $(brew --cache)
95+
if: runner.os == 'macOS'
8396

84-
# - name: Cache Rust
85-
# uses: Swatinem/rust-cache@a95ba195448af2da9b00fb742d14ffaaf3c21f43
97+
- name: Set GitHub CI Environment Variables
98+
shell: bash
99+
run: |
100+
# These tweak the amount of iterations performed as approprtiate for GitHub's CI
101+
echo 'GITHUB_CI=true' >> "$GITHUB_ENV"
102+
echo RUSTFLAGS="$RUSTFLAGS --cfg github_ci" >> "$GITHUB_ENV"
103+
# We always appreciate backtraces in the CI
104+
echo 'RUST_BACKTRACE=1' >> "$GITHUB_ENV"

.github/actions/docker/action.yml

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
name: docker
2+
description: Installs `docker` for Serai
3+
4+
runs:
5+
using: "composite"
6+
steps:
7+
- name: Remove preinstalled Docker
8+
if: runner.os == 'Linux'
9+
shell: bash
10+
run: |
11+
docker system prune --all --force
12+
13+
sudo apt remove -y *docker*
14+
15+
# Install `uidmap`, required for the explicitly-installed rootless Docker
16+
sudo apt install -y uidmap
17+
18+
- name: Install rootless Docker (Linux)
19+
uses: docker/setup-docker-action@1a6edb0ba9ac496f6850236981f15d8f9a82254d # 5.0.0
20+
if: runner.os == 'Linux'
21+
with:
22+
rootless: true
23+
set-host: true
24+
# https://github.com/moby/moby/issues/45014
25+
daemon-config: |
26+
{
27+
"exec-opts": ["native.cgroupdriver=cgroupfs"]
28+
}
29+
30+
- name: Remove preinstalled Docker
31+
if: runner.os == 'macOS'
32+
shell: bash
33+
run: |
34+
# Docker isn't pre-installed on macOS images, so we solely have to confirm it isn't
35+
if [ $(command -v docker; printf $?) -eq 0 ]; then
36+
echo "\`docker`` was pre-installed"
37+
exit 1
38+
fi
39+
40+
- name: Get the arguments to start Lima with
41+
shell: bash
42+
if: runner.os == 'macOS'
43+
run: |
44+
if [ $(uname -m) = "x86_64" ]; then
45+
# On Intel CPUs, where we can use the Virtualization Framework, we do so
46+
echo "LIMA_START_ARGS=--vm-type=vz --mount-type=virtiofs" >> "$GITHUB_ENV"
47+
fi
48+
49+
- name: Install Docker (macOS)
50+
uses: docker/setup-docker-action@1a6edb0ba9ac496f6850236981f15d8f9a82254d # 5.0.0
51+
if: runner.os == 'macOS'
52+
env:
53+
# m1 chips, as seen in the GitHub CI, don't support nested hardware virtualization.
54+
#
55+
# We need `-machine virt` to stop Lima from providing `accel=hvf`due to this
56+
# [QEMU issue](https://gitlab.com/qemu-project/qemu/-/issues/2981).
57+
#
58+
# We also need `-cpu *` to stop Lima from providing `-cpu host` as:
59+
# 1) `-cpu host` requires `kvm` or `hvf` (which we don't have)
60+
# 2) `-cpu host` implies `host-phys-bits=on` which is borked in this environment
61+
# From which CPU to actually emulate, we choose what will be the most performant.
62+
#
63+
# We accomplish both of these goals with the methodology from
64+
# [this comment](https://github.com/lima-vm/lima/pull/3173#issuecomment-2623130310).
65+
QEMU_SYSTEM_AARCH64: "qemu-system-aarch64 -machine virt -cpu max,pmu=off,sve=on,sve128=on,sme=off,pauth=off"
66+
with:
67+
set-host: true
68+
69+
- name: Install `buildx`
70+
if: runner.os == 'macOS'
71+
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # 4.0.0
72+
with:
73+
# This is Docker's default, but `setup-buildx-action` defaults to `docker-container`
74+
# (for _some_ reason) which means built images won't be loaded into Docker (`--load`) by
75+
# default. We want that behavior.
76+
driver: docker
77+
78+
- name: Remove preinstalled Docker
79+
if: runner.os == 'Windows'
80+
shell: pwsh
81+
run: |
82+
docker system prune --all --force
83+
84+
# GitHub uses an install script from Microsoft, so we run the complimentary uninstall script
85+
Invoke-WebRequest https://raw.githubusercontent.com/microsoft/Windows-Containers/Main/helpful_tools/Install-DockerCE/uninstall-docker-ce.ps1 -OutFile .\uninstall-docker-ce.ps1
86+
& .\uninstall-docker-ce.ps1 -Force
87+
88+
# These are defined/installed by the GitHub runner image definition
89+
# GitHub also adds Docker Compose, but to Docker's directory, causing it to be removed when Docker is
90+
Remove-Item -LiteralPath C:\Windows\SysWOW64\docker.exe -Force
91+
Remove-Item -LiteralPath C:\Windows\System32\docker-credential-wincred.exe -Force
92+
93+
# The preinstalled Docker, and Docker from `setup-docker-action`, do not allow running Linux
94+
# containers. We manually install `podman` to workaround this. Alternatively, we could install
95+
# 'Docker Desktop' and run `docker desktop engine use linux`, but 'Docker Desktop' is a
96+
# pseudo-enterprise product and it isn't worth installing/configuring it compared to installing
97+
# a more direct solution which behaves as a drop-in replacement _to the degree we need it_.
98+
- name: Install Podman (Windows)
99+
if: runner.os == 'Windows'
100+
shell: pwsh
101+
run: |
102+
Invoke-WebRequest https://github.com/containers/podman/releases/download/v5.8.1/podman-installer-windows-amd64.msi -OutFile podman.msi
103+
Start-Process -Wait -PassThru 'msiexec' -ArgumentList "/package podman.msi /quiet /log podman-msi.log MACHINE_PROVIDER=wsl ALLUSERS=1"
104+
Get-Content podman-msi.log
105+
106+
$env:PATH += ';C:\Program Files\Podman'
107+
108+
# Start Podman
109+
podman machine init
110+
podman machine start
111+
112+
# Claim `podman` is `docker`, as we expect `docker`
113+
# Installing to `System32` is gross, but functional and where `docker.exe` was pre-installed
114+
New-Item -ItemType SymbolicLink -Path 'C:\Windows\System32\docker.exe' -Target (Get-Command podman).Path
115+
116+
# When cross-compiling to a target architecture, the host still impacts the result. For our
117+
# runtime, a WASM blob which should be exactly reproducible, we fix the builder to x86-64
118+
# accordingly. This requires we be able to run a x86-64 userspace.
119+
- name: Install x64 Qemu for non-x64 Docker
120+
if: (runner.os != 'Windows') && (runner.arch != 'X64')
121+
uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a # 4.0.0
122+
with:
123+
platforms: amd64
124+
125+
# This ensures we have a consistent clean build, there aren't any issues from any version of
126+
# `docker` we removed before installing our current version, and checks that `docker` was in
127+
# fact installed and can be successfully called.
128+
- name: Ensure there's no Docker cache
129+
shell: bash
130+
run: docker system prune --all --force

.github/actions/monero-wallet-rpc/action.yml

Lines changed: 0 additions & 49 deletions
This file was deleted.

0 commit comments

Comments
 (0)