* 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
* HIP-30: sharding configuration boilerplate
* update comments
* goimports
* HIP-30: minimum validator commission of 7%
Based on #4495, which must be merged before this PR. This PR should be
rebased with dev after #4495 is merged to retain atomicity of changes by
pull request.
* goimports
* HIP-30: Emission split implementation
Note that the allocated split of the emission goes directly to the
recipient (and not via the Reward). This is because rewards are indexed
by validator and not by delegator, and the recipient may/may not have
any delegations which we can reward. Even if one was guaranteed to
exist, it would mess up the math of the validator.
* set up mainnet recipient of emission split
* HIP-30: Emission split addresses for non mainnet
* HIP-30: deactivate shard 2 and 3 validators
* goimports
* update test
* goimports
* migrate balance uring epoch T - 1
highly untested code. also missing is the ability to generate a
pre-migration report for future verification.
* update test
* export prometheus metric when no error importing preimage
* add comment
* test account migration in localnet
* add preimages flags to rootflags
* enable preimages on the whitelist
* add the generate method
* fix cropping log
* fix cropping log
* cropping startpoint when bigger than endpoint
* add support for the rpcblocknumer type
* enable import api
* use earlies block
* debug logs
* debug logs
* debug logs
* debug logs
* fix error catching
* fix error catching
* make end optional for the comand line
* fix cropping logic
* improve error when apply message fails
* add balance on the error
* fix importing
* remove unused imports
---------
Co-authored-by: Nita Neou (Soph) <soph@harmony.one>
Co-authored-by: Soph <35721420+sophoah@users.noreply.github.com>
Co-authored-by: Diego Nava <diego.nava77@hotmail.com>
Co-authored-by: Diego Nava <8563843+diego1q2w@users.noreply.github.com>
* 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>
* 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”>
* [rpc] fix some test cases
* fix test cases
* [rpc] use harmony/eth/rpc for customized changes
* [RPC] replace one more use of RPC at accounts module
* [RPC] fix test cases
* Move tracing functions to hmy object
* Add new "debug" namespace for tracing functions
* Some tracing functions are disabled & return a RPC not available yet error
* [rpc] Refactor - expose RPC functions in rpc package
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rpc] Refactor - Undo v1 & v2 code duplication pt1
* Move apiv1 into rpc package as baseline
* Create version enum
* Refactor API creation to use version enum
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rpc] Refactor - Rejoin GetBlockByNumber & GetBlockByHash
* Both RPC versions are supported in 1 function
* Created types directory for v1 & v2 response types
* Added framework to make rpc layer more clear and legible
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rpc] Refactor - Undo v1 & v2 code duplication pt2
* Rejoin blockchain.go functions
* Create legacy service
* Improve inline documentation
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rpc] Refactor - Undo v1 & v2 code duplication pt3
* Use StructuredResponse when returning an exposed type from RPC
* Remove addrlock.go
* Add RPCBlock creation with exposed struct for easy utility from consumers
* Update blockchain.go to reflect changes of RPCBlock
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rpc] Refactor - Undo v1 & v2 code duplication pt3
* Create types for RPCs that are returned.
* Reorganize types to appropriate v1 & v2 package.
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rpc] Refactor - Undo v1 & v2 code duplication pt4
* Add context to all RPCs
* Add response switches based on different versions of the API
* Add debug logs for RPC that don't return errors
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rpc] Refactor - Undo v1 & v2 code duplication pt5
* Add versions switches to all transaction related RPCs
* Integrate response with newly defined structures
* Add debug messages for RPCs that don't return errors
* Add inline documentation for all transaction related RPCs
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rpc] Refactor - Undo v1 & v2 code duplication pt6
* Remove apiv2
* Move StructuredResponse & TxHistoryArgs to main rpc types.go
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rpc] Refactor - Undo v1 & v2 code duplication pt7
* Create contract, pool, staking & transaction services
* Move apis into correct services
* Remove util.go (functions are now baked into RPCs in pool.go)
* Remove transaction.go (functions/methods are distributed among created services)
* Update changes for StructuredResponse
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rpc] Refactor - Add rpc server start/stop to pkg
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [node] Refactor - use new RPC start / stop for servers
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [hmy] Refactor - rename network.go to net.go to match rpc
* Change names for consistency with rpc pkg
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* fix go lint & go imports
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rpc] Refactor - Fix GetTransactionReceipt for staking txs
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rpc] Refactor - Rename v1 & v2 struct to not have leading 'RPC'
* Update comments
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rpc] Refactor - make defaultBlocksPeriod be the num blocks per epoch
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>