Skip to content

Commit 90ed89d

Browse files
Merge pull request #4960 from harmony-one/dev
2 parents dc52025 + d05470f commit 90ed89d

File tree

314 files changed

+38712
-8810
lines changed

Some content is hidden

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

314 files changed

+38712
-8810
lines changed

.github/workflows/build-docker-proto-image.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ jobs:
2727
- name: Build and push
2828
uses: docker/build-push-action@v6
2929
with:
30-
context: ./harmony/api/service/legacysync/downloader
31-
file: ./harmony/api/service/legacysync/downloader/Proto.Dockerfile
30+
context: ./harmony/api/service/synchronize/legacysync/downloader
31+
file: ./harmony/api/service/synchronize/legacysync/downloader/Proto.Dockerfile
3232
push: true
3333
platforms: linux/amd64,linux/arm64
3434
tags: |

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,11 @@ blspass.txt
7676
# local test db
7777
db-127.0.0.1-*
7878

79-
# dht storage
79+
# dht and peer storage
8080
.dht
8181
.dht-*
82+
.ps
83+
.ps-*
8284
.tern-port
8385

8486
# testdata

.hmy/wallet.ini

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ bootnode = /ip4/100.26.90.187/tcp/9874/p2p/Qmdfjtk6hPoyrH1zVD9PEH4zfWLo38dP2mDvv
44
bootnode = /ip4/54.213.43.194/tcp/9874/p2p/QmZJJx6AdaoEkGLrYG4JeLCKeCKDjnFz2wfHNHxAqFSGA9
55
bootnode = /ip4/13.113.101.219/tcp/12019/p2p/QmQayinFSgMMw5cSpDUiD9pQ2WeP6WNmGxpZ6ou3mdVFJX
66
bootnode = /ip4/99.81.170.167/tcp/12019/p2p/QmRVbTpEYup8dSaURZfF6ByrMTSKa4UyUzJhSjahFzRqNj
7-
shards = 4
7+
shards = 2
88
network = mainnet
99

1010
[main.shard0.rpc]
@@ -15,14 +15,6 @@ rpc = s0.t.hmny.io:14555
1515
rpc = l1.t.hmny.io:14555
1616
rpc = s1.t.hmny.io:14555
1717

18-
[main.shard2.rpc]
19-
rpc = l2.t.hmny.io:14555
20-
rpc = s2.t.hmny.io:14555
21-
22-
[main.shard3.rpc]
23-
rpc = l3.t.hmny.io:14555
24-
rpc = s3.t.hmny.io:14555
25-
2618
[local]
2719
chain_id = 2
2820
bootnode = /ip4/127.0.0.1/tcp/19876/p2p/Qmc1V6W7BwX8Ugb42Ti8RnXF1rY5PF7nnZ6bKBryCgi6cv
@@ -59,7 +51,7 @@ rpc = s1.b.hmny.io:14555
5951
chain_id = 3
6052
bootnode = /ip4/54.86.126.90/tcp/9889/p2p/Qmdfjtk6hPoyrH1zVD9PEH4zfWLo38dP2mDvvKXfh3tnEv
6153
bootnode = /ip4/52.40.84.2/tcp/9889/p2p/QmZJJx6AdaoEkGLrYG4JeLCKeCKDjnFz2wfHNHxAqFSGA9
62-
shards = 4
54+
shards = 2
6355
network = pangaea
6456

6557
[pangaea.shard0.rpc]
@@ -69,11 +61,3 @@ rpc = s0.p.hmny.io:14555
6961
[pangaea.shard1.rpc]
7062
rpc = l1.p.hmny.io:14555
7163
rpc = s1.p.hmny.io:14555
72-
73-
[pangaea.shard2.rpc]
74-
rpc = l2.p.hmny.io:14555
75-
rpc = s2.p.hmny.io:14555
76-
77-
[pangaea.shard3.rpc]
78-
rpc = l3.p.hmny.io:14555
79-
rpc = s3.p.hmny.io:14555

.travis.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,12 @@ env:
1313
- TEST="make"
1414
- TEST="bash ./scripts/travis_go_checker.sh"
1515
- TEST="bash ./scripts/travis_rpc_checker.sh"
16-
- TEST="bash ./scripts/travis_rosetta_checker.sh"
1716
- TEST="bash ./scripts/travis_pyhmy_checker.sh"
1817

19-
# We enable Travis on the main/dev branches or forked repositories here.
20-
# PRs workflow isn't affected by this condition
18+
# We enable Travis on the main/dev branches.
19+
# pull_request type includes both main repo/fork PR workflow
2120
if: >
22-
repo != harmony-one/harmony OR
21+
type = pull_request OR
2322
(repo = harmony-one/harmony AND (branch = main OR branch = dev))
2423
2524
# upgrade docker to latest stable version
@@ -40,7 +39,7 @@ install:
4039
# - curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.41.1
4140
- make go-get
4241
- go install golang.org/x/tools/cmd/goimports@v0.30.0
43-
- go install github.com/fjl/gencodec@v0.1.0
42+
- go install github.com/fjl/gencodec@v0.1.1
4443
- echo "[WARN] - workaround for the GOPATH:"
4544
# sometimes Travis decides to respect GOPATH and creates a symlink, thus we have || true for such cases
4645
- rm $GOPATH/src/github.com/harmony-one/harmony || true;

Makefile

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ RELEASE?=$(shell git describe --long | cut -f2 -d-)
1111
RPMBUILD=$(HOME)/rpmbuild
1212
DEBBUILD=$(HOME)/debbuild
1313
SHELL := bash
14+
EPOCH_TO_WAIT ?=5
15+
EXTRA_NODES_FILE ?="./test/configs/local-extra-nodes.txt"
1416

1517
.PHONY: all help libs exe race trace-pointer debug debug-ext debug-kill test test-go test-api test-api-attach linux_static deb_init deb_build deb debpub_dev debpub_prod rpm_init rpm_build rpm rpmpub_dev rpmpub_prod clean distclean docker go-vet go-test docker build_localnet_validator protofiles travis_go_checker travis_rpc_checker travis_rosetta_checker debug-start-log debug-stop-log debug-restart-log debug-delete-log
1618

@@ -38,6 +40,7 @@ help:
3840
@echo "test-rosetta-attach - attach onto the rosetta testing docker container for inspection"
3941
@echo "linux_static - static build the harmony binary & bootnode along with the MCL & BLS libs (for linux)"
4042
@echo "linux_static_quick - static build the harmony binary & bootnode more quickly without recompiling dependencies (for linux)"
43+
@echo "linux_static_cross_build - cross-compile static Linux binaries for Harmony and Bootnode from macOS"
4144
@echo "rpm_init - prepare the RPM build environment by creating directories, copying files, and generating the spec file and source tarball"
4245
@echo "rpm_build - build an RPM package for x86_64 architecture using the spec file (<RPMBUILD>/SPECS/harmony.spec)"
4346
@echo "rpm - build a harmony RPM pacakge"
@@ -56,6 +59,7 @@ help:
5659
@echo "travis_rosetta_checker - run the Travis Rosetta checker script, defaulting the test branch to 'master' unless overridden by TEST_REPO_BRANCH"
5760
@echo "debug_external - cleans up environment, rebuilds the binary, and deploys with external nodes"
5861
@echo "debug-multi-bls - cleans up environment, rebuilds the binary, and deploys with external nodes in configuration 1 harmony process -> 2 validators"
62+
@echo "debug-add-extra-nodes-to-the-running-network wait for EPOCH_TO_WAIT and add nodes from EXTRA_NODES_FILE file"
5963
@echo "build_localnet_validator - imports validator keys, funds validator accounts, waits for the epoch, and creates external validators on a local network"
6064
@echo "debug-start-log - start a docker compose Promtail->Loki->Grafana stack against localnet logs, creates"\
6165
"persistent volume to store parsed logs between localnet runs, needs docker compose and started localnet"
@@ -79,10 +83,9 @@ trace-pointer:
7983
bash ./scripts/go_executable_build.sh -t
8084

8185
debug:
82-
rm -rf .dht-127.0.0.1*
8386
# uncomment the following lines to enable debug logging for libp2p, it produces a lot of logs, so disabled by default
84-
#export GOLOG_LOG_LEVEL=debug
85-
#export GOLOG_OUTPUT=stdout
87+
# export GOLOG_LOG_LEVEL=debug
88+
# export GOLOG_OUTPUT=stdout
8689
# add VERBOSE=true before bash or run `export VERBOSE=true` on the shell level for have max logging
8790
# add LEGACY_SYNC=true before bash or run `export LEGACY_SYNC=true` on the shell level to switch to the legacy sync
8891
bash ./test/debug.sh ./test/configs/local-resharding.txt
@@ -117,6 +120,11 @@ debug-multi-bls-with-terminal:
117120
bash ./test/build-localnet-validator.sh
118121
screen -r localnet
119122

123+
debug-add-extra-nodes-to-the-running-network:
124+
echo waiting for the $(EPOCH_TO_WAIT) epoch on the localnet
125+
bash ./test/wait_till_n_epoch.sh $(EPOCH_TO_WAIT)
126+
./test/debug.sh $(EXTRA_NODES_FILE) 64 64 false &
127+
120128
debug-multi-bls-multi-ext-node:
121129
# add VERBOSE=true before bash or run `export VERBOSE=true` on the shell level for have max logging
122130
# add LEGACY_SYNC=true before bash or run `export LEGACY_SYNC=true` on the shell level to switch to the legacy sync
@@ -127,6 +135,7 @@ debug-multi-bls-multi-ext-node:
127135

128136
clean:
129137
rm -rf ./tmp_log/*
138+
rm -rf ./.ps*
130139
rm -rf ./.dht*
131140
rm -rf ./db-*
132141
rm -rf ./latest
@@ -168,6 +177,9 @@ linux_static:
168177
linux_static_quick:
169178
bash ./scripts/go_executable_build.sh -s
170179

180+
linux_static_cross_build:
181+
bash ./scripts/linux_executable_from_macos.sh -s
182+
171183
deb_init:
172184
rm -rf $(DEBBUILD)
173185
mkdir -p $(DEBBUILD)/$(PKGNAME)-$(VERSION)-$(RELEASE)/{etc/systemd/system,usr/sbin,etc/sysctl.d,etc/harmony}
@@ -257,3 +269,6 @@ debug-delete-log:
257269
@echo "[WARN] - it needs sudo to remove folder created with loki docker image user"
258270
sudo rm -rf test/logs_aggregator/loki
259271

272+
273+
docker-go-test:
274+
docker run --rm -it -v "$PWD":/go/src/github.com/harmony-one/harmony frozen621/harmony-test bash -c 'make go-test'

Test.Dockerfile

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
FROM golang:1.24
2+
3+
ARG ENV=dev
4+
5+
RUN apt-get update && \
6+
apt-get install -y build-essential make git curl libgmp-dev libssl-dev gcc g++ && \
7+
rm -rf /var/lib/apt/lists/*
8+
9+
WORKDIR /go/src/github.com/harmony-one
10+
11+
RUN git clone https://github.com/harmony-one/mcl.git && \
12+
git clone https://github.com/harmony-one/bls.git
13+
14+
RUN echo "Cloning branch: ${ENV}" && \
15+
git clone -b ${ENV} https://github.com/harmony-one/harmony.git && \
16+
cd harmony && \
17+
go mod tidy && \
18+
make deps
19+
20+
WORKDIR /go/src/github.com/harmony-one/harmony
21+
22+
CMD ["make", "go-test"]

api/service/manager.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ const (
2323
Prometheus
2424
Synchronize
2525
CrosslinkSending
26-
StagedStreamSync
2726
)
2827

2928
func (t Type) String() string {
@@ -46,8 +45,6 @@ func (t Type) String() string {
4645
return "Synchronize"
4746
case CrosslinkSending:
4847
return "CrosslinkSending"
49-
case StagedStreamSync:
50-
return "StagedStreamSync"
5148
default:
5249
return "Unknown"
5350
}

api/service/stagedstreamsync/download_manager_test.go

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

api/service/legacysync/downloader/Proto.Dockerfile renamed to api/service/synchronize/legacysync/downloader/Proto.Dockerfile

File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)