For view change, the view change ID is the key to determine which node
will be next leader. In our original algorithm, the view ID always increased one step
at a time. The view change period increased exponetially based on the square of
the gap between current view changing ID and previous known block view change ID.
However, it is very slow to converge the view change if multiple nodes are offline and
view change can't be reached. Especially, during the shard down event, multiple nodes
are offline and other nodes have advanced their current view changing ID.
The new time-baed synchronuous view change algorithm uses the local timestamp and
the timestamp of the block to calculate the expected view changing ID. In this case,
offline nodes can immediately catch up with the latest view changing ID as long as
the offline nodes have the latest sync'ed block and relatively acturate local
clock. This algorithm will converge the view change faster in one or two view change
duration.
Signed-off-by: Leo Chen <leo@harmony.one>
* [rosetta] Fix pre-staking rewards with GetPreStakingBlockRewards
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [hmy] Refactor GetDetailedBlockSignerInfo to use availability
* Add GetPreStakingBlockRewards with cache
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rosetta] Fix prestaking block reward unit tests
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rosetta] Report tx fees of coinbase for prestaking rewards
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rosetta] Update docker file name in readme
* [rosetta] Print node version when running node using docker
* [rosetta] Make docker image smaller & update README.md
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
In case of ntp server is busy, we added the following
protection.
* increase timeout of ntp query
* ignore timeout error for ntp query
Signed-off-by: Leo Chen <leo@harmony.one>
* Basic multi-sig logic
* Refactor multi-sig logic for validator; Add slashing sanity check
* correct func comment
* expose more details about block reward error
* Add tests for prepare and commit message construction
* Add more unit tests for vote submission
* Add multikey dedup and test cases
* Fix refactor; add test for AggregateVotes
* Add more tests for mask
* update aggregate sig epoch
* fix comments
* fix comments
* update fbft id
* add HasSingleSender func
* fix comments
* [core] Add FindLogsWithTopic & unit test
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [hmy] Add GetDetailedBlockSignerInfo
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [hmy] Add IsCommitteeSelectionBlock
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [test] Add test transaction creation helpers
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rosetta] Refactor account.go & add tests
* Move TestNewAccountIdentifier & TestGetAddress to account_test.go
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rosetta] Move Operation & Tx formatting to own files
* Move Respective unit tests to own files
* Expose GetOperations & GetStakingOperations
* Expose FormatTransaction, FormatCrossShardReceiverTransaction,
FormatGenesisTransaction, FormatPreStakingRewardTransaction & FormatUndelegationPayoutTransaction
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rosetta] Move TransactionMetadata to transaction_construction.go
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rosetta] Update construction to use new helpers & formatters
* Make docs consistent for mempool.go
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rosetta] Move all special tx & blk handling to own file
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rosetta] Remove all moved fns, methods & tests from block.go
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* Fix lint & imports
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rosetta] Rename all tx related files for clarity
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rosetta] Rename DefaultSenderAddress to FormatDefaultSenderAddress
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rosetta] Rename Currency to NativeCurrency
* This is in anticipation of HRC20 token support with rosetta
* Rename various native operation functions accordingly
* Add documentation to explain what a native token is
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rosetta] Fix pre-staking block reward calculation
* Move getPreStakingRewardTransactionIdentifiers to block_special.go
* Add epoch to block metadata
* Update unit tests
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* Add IsLastBlockInEpoch method to Block & Header
* Refactor all uses of length check `ShardState`
* [hmy] Refactor IsCommitteeSelectionBlock to use chain.IsCommitteeSelectionBlock
* Address PR comments
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rosetta] Update var names in preStakingRewardBlockTransaction
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>