* Fix: max rate issue (#4580)
* fix: max-rate bellow the era min-rate
* fix comments
* add localnet epoch config
* update config
* update config
* update config
* update config
* add log
* remove hip30 from localnet
* disable localnet config
* engine: actually fix the 7% fee implementation
* rpc: fix transaction receipt format for eth
use the same receipt as `hmyv2_`. using a boolean variable, decide if
the addresses need to be converted to bech32. do not return a contract
address unless a contract was actually deployed in the transaction by
using a pointer address type.
* rpc: add comment indicating function is unused
with the switch to `v2.NewReceipt` for even `eth_` queries, the
`eth.NewReceipt` function is no longer used
* build: fix delegation tests
* update comment
blocks was referring to `blocks of code` and not blocks in a chain.
removed the confusing word
* rpc: remove ConvertToEth in GetBlockReceipts
* internal: max rate hard fork schedule
* internal: testnet max rate schedule
---------
Co-authored-by: Diego Nava <8563843+diego1q2w@users.noreply.github.com>
* Cleanup and fix update pub keys.
* Skip the next leader if it doesn't sign blocks.
* Comment & constant.
* Updated with dev.
* Updated with latest dev.
* Cleanup
* add new functions to p2p stream client for sharing the full states
* remove extra comments, add bytes checking
* add client tests for new p2p stream client functions
* rename new client functions
* complete tests for new functions of p2p stream client
* enable on devnet hip28 and hip30 together at hip30
* enable 30M epoch for all except mainnet/testnet, update devnet for restart
* remove unused var
* update partner/devnet feature activation
* Remove old devnet/partner instance config
* 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
* create preimage for genesis block
* fix consensus with No Migration Possible
* use correct header for migration
* process all tx in all block for non shard 0
---------
Co-authored-by: MaxMustermann2 <82761650+MaxMustermann2@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
* preimages: re-generate them using CLI
* move from rpc to core
* migrate balance uring epoch T - 1
highly untested code. also missing is the ability to generate a
pre-migration report for future verification.
* test account migration in localnet
* 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
* Fixed stuck.
* Additional logs.
* Cleanup.
* Rebased on harmony-one:hip30/testing.
* Removed code duplicate.
* Fixed stuck.
* IsOneEpochBeforeHIP30 for only 1 epoch.
---------
Co-authored-by: MaxMustermann2 <82761650+MaxMustermann2@users.noreply.github.com>
Co-authored-by: Nita Neou (Soph) <soph@harmony.one>
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
* 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>
* 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
* update test
* update test
* shard reduction: update block reward
---------
Co-authored-by: Casey Gardiner <117784577+ONECasey@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>
* 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
* update test
* update test
* Update mainnet.go
---------
Co-authored-by: Casey Gardiner <117784577+ONECasey@users.noreply.github.com>
* 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
* update test
* update test
---------
Co-authored-by: Casey Gardiner <117784577+ONECasey@users.noreply.github.com>
* 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
* integrate snapshot feature with statedb and add cache to states
* send nil as stateCache to let NewDatabase function decides about cache configs
* fix test issues of using snapshot