Skip to content

Commit bf89457

Browse files
authored
Merge pull request #1421 from vechain/release/hayabusa
Release/hayabusa
2 parents d3a183b + 9467aff commit bf89457

File tree

221 files changed

+28783
-2270
lines changed

Some content is hidden

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

221 files changed

+28783
-2270
lines changed

‎.dockerignore‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
vendor
2+
.github
3+
.idea
4+
compose.yaml

‎.git-hooks/pre-commit‎

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,18 @@
11
#!/usr/bin/env bash
22
#
3-
# Scan only staged changes for any 64-character hex strings (Ethereum private keys).
4-
# Override with: git commit --safe-to-ignore-key
3+
# pre-commit hook: scan staged changes for any 64-character hex strings (Ethereum private keys).
4+
# To bypass this check, set SAFE_TO_IGNORE_KEY=1 when running git commit.
55

6-
# 1) detect override flag on parent `git commit`
7-
if [ -r "/proc/$PPID/cmdline" ]; then
8-
parent_cmd=$(tr '\0' ' ' </proc/$PPID/cmdline)
9-
else
10-
parent_cmd=$(ps -o args= -p "$PPID" 2>/dev/null)
11-
fi
12-
if [[ "$parent_cmd" == *"--safe-to-ignore-key"* ]]; then
6+
# 1) If the environment variable is set, skip the scan entirely.
7+
if [ -n "$SAFE_TO_IGNORE_KEY" ]; then
138
exit 0
149
fi
1510

16-
# 2) scan only added (+) or modified (-) lines (not the diff headers)
17-
# and look for any 64-hex-char run
11+
# 2) Scan only staged additions or modifications (no context lines) for any 64-hex-char run.
1812
if git diff --cached --diff-filter=AM -U0 | \
1913
grep -E --color=never '^(\+[^\+]|-[^-]).*[0-9A-Fa-f]{64}'; then
2014
echo
21-
echo "✖ ERROR: Detected ECDSA private key in staged changes. Commit aborted."
15+
echo "✖ ERROR: Detected a 64-character hex string (possible private key) in staged changes. Commit aborted."
2216
echo
2317
exit 1
2418
fi

‎.github/workflows/on-master-commit.yaml‎

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ on:
77
- 'release/*'
88
- 'releases/*'
99

10+
concurrency:
11+
group: 'master-commit-ci'
12+
cancel-in-progress: false
13+
1014
jobs:
1115
run-unit-tests:
1216
name: Run Unit Tests
@@ -29,6 +33,9 @@ jobs:
2933
run-e2e-tests:
3034
name: E2E Tests
3135
uses: ./.github/workflows/test-e2e.yaml
36+
permissions:
37+
contents: read
38+
secrets: inherit
3239

3340
run-smoke-tests:
3441
name: Smoke Tests
@@ -83,6 +90,7 @@ jobs:
8390
type=raw,value=${{ needs.generate-tags.outputs.clean_ref_name }}-${{ needs.generate-tags.outputs.tag_date }}-${{ needs.generate-tags.outputs.short_sha }}
8491
type=raw,value=${{ needs.generate-tags.outputs.clean_ref_name }}-latest
8592
trigger_internal_ci: true
93+
8694
notify-slack:
8795
name: Notify Slack
8896
needs:
@@ -93,7 +101,13 @@ jobs:
93101
- module-check
94102
- run-unit-tests
95103
- run-e2e-tests
96-
if: always() && (needs.publish-docker-image.result != 'success' || needs.run-unit-tests.result != 'success' || needs.lint.result != 'success' || needs.run-e2e-tests.result != 'success' || needs.license-check.result != 'success' || needs.module-check.result != 'success')
104+
if: github.ref_name == 'master' && always() && (
105+
needs.publish-docker-image.result != 'success' ||
106+
needs.run-unit-tests.result != 'success' ||
107+
needs.lint.result != 'success' ||
108+
needs.run-e2e-tests.result != 'success' ||
109+
needs.license-check.result != 'success' ||
110+
needs.module-check.result != 'success')
97111
runs-on: ubuntu-latest
98112
steps:
99113
- name: Checkout code

‎.github/workflows/on-pull-request.yaml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ jobs:
2929
run-e2e-tests:
3030
name: E2E Tests
3131
uses: ./.github/workflows/test-e2e.yaml
32+
permissions:
33+
contents: read
34+
secrets: inherit
3235

3336
run-smoke-tests:
3437
name: Smoke Tests

‎.github/workflows/test-e2e.yaml‎

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,17 @@ name: E2E Tests
22

33
on:
44
workflow_call:
5-
5+
inputs:
6+
hayabusa-e2e-branch:
7+
type: string
8+
default: 'release/hayabusa'
9+
workflow_dispatch:
10+
inputs:
11+
hayabusa-e2e-branch:
12+
description: 'Branch to test against'
13+
required: true
14+
default: 'release/hayabusa'
15+
616
permissions:
717
contents: read
818

@@ -41,7 +51,7 @@ jobs:
4151
THOR_IMAGE: vechain/thor:${{ github.sha }}
4252
name: Run Tests
4353
steps:
44-
# Main: https://github.com/vechain/thor-e2e-tests/tree/edff19f6b2b670f0c5700c26ed7fe576e74c17ce
54+
# Main: https://github.com/vechain/thor-e2e-tests/tree/a51bdc9833d1a4641c2d7969414dbe23a4fa345e
4555
# For release branches, names in the thor and thor-e2e-tests repos should match
4656
- name: Set e2e repo reference
4757
id: set-ref
@@ -51,7 +61,7 @@ jobs:
5161
GITHUB_REF_NAME: ${{ github.ref_name }}
5262
run: |
5363
# Default fallback commit
54-
DEFAULT_COMMIT="edff19f6b2b670f0c5700c26ed7fe576e74c17ce"
64+
DEFAULT_COMMIT="a51bdc9833d1a4641c2d7969414dbe23a4fa345e"
5565
REF="$DEFAULT_COMMIT"
5666
5767
if [ "$EVENT_NAME" = "pull_request" ]; then
@@ -67,7 +77,7 @@ jobs:
6777
fi
6878

6979
# Verify if branch exists
70-
if ! git ls-remote --heads https://github.com/vechain/thor-e2e-tests.git $REF; then
80+
if ! git ls-remote --heads https://github.com/vechain/thor-e2e-tests.git "$REF"; then
7181
echo "Branch does not exist, using default commit"
7282
echo "ref=$DEFAULT_COMMIT" >> "$GITHUB_OUTPUT"
7383
else
@@ -109,3 +119,12 @@ jobs:
109119
name: e2e-test-results-${{ github.sha }}
110120
path: ./junit.xml
111121
retention-days: 14
122+
123+
run-hayabusa-tests:
124+
uses: vechain/hayabusa-e2e/.github/workflows/run-tests.yaml@release/hayabusa
125+
with:
126+
codebuild-name: codebuild-ThorGHA
127+
thor-branch: ${{ github.ref }}
128+
permissions:
129+
contents: read
130+
secrets: inherit

‎.github/workflows/test-smoke.yaml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ jobs:
128128
129129
- name: Run Smoke Test Separately
130130
run: |
131+
THOR_BRANCH=${{ github.head_ref || github.ref_name }} \
131132
RUNTESTS=TestSmokeTest,TestGenerateRequests,TestConnectionDiesNoPingResponse,TestConnectionClosedWithoutSubscription \
132133
TEST_NETWORK_ADDR=http://127.0.0.1:8669 \
133134
TEST_PK=99f0500549792796c14fed62011a51081dc5b5e68fe8bd8a13b86be829c4fd36 \

‎.github/workflows/test.yaml‎

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
runs-on: ubuntu-latest
4545
steps:
4646
- name: Checkout code
47-
uses: actions/checkout@v4
47+
uses: actions/checkout@v5
4848

4949
- name: Install Go
5050
uses: actions/setup-go@v5
@@ -64,3 +64,44 @@ jobs:
6464
fail_ci_if_error: true
6565
files: ./coverage.out
6666
token: ${{ secrets.CODECOV_TOKEN }}
67+
68+
solo-test:
69+
strategy:
70+
matrix:
71+
args:
72+
- 'solo'
73+
- 'solo --hayabusa'
74+
- 'solo --on-demand'
75+
runs-on: ubuntu-latest
76+
steps:
77+
- name: Checkout code
78+
uses: actions/checkout@v5
79+
80+
- name: Install Go
81+
uses: actions/setup-go@v5
82+
with:
83+
go-version: 1.24.x
84+
85+
- name: Download dependencies
86+
run: go mod download
87+
88+
- name: Start Solo
89+
run: nohup go run ./cmd/thor ${{matrix.args}} > thor-solo.log 2>&1 &
90+
91+
- name: Wait for block 1
92+
run: |
93+
for i in {1..30}; do
94+
status=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:8669/blocks/1 || true)
95+
if [ "$status" -eq 200 ]; then
96+
echo "✅ Healthcheck passed"
97+
exit 0
98+
fi
99+
echo "Healthcheck failed (status: $status). Retrying in 1s..."
100+
sleep 1
101+
done
102+
echo "❌ Healthcheck failed after 30 attempts"
103+
exit 1
104+
105+
- name: Print Logs
106+
if: failure()
107+
run: cat thor-solo.log

‎.golangci.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ linters:
3333
severity: warning
3434
disabled: false
3535
exclude:
36-
- ""
36+
- "builtin/staker/types/*"
3737
exclusions:
3838
generated: lax
3939
presets:

‎Makefile‎

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,10 @@ disco:| go_version_check #@ Build the `disco` executable
3131
@go build -v -o $(CURDIR)/bin/$@ -ldflags "-X main.version=$(DISCO_VERSION) -X main.gitCommit=$(GIT_COMMIT) -X main.gitTag=$(GIT_TAG) -X main.copyrightYear=$(COPYRIGHT_YEAR)" ./cmd/disco
3232
@echo "done. executable created at 'bin/$@'"
3333

34-
dep:| go_version_check
35-
@go mod download
34+
dep:| go_version_check #@ Deprecated legacy dependency management
35+
36+
generate:| go_version_check #@ Generate the `builtin` package
37+
@go generate builtin/gen/gen.go
3638

3739
go_version_check:
3840
@if test $(MAJOR) -lt $(REQUIRED_GO_MAJOR); then \
@@ -79,7 +81,20 @@ lint_command_check:
7981
@command -v golangci-lint || (echo "golangci-lint not found, please install it from https://golangci-lint.run/usage/install/" && exit 1)
8082

8183
lint: | go_version_check lint_command_check #@ Run 'golangci-lint'
84+
@echo "running golangci-lint..."
8285
@golangci-lint run --config .golangci.yml
86+
@echo "running modernize..."
87+
@go run golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize@v0.18.1 ./...
88+
@echo "done."
89+
90+
lint-fix: | go_version_check lint_command_check #@ Attempt to fix linting issues
91+
@echo "running golangci-lint..."
92+
@golangci-lint run --config .golangci.yml --fix
93+
@echo "running modernize..."
94+
@go run golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize@v0.18.1 --fix ./...
95+
@echo "running builtin generator..."
96+
@go generate ./builtin/gen
97+
@echo "done."
8398

8499
license-check: #@ Check license headers
85100
@FILE_COUNT=$$(find . -type f -name '*.go' | wc -l); \

‎README.md‎

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ For more configuration options, see [Command Line Arguments](https://github.com/
8282

8383
#### Prerequisites
8484

85-
Thor requires Go 1.19+ and a C compiler to build. Install them using your preferred package manager before continuing.
85+
Thor requires <a href="https://golang.org"><img src="https://img.shields.io/github/go-mod/go-version/vechain/thor"/></a> and a C compiler to build. Install them using your preferred package manager before continuing.
8686

8787
#### Commands
8888

@@ -122,11 +122,15 @@ Thor will begin syncing the mainnet and can be accessed at [http://localhost:866
122122

123123
#### Docker CLI
124124

125-
```sh
126-
docker run -d\
127-
-v {path-to-your-data-directory}/.org.vechain.thor:/home/thor/.org.vechain.thor\
128-
--api-addr 0.0.0.0:8669 -p 127.0.0.1:8669:8669 -p 11235:11235 -p 11235:11235/udp\
129-
--name thor-node vechain/thor --network main
125+
```html
126+
docker run -d \
127+
-v <local-data-dir>/.org.vechain.thor:/home/thor/.org.vechain.thor \
128+
-p 127.0.0.1:8669:8669 \
129+
-p 11235:11235 \
130+
-p 11235:11235/udp \
131+
--name thor-node vechain/thor \
132+
--network main \
133+
--api-addr 0.0.0.0:8669
130134
```
131135

132136
Thor will begin syncing the mainnet and can be accessed at [http://localhost:8669/](http://localhost:8669/).

0 commit comments

Comments
 (0)