* flags: set up preimage flags
* hip30: set up preimage import, export, api
* save pre-images by default
* add pre images api
* goimports
* commit rpc preimages file
* preimages: re-generate them using CLI
* add metrics and numbers for pre-images
* automate generation after import
* move from rpc to core
* goimports
* add back core/preimages.go file
* goimports
* goimports
* export prometheus metric when no error importing preimage
* add preimages flags to rootflags
---------
Co-authored-by: Nita Neou (Soph) <soph@harmony.one>
* add error desc in validateNewBlock to help to identify validation issues
* let stream sync downloader continues loop even if error occured
* pass consensus to stream sync through downloader
* add last mile functions to stream sync
* add if to check invalid block revert
* add last mile stage to stream sync
* goimports
* improve stream sync downloader loop to block redundant calls
* move startSyncing out of the shortrange loop
* goimports
* fix sync loop go routine
* remove extra log
* add debug mode to stream sync help debugging syncing issues
* fix stream sync loop channels
* add streamFailed function to short range helper to avoid removing of the healthy streams
* remove execution of stage bodies, stage lastmile, stage short range and stage state for epoch chain
* refactor stage epoch
* add debug logs
* goimports
* add a few debug log to stage short range
* doSync returns estimated height as well
* only switch to short range if the current block number is very close to the chain current height
* stream sync gets UseMemDb from config file
* goimports
* only flag failed streams rather than removing them in stream sync
* if stage blocks progress behind current head, remove block cache
* add rollback to short range
* refactor stage last mile blocks, add roll back to this stage
* improve addConsensusLastMile
* goimports
* fix log spell error
* improve revert function, no need to revert if hashes are empty
* fix switch to short range by removing extra condition
* add donC chan size
* refactor downloader loop mechanism
* use atomic flag rather than done channel in downloader loop
* no need for fail stream in epoch sync
* ignore context timeout
* add mux lock to get access to last mile blocks
* remove atomic flag for downloader loop
* a few improvements on staged sync, check addedBn before switch to short range
* goimports
* fix consensus catchup issue
* fix panic issue from runnig sync loop while stream sync is runing
* goimports
* add two more logs to staged sync
* remove extra debug logs, add more file logs for stream sync
* add comment for DebugMode
* improve the byte comparison for getBlockFromLastMileBlocksByParentHash function
* add description for closing client and change randomize process to make sure only online nodes are added to sync config
* fix sync test
* fix legacy limitNumPeers test
* add WaitForEachPeerToConnect to node configs to make parallel peer connection optional
Co-authored-by: “GheisMohammadi” <“Gheis.Mohammadi@gmail.com”>
* fix unexpected chain id (https://github.com/harmony-one/harmony/issues/4129)
* update epoch numbers for ChainId fix
* updated ChainID Epoch for test net
* align comment with other comments
* fix the build using goimports
* added flags to enable/disable rpc for staking and eth
* add feature to be able to feed custom configuration for each single node in testnet
* add method filter
* add rpc method filters file and one new flag for legacy APIs
* fixed tests and improved method filter and added more tests
* fix format and removed extra comments
* fix method_filter comments
* remove extra debug print
Co-authored-by: “GheisMohammadi” <“Gheis.Mohammadi@gmail.com”>
* Add rate limit to metrics
* Compliance with harmony's metrics specifications
* Improve rate limit metrics info
* minor: remove the redundancy of rpc metrics name
Signed-off-by: Leo Chen <leo@harmony.one>
* [rpc] set default rate limit to 1000
Signed-off-by: Leo Chen <leo@harmony.one>
* [rpc] fix test errors
Signed-off-by: Leo Chen <leo@harmony.one>
* [metrics] init rpc rate limiter
Signed-off-by: Leo Chen <leo@harmony.one>
Co-authored-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>
* [rosetta] Add server with example block & network services
* Update go.mod for rosetta SDK
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [internal/configs] Add RosettaServer to node config
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [cmd] Add rosetta port flag
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [node] Add rosetta server start & rename api.go
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rosetta] Change server start to use nodeconfig of rosetta
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [cmd] Cleanup debugging prints
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rosetta] Fix stdout print & document placeholders
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rosetta] Fix lint & make StartSevers more consistent
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [cmd] Disable rosetta by default
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [test] Make explorer deploy rosetta server
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rosetta] Use direct http server for start
* Make go.mod changes minimal
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rosetta] Fix fmt
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rosetta] Fix fmt of go.mod
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rosetta] Use port 9700 instead of 10000
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [cmd] Bump config version
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [cmd] Add v1.0.0 config backwards compatibility test
* Included update message if old config is loaded
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [test] Do not broadcast invalid tx on localnet
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [cmd] Correct for invalid port when loading old config
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [cmd] Make rosetta variable names consistent
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>