* 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.
On Docker versions < 20.10.9, `apt update` fails due to the use of
syscall `clone3` by `Glibc >= 2.34`. This change upgrades the base
distribution used by Travis to `jammy`, which contains Docker engine
20.10.12.
See https://docs.travis-ci.com/user/reference/jammy/#docker and
moby/moby#42681 for reference.