Commit Graph

83 Commits

Author SHA1 Message Date
Federico Kunze Küllmer
7389770b10
ci: lint (#500) 2021-08-26 15:45:45 +00:00
Thomas Nguy
4ea3cc190e
rpc: add EIP1898 support (#462)
* support for eip1898

* update changelog

* fix linter

* fix linter

* refactor code

* add test

* support for eip1898

* update changelog

* fix linter

* fix linter

* refactor code

* add test

* cleanup code

* add comment

* create const for block param

* change default to be earliest to be consistant with geth

* correct comment

* update doc

* update doc

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
2021-08-25 01:21:57 +00:00
Guillermo Paoletti
204c361043
docs: miner namespace (#481)
* miner_namespace docs

* use GetConfig to maintain user configuration instead of the default

* Minimal changes to the docs

* Changelog updated

Co-authored-by: ramacarlucho <ramirocarlucho@gmail.com>
2021-08-23 13:47:09 -04:00
Federico Kunze Küllmer
d068f5b331
server: logger handler (#343)
* Problem: verbose logs display with FATAL option (fix #320)
add my script

increase amount for metamask

add run

amount ok

hide log

show info

my logger

hook log

revive eth log

tidy up

use suplog

log replace ok

removed suplog

tidy up

tidy up

fix compile

remove sh

tidy up

tidy up

* logger handler

* fix

* fix eth log override (#371)

remove redundant log

tidy up

* log test

* c++

Co-authored-by: jongwhan lee <jonghwan@crypto.com>
Co-authored-by: Jongwhan Lee <51560997+leejw51crypto@users.noreply.github.com>
2021-08-19 16:55:13 +00:00
Federico Kunze Küllmer
83c838330f
rpc: configure gas cap (#457)
* rpc: configure gas cap

* c++

* rm old const

* docs
2021-08-18 14:11:51 +00:00
Thomas Nguy
52f42b5ff4
rpc: fix get transaction by hash (#428)
* fix get transaction by hash

* add test case
2021-08-11 07:15:11 -04:00
crypto-facs
640684c648
rpc: refactor backend package (#418)
* backend refractor

* Revert init file changes

* fix linter issues

* Update ethereum/rpc/namespaces/personal/api.go

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
2021-08-10 10:04:16 +00:00
Ramiro Carlucho
bfb9943af3
fix fee value (#396) 2021-08-04 16:10:08 +00:00
Guillermo Paoletti
396db9f20a
rpc: miner_ namespace (#377)
* miner namespace

* SetGasPrice call

* Added note plus fixed error logging

* Refactor to use the keyring in the miner namespace

* Changed keyring function return

* Added more detailed logs to unsupported functions

* Reverted changes on ethapi and just using a refrence to it on miner

* Creating a transaction

* fix condition

* Error string not capitalized

* suggested changes to setEtherbase

* change log level

* minor changes

* minor changes

* Sending tx to test the endpoint

* get tx nonce

* Using aphoton const and changing the logger to debug

* Using default RPC gas limit constant

* Apply suggestions from code review

Renames and log changes

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>

* pair programming session

* get gas

* Set gas prices note added

* Setting fess and max gas

* delete unnecessary log

* Apply suggestions from code review

return false in case of error

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>

* Suggested changes applied

* Updated changelog and json_rpc docs

* Update CHANGELOG.md

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>

* Update ethereum/rpc/namespaces/miner/api.go

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>

* Update ethereum/rpc/namespaces/miner/api.go

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>

* Update ethereum/rpc/namespaces/miner/api.go

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>

* Update ethereum/rpc/namespaces/miner/api.go

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>

* Using the same coin denom as the gas price for the fee

Co-authored-by: ramacarlucho <ramirocarlucho@gmail.com>
Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: Federico Kunze <federico.kunze94@gmail.com>
2021-08-04 09:18:22 +00:00
crypto-facs
c4aa8fafab
fix: Extra data empty response (#381) 2021-07-29 13:40:59 -04:00
Thomas Nguy
63aa0de1e8
evm: update error format (#350)
* return geth error format

* fix format in gasestimate

* deal with other evm errors

* fix import

* fix lint

* add test

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
2021-07-28 15:50:05 +00:00
Federico Kunze Küllmer
09746c6a51
feat: import ethermint without forking (#378)
* cmd: cleanup

* update gh action

* lint

* more cleanup

* update config

* register denom
2021-07-28 05:47:29 -04:00
crypto-facs
d1212725f8
feat: configurable JSON-RPC APIs (#349)
* fix confusing name

* feat: Enable configurable grpc apis

* docs: Update docs and changelog

* Organized flags order

* fix linter

* fix linter

* fix maligned struct

* fix typo in docs

* fix unnecesary duplicate

* Update cmd/ethermintd/config/config.go

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>

* Update cmd/ethermintd/config/config.go

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>

* Update cmd/ethermintd/config/config.go

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>

* Update docs/basics/json_rpc.md

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>

* fix eth to be manage as default

* Update init.sh

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>

* Update tests/solidity/init-test-node.sh

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>

* add default case

* add default enable api namespaces

* update changelog

* fix namespaces array  handler

* remove duplicated changelog

* fix typo

* remove duplicates namespaces and fix eth namespace issue

* fix variable name

* break line in docs

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
2021-07-26 11:15:55 +00:00
yihuang
3f136bf5d6
rpc: return ABCI state's latest block number (#331)
* return abci state's latest block number in rpc

Closes #318

* Update ethereum/rpc/backend/backend.go

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>

* add comments

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
2021-07-22 11:06:44 -04:00
Thomas Nguy
0276f3465d
rpc: fix Bloom filter response (#321)
* fix bloomfilter in rpc response

* add comments
2021-07-20 15:16:02 +00:00
Guillermo Paoletti
282eb13a6f
rpc: implement internal debug_ API namespace functions (#313)
* API Hello World

* Added all the debug functions + more data to try implementing the GC functions

* Getting transactions information

* Added cpu profile first approach functions

* new struct for cpuprofile and read filename from params

* cpuprofile, gcstats and memstats

* added comment

* All endpoints returns error instead of string

* Code cleanup

* Changed errors messages to match go-eth returns

* Removed activated flag and just using the file to check if it's running

* Added new endpoints to the json_rpc.md file

* GoTrace debug endpoints added

* Block profile endpoint added

* missing goeth calls

* added debug logs

* divide debug and internal api

* Using ExpandHome on server configuration

* Added rpc changes to changelog

* Logging go trace status

* Removed logger functions and moved logger errors to debug

* Added more logs to go trace

* Added more datailed changelog

* Removed trace debug api interface

* added comments

* cleanup

* Updated changelog

* disable lint on cpuprofile rename

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>

* return error in StopCpuProfile

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>

* return error in StopGoTrace

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>

* implement suggested changes

Co-authored-by: ramacarlucho <ramirocarlucho@gmail.com>
Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
2021-07-20 12:50:17 +00:00
yihuang
14b38af8bc
rpc, evm: use binary search to estimate gas (#272)
* do binary search to estimate gas

Closes #268

- Also refactor ApplyMessage to be more reuseable

move binary search to rpc api side to have a clean context each try

remove EstimateGas grpc api

* extract BinSearch function and add unit test

* do estimateGas in grpc query

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
2021-07-19 15:19:23 +00:00
Thomas Nguy
c8b88a3a8b
evm, rpc: fix parameters and block gas limit in getBlockByHeight and getBlockByHash (#312)
* fix evm set parameters

* recompute header hash only if its not set

* Update x/evm/keeper/state_transition.go

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
2021-07-19 01:52:44 +00:00
Calvin Lau
071ae3f618
rpc: fix eth_getBlockTransactionCountByNumber crash on block not found (#254)
* Fix GetBlockTransactionCountByNumber crashed on block not found

* Fix getTransactionByBlock*

* Update log based on review

* Apply suggestions from code review

* Update ethereum/rpc/namespaces/eth/api.go

* Apply suggestions from code review

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
2021-07-16 10:13:15 +00:00
Thomas Nguy
6aa43305ee
rpc: fix EthLatestBlockNumber value (#300)
Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
2021-07-15 11:07:23 +00:00
yihuang
297a35dbdd
evm: treat all vm errors the same as reverted (#276)
Closes: #274

evm: fix `ExtraEIP` activation (#288)

Closes: #287

Update x/evm/types/utils.go

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>

Add `Failed` utility function and changelog
2021-07-15 02:01:05 -04:00
Federico Kunze Küllmer
5e87661e4c
rpc: display block proposer address as the miner address (#290)
* rpc: display proser address as the miner address

* use validator operator address
2021-07-14 14:40:32 +00:00
Thomas Nguy
aab793e7f4
rpc: fix BlockBloom not found in header (#258)
* fix context index

* return default bloom if cannot be found

* fix blockbloom error

* fix setting blockbloom transient in ctx

* clean comments

* remove unused method

* update changelog

* Update CHANGELOG.md

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
2021-07-14 09:40:58 +00:00
Federico Kunze Küllmer
e09bf23bd0
evm: move ChainConfig to Params (#266)
* evm: move ChainConfig to Params

* fixes

* fix test
2021-07-14 05:13:55 -04:00
Federico Kunze Küllmer
74b7eaf431
rpc: fix inconsistent logging levels (#265)
* rpc: fix incosistent logging levels

* minor changes
2021-07-12 18:39:35 +00:00
yihuang
1a48e09e78
rpc: implement eth_getPendingTransactions (#259)
* Implement `eth_getPendingTransactions`

Closes #244

* refactor repeatitive code

* Update ethereum/rpc/namespaces/eth/api.go

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>

* Update ethereum/rpc/namespaces/eth/api.go

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>

* Update ethereum/rpc/namespaces/eth/api.go

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>

* Update ethereum/rpc/namespaces/eth/api.go

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>

* test UnwrapEthereumMsg

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
2021-07-12 17:42:53 +00:00
Calvin Lau
8d51a70d6d
rpc: fix GetBlockByHash crash on block not found (#256)
* Fix GetBlockByHash crashed on block not found

* Add and update log message based on review

* Apply suggestions from code review

* Apply suggestions from code review

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
2021-07-12 12:45:13 +00:00
Calvin Lau
8bfb6b0a67
rpc: implement net_listening and net_peerCount JSON-RPC endpoints (#252)
* Add net_listening net_peerCount endpoint

* Add test cases

* Use RPC client from context

* Fix lint issue

* Revert unnecessary changes

* Update JSON RPC documentation
2021-07-12 08:26:33 -04:00
yihuang
8f73d556c6
rpc: fix eth_getTransactionByHash tx in mempool (#261)
Closes #260

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
2021-07-12 10:34:47 +00:00
yihuang
0020e4f2cd
grpc: add eth_call query command (#236)
* add eth_call query command

Implement EthCall grpc query api

Closes #229

add eth_call query command

fix codec issue

use query client

use grpc status error and codes

validate address length in grpc handler

* Update x/evm/types/callargs.go

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
2021-07-09 09:04:46 +00:00
yihuang
7951852bb0
rpc: implement pending nonce with UnconfirmedTx (#243)
* implement pending nonce with UnconfirmedTx

Closes #242

fix lint

* return early on error
2021-07-09 04:34:49 -04:00
yihuang
d0b890b794
rpc: support query historical state for GetTransactionCount (#241)
Closes #240
2021-07-09 02:19:20 -04:00
Federico Kunze Küllmer
623863231b
evm, rpc: query ChainConfig via gRPC (#239)
* evm, rpc: query ChainConfig via gRPC

* c++
2021-07-08 14:46:42 +00:00
Thomas Nguy
3a398d9237
rpc: fix DecodeTx (#227)
* fix decodeTx method

* fix logic

* fix singleswitchstatement lint error

* refactor logic

* add log

* remove unecessary function

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
2021-07-08 08:23:59 +00:00
Thomas Nguy
735f00d4a3
evm: store reverted tx as not failed (#228)
* add tx when evm revert

* add comment

* use cache ctx

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
2021-07-08 08:14:11 +00:00
Federico Kunze Küllmer
5f1f252361
evm: TxData as proto.Any (#220)
* evm: TxData as proto.Any

* proto message

* fix protobuf any generation

* Int pointer

* fix build and tests

* ante tests

* swagger

* cleanup

* c++
2021-07-05 16:39:08 +00:00
crypto-facs
0fc3472705
rpc: fix parent hash format (#222) 2021-07-03 06:21:17 -04:00
yihuang
e6f1874cfc
rpc: extract sender address from msg signature (#217)
* extract real from address in rpc tx query api

Closes: #210

* Update x/evm/types/msg.go

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
2021-07-02 09:34:15 +00:00
yihuang
6e983a9da1
rpc: fix balance overflow (#219)
Closes #218
2021-07-02 05:29:47 -04:00
Federico Kunze Küllmer
86e30e8fa3
feat: use sdk.Int for TxData (#208)
* feat: use sdk.Int for TxData

* c++

* fix

* fix test

* fix rpc

* lint
2021-06-30 15:28:38 +00:00
yihuang
0113b4d2c0
fix: return ethereum-formatted tx hash to client (#202)
* return eth tx hash to client

Closes #67

Update ethereum/rpc/namespaces/eth/api.go

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>

Update ethereum/rpc/namespaces/eth/api.go

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>

change GetTxByEthHash to method

add entry to changelog

* use eth tx hash internally
2021-06-30 05:35:11 -04:00
Thomas Nguy
5ba8ffe669
ante, evm: update gas consumption logic (#178)
* clean up logic by ignoring cosmos gas meter

* set gas used in txResponse

* reset and set the gas in context

* rename ante handler

* fix refundedgas logic

* remove gas update logic in keeper

* update context in keeper

* add test for EthSetupContextDecorator

* fix broken test due to gas logic change
2021-06-30 05:31:30 -04:00
Thomas Nguy
3b3daa4b48
rpc: support fetching pending nonce (#191)
* consider mempool tx when computing account nonce

* fix lint

* add condition on blocknbr

* add log

* update changelog
:

* cleanup
2021-06-30 03:30:01 -04:00
Federico Kunze Küllmer
dcc9585595
all: bump SDK to v0.43.0-rc0 (#194)
* all: bump SDK to v0.43.0-rc0

* more updates

* keys

* accounting

* update account

* ante changes

* readonly

* readonly build

* minor changes from self review

* fixes

* evm debug

* custom config & rosetta

* fix
2021-06-29 13:02:21 -04:00
Jongwhan Lee
a2e3d35df2
rpc: fix JSON-RPC block extraData (#204) 2021-06-29 11:05:12 -04:00
Thomas Nguy
61260dfda8
fix linter issues (#184) 2021-06-25 04:31:57 -04:00
Federico Kunze
365c96acfa
evm: update log tx hash key (#182)
* evm: update log tx hash key

* update test
2021-06-24 12:05:45 -04:00
Federico Kunze
0f3a346cdc
rpc: use evm denom for tx fee (#181)
* rpc: use evm denom for tx fee

* changelog
2021-06-24 04:22:36 -04:00
Thomas Nguy
b7f00d5a07
rpc: fix nil pointer exception when parameters are nil (#180)
* fix nil pointer exception when parameters are nil

* Update ethereum/rpc/types/types.go

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
2021-06-24 03:57:51 -04:00
crypto-facs
1c06553746
rpc: namespaces refractor (#170)
* refactor: rpc namespace refactor - txpool

* refactor: rpc namespace refactor - net

* refactor: rpc namespace refactor - web3

* refactor: rpc namespace refactor - eth

* refactor: rpc namespace refactor - personal

* fix: api to uppercase

* fix: fix import cycle

* fix: fix import cycle
2021-06-23 02:38:05 -04:00