* [rosetta] Refactor operations & prep for internal tx exposure
* Remove gas op relation for tx operations. Gas is for submission & processing
the tx, thus not really related to the amount being transferred
* Make optional starting op a ptr to a uint to keep consistent
* Reorg file for consistency of fn placement
* Rename functions for clarity
* Make getContractCreationNativeOperations consume getBasicTransferOperations for consistency
* Remove invariant doc as it does not apply anymore
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rosetta] Add framework for parsing traced txs
* Define ContractInfo struct for FormatTransaction
* Add tx trace helper function defs & propagate type defs
* Add a GetTransactionStatus helper fn for Operation formatting/creation
* Add wrapper function, getContractTransferNativeOperations, to get internal operations
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rosetta] Implement transaction tracer
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [tracer] Add CallerAddress & CodeAddress to tracer logs
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [tracer] Remove ptr to slice & map in StructLogRes
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rosetta] Implement getContractInternalTransferNativeOperations
* Add ContractAddress to ContractInfo for future usages (i.e: erc20 parsing)
* Only check for contract address if there is tx data in BlockTransaction
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rosetta] Fix status report for contract related txs
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [tracer] Expose contract address instead of code address
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rosetta] Add trace cache & update TODO
* Trace any PLAIN transaction instead of only transactions with data.
This is to account for fall back contract fn calls & ignore staking data.
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rosetta] Make internal tx formatter not return err on nil exec result
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* Fix lint
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rosetta] Fix tests
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rosetta] Add internal tx unit tests
* Fix tx data len check for contract related transfers as a transaction with len 0
data can happen for a contract (and fail) due to fall back operations.
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rosetta] Update invariant comment
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rosetta] Expose mutually exclusive ops + update docs & tests
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rosetta] Fix docs and err msgs
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* Add 3s block time and change of block reward
* fixes
* add new blocks per epoch for testnet
* remove unused code
* fix 2s changing logic
* enable 2s at epoch 73000 at testnet
* counter of consensus
* finality histogram
* number of signatures
* number of started view change
* number of finished view change
* counter of state syncing
Signed-off-by: Leo Chen <leo@harmony.one>
* [rosetta] Start refactor of side effect transactions
* Rename special transactions to side effect transactions
* Rename various variables for consistancy within context of side effect transasctions
* Remove all individual transaction for side effects, instead start process of batching
all side effects under one transaction.
* Finish batching of genesis side effect transaction.
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rosetta] Add `getSideEffectTransaction` & refactor consumers
This will hook in the logic to report all side effects under 1 transactions.
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rosetta] Remove genesis logic path for special effect txs
It is not integrated with the normal special effect logic
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rosetta] Rename helper fns to use 'side effect'
Replacing special case
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rosetta] Fix special case operation index
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rosetta] Consolidate side effect operation logic
* Update tests for new side effect logic
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rosetta] Fix import
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rosetta] Update inline doc
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
* [rosetta] Fix comment for /block logic
Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>