* add faultRecoveryThreshold to reset stream failures
* increase MaxStreamFailures to let stream be longer in the list
* set Concurrency to 2 for devnet to be same as MinStreams, otherwise it will rewrite MinStreams
* stream sync loop checks for ErrNotEnoughStreamsand waits for enough streams in case there are not enough connected streams in list
* fix fault recovery issue
* improve checkPrerequisites to be able to continue with minimum streams
* refactor fixValues function, put priority on MinStreams rather than Concurrency
* drop remote peer if sending empty blocks array
* goimports to fix build issue
* fix getReceipts array assignments
* fix getReceipts and add tests for it
* 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.