* [quorum] Factor out single vote & provide for staked quorum vote
* [quorum] Pass ShardID to decider via cb
* [quorum] Move ShardIDProvider higher, fix nil mistake
* [quorum] ReadAllSignatures optimization
* [quorum] Safer way to read over map, then to slice
* [quorum] Address PR comments - naming changes
* [committee] Move core.ShardingSchedule to shard.Schedule
* [consensus] Remove redundant PublicKeys field of Consensus as Decider maintains that
* [committee] Use committee package to pick PublicKeys
* [committee] Use committee inplace of CalculateShardState
* [committee] Remove core/resharding.go, complete usage of committee as implementation replacement
* [committee] Address PR comments
* [consensus] Factor out enums to core/values, begin factor out of consensus mechanisms
* [consensus] Make Mechanism explicit
* [consensus] Add ViewChange to QuorumPhase
* Update core/values/consensus.go
Co-Authored-By: Eugene Kim <ek@harmony.one>
* Update core/values/consensus.go
Co-Authored-By: Eugene Kim <ek@harmony.one>
* [mainnet-release] Address code comments
* [staking][consensus][project] Remove txgen, factor out consensus
* [consensus] Factor out PublicKeys
* [txgen] Bring back txgen
* [project] Undo prior consolidation of error values under core
* [consensus] Update tests using quorum decider
* [consensus] Fix overlooked resets during refactor
* [consensus] Fix wrong check of quorum phase
* [consensus] Address leftover TODO for prepare count
* [consensus] Simplfy reset switch
* [consensus] Fix mistake of wrong ReadSignature in ViewChange, need sender, not node PubKey
block.Header is now a lightweight wrapper around an embedded
HeaderInterface value, which is implemented by both v0 and v1 headers.
It inherits all methods from the wrapped HeaderInterface, except it
overrides EncodeRLP, DecodeRLP, and Hash to handle tagged-RLP
encoding/decoding. (block.HeaderRegistry is the tagged RLP registry for
versioned headers.)
A ripple effect is that header instance creation now requires knowledge
of epoch. This logic is handled by blockfactory. blockfactory.Factory
is the interface, implemented by blockfactory.factory type. It uses a
chain config to pull in the right epoch for the right type.
As a convenience, blockfactory.NewTestHeader creates a new test-purpose
headers. Use this in contexts where the implied chain config is
TestChainConfig or the chain config does not matter.
Miscellaneous changes:
- block.HeaderFieldSetter now lives in its own file.
- The functionality of block.NewHeaderWith has been replaced by the
(*block.Header).With method.
The accompanying unit tests for (*block.Header).EncodeRLP and
(*block.Header).DecodeRLP() are the cross-sectional unit tests for the
functionality added by this. They make sure that v0 header is
encoded/decoded without tagged RLP envelope (compatibility mode), and v1
header is encoded/decoded with one. See comments of the RLP byte
sequence for differences.
Leave constant HexToAddress calls as is for now; they are numerous and
converting them have no real benefit.
ParseAddr parses both base16 and bech32 addresses.
* Log the right shard number for wallet/getFreeToken
* Don't try to use empty commit bitmap from genesis block
* Fail hard if block reward or finalization fails
* Log the public key if message sig verification fails
* Extract and save chain state from received blocks in order to
eliminate deep tail recursion
* Properly deep copy chain config (previously ChainID was being shared
among chains)
* Eliminate chain use-before-init window in node.New()
* Save genesis epoch shard state in new blockchain database
* Do not check epoch of the received shard state message (temp
workaround – we should introduce the check elsewhere)
* Propose an empty block if no transactions have been received for 10
seconds
* Manage shard chains as first class citizen
* Bring core.BlockChain's read/write semantics cleaner
* Reimplement the block reward in terms of on-chain committee info, not
hardcoded genesis committee.