-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1143 from HathorNetwork/master
Release-candidate v0.63.0-rc.1
- Loading branch information
Showing
203 changed files
with
6,891 additions
and
3,300 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
if [[ $(type -t use_flake) != function ]]; then | ||
echo "ERROR: use_flake function missing." | ||
echo "Please update direnv to v2.30.0 or later." | ||
exit 1 | ||
fi | ||
|
||
use flake |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: setup-hathor-env | ||
description: Setup Hathor node environment | ||
inputs: | ||
python: | ||
description: The python version | ||
os: | ||
description: The OS name | ||
runs: | ||
using: composite | ||
steps: | ||
- name: Install Poetry | ||
shell: bash | ||
run: pipx install poetry | ||
|
||
- name: Set up Python ${{ inputs.python }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ inputs.python }} | ||
cache: 'poetry' | ||
|
||
- name: Install Ubuntu dependencies | ||
if: startsWith(inputs.os, 'ubuntu') | ||
run: | | ||
sudo apt-get -qy update | ||
sudo apt-get -qy install graphviz librocksdb-dev libsnappy-dev liblz4-dev | ||
shell: bash | ||
|
||
- name: Install macOS dependencies | ||
if: startsWith(inputs.os, 'macos') | ||
run: | | ||
brew cleanup -q | ||
# brew update -q | ||
brew install -q graphviz rocksdb pkg-config | ||
shell: bash | ||
|
||
- name: Install Poetry dependencies | ||
run: poetry install -n --no-root | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# yamllint disable rule:line-length | ||
name: benchmarking | ||
on: # yamllint disable-line rule:truthy | ||
push: | ||
branches: | ||
- master | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
benchmark_base_branch: | ||
name: Continuous Benchmarking base branch | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: bencherdev/bencher@main | ||
- name: Install hyperfine | ||
run: | | ||
wget https://github.com/sharkdp/hyperfine/releases/download/v1.12.0/hyperfine_1.12.0_amd64.deb | ||
sudo dpkg -i hyperfine_1.12.0_amd64.deb | ||
- uses: ./.github/actions/setup-hathor-env | ||
name: Setup Hathor node environment | ||
with: | ||
python: 3.11 | ||
os: ubuntu-22.04 | ||
- name: Set env vars | ||
run: cat ./extras/benchmarking/sync_v2/.env >> $GITHUB_ENV | ||
- name: Download benchmark data | ||
run: | | ||
wget $BENCH_DATA_URL | ||
tar -xzf $BENCH_DATA_FILE_NAME.tar.gz | ||
mkdir $SERVER_DATA_DIR | ||
poetry run hathor-cli load-from-logs \ | ||
--testnet \ | ||
--data $SERVER_DATA_DIR \ | ||
--cache \ | ||
--cache-size $CACHE_SIZE \ | ||
--x-localhost-only \ | ||
--log-dump $BENCH_DATA_FILE_NAME | ||
- name: Run server node | ||
run: | | ||
poetry run hathor-cli run_node \ | ||
--testnet \ | ||
--data $SERVER_DATA_DIR \ | ||
--cache \ | ||
--cache-size $CACHE_SIZE \ | ||
--x-localhost-only \ | ||
--listen tcp:$TCP_PORT \ | ||
& | ||
- name: Track base branch benchmarks with Bencher | ||
run: | | ||
bencher run \ | ||
--project hathor-core \ | ||
--token '${{ secrets.BENCHER_API_TOKEN }}' \ | ||
--branch master \ | ||
--testbed ubuntu-22.04 \ | ||
--adapter shell_hyperfine \ | ||
--err \ | ||
--file $BENCH_FILE \ | ||
'./extras/benchmarking/sync_v2/benchmark_sync_v2.sh' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# yamllint disable rule:line-length | ||
name: benchmarking | ||
on: # yamllint disable-line rule:truthy | ||
pull_request: | ||
branches: | ||
- master | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
benchmark_pr_branch: | ||
name: Continuous Benchmarking PRs | ||
# DO NOT REMOVE: For handling Fork PRs see Pull Requests from Forks | ||
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository | ||
permissions: | ||
pull-requests: write | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: bencherdev/bencher@main | ||
- name: Install hyperfine | ||
run: | | ||
wget https://github.com/sharkdp/hyperfine/releases/download/v1.12.0/hyperfine_1.12.0_amd64.deb | ||
sudo dpkg -i hyperfine_1.12.0_amd64.deb | ||
- uses: ./.github/actions/setup-hathor-env | ||
name: Setup Hathor node environment | ||
with: | ||
python: 3.11 | ||
os: ubuntu-22.04 | ||
- name: Set env vars | ||
run: cat ./extras/benchmarking/sync_v2/.env >> $GITHUB_ENV | ||
- name: Download benchmark data | ||
run: | | ||
wget $BENCH_DATA_URL | ||
tar -xzf $BENCH_DATA_FILE_NAME.tar.gz | ||
mkdir $SERVER_DATA_DIR | ||
poetry run hathor-cli load-from-logs \ | ||
--testnet \ | ||
--data $SERVER_DATA_DIR \ | ||
--cache \ | ||
--cache-size $CACHE_SIZE \ | ||
--x-localhost-only \ | ||
--log-dump $BENCH_DATA_FILE_NAME | ||
- name: Run server node | ||
run: | | ||
poetry run hathor-cli run_node \ | ||
--testnet \ | ||
--data $SERVER_DATA_DIR \ | ||
--cache \ | ||
--cache-size $CACHE_SIZE \ | ||
--x-localhost-only \ | ||
--listen tcp:$TCP_PORT \ | ||
& | ||
- name: Track PR Benchmarks with Bencher | ||
run: | | ||
bencher run \ | ||
--project hathor-core \ | ||
--token '${{ secrets.BENCHER_API_TOKEN }}' \ | ||
--branch '${{ github.head_ref }}' \ | ||
--start-point '${{ github.base_ref }}' \ | ||
--start-point-hash '${{ github.event.pull_request.base.sha }}' \ | ||
--start-point-clone-thresholds \ | ||
--testbed ubuntu-22.04 \ | ||
--adapter shell_hyperfine \ | ||
--err \ | ||
--github-actions '${{ secrets.GITHUB_TOKEN }}' \ | ||
--file $BENCH_FILE \ | ||
'./extras/benchmarking/sync_v2/benchmark_sync_v2.sh' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,3 +22,6 @@ extras/docker/envvars | |
/dist/ | ||
/requirements.txt | ||
*.egg-info | ||
|
||
# Nix | ||
.direnv/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
BENCH_DATA_FILE_NAME=ci_testnet_upto_20k | ||
BENCH_DATA_URL=https://hathor-public-files.s3.amazonaws.com/hathor-core-ci/ci_testnet_upto_20k.tar.gz | ||
N_BLOCKS=20000 | ||
CACHE_SIZE=100000 | ||
SERVER_DATA_DIR=server-data | ||
TCP_PORT=40403 | ||
N_RUNS=2 | ||
BENCH_FILE=testnet_upto_20k_results.json | ||
BENCH_DATA_DIR=bench-data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
hyperfine \ | ||
--warmup 1 \ | ||
--runs $N_RUNS \ | ||
--export-json $BENCH_FILE \ | ||
--command-name "sync-v2 (up to $N_BLOCKS blocks)" \ | ||
--prepare "rm -rf $BENCH_DATA_DIR && mkdir $BENCH_DATA_DIR" \ | ||
" | ||
poetry run hathor-cli quick_test \ | ||
--testnet \ | ||
--data $BENCH_DATA_DIR \ | ||
--cache \ | ||
--cache-size $CACHE_SIZE \ | ||
--x-localhost-only \ | ||
--bootstrap tcp://localhost:$TCP_PORT \ | ||
--quit-after-n-blocks $N_BLOCKS | ||
" |
Oops, something went wrong.