mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-12 22:19:26 +00:00
Compare commits
2 Commits
d3464cfcb3
...
2fbe925c4d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2fbe925c4d | ||
|
|
6aad496d86 |
4
.github/workflows/lint.yml
vendored
4
.github/workflows/lint.yml
vendored
@@ -74,7 +74,7 @@ jobs:
|
|||||||
cache: false
|
cache: false
|
||||||
|
|
||||||
- name: Run forge fmt
|
- name: Run forge fmt
|
||||||
run: FOUNDRY_FMT_SORT_INPUTS=false FOUNDRY_FMT_LINE_LENGTH=100 FOUNDRY_FMT_TAB_WIDTH=2 FOUNDRY_FMT_BRACKET_SPACING=true FOUNDRY_FMT_INT_TYPES=preserve forge fmt --check $(find . -iname "*.sol")
|
run: FOUNDRY_FMT_SORT_INPUTS=false FOUNDRY_FMT_LINE_LENGTH=100 FOUNDRY_FMT_TAB_WIDTH=2 FOUNDRY_FMT_BRACKET_SPACING=true FOUNDRY_FMT_INT_TYPES=preserve forge fmt --check $(find . -name "*.sol")
|
||||||
|
|
||||||
machete:
|
machete:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -209,6 +209,6 @@ jobs:
|
|||||||
- name: shellcheck
|
- name: shellcheck
|
||||||
run: |
|
run: |
|
||||||
sudo apt install -y shellcheck
|
sudo apt install -y shellcheck
|
||||||
find . -iname "*.sh" | while read -r script; do
|
find . -name "*.sh" | while read -r script; do
|
||||||
shellcheck --enable=all --shell=sh --severity=info $script
|
shellcheck --enable=all --shell=sh --severity=info $script
|
||||||
done
|
done
|
||||||
|
|||||||
121
.github/workflows/stack-size.yml
vendored
121
.github/workflows/stack-size.yml
vendored
@@ -16,58 +16,131 @@ jobs:
|
|||||||
stack_size:
|
stack_size:
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-latest, ubuntu-24.04, ubuntu-22.04]
|
os: [ubuntu-latest, ubuntu-24.04, ubuntu-22.04, macos-15-intel, macos-latest]
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # 6.0.0
|
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # 6.0.0
|
||||||
|
|
||||||
- name: Download Monero
|
- name: Install Go
|
||||||
uses: ./.github/actions/monero
|
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # 6.1.0
|
||||||
|
with:
|
||||||
|
go-version: stable
|
||||||
|
|
||||||
|
- name: Monero Daemon Cache
|
||||||
|
id: cache-monerod
|
||||||
|
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # 4.2.4
|
||||||
|
with:
|
||||||
|
path: monerod
|
||||||
|
key: stack-size-monerod
|
||||||
|
|
||||||
|
- name: Download the Monero Daemon
|
||||||
|
if: steps.cache-monerod.outputs.cache-hit != 'true'
|
||||||
|
run: |
|
||||||
|
# We explicitly download the Linux binary as this script executes over an ELF binary
|
||||||
|
wget https://downloads.getmonero.org/cli/monero-linux-x64-v0.18.4.4.tar.bz2
|
||||||
|
tar -xvf monero-linux-x64-v0.18.4.4.tar.bz2
|
||||||
|
mv $(find . -name monerod) .
|
||||||
|
|
||||||
- name: Verify expected behavior
|
- name: Verify expected behavior
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
cp /usr/bin/monerod monerod
|
|
||||||
|
|
||||||
STACK=$((8 * 1024 * 1024))
|
STACK=$((8 * 1024 * 1024))
|
||||||
|
|
||||||
cp monerod monerod-chelf
|
OS=${{ runner.os }}
|
||||||
git clone https://github.com/Gottox/chelf
|
if [ "$OS" = "Linux" ]; then
|
||||||
cd chelf
|
sudo apt update -y
|
||||||
git checkout b2994186cea7b7d61a588fd06c1cc1ae75bcc21a
|
sudo apt install -y ksh bash dash zsh busybox posh mksh yash
|
||||||
make
|
sudo ln -s "$(which busybox)" /usr/bin/ash
|
||||||
./chelf -s "$STACK" ../monerod-chelf
|
sudo ln -s "$(which busybox)" /usr/bin/hush
|
||||||
cd ..
|
wget http://ftp.us.debian.org/debian/pool/main/g/gash/gash_0.3.1-1_amd64.deb
|
||||||
|
sudo apt install ./gash_0.3.1-1_amd64.deb
|
||||||
|
SHELLS="sh ksh bash dash zsh ash hush posh mksh lksh gash yash"
|
||||||
|
fi
|
||||||
|
if [ "$OS" = "macOS" ]; then
|
||||||
|
brew install binutils # `readelf`
|
||||||
|
|
||||||
|
# `binutils` is not placed within the path, so find its
|
||||||
|
# `readelf` bin and manually move it into our path
|
||||||
|
HOMEBREW_ROOT_PATH=/opt/homebrew # Apple Silicon
|
||||||
|
if [ $(uname -m) = "x86_64" ]; then HOMEBREW_ROOT_PATH=/usr/local; fi # Intel
|
||||||
|
sudo cp $(find "$HOMEBREW_ROOT_PATH" -name readelf) /usr/local/bin/
|
||||||
|
|
||||||
|
# macOS has the benefit of packaging `oksh`, `osh`, and having distinct core tools
|
||||||
|
# TODO: `posh` is packaged but doesn't work: https://github.com/serai-dex/serai/issues/703
|
||||||
|
brew install ksh93 bash dash-shell zsh mksh oksh yash oils-for-unix
|
||||||
|
SHELLS="sh ksh bash dash zsh mksh oksh yash osh"
|
||||||
|
|
||||||
|
# macOS also has the benefit of packaging (via MacPorts) `mrsh`,
|
||||||
|
# which explicitly attempts to be be exactly POSIX, without any extensions.
|
||||||
|
# We first have to install MacPorts, the easiest method being via source.
|
||||||
|
curl -O https://distfiles.macports.org/MacPorts/MacPorts-2.11.6.tar.bz2
|
||||||
|
tar xf MacPorts-2.11.6.tar.bz2
|
||||||
|
cd MacPorts-2.11.6
|
||||||
|
./configure
|
||||||
|
make
|
||||||
|
sudo make install
|
||||||
|
cd ..
|
||||||
|
PATH=$PATH:/opt/local/bin
|
||||||
|
sudo port -v selfupdate
|
||||||
|
|
||||||
|
# Now, we install `mrsh`
|
||||||
|
# TODO: https://github.com/serai-dex/serai/issues/704
|
||||||
|
# sudo port install mrsh
|
||||||
|
# SHELLS="$SHELLS mrsh"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Install shells available via `cargo`
|
||||||
|
cargo install brush-shell
|
||||||
|
SHELLS="$SHELLS brush"
|
||||||
|
# We would also test with `nsh` here if not for https://github.com/nuta/nsh/issues/49
|
||||||
|
# cargo install nsh
|
||||||
|
# SHELLS="$SHELLS nsh"
|
||||||
|
|
||||||
|
# Install shells available via `go`
|
||||||
|
# TODO: https://github.com/u-root/u-root/issues/3474
|
||||||
|
# GOBIN=/usr/local/bin go install github.com/u-root/u-root/cmds/core/gosh@latest
|
||||||
|
# SHELLS="$SHELLS gosh"
|
||||||
|
|
||||||
|
# Patch with `muslstack`
|
||||||
cp monerod monerod-muslstack
|
cp monerod monerod-muslstack
|
||||||
GOBIN=$(pwd) go install github.com/yaegashi/muslstack@d19cc5866abce3ca59dfc1666df7cc97097d0933
|
GOBIN=$(pwd) go install github.com/yaegashi/muslstack@d19cc5866abce3ca59dfc1666df7cc97097d0933
|
||||||
./muslstack -s "$STACK" ./monerod-muslstack
|
./muslstack -s "$STACK" ./monerod-muslstack
|
||||||
|
|
||||||
sudo apt update -y
|
# Patch with `chelf`, which only works on a Linux host (due to requiring `elf.h`)
|
||||||
sudo apt install -y ksh bash dash zsh busybox mksh posh gash yash
|
# TODO: Install the header on macOS so `chelf` may be used as the source of truth
|
||||||
sudo ln -s "$(which busybox)" /usr/bin/ash
|
if [ "$OS" = "Linux" ]; then
|
||||||
sudo ln -s "$(which busybox)" /usr/bin/hush
|
cp monerod monerod-chelf
|
||||||
cargo install brush-shell
|
git clone https://github.com/Gottox/chelf
|
||||||
for shell in sh ksh bash dash zsh ash hush mksh lksh posh gash yash brush; do
|
cd chelf
|
||||||
|
git checkout b2994186cea7b7d61a588fd06c1cc1ae75bcc21a
|
||||||
|
make
|
||||||
|
./chelf -s "$STACK" ../monerod-chelf
|
||||||
|
cd ..
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Run our script with all installed shells
|
||||||
|
for shell in $SHELLS; do
|
||||||
|
echo "Executing \`$shell\`"
|
||||||
cp monerod monerod-idss-$shell
|
cp monerod monerod-idss-$shell
|
||||||
ln -s "$(which $shell)" sh
|
ln -s "$(which $shell)" sh
|
||||||
./sh ./orchestration/increase_default_stack_size.sh monerod-idss-$shell
|
./sh ./orchestration/increase_default_stack_size.sh monerod-idss-$shell
|
||||||
rm ./sh
|
rm ./sh
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# Verify they all had the same result
|
||||||
sha256() {
|
sha256() {
|
||||||
sha256sum "$1" | cut -d' ' -f1
|
sha256sum "$1" | cut -d' ' -f1
|
||||||
}
|
}
|
||||||
CHELF=$(sha256 monerod-chelf)
|
CHELF=$(sha256 monerod-muslstack)
|
||||||
find . -iname "monerod-*" | while read -r bin; do
|
find . -name "monerod-*" | while read -r bin; do
|
||||||
BIN=$(sha256 "$bin")
|
BIN=$(sha256 "$bin")
|
||||||
if [ ! "$CHELF" = "$BIN" ]; then
|
if [ ! "$CHELF" = "$BIN" ]; then
|
||||||
echo "Different artifact between monerod-chelf ($CHELF) and $bin ($BIN)"
|
echo "Different artifact between \`monerod-muslstack\` ($CHELF) and \`$bin\` ($BIN)"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# Verify the integrity of the result
|
||||||
read_stack() {
|
read_stack() {
|
||||||
STACK_INFO=$(readelf "$1" -l | grep STACK -A1)
|
STACK_INFO=$(readelf "$1" -l | grep STACK -A1)
|
||||||
MEMSZ=$(printf "%s\n" "$STACK_INFO" | tail -n1 | sed -E s/^[[:space:]]*//g | cut -f2 -d' ')
|
MEMSZ=$(printf "%s\n" "$STACK_INFO" | tail -n1 | sed -E s/^[[:space:]]*//g | cut -f2 -d' ')
|
||||||
@@ -79,14 +152,14 @@ jobs:
|
|||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
UPDATED_STACK=$(read_stack monerod-chelf)
|
UPDATED_STACK=$(read_stack monerod-muslstack)
|
||||||
if [ "$UPDATED_STACK" -ne "$STACK" ]; then
|
if [ "$UPDATED_STACK" -ne "$STACK" ]; then
|
||||||
echo "Updated \`PT_GNU_STACK\` ($UPDATED_STACK) wasn't 8 MB ($STACK)"
|
echo "Updated \`PT_GNU_STACK\` ($UPDATED_STACK) wasn't 8 MB ($STACK)"
|
||||||
exit 3
|
exit 3
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Only one byte should be different due to the bit pattern of 8 MB
|
# Only one byte should be different due to the bit pattern of 8 MB
|
||||||
BYTES_DIFFERENT=$(cmp -l monerod monerod-chelf | wc -l || true)
|
BYTES_DIFFERENT=$(cmp -l monerod monerod-muslstack | wc -l || true)
|
||||||
if [ "$BYTES_DIFFERENT" -ne 1 ]; then
|
if [ "$BYTES_DIFFERENT" -ne 1 ]; then
|
||||||
echo "More than one byte was different between the two binaries"
|
echo "More than one byte was different between the two binaries"
|
||||||
exit 4
|
exit 4
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ RUN wget -4 https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/SHA256SU
|
|||||||
# Verify all sigs and check for a valid signature from laanwj -- 71A3
|
# Verify all sigs and check for a valid signature from laanwj -- 71A3
|
||||||
RUN git clone https://github.com/bitcoin-core/guix.sigs && \
|
RUN git clone https://github.com/bitcoin-core/guix.sigs && \
|
||||||
cd guix.sigs/builder-keys && \
|
cd guix.sigs/builder-keys && \
|
||||||
find . -iname '*.gpg' -exec gpg --import {} \; && \
|
find . -name '*.gpg' -exec gpg --import {} \; && \
|
||||||
gpg --verify --status-fd 1 --verify ../../SHA256SUMS.asc ../../SHA256SUMS | grep "^\[GNUPG:\] VALIDSIG.*71A3B16735405025D447E8F274810B012346C9A6"
|
gpg --verify --status-fd 1 --verify ../../SHA256SUMS.asc ../../SHA256SUMS | grep "^\[GNUPG:\] VALIDSIG.*71A3B16735405025D447E8F274810B012346C9A6"
|
||||||
|
|
||||||
RUN grep bitcoin-${BITCOIN_VERSION}-$(uname -m)-linux-gnu.tar.gz SHA256SUMS | sha256sum -c
|
RUN grep bitcoin-${BITCOIN_VERSION}-$(uname -m)-linux-gnu.tar.gz SHA256SUMS | sha256sum -c
|
||||||
|
|||||||
Reference in New Issue
Block a user