* [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>
This is a big PR merged many small commits together.
We add the message validation function in libp2p layer.
In the validation function, we check the following conditions
1) the p2p message is a valid consensus message
2) the p2p message sender has a valid public key
3) the sender's public key is in the current committee
4) log the number of invalid/valid messages
After the validation, the valid messages will be forward to the network,
while the invalid messages will be filtered out.
The messages intended for the validator will be handled in the consensus layer.
Signed-off-by: Leo Chen <leo@harmony.one>
* separate transaction counts rpi api into regular vs staking
* fix api_test.sh for getTransactionCount apiv1
* nit. return results directly for get(Staking)TransactionsCount apis
* staking txn. look up by hash fix on api backend rawdb storage
* node explorer staking txn 'history' RPC layer support
* fix unit test
* add error log when explorer node db instance cannot be fetched
* revert unwanted merge changes during rebase
* use already encoded tx message fields for get staking txn rpc
* update explorer node storage service for staking txns
* use hex string for staking transaction data field
* revert transaction pool apiv1 changes
* More logs and checks before processing staking txns
* fix import
* Refactor block proposal
* Various fixes and todos for auditing; add log for collect rewards
* Fix lint
* fix comment
* [slashing] Add Slashing fields in header, only available from v3 onward
* [slashing] Add Banned field to validator struct
* [consensus] Remove dead code
* [node] Use named value for shardID of beaconchain
* [consensus] No need to memory thrash Buffer
* [slashing] Add slash record type, stub out BroadcastSlash
* [cmd] Bump 2019 -> 2020
* [votepower] Add ballot results structs
* [quorum][slash] Refactor quorum to accomdate extra data points needed for slashing
* [consensus] Begin refactor of consensus leader messages
* [consensus] Accomdate consensus for changed method signatures in quorum
* [project] Whitespace and helper function
* [block] More comments and logs for fields that do not make sense in earlier v version
* [slashing] More comments, field renames, tag Edgar TODO
* [quorum] Undo name change of Prepare to Announce, was mislead by other existing code
* [engine] Verify quorum achieved by mask in VerifySeal
* [engine] Use RJs PR comment on how to pull slotList, move parentQuorum inside else
* [node] Use votingpower logic check in node explorer message handler
* [explorer][node] Simplify explorer quorum by mask
* [engine] Additional check for quorum voting power in VerifyHeaderWithSignature
* [staking] Fix mistake on QurorumThreshold, change Harmony share to 68
* [staking] Use dec instead of big.Int for easier use
* [staking] Adjust one-vote quorum to account for usage of decimal
* [staking] Replace threshold with TwoThirdExplicit signer count, quorum threshold was becoming overloaded
* [staking] Count plain case of quorum achieved for one-node-one-vote
* [staking] Staked vote TODO
* [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
[cleanup] remove is_genesis flag
Signed-off-by: Leo Chen <leo@harmony.one>
[nodetype] add nodetype to replace is_explorer
Signed-off-by: Leo Chen <leo@harmony.one>
fix beacon sync channel blocking issue
use lastMileMux to protect lastMileBlock queue to avoid potential blocking; use sleep instead of ticker
Fix the beacon committee check
[release] add release action to go_executable_build.sh
Signed-off-by: Leo Chen <leo@harmony.one>
[node.sh] add -d option
-d download only
Signed-off-by: Leo Chen <leo@harmony.one>
[node.sh] add -T node_type option
-T node_type support node type (validator/explorer)
Signed-off-by: Leo Chen <leo@harmony.one>
[node.sh] backward compatible with older harmony binary
Signed-off-by: Leo Chen <leo@harmony.one>
[node.sh] support -i shard_id option
-i shard_id specify shard_id, this is applicable only to
explorer node
Signed-off-by: Leo Chen <leo@harmony.one>
Revisited api
Fix rpc integration
address some minor issues in comments and code
addressed comments on others' buckets
Add Global Access to OS Temp Directory Variable and Move DHT Files Into Temp Directory
Add flag to disable signers
Fix explorer handler
Fix explorer handler
fix explorer for loop
add shardID information in getTransactionByHash RPC CALL
Add CXReceipt RPC call; Add indexing for CXReceipt by TxHash
use only one index for CXEntryLookup; use shardID instead of fromShardID in RPC returned results