Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
218 commits
Select commit Hold shift + click to select a range
0535d0c
harmony-one/dependabot/go_modules/golang.org/x/net-0.33.0 (#4836)
dependabot[bot] Jan 23, 2025
c766715
Double propose fix on epoch change.
Frozen Jan 23, 2025
7a522d8
Proper deploy process termination.
Frozen Jan 23, 2025
8e05122
refactor download manager in staged stream sync
GheisMohammadi Dec 27, 2024
be3649e
rename block download manager to download manager and generalize its …
GheisMohammadi Dec 30, 2024
f03d97a
add block hashes to list of stream sync stages
GheisMohammadi Dec 30, 2024
ba6f577
add block hashes stage to staged stream sync
GheisMohammadi Dec 30, 2024
6f2865f
optimize final block hash calculations, remove invalid streams
GheisMohammadi Dec 30, 2024
5b41be5
add new function to stream client for requesting blocks by hashes
GheisMohammadi Dec 31, 2024
d1d7191
refactor stage bodies to use hashes rather than block numbers
GheisMohammadi Dec 31, 2024
047d69e
fix download manager issue of skipping blocks
GheisMohammadi Jan 6, 2025
3734a1d
add comment and TODO to download manager and stage bodies to check so…
GheisMohammadi Jan 6, 2025
8d93ecc
add contains function to prioritizedNumbers
GheisMohammadi Jan 10, 2025
aea57f4
add tests for stream sync download manager
GheisMohammadi Jan 10, 2025
c74880a
fix using internal transaction in stage bodies
GheisMohammadi Jan 23, 2025
997e8fd
refactor save progress in stage block hashes
GheisMohammadi Jan 23, 2025
1ea865e
update logs identifiers to differentiate between staged sync and stag…
GheisMohammadi Jan 24, 2025
70175de
add block number to logs for re-download bad block function
GheisMohammadi Jan 24, 2025
ce62cf5
save progress for last two stages; block bodies and states
GheisMohammadi Jan 24, 2025
3040907
support reserved stream list in p2p stream manager
GheisMohammadi Jan 8, 2025
5a4616d
add test for reserved stream list
GheisMohammadi Jan 8, 2025
bb63cf8
improve handling new streams for reserved list, improve test comments
GheisMohammadi Jan 8, 2025
1b4d625
Refactor Staged Stream Sync Long Range (#4824)
sophoah Jan 24, 2025
fffcfd3
feat(localnet log aggregation): store localnet logs between runs
mur-me Jan 14, 2025
27230b5
refactor(Makefile): remove redundant debug_external command
mur-me Jan 16, 2025
2cda0ae
feat(localnet log aggregation): fix loki config path, tweak loki conf…
mur-me Jan 24, 2025
f7bec84
feat: store localnet logs between runs (#4830)
sophoah Jan 27, 2025
fa0422a
Improve multiple propose at epoch change (#4837)
sophoah Jan 27, 2025
03a37af
fix some function names in comment (#4812)
depthlending Jan 29, 2025
9893cdd
improve ListPeer to return only existed joined peers
GheisMohammadi Jan 30, 2025
5dd1523
close stream if its sanity check fails
GheisMohammadi Jan 30, 2025
9369fe7
Fix for num shards.
Frozen Nov 17, 2023
f8b7bfb
add test for ShardIDFromKey
sophoah Jan 29, 2025
e65ceec
Fix for ShardIDFromKey (#4566)
sophoah Jan 30, 2025
c5e7f3c
fix streamSet pop stream lock handling
GheisMohammadi Jan 30, 2025
350573a
Enhance P2P Streams with Reserved Stream Replacement (#4826)
sophoah Jan 30, 2025
e4ce1ac
Moved several consensus fields to state struct (#4825)
Frozen Jan 31, 2025
6690e40
Add clock to Clock represents time in a way that can be provided by v…
GheisMohammadi Jan 31, 2025
86c4be7
add test for system clock
GheisMohammadi Jan 31, 2025
abe00a9
add a simple test for clock basic functions
GheisMohammadi Jan 31, 2025
e6f3fda
add test for clock loop function
GheisMohammadi Jan 31, 2025
f38837a
add test for clock advancing
GheisMohammadi Jan 31, 2025
c50c1a6
add deterministic test for clock functions
GheisMohammadi Jan 31, 2025
536312f
add clock utils test
GheisMohammadi Jan 31, 2025
2b3e77d
refactor node tests to create random node and peer
GheisMohammadi Jan 31, 2025
d31d8a1
add scorebook to create extended peerstore
GheisMohammadi Jan 31, 2025
498a789
add records book to be used in extended peerstore
GheisMohammadi Jan 31, 2025
18c5acd
add peer ban book to be be used in extended peerstore
GheisMohammadi Jan 31, 2025
18c55d2
add ip ban book to be be used in extended peerstore
GheisMohammadi Jan 31, 2025
0655d77
add mdbook for peer store
GheisMohammadi Jan 31, 2025
87733ac
add iface for peer store
GheisMohammadi Jan 31, 2025
fa94703
add gc for extended peer store
GheisMohammadi Jan 31, 2025
b71845f
add extended peer store
GheisMohammadi Jan 31, 2025
bbe27a7
support serializing for extended peer store
GheisMohammadi Jan 31, 2025
b028186
add advanced p2p connection gater with scoring, expiry and blocking f…
GheisMohammadi Jan 31, 2025
057e0eb
add tests for p2p connection gater
GheisMohammadi Jan 31, 2025
799b79d
add metrics for connection gater to populate stats
GheisMohammadi Jan 31, 2025
14dff63
add mocks for connection gater
GheisMohammadi Jan 31, 2025
af078c5
refactor host to support connection gater and new extended peer store
GheisMohammadi Jan 31, 2025
41caa6c
Apply suggestions from code review
Frozen Feb 3, 2025
7f2ddd3
skip mockery generate for connection blocking
GheisMohammadi Feb 4, 2025
71b99bc
replace eth logger with harmony logger in p2p gater
GheisMohammadi Feb 4, 2025
be640be
remove log parameter from extended peer store and switch to harmony l…
GheisMohammadi Feb 4, 2025
4db3a3c
disabled go generate for mockery, fix goimports
GheisMohammadi Feb 4, 2025
72e90f7
Merge pull request #4838 from harmony-one/fix/kill-deploy
mur-me Feb 4, 2025
7819f69
remove all go mockery tests from gating
GheisMohammadi Feb 4, 2025
f150090
fix make debug-multi-bls without external
sophoah Feb 5, 2025
76607e5
fix make debug-multi-bls without external (#4842)
sophoah Feb 5, 2025
a8ffc2f
Prevents explorer nodes from accepting out-of-sequence future blocks
GheisMohammadi Feb 7, 2025
bdf0491
remove consensus block number from logs in explorer node
GheisMohammadi Feb 11, 2025
7a97722
fix explorer node connectivity issue of streams
GheisMohammadi Feb 12, 2025
602fcee
add a few logs to stream manager for better visibility
GheisMohammadi Feb 12, 2025
a566c25
change log type to debug to not have overloaded logs
GheisMohammadi Feb 12, 2025
0da69c1
Fix Explorer Node's Stream Connectivity Issues (#4846)
sophoah Feb 12, 2025
100fcba
improve condition checking and log for node explorer
GheisMohammadi Feb 13, 2025
ad33d99
Create a local logger for each stage with the corresponding module an…
GheisMohammadi Feb 13, 2025
3f3ed59
use a local logger for staged sync helpers
GheisMohammadi Feb 13, 2025
4c425f5
use a local logger for download manager in staged sync
GheisMohammadi Feb 13, 2025
5a429b4
add local logger to receipt download manager in staged sync
GheisMohammadi Feb 13, 2025
da7d567
add a few logs to staged sync downloader to monitor stream connections
GheisMohammadi Feb 13, 2025
c59f3d9
refactor advertisement logic with retries and dynamic sleep adjustments
GheisMohammadi Feb 13, 2025
876dca6
fix protocol test by passing background context
GheisMohammadi Feb 14, 2025
8771bfa
comment out getPeerTopics because it's not being used yet
GheisMohammadi Feb 15, 2025
0c3134a
Update Makefile to include additional help commands
Feb 17, 2025
b727624
Add MacOS setup configurations to Readme.md
GheisMohammadi Feb 17, 2025
a513ba8
Prevent Explorer Nodes from Adding Future Blocks (#4845)
sophoah Feb 17, 2025
51e4eda
Merge pull request #4851 from harmony-one/improve/help_readme
sophoah Feb 18, 2025
36b6d22
Improve P2P Stream Removal Tracking and Cooldown Handling
GheisMohammadi Feb 18, 2025
5a2007f
feat: implement tload and tstore opcodes
Feb 19, 2025
95e4a7f
Add function to track and handle inactive streams
GheisMohammadi Feb 20, 2025
0ff128a
Add test for request cancellation when no active streams available
GheisMohammadi Feb 20, 2025
30a33fc
fix request manager no stream test
GheisMohammadi Feb 20, 2025
b2225ac
Stream Removal if its Sanity Check Fails #4839
sophoah Feb 20, 2025
d3ed01c
n Refactor Staged Stream Sync Logger #4847
sophoah Feb 20, 2025
d240733
Refactor advertisement logic with retries and dynamic sleep adjustmen…
sophoah Feb 20, 2025
b62c88b
Enhance P2P Layer: Stream Removal Tracking and Cooldown Handling #4853
sophoah Feb 20, 2025
f866381
send signal on stream feed once added streams from reserved list
GheisMohammadi Feb 20, 2025
c1835d8
try to replace removed stream from the reserved list after sending re…
GheisMohammadi Feb 20, 2025
1adbb90
feat: implement prepare & rename previous Prepare to SetTxContext
Feb 21, 2025
765be3c
tests: unit tests for opcodes and prepare method
Feb 21, 2025
ef30908
chore: cleanup comment
Feb 21, 2025
47b14a6
use workerID rather than loopID in stages
GheisMohammadi Feb 18, 2025
dd3dc95
fix initilization of the stage hashes
GheisMohammadi Feb 18, 2025
5313cd2
fix nil pointer issue for calculateFinalBlockHashes
GheisMohammadi Feb 18, 2025
afaf33a
remove stream if it sends zero as block hash
GheisMohammadi Feb 19, 2025
e1cc685
refactor stream sync download manager to handle current height intern…
GheisMohammadi Feb 21, 2025
a37b3fe
fix staged stream sync download manager tests
GheisMohammadi Feb 21, 2025
427acc4
fix stage block hashes issue of not saving in db
GheisMohammadi Feb 21, 2025
8d65035
optimize block bodies stage by using separate thread for reading hash…
GheisMohammadi Feb 21, 2025
264a02f
Fix Handling of Reserved Streams Additions and Removals #4856
sophoah Feb 26, 2025
1aba728
Add Stream Health Monitoring and Improve Request Handling #4857
sophoah Feb 26, 2025
185e52c
Optimize Staged Stream Sync Block Download Process and Improve Stage…
sophoah Feb 27, 2025
68d2e50
Refactor staged stream sync loop, Improve concurrency, logging
GheisMohammadi Feb 27, 2025
7ae97c3
Improve bad block re-download mechanism with retries & better error h…
GheisMohammadi Feb 27, 2025
e25b160
Remove Staged DNS Sync
GheisMohammadi Feb 27, 2025
806f2eb
Remove Staged DNS Sync #4863
sophoah Feb 28, 2025
4bcfa6f
feat: tload and tstore opcodes for transient storage (EIP-1153) #4854
sophoah Feb 28, 2025
f9ee510
Merge pull request #4862 from harmony-one/improve/sss_redownload_back…
GheisMohammadi Mar 2, 2025
5da7808
Improve Advertise Function: Dynamic Timeout & Backoff Adjustments
GheisMohammadi Mar 2, 2025
10dcc7b
reduce discovery logs, change logd to debug
GheisMohammadi Mar 3, 2025
6ca5326
Refactor Staged Stream Sync Downloader Loop, Remove Sync Overlaps #4861
sophoah Mar 3, 2025
85424e6
Merge pull request #4864 from harmony-one/fix/p2p_advertise_timeout
GheisMohammadi Mar 4, 2025
8c11b92
increase stream sync protocol advertise timeout
GheisMohammadi Mar 5, 2025
9c55276
fix stream downloader download signal lock handling
GheisMohammadi Mar 5, 2025
a909229
Fix deadlock in Downloader loop and improve handling of downloadC sig…
sophoah Mar 6, 2025
f9aed67
[Feature] P2P Host Gater and Extended Peer Store #4841
sophoah Mar 6, 2025
8ad4ed9
fix(CI) - pin goimports and gencodec versions
mur-me Mar 11, 2025
3255b6b
fix(CI) - pin goimports and gencodec versions #4871
sophoah Mar 12, 2025
e3937ab
Enhance Stream Management with Reconnection & Memory Optimization
GheisMohammadi Mar 7, 2025
12ec901
Remove stream if redownload bad blocks failed
GheisMohammadi Mar 7, 2025
7895cf7
Set Timeout for Download Block Hashes
GheisMohammadi Mar 7, 2025
9c038c3
Increase Timeout for Block Requests in Stream Sync Protocol
GheisMohammadi Mar 7, 2025
55c62a6
Improve estimateCurrentNumber for long range syncing
GheisMohammadi Mar 7, 2025
44bcf83
Handle DB issues in stage States
GheisMohammadi Mar 7, 2025
60130bf
goimports for stream.go
GheisMohammadi Mar 7, 2025
136c3fd
add reconnect logic for streams
GheisMohammadi Mar 12, 2025
85e20f0
fix context with timeout in block hashes stage
GheisMohammadi Mar 12, 2025
c615e0e
fix error handling in stream for write after reconnect
GheisMohammadi Mar 12, 2025
0d03f82
return back stream buffer handling to original version
GheisMohammadi Mar 12, 2025
420cd94
Merge pull request #4866 from harmony-one/fix/streamnet_nodes_stuck
GheisMohammadi Mar 13, 2025
044a6a6
remove beacon validator flag from protocol id
GheisMohammadi Mar 16, 2025
7c34e66
refactor stream protocol ID and add epoch chain flag to stream protoc…
GheisMohammadi Mar 16, 2025
2f95ea3
add EpochChain to stream downloader config
GheisMohammadi Mar 16, 2025
f210b3a
add a separate protocol to p2p host to handle epoch chain sync
GheisMohammadi Mar 16, 2025
c71b715
Merge pull request #4873 from harmony-one/refactor/proto_id
GheisMohammadi Mar 17, 2025
0c75e4d
1 second finality (#4820)
Frozen Mar 25, 2025
5171f60
update devnet default settings, set Min Peers to three #4874
GheisMohammadi Mar 26, 2025
2d2fc5c
Fix effective gas price for rpc getTransactionReceipt (#4844)
Frozen Mar 26, 2025
0ed471d
feat: add block and state overrides to `TraceCall` (#4833)
sunwavesun Mar 27, 2025
e2f19bf
fix the issue of node sync instance creation
GheisMohammadi Mar 27, 2025
33d57ce
Merge pull request #4875 from harmony-one/fix/sync_instance_issue
mur-me Mar 27, 2025
dd0e7fb
refactor estimateCurrentNumber to ask all available streans for block…
GheisMohammadi Mar 31, 2025
7dc4585
remove stream if can't provide all requested blocks
GheisMohammadi Mar 31, 2025
c0a9ff0
Refactor body download loop to use pull-based worker model
GheisMohammadi Mar 31, 2025
b8519f1
feat(CI): enable CI only on PRs and main/dev branches
mur-me Mar 31, 2025
3649778
feat(CI): add more cached folder to speed up go build
mur-me Mar 31, 2025
eb19eb8
define error message for not enough streams
GheisMohammadi Mar 31, 2025
6695487
add timeout for pending requests
GheisMohammadi Mar 31, 2025
7b47ea6
wait for enough streams to be added if any syncing error
GheisMohammadi Mar 31, 2025
80c4239
goimports fix
GheisMohammadi Mar 31, 2025
661948a
fix staged sync block bodies stage download loop
GheisMohammadi Apr 1, 2025
b09df6b
retry with other streams if whitelist streams failed
GheisMohammadi Apr 1, 2025
024da9f
Merge pull request #4878 from harmony-one/feat_enable_only_pr_main_de…
mur-me Apr 1, 2025
626863d
Remove Last-Mile Blocks Stage from Staged Stream Sync #4876
GheisMohammadi Apr 1, 2025
0acd42a
Merge pull request #4877 from harmony-one/refactor/sss_stage_blocks
mur-me Apr 2, 2025
f905f11
go 1.24 (#4869)
Frozen Apr 3, 2025
92ad804
fix request queue pop, remove element after pop
GheisMohammadi Apr 7, 2025
d1f3a77
continue stage bodies worker for any failure
GheisMohammadi Apr 7, 2025
a049d59
use separate context for GetCurrentNumberRequest in staged stream sync
GheisMohammadi Apr 7, 2025
a3ebecd
refactor stream request manager, handle requests health checking in s…
GheisMohammadi Apr 7, 2025
7b81cee
Add a flag to track active block download state
GheisMohammadi Apr 10, 2025
d025672
readjust request manager timeouts
GheisMohammadi Apr 10, 2025
1551932
refactor p2p stream request manager, improve stream availability hand…
GheisMohammadi Apr 10, 2025
4567d26
remove staged stream sync protocol's context timeouts
GheisMohammadi Apr 10, 2025
20de5a8
stage block hashes returns error to upper layer
GheisMohammadi Apr 10, 2025
b1840ae
rename no stream threshold
GheisMohammadi Apr 10, 2025
0e917a4
set no stream checking interval to one second
GheisMohammadi Apr 11, 2025
70be274
fix request manager concurrency issue for closing
GheisMohammadi Apr 11, 2025
8a7e6ea
Merge pull request #4882 from harmony-one/fix/sss_stuck
GheisMohammadi Apr 14, 2025
56cd05e
close discovery process before closing host
GheisMohammadi Apr 15, 2025
b32164a
chore(bootnode): use ip setting from command line in the rpcCongig fo…
mur-me Apr 16, 2025
bc01242
Merge pull request #4885 from harmony-one/fix/bootnode_datastore
mur-me Apr 23, 2025
dd0dc92
Merge pull request #4886 from harmony-one/chore_bootnode_sync_http_se…
mur-me Apr 23, 2025
af6223b
thread safe p2p stream, reset stream if any failure
GheisMohammadi Apr 23, 2025
e03684c
add comment for blockC channel in beacon helper
GheisMohammadi Apr 23, 2025
b9bc470
remove LogProgress parameter from Staged Sync options, fix staged str…
GheisMohammadi Apr 23, 2025
2dd14d1
use initSync value from staged sync parameters rather than external v…
GheisMohammadi Apr 23, 2025
7ea7651
add last mile blocks back to sync loop
GheisMohammadi Apr 23, 2025
2d64937
remove extra shard checking for beacon config
GheisMohammadi Apr 23, 2025
296bb6e
fix stream failures type issue
GheisMohammadi Apr 23, 2025
1810fa7
fix beacon helper initialization
GheisMohammadi Apr 23, 2025
f764a37
accpet part of requested blocks in short range sync
GheisMohammadi Apr 24, 2025
96cb536
use a var for current epoch
GheisMohammadi Apr 24, 2025
8e58422
fix comment for breaking sync loop
GheisMohammadi Apr 24, 2025
bf3a577
Improved consensus logging (#4892)
Frozen Apr 24, 2025
761692c
clean up commented code
GheisMohammadi Apr 24, 2025
349c7e8
Merge pull request #4891 from harmony-one/refactor/sss_stages
GheisMohammadi Apr 24, 2025
61816f7
Add Stream Removal Reason (#4894)
GheisMohammadi May 5, 2025
503e927
Removed locks from GetLogger method.
Frozen Apr 25, 2025
9b0c617
Incorrect types fixes.
Frozen Apr 26, 2025
557d2ae
Merge pull request #4893 from harmony-one/feature/consensus-getlogger…
mur-me May 6, 2025
e10d464
Improve Stream Closure Logs, Remove advertise logs (#4895)
GheisMohammadi May 6, 2025
7731c9c
feat(hmy_tests) - enable new test job for each PR and new commits to …
mur-me May 9, 2025
3f52caa
Merge pull request #4899 from harmony-one/enable_hmy_test_suite
sunwavesun May 13, 2025
a8b06ba
add read dead line to stream, refactor stream locks, refactor stream …
GheisMohammadi May 13, 2025
321229e
sync stream handles closeC signal to exit loops instantly
GheisMohammadi May 13, 2025
9341e60
Rename protocol stream to sync_stream to avoid conflict with stream/t…
GheisMohammadi May 13, 2025
634c3ba
add internal config to adjust stream dead lines
GheisMohammadi May 14, 2025
9f236c1
add error handling to stream deadline adjustments
GheisMohammadi May 14, 2025
899cbe8
avoid cooldown for common stream issues, detect critical errors to re…
GheisMohammadi May 14, 2025
1384066
disable resource manager by setting ResourceManager(nil)
GheisMohammadi May 14, 2025
30ccbea
add infinite limits option to resource manager creation function
GheisMohammadi May 14, 2025
b6bda15
Merge pull request #4901 from harmony-one/fix/resource_manager_disabled
GheisMohammadi May 15, 2025
afef685
Merge pull request #4900 from harmony-one/improve/stream_handling
GheisMohammadi May 21, 2025
9b80284
refactor blocking connection gater
GheisMohammadi May 18, 2025
71b86ce
merge default gater into blocking gater to fix multi gater conflicts …
GheisMohammadi May 18, 2025
104cdca
fix gater tests, add data store creation to gater tests
GheisMohammadi May 18, 2025
ca41a99
refactor p2p host gater initialization, add new blocking gater to p2p…
GheisMohammadi May 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,4 @@ cache_*_db

# log aggregation logs folder variable file, no sense to track it
test/logs_aggregator/.env
test/logs_aggregator/loki
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dd11eabd17b257220f9523efd6524f12b7c1356f21667a87fe1b8c630bdf9f7d247087f85a8f661a7ef8ccde6e6287d54361aa2287fdf258321a1cc1d885b45a3b636a23e40aec0357dbd699c82a36e07fff9ca6fd85f79652320113
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
837cdffcc049ba89931d570e4be38bfef513df65d8dd277b0da8e62adf8c23b3c5229a2a4b36aa2c90c17d490dd5f95869365ebc4429d1efc784d25a64db246870d4bb4831d98ec02317ea88b76491a7fdfd2fa5e10f267e8f3989d9
17 changes: 14 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,25 @@ os: linux
dist: jammy
language: go
go:
- 1.22.5
- 1.24.2
go_import_path: github.com/harmony-one/harmony
cache:
directories:
- docker_images
- $HOME/.cache/go-build
- $GOPATH/pkg/mod
env:
- TEST="make"
- TEST="bash ./scripts/travis_go_checker.sh"
- TEST="bash ./scripts/travis_rpc_checker.sh"
- TEST="bash ./scripts/travis_rosetta_checker.sh"
- TEST="bash ./scripts/travis_pyhmy_checker.sh"

# We enable Travis on the main/dev branches or forked repositories here.
# PRs workflow isn't affected by this condition
if: >
repo != harmony-one/harmony OR
(repo = harmony-one/harmony AND (branch = main OR branch = dev))

# upgrade docker to latest stable version
before_install:
Expand All @@ -30,9 +39,11 @@ install:
- (cd $GOPATH/src/github.com/harmony-one/bls; make BLS_SWAP_G=1 -j4)
# - curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.41.1
- make go-get
- go install golang.org/x/tools/cmd/goimports@latest
- go install github.com/harmony-ek/gencodec@latest
- go install golang.org/x/tools/cmd/goimports@v0.30.0
- go install github.com/fjl/gencodec@v0.1.0
- echo "[WARN] - workaround for the GOPATH:"
# sometimes Travis decides to respect GOPATH and creates a symlink, thus we have || true for such cases
- rm $GOPATH/src/github.com/harmony-one/harmony || true;
- mv /home/travis/build/harmony-one/harmony $GOPATH/src/github.com/harmony-one/
script:
- ${TEST}
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM ubuntu:22.04

ARG TARGETARCH
ARG GOLANG_VERSION="1.22.5"
ARG GOLANG_VERSION="1.24.2"

SHELL ["/bin/bash", "-c"]

Expand Down
27 changes: 18 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ RPMBUILD=$(HOME)/rpmbuild
DEBBUILD=$(HOME)/debbuild
SHELL := bash

.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
.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

all: libs
bash ./scripts/go_executable_build.sh -S

help:
@echo "all - build the harmony binary & bootnode along with the MCL & BLS libs (if necessary)"
@echo "libs - build only the MCL & BLS libs (if necessary) "
@echo "libs - build only the MCL & BLS libs (if necessary)"
@echo "exe - build the harmony binary & bootnode"
@echo "race - build the harmony binary & bootnode with race condition checks"
@echo "trace-pointer - build the harmony binary & bootnode with pointer analysis"
Expand Down Expand Up @@ -55,10 +55,15 @@ help:
@echo "travis_rpc_checker - run the Travis RPC checker script, defaulting the test branch to 'master' unless overridden by TEST_REPO_BRANCH"
@echo "travis_rosetta_checker - run the Travis Rosetta checker script, defaulting the test branch to 'master' unless overridden by TEST_REPO_BRANCH"
@echo "debug_external - cleans up environment, rebuilds the binary, and deploys with external nodes"
@echo "debug-multi-bls - cleans up environment, rebuilds the binary, and deploys with external nodes in configuration 1 harmony process -> 2 validators"
@echo "build_localnet_validator - imports validator keys, funds validator accounts, waits for the epoch, and creates external validators on a local network"
@echo "debug-start-log - start a docker compose Promtail->Loki->Grafana stack against localnet logs, needs docker compose and started localnet"
@echo "debug-start-log - start a docker compose Promtail->Loki->Grafana stack against localnet logs, creates"\
"persistent volume to store parsed logs between localnet runs, needs docker compose and started localnet"
@echo "debug-stop-log - stops a docker compose Promtail->Loki->Grafana stack"
@echo "debug-restart-log - restart a docker compose Promtail->Loki->Grafana stack"
@echo "debug-delete-log - removes persistent volume for the Loki and host folder for it"
@echo "debug-multi-bls-multi-ext-node - start a localnet with multiple external nodes and multi-BLS configuration"
@echo "protofiles - generate Go code from protobuf files"

libs:
make -C $(TOP)/mcl -j8
Expand All @@ -85,6 +90,7 @@ debug:
debug-kill:
bash ./test/kill_node.sh
pkill -9 -f debug.sh
pkill -9 -f deploy.sh

debug-ext:
# add VERBOSE=true before bash or run `export VERBOSE=true` on the shell level for have max logging
Expand All @@ -101,7 +107,7 @@ debug-multi-bls:
echo sleep 10s before creating the external validator
sleep 10
bash ./test/build-localnet-validator.sh

debug-multi-bls-with-terminal:
# add VERBOSE=true before bash or run `export VERBOSE=true` on the shell level for have max logging
# add LEGACY_SYNC=true before bash or run `export LEGACY_SYNC=true` on the shell level to switch to the legacy sync
Expand All @@ -111,7 +117,7 @@ debug-multi-bls-with-terminal:
bash ./test/build-localnet-validator.sh
screen -r localnet

debug-multi-bls-multi-ext-node: pre-external
debug-multi-bls-multi-ext-node:
# add VERBOSE=true before bash or run `export VERBOSE=true` on the shell level for have max logging
# add LEGACY_SYNC=true before bash or run `export LEGACY_SYNC=true` on the shell level to switch to the legacy sync
./test/debug.sh ./test/configs/local-multi-bls-multi-ext-node.txt &
Expand All @@ -120,7 +126,7 @@ debug-multi-bls-multi-ext-node: pre-external
bash ./test/build-localnet-validator.sh

clean:
rm -rf ./tmp_log*
rm -rf ./tmp_log/*
rm -rf ./.dht*
rm -rf ./db-*
rm -rf ./latest
Expand Down Expand Up @@ -232,9 +238,6 @@ travis_rpc_checker:
travis_rosetta_checker:
bash ./scripts/travis_rosetta_checker.sh

debug_external: clean
bash test/debug-external.sh

build_localnet_validator:
bash test/build-localnet-validator.sh

Expand All @@ -248,3 +251,9 @@ debug-stop-log:
bash ./test/logs_aggregator/stop_log_aggregator.sh

debug-restart-log: debug-stop-log debug-start-log

debug-delete-log:
docker volume rm logs_aggregator_loki_data
@echo "[WARN] - it needs sudo to remove folder created with loki docker image user"
sudo rm -rf test/logs_aggregator/loki

67 changes: 51 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ http://api.hmny.io/

## Requirements

### **Go 1.22.5**
### **Go 1.24.2**
### **GMP and OpenSSL**

On macOS:
Expand All @@ -25,14 +25,15 @@ brew install gmp
brew install openssl
sudo ln -sf /usr/local/opt/[email protected] /usr/local/opt/openssl
```
On Linux (Ubuntu)
On Linux (Ubuntu):
```bash
sudo apt install libgmp-dev libssl-dev make gcc g++
sudo apt install libgmp-dev libssl-dev make gcc g++
```
On Linux (Cent OS / Amazon Linux 2)
On Linux (Cent OS / Amazon Linux 2):
```bash
sudo yum install glibc-static gmp-devel gmp-static openssl-libs openssl-static gcc-c++
```

### **Docker** (for testing)

On macOS:
Expand All @@ -41,13 +42,55 @@ brew install --cask docker
open /Applications/Docker.app
```
On Linux, reference official documentation [here](https://docs.docker.com/engine/install/).

### **Bash 4+**

For macOS, you can reference this [guide](http://tldrdevnotes.com/bash-upgrade-3-4-macos). For Linux, you can reference this [guide](https://fossbytes.com/installing-gnu-bash-4-4-linux-distros/).

### **Developer Tools for macOS**

On macOS, make sure you have the **Xcode Command Line Tools** installed. This includes essential tools like `git`, `make`, and other development utilities:
```bash
xcode-select --install
```

## Setting Up MCL & BLS Libraries on macOS

The Harmony project depends on the MCL (multi-curve library) and BLS (Boneh-Lynn-Shacham) cryptographic libraries. These need to be installed and configured before building the project.

### Clone and Build MCL & BLS Repositories
First, clone the MCL and BLS repositories:
```bash
git clone https://github.com/harmony-one/mcl.git
git clone https://github.com/harmony-one/bls.git
```

### Update `.zshrc` for MCL and BLS Paths

To ensure the libraries are correctly located when building the project, you need to add the MCL and BLS library paths to your `.zshrc` file.

Add the following lines to your `.zshrc` (or `.bash_profile` for bash users):
```bash
# MCL & BLS paths for Harmony
export MCL_PATH=$GOPATH/src/github.com/harmony-one/mcl
export BLS_PATH=$GOPATH/src/github.com/harmony-one/bls

# Add library paths for MCL and BLS
export CGO_CFLAGS="-I$MCL_PATH/include -I$BLS_PATH/include -I/opt/homebrew/opt/[email protected]/include"
export CGO_LDFLAGS="-L$MCL_PATH/lib -L$BLS_PATH/lib -L/opt/homebrew/opt/[email protected]/lib"
export LD_LIBRARY_PATH=$MCL_PATH/lib:$BLS_PATH/lib:/opt/homebrew/opt/[email protected]/lib
export LIBRARY_PATH=$LD_LIBRARY_PATH
export DYLD_FALLBACK_LIBRARY_PATH=$LD_LIBRARY_PATH
```

Then, apply the changes by running:
```bash
source ~/.zshrc
```

## Dev Environment

**Most repos from [harmony-one](https://github.com/harmony-one) assumes the GOPATH convention. More information [here](https://github.com/golang/go/wiki/GOPATH).**
**Most repos from [harmony-one](https://github.com/harmony-one) assume the GOPATH convention. More information [here](https://github.com/golang/go/wiki/GOPATH).**

### First Install
Clone and set up all of the repos with the following set of commands:
Expand Down Expand Up @@ -77,9 +120,7 @@ make

## Dev Docker Image

Included in this repo is a Dockerfile that has a full harmony development environment and
comes with emacs, vim, ag, tig and other creature comforts. Most importantly, it already has the go environment
with our C/C++ based library dependencies (`libbls` and `mcl`) set up correctly for you.
Included in this repo is a Dockerfile that has a full harmony development environment and comes with emacs, vim, ag, tig, and other creature comforts. Most importantly, it already has the go environment with our C/C++ based library dependencies (`libbls` and `mcl`) set up correctly for you.

You can build the docker image for yourself with the following commands:
```bash
Expand All @@ -93,8 +134,6 @@ docker build -t harmony .
> ```
> Learn more about the `--platform` arg and multi-CPU architecture support, [here](https://docs.docker.com/engine/reference/builder/#automatic-platform-args-in-the-global-scope) and [here](https://docs.docker.com/desktop/multi-arch/).



Then you can start your docker container with the following command:
```bash
docker run --rm --name harmony -it -v "$(go env GOPATH)/src/github.com/harmony-one/harmony:/root/go/src/github.com/harmony-one/harmony" harmony /bin/bash
Expand Down Expand Up @@ -204,13 +243,9 @@ make test-rosetta-attach

## License

Harmony is licensed under GNU Lesser General Public License v3.0. See [`LICENSE`](LICENSE) file for
the terms and conditions.
Harmony is licensed under GNU Lesser General Public License v3.0. See [`LICENSE`](LICENSE) file for the terms and conditions.

Harmony includes third-party open-source code. In general, a source subtree
with a `LICENSE` or `COPYRIGHT` file is from a third party, and our
modifications thereto are licensed under the same third-party open source
license.
Harmony includes third-party open-source code. In general, a source subtree with a `LICENSE` or `COPYRIGHT` file is from a third party, and our modifications thereto are licensed under the same third-party open source license.

Also please see [our Fiduciary License Agreement](FLA.md) if you are
contributing to the project. By your submission of your contribution to us, you
Expand Down
2 changes: 1 addition & 1 deletion accounts/abi/unpack_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -909,7 +909,7 @@ func TestOOMMaliciousInput(t *testing.T) {
}
encb, err := hex.DecodeString(test.enc)
if err != nil {
t.Fatalf("invalid hex: %s" + test.enc)
t.Fatalf("invalid hex: %s", test.enc)
}
_, err = abi.Methods["method"].Outputs.UnpackValues(encb)
if err == nil {
Expand Down
2 changes: 1 addition & 1 deletion api/service/legacysync/downloader/Proto.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.22.5-bullseye
FROM golang:1.24.2-bullseye

RUN apt update
RUN apt install -y protobuf-compiler
Expand Down
3 changes: 2 additions & 1 deletion api/service/stagedstreamsync/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,15 @@ type syncProtocol interface {
GetRawBlocksByNumber(ctx context.Context, bns []uint64, opts ...syncproto.Option) ([][]byte, [][]byte, sttypes.StreamID, error)
GetBlockHashes(ctx context.Context, bns []uint64, opts ...syncproto.Option) ([]common.Hash, sttypes.StreamID, error)
GetBlocksByHashes(ctx context.Context, hs []common.Hash, opts ...syncproto.Option) ([]*types.Block, sttypes.StreamID, error)
GetRawBlocksByHashes(ctx context.Context, hs []common.Hash, opts ...syncproto.Option) ([][]byte, [][]byte, sttypes.StreamID, error)
GetReceipts(ctx context.Context, hs []common.Hash, opts ...syncproto.Option) (receipts []types.Receipts, stid sttypes.StreamID, err error)
GetNodeData(ctx context.Context, hs []common.Hash, opts ...syncproto.Option) (data [][]byte, stid sttypes.StreamID, err error)
GetAccountRange(ctx context.Context, root common.Hash, origin common.Hash, limit common.Hash, bytes uint64, opts ...syncproto.Option) (accounts []*message.AccountData, proof [][]byte, stid sttypes.StreamID, err error)
GetStorageRanges(ctx context.Context, root common.Hash, accounts []common.Hash, origin common.Hash, limit common.Hash, bytes uint64, opts ...syncproto.Option) (slots [][]*message.StorageData, proof [][]byte, stid sttypes.StreamID, err error)
GetByteCodes(ctx context.Context, hs []common.Hash, bytes uint64, opts ...syncproto.Option) (codes [][]byte, stid sttypes.StreamID, err error)
GetTrieNodes(ctx context.Context, root common.Hash, paths []*message.TrieNodePathSet, bytes uint64, opts ...syncproto.Option) (nodes [][]byte, stid sttypes.StreamID, err error)

RemoveStream(stID sttypes.StreamID) // If a stream delivers invalid data, remove the stream
RemoveStream(stID sttypes.StreamID, reason string) // If a stream delivers invalid data, remove the stream
StreamFailed(stID sttypes.StreamID, reason string)
SubscribeAddStreamEvent(ch chan<- streammanager.EvtStreamAdded) event.Subscription
NumStreams() int
Expand Down
12 changes: 3 additions & 9 deletions api/service/stagedstreamsync/beacon_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (

"github.com/harmony-one/harmony/core"
"github.com/harmony-one/harmony/core/types"
"github.com/harmony-one/harmony/internal/utils"
"github.com/rs/zerolog"
)

Expand Down Expand Up @@ -38,16 +37,15 @@ type (
}
)

func newBeaconHelper(bc blockChain, blockC <-chan *types.Block, insertHook func()) *beaconHelper {
func newBeaconHelper(bc blockChain, logger zerolog.Logger, blockC <-chan *types.Block, insertHook func()) *beaconHelper {
return &beaconHelper{
bc: bc,
blockC: blockC,
insertHook: insertHook,
lastMileCache: newBlocksByNumber(lastMileCap),
insertC: make(chan insertTask, 1),
closeC: make(chan struct{}),
logger: utils.Logger().With().
Str("module", "staged stream sync").
logger: logger.With().
Str("sub-module", "beacon helper").
Logger(),
}
Expand Down Expand Up @@ -77,7 +75,7 @@ func (bh *beaconHelper) loop() {
case <-t.C:
bh.insertAsync()

case b, ok := <-bh.blockC:
case b, ok := <-bh.blockC: // for side chain, it receives last block of each epoch
if !ok {
return // blockC closed. Node exited
}
Expand Down Expand Up @@ -178,10 +176,6 @@ func (bh *beaconHelper) getNextBlock(expBN uint64) *types.Block {
if b.NumberU64() < expBN {
continue
}
if b.NumberU64() > expBN {
bh.lastMileCache.push(b)
return nil
}
return b
}
return nil
Expand Down
Loading
Loading