* 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
The function `state_object.CodeSize` erroneously returns the validator
code size to be 0. This functionality is only used by the EVM, where the
size is overridden by the `ValidatorCodeFixEpoch` hard fork to be 0
anyway.
However, for nodes currently syncing blocks before the hard fork was
effective, this causes an error. A transaction which attempts to mint an
NFT to a validator address prior to the hard fork would have failed,
because `onERC1155Received` is not implemented by a validator's code.
With the erroneous line, the transaction goes through - causing
a node with the unpatched binary to reject the block.
With #4427, the protofiles are generated using a Docker image and thus
`protoc` related binaries are not required. However, `mockgen` and
`golangci-lint` are still being used by our Travis build. This change
restores the file that installs them, and removes `protoc` related files
from the list of installations.