* [config] Fix confusing variable name
* [pool] Allow pool to accept Delegate transactions that utilize the locked redelegation amount
* [pool] Bypass balance check for Delegate transactions, let validation be done with validateStakingTx
* [list] Perform validation on staking transactions when filtering for overpriced/invalid transactions
* [list] Rename FilterCost to FilterValid, to reflect changes & update comment
* [pool] Remove now unnecessary staking logic in demotion logic
* [list] Fix imports
* [rosetta] Update staking operations to account for re-delegation
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [hmy] Add GetUndelegationChange
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [hmy] Add GetAllUndelegatedDelegators
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [hmy] Fix GetAllUndelegatedDelegators & add GetDelegationLockingPeriodInEpoch
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rosetta] Fix block reward TX ID formatting
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [hmy] Remove unused GetUndelegationChange
* Fix GetUndelegationPayouts
* Add GetDelegationsByValidatorAtBlock
* Keep beaconchain usage at a minimum
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [hmy] Remove debug print & update comments for GetUndelegationPayouts
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [core] Add last garbage collected number to blockchain.go
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rosetta] Add oldest block ID in net stat for non-archival nodes
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rosetta] Fix network oldest block case when garb col blk unknown
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [core] Rename lastGarbCollectedBlkNum to maxGarbCollectedBlkNum
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [internal/chain] Refactor token lock period getter & expose
* Use refactored token lock period getter
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [hmy] Add UndelegationPayouts type
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rosetta] Improve NewError detail failure message
* Add UndelegationPayoutOperation
* Rename PreStakingEraBlockRewardOperation to UndelegationPayoutOperation
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rosetta] Integrate Correct undelegation payout operations
* Refactor special case transaction handeling & add helper functions
for determanining when payouts should be calculated
* Make getBlockSignerInfo a method of BlockAPI
* Rename constants for clarity
* Add unit tests for formatting Undelegation payout special transaction
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [hmy] Add caching to GetUndelegationPayouts
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [hmy] Nit - fix comment
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rosetta] Add block not found error
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rosetta] Refactor special case txID to be for general
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rosetta] Fix lint
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rosetta] Nit - fix comment
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [hmy] Nit - Make GetUndelegationPayouts more readable
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* add support for redelegation
* Add test
* Revert "[go.mod] version upgrade of libp2p modules"
This reverts commit ce53468e3e.
* Fix bug that validator self delegation doesn't work
* Restore 7 epoch locking time at redelegation epoch
* Add debug log for chain context
* [rosetta] Add server with example block & network services
* Update go.mod for rosetta SDK
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [internal/configs] Add RosettaServer to node config
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [cmd] Add rosetta port flag
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [node] Add rosetta server start & rename api.go
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rosetta] Change server start to use nodeconfig of rosetta
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [cmd] Cleanup debugging prints
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rosetta] Fix stdout print & document placeholders
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rosetta] Fix lint & make StartSevers more consistent
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [cmd] Disable rosetta by default
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [test] Make explorer deploy rosetta server
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rosetta] Use direct http server for start
* Make go.mod changes minimal
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rosetta] Fix fmt
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rosetta] Fix fmt of go.mod
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rosetta] Use port 9700 instead of 10000
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [cmd] Bump config version
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [cmd] Add v1.0.0 config backwards compatibility test
* Included update message if old config is loaded
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [test] Do not broadcast invalid tx on localnet
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [cmd] Correct for invalid port when loading old config
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [cmd] Make rosetta variable names consistent
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rpc] Refactor - expose RPC functions in rpc package
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rpc] Refactor - Undo v1 & v2 code duplication pt1
* Move apiv1 into rpc package as baseline
* Create version enum
* Refactor API creation to use version enum
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rpc] Refactor - Rejoin GetBlockByNumber & GetBlockByHash
* Both RPC versions are supported in 1 function
* Created types directory for v1 & v2 response types
* Added framework to make rpc layer more clear and legible
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rpc] Refactor - Undo v1 & v2 code duplication pt2
* Rejoin blockchain.go functions
* Create legacy service
* Improve inline documentation
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rpc] Refactor - Undo v1 & v2 code duplication pt3
* Use StructuredResponse when returning an exposed type from RPC
* Remove addrlock.go
* Add RPCBlock creation with exposed struct for easy utility from consumers
* Update blockchain.go to reflect changes of RPCBlock
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rpc] Refactor - Undo v1 & v2 code duplication pt3
* Create types for RPCs that are returned.
* Reorganize types to appropriate v1 & v2 package.
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rpc] Refactor - Undo v1 & v2 code duplication pt4
* Add context to all RPCs
* Add response switches based on different versions of the API
* Add debug logs for RPC that don't return errors
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rpc] Refactor - Undo v1 & v2 code duplication pt5
* Add versions switches to all transaction related RPCs
* Integrate response with newly defined structures
* Add debug messages for RPCs that don't return errors
* Add inline documentation for all transaction related RPCs
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rpc] Refactor - Undo v1 & v2 code duplication pt6
* Remove apiv2
* Move StructuredResponse & TxHistoryArgs to main rpc types.go
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rpc] Refactor - Undo v1 & v2 code duplication pt7
* Create contract, pool, staking & transaction services
* Move apis into correct services
* Remove util.go (functions are now baked into RPCs in pool.go)
* Remove transaction.go (functions/methods are distributed among created services)
* Update changes for StructuredResponse
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rpc] Refactor - Add rpc server start/stop to pkg
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [node] Refactor - use new RPC start / stop for servers
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [hmy] Refactor - rename network.go to net.go to match rpc
* Change names for consistency with rpc pkg
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* fix go lint & go imports
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rpc] Refactor - Fix GetTransactionReceipt for staking txs
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rpc] Refactor - Rename v1 & v2 struct to not have leading 'RPC'
* Update comments
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rpc] Refactor - make defaultBlocksPeriod be the num blocks per epoch
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* Add latest dir removal for make clean
Fix docker image in README
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [hmy] Refactor - Expose Harmony attributes & remove accessors
* Add internals for APIBackend & Harmony fuse
* Add skeleton for refactor of GetTotalStakingSnapshot
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [hmy] Refactor - Re-implement APIBacked methods in Harmony
* Add 'FIXME:done' comments to indicate implemented methods,
some were left out as they are simple accessors and will transition to using
the exposed harmony attributes.
* Split functions into standalone files for clarity.
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [hmy] Refactor - Fix GetTotalStakingSnapshot in Harmony implementation
Previous implementation used rps.LatestBlockNumber, which is a constant -1,
thus, the cache was never used
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [hmy] Refactor - Move ErrFinalizedTransaction to hmy.go
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [hmyapi] Refactor - Make PublicHarmonyAPI use Harmony instead of Backed
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [hmyapi] Refactor - Make NewPublicBlockChainAPI use Harmony instead of Backend
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [hmyapi] Refactor - Make NewPublicTransactionPoolAPI use Harmony instead of Backend
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [hmyapi] Refactor - Make DebugAPI use Harmony instead of Backend
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [hmyapi] Refactor - Make filers use Harmony instead of Backend
* Fix unhandled errors
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [hmy] Refactor - Change NetVersion to ChainID
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [hmyapi] Refactor - Change API service declaration to use Harmony
* Remove irrelevant TODOs
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [node] Refactor - Move harmony create to APIs fetch
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [hmy] Refactor - Remove api_backend.go & Backend
* Update hmyapi net.go to return ChainID as Version
* Remove unused err return on New Harmony obj
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [hmy] Refactor - Prettify var names, structure & comments
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [hmyapi] Refactor - Prettify var names, structure & comments
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [hmyapi] Refactor - Remove backend interface
* Fix lint
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [hmy] Refactor - Remove exposure for eventMux and chainDb
This is to satisfy existing interfaces, mainly the in filters.
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [hmy + hmyapi] Refactor - Fix imports
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [hmy] Refactor - Apply changes from #3243
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [hmyapi] Refactor - Make filters use Backend instead of hmy
This is for testing from eth if we need it in the future
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [hmyapi] Refactor - Fix imports
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>