* [core] Add tx-pool txn interface & update supporting components
* Add txn interface (`PoolTransaction`) for tx-pool
* Update tx_journal to handle pool's txn interface
* Update tx_list to handle pool's txn interface
* [staking] Satisfy `PoolTransaction` interface & move error sink types
* Implement `Protected`, `ToShardID`, `To`, `Data`, `Value` and `Size`
for `StakingTransaction` to satisfy `PoolTransaction` interface
* Refactor `Price` to `GasPrice` for `StakingTransaction` to
satisfy `PoolTransaction` interface
* Move error sink related components to transaction.go
* Expose `VerifyBLSKey` and `VerifyBLSKeys`
* [core] Generalize tx pool & refactor error sink logic
* Refactor txn logic to use `PoolTransaction` and `PoolTransactions`
* Add `txPoolErrorReporter` to handle reporting to plainTx and stakingTx
error sinks
* Remove old & unpayable txs error reports (to error sink) since errs
are already reported when adding the txs
* Fix known transaction error report when adding txn batches
* Add error sink reporting when failed to enqueue txs
* [node] Fix error sink & update tx pool interaction
* Integrate staking transaction in tx-pool
* Remove staking transaction error sink
* [hmy api] Integrate staking transactions from tx pool
* Remove looking at tx pool for `GetTransactionByHash`
* Add `PendingStakingTransactions` and update `PendingTransactions` to
only return plainTx
* [tests] Update all tests for tx pool txn interface & staking err sink
* Update transactions to `PoolTransaction` interface
* Remove `CommitTransactions` staking txn error sink
* Add basic staking txn tests to tx pool tests
* [node] Make all node broadcast staking tx and plain tx
* [core + staking] Separate staking msg check and put in tx pool
* Move `Validator` specific sanity check into its own method and
call said method in `ValidatorWrapper` sanity check
* Create staking msg verifiers and preprocessors in `staking_verifier.go`
* Remove staking msg verification on all staking msg applications
in `state_transition.go` and call new staking msg verifiers & preprocessors
* Add staking msg verification to tx pool
* Remove `ToShardID` from `PoolTransaction` interface and remove trivial
implementation of `ToShardID` in `StakingTransaction`
To verify the signature of downloaded binaries, make it optional.
For engineering build, there is no need to verify the signature.
Signed-off-by: Leo Chen <leo@harmony.one>
* update testnet epochs
* Fix the one-off error fully
* Add const for the bad block num
* Graceful shutdown of node
* Add syscall.SIGTERM for shutdown
* Add transaction base fee for createValidator as 10x of create contract
* Add transaction base fee for createValidator as 100x of create contract
* Add transaction base fee for createValidator as 10x of create contract
* Add transaction base fee for createValidator as 100x of create contract
* Fix lint
* [consensus] Remove unnecessary usage of bandwidth in network messages, small adjustments after consensus code review
* [consensus] Factor out behavior of when quorum prepare reached
* [consensus] Push code from another scratch branch
* [consensus] Still do need to accept higher than blocknum message
* [rpc] Stub out estimate gas cost
* Fix estimate gas
* Fix different block numbers
* Add to apiv2
Co-authored-by: flicker-harmony <52401354+flicker-harmony@users.noreply.github.com>
* [chain][network] Factor out block reward from internal chain to proper package
* [network] Fill out record intended for RPC
* [staking][network] NewUtilityMetricSnapshot
* Expose rewards to RPC API
* Change json field
* Fix lint
* Remove marshalling
* Remove import
* Optimize median raw stake, total stake, get stake methods
* Remove unnecessary methods and add thread safety
* Review feedback
* Remove lock/unlock
Co-authored-by: Edgar Aroutiounian <edgar.factorial@gmail.com>
* [slash] Remove dead interface, associated piping
* [slash] Expand out structs
* [consensus] Write to a chan when find a case of double-signing, remove dead code
* [slash] Broadcast the noticing of a double signing
* [rawdb] CRUD for slashing candidates
* [slashing][node][proto] Broadcast the slash record after receive from consensus, handle received proto message, persist in off-chain db while pending
* [slash][node][propose-block] Add verified slashes proposed into the header in block proposal
* [slash][shard] Factor out external validator as method on shard state, add double-signature field
* [slash][engine] Apply slash, name boolean expression for sorts, use stable sort
* [slash] Abstract Ballot results so keep track of both pre and post double sign event
* [slash] Fix type errors on test code
* [slash] Read from correct rawdb
* [slash] Add epoch based guards in CRUD of slashing
* [slash] Write to correct cache for slashing candidates
* [shard] Use explicit named type of BLS Signature, use convention
* [slash] Fix mistake done in refactor, improper header used. Factor out fromSlice to set
* [slash][node] Restore newblock to master, try again minimial change
* [cx-receipts] Break up one-liner, use SliceStable, not Slice
* [network] Finish refactor that makes network message headers once
* [network] Simplify creation further of headers write
* [slash] Adjust data structure of slash after offline discussion with RJ, Chao
* [slash] Still did need signature of the double signature
* [consensus] Prepare message does not have block header
* [consensus] Soft reset three files to 968517d~1
* [consensus] Begin factor consensus network intended message out with prepare first
* [consensus] Factor out Prepared message
* [consensus] Factor out announce message creation
* [consensus] Committed Message, branch on verify sender key for clearer log
* [consensus] Committed Message Factor out
* [consensus] Do jenkins MVP of signatures adjustment
* [main][slash] Provide YAML config as webhook config for double sign event
* [consensus] Adjust signatures, whitespace, lessen GC pressure
* [consensus] Remove dead code
* [consensus] Factor out commit overloaded message, give commit payload override in construct
* [consensus] Fix travis tests
* [consensus] Provide block bytes in SubmitVote(quorum.Commit)
* [consensus] Factor out noisy sanity checks in BFT, move existing commit check earlier as was before
* [quorum] Adjust signatures in quorum
* [staking] Adjust after merge from master
* [consensus] Finish refactor of consensus
* [node] Fix import
* [consensus] Fix travis
* [consensus] Use origin/master copy of block, fix mistake of pointer to empty byte
* [consensus] Less verbose bools
* [consensus] Remove unused trailing mutation hook in message construct
* [consensus] Address some TODOs on err, comment out double sign
* [chain][network] Factor out block reward from internal chain to proper package
* [network] Fill out record intended for RPC
* [staking][network] NewUtilityMetricSnapshot
* [rpc] Merge squash from remote flicker-harmony/pr_rewards
Co-authored-by: flicker-harmony <52401354+flicker-harmony@users.noreply.github.com>