Removed implicit port subtraction(-3000). This is now only done in the migration of old configs. Once old configs
are migrated port will match with actual port used
Fixes regarding config V2.0.0
The following fixes and improvements have been applied
- Added timeout to config update prompt. Prompt logic has been moved to
a separate func
- When updating config file, the original is saved to <config>.backup
- Added semantic version validation for the version found in config. Error is
returned if version is missing, not a valid sematic version or not
found in the migrations map
- Flags related to DNSSync has been moved to dnsSyncFlags flag array.
Also moved tests related to DNSSync flags to separate test func
- Added dns.server and dns.client flags and tests for them
- Added migration tests with dumps of versions 1.0.2, 1.0.3, 1.0.4
Inital commit
Removed lint warning
Fixed names, that have changed in dnsSync
Fixed some lint errors
Some functions were exported although no need to be and some test
variables were also renamed
Fixed 1.0.4 migration
- Tests in config_test.go expected wrong version since it was migrated to
2.0.0
- getDefaultHmyConfigCopy did not get DNSSync defaults
- Key for DNSPort for version prior to 1.0.4 was wrong - DNSSyncPort
Added default for DNSSync when creating default Config
Fixed empty string user input crash
Inputing empty string was causing out of bounds index to be read from
readStr
Fixed flags_test to work with config version 2.0.0
Changed DNSSync fields names
It seems that Enabled was not a good name, considering that actually did
the opposite. Also kept LegacyClient and LegacyServer names
Removed Legacy prefix from dnsSync fields
It seems Legacy prefix is obsolite since moving the fields to dsnSync
Fixes regarding config V2.0.0
The following fixes and improvements have been applied
- Added timeout to config update prompt. Prompt logic has been moved to
a separate func
- When updating config file, the original is saved to <config>.backup
- Added semantic version validation for the version found in config. Error is
returned if version is missing, not a valid sematic version or not
found in the migrations map
- Flags related to DNSSync has been moved to dnsSyncFlags flag array.
Also moved tests related to DNSSync flags to separate test func
- Added dns.server and dns.client flags and tests for them
- Added migration tests with dumps of versions 1.0.2, 1.0.3, 1.0.4
Fix for config_migrations_test
Added default value to serverPort during migration
1. Added some functionality to HostV2 for stream support.
2. Added new module discovery under p2p host to replace the networkInfo service.
3. Make dht datastore badger only active on bootstrap nodes. For normal nodes, badger is disabled by default. It can also be enabled by flags.
Co-authored-by: Rongjian Lan <rongjian.lan@gmail.com>
1. Refactored service manager with cleaner interface.
2. Add prometheus to the service manager.
3. Graceful shutdown of the services (including consensus).
4. Some code refactor regarding consensus graceful shutdown.
Co-authored-by: Rongjian Lan <rongjian.lan@gmail.com>
* [node] graceful shutdown validator and leader
when leader/validator is in commit phase, wait until it finishes the consensus
before shutdown the node.
This is useful for node upgrade to avoid unexpected blockchain state.
Signed-off-by: Leo Chen <leo@harmony.one>
* [node] stop block proposal service on leader
Signed-off-by: Leo Chen <leo@harmony.one>
* [node] warn on block proposal stopped
Signed-off-by: Leo Chen <leo@harmony.one>
Co-authored-by: Rongjian Lan <rongjian.lan@gmail.com>
* Add 3s block time and change of block reward
* fixes
* add new blocks per epoch for testnet
* remove unused code
* fix 2s changing logic
* enable 2s at epoch 73000 at testnet
* add aggregateSig flag
* add flag to valid
* revert import change
* enable agg sig at epoch 233 for shard 3 in mainnet
* fix consensus nil
* revert agg sig epoch logic
* fix test
In case of ntp server is busy, we added the following
protection.
* increase timeout of ntp query
* ignore timeout error for ntp query
Signed-off-by: Leo Chen <leo@harmony.one>
[viewchange] new view change struct
move all view change data structure to a new viewchange struct
[viewchange] wrap functions in viewchange struct
[viewchange] newView process can not be reentrant
[viewchange] additional debug
[viewchange] always add m3 message to bitmap
[viewchange] shorten the duration for view change
[viewchange] further cleanup of onNewView func
[viewchange] add validpayloadlength const
[viewchange] only add m3 message if valid m1/m2 received
[viewchange] set next leader to any key
[viewchange] print more error message in log
[viewchange] get leader pubkey from coinbase
[viewchange] rename files back for easy review
[viewchange] fix nil pointer in getNextLeader
[viewchange] fix review comments
[viewchange] squash single used function
[viewchange] code re-org
[viewchange] clean up functions
[viewchange] minor typo fix
[viewchange] code clean up and more comments
Signed-off-by: Leo Chen <leo@harmony.one>
* [cmd] Add IsOffline flag
* Add IsOffline to node config
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [node] Disable syncing and p2p msgs if offline
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rosetta] Clarify syncing status msg
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [internal/config] Add DefaultLocalListenIP & DefaultPublicListenIP
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [cmd] Add IP to p2p config
* Use default local listening ip for p2p hors if node is in offline
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [p2p] Use peer ip when creating listenAddr
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [cmd] Fix unit tests & bump config version
* Fix TestAddPeer & TestConnectionToInvalidPeer p2p test
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [cmd] Fix lint
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [cmd] Address PR comments
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rawdb] add error handling to all rawdb write. Add fdlimit module. Fix the node stuck
* [core] switch back the batch write condition in InsertReceiptChain
* [core] add comments on isUnrecoverableErr