Commit Graph

223 Commits

Author SHA1 Message Date
JayT106
9a8827e790
evm: increase performance of tx Log storage (#461)
* revise the way of the logs store into the stateDB

* wording

* refine GetTxLogs/SetLogs

* nit

* add bytes_uint16 convert helper

* using helper to instead of big.Int

* nit

* helper tests and fixes

* handle the logs length in SetLogs

* revise Get/Set logs with store.iterator

* remove Bytes<->Uint16 functions

* remove unused const

* simplify SetLog(s)

* make logs return determinism

* Add comments

* update changelog

* Update CHANGELOG.md

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
2021-08-31 08:32:11 +00:00
yihuang
a5ab608336
evm: benchmark contract execution (#436)
Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
2021-08-30 03:14:58 +00:00
Federico Kunze Küllmer
7389770b10
ci: lint (#500) 2021-08-26 15:45:45 +00:00
Federico Kunze Küllmer
b5288399d3
ci: liveness test (#498)
* ci: liveness test

* rm key

* makefile

* chmod

* update docs
2021-08-26 15:21:43 +00:00
Federico Kunze Küllmer
f469db94ef
feat: fee market module (#491)
* feat: fee market module

* update proto

* queriers: CLI + gRPC

* gov params

* genesis

* enable height

* fixes

* fix app
2021-08-26 10:08:11 +00:00
Federico Kunze Küllmer
1ad9b4c1a5
evm: EIP1559 & go-ethereum related updates (#469)
* updates

* more changes

* proto updates

* tidy

* v1beta1

* update buf

* lint

* comments

* typo
2021-08-25 14:45:51 +00: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
crypto-facs
fc46430e0f
evm: decouple tracer from evm creation (#459) 2021-08-19 04:18:20 -04: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
Federico Kunze Küllmer
6f5f15fc6d
proto: v1alpha to v1 (#448)
* proto: v1alpha to v1

* c++

* go mod
2021-08-17 15:30:35 +00:00
Federico Kunze Küllmer
aa1b728d34
feat: update chain-id format (#447)
* feat: update chain-id format

* c++

* docs

* additional context'
2021-08-17 14:11:26 +00:00
Federico Kunze Küllmer
cc3b2ff8e9
evm, server: configurable tracer (#434)
* server: update server and enable configurable tracer

* config validation

* fix import cycle

* fix start

* update fields

* c++

* c++
2021-08-16 09:45:10 +00:00
yihuang
353455def9
evm: prepare access list in eth_call (#348)
Closes: #335

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
2021-08-16 08:19:27 +00:00
Federico Kunze Küllmer
ff8f63e99b
evm: fix params (#437) 2021-08-15 14:54:44 +00:00
Federico Kunze Küllmer
10f0164181
docs: additional content (#430)
* docs: additional content

* testnet and intro
2021-08-11 12:51:18 +00:00
yihuang
9227e78c79
evm: use stack of contexts to implement snapshot revert (#399)
* use stack of contexts to implement snapshot revert

Closes #338

add exception revert test case

verify partial revert

mutate state after the reverted subcall

polish

update comments

name the module after the type name

remove the unnecessary Snapshot in outer layer

and add snapshot unit test

assert context stack is clean after tx processing

cleanups

fix context revert

fix comments

update comments

it's ok to commit in failed case too

Update x/evm/keeper/context_stack.go

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

Update x/evm/keeper/context_stack.go

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

Update x/evm/keeper/context_stack.go

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

update comment and error message

add comment to cacheContext

k -> cs

Update x/evm/keeper/context_stack.go

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

evm can handle state revert

renames and unit tests

* use table driven tests

* keep all the cosmos events

* changelog

* check for if commit function is nil

* fix changelog

* Update x/evm/keeper/context_stack.go

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
2021-08-10 07:22:46 +00:00
yihuang
73c2f8e529
evm: re-emit the cosmos events from cache context (#415)
Closes: #414
2021-08-09 09:38:43 +00:00
Federico Kunze Küllmer
098da6d0cc
evm: code comments and cleanup (#404)
* evm: code comments and cleanup

* context comment

* abci, tx type event and metrics

* statedb comments
2021-08-05 16:24:06 +00:00
yihuang
9bf3659718
evm: use clean context for GetCommittedState (#383)
* keep the original context for GetCommittedState api

* fix method mutation

* keep estimateGas consistant

* added test after the original context is recovered

* add integration test for the gas consumption of sstore

* test the committed case

* move methods to keeper module

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
2021-08-04 07:49:02 +00:00
Federico Kunze Küllmer
f7bcc8d12e
docs: first update (#188)
* docs: update

* update +

* txs

* update docs

* more docs

* spec update

* doc fixes
2021-08-03 17:35:31 +00:00
Federico Kunze Küllmer
9b9c835266
evm: dynamic fee tx (#384)
* evm: dynamic fee tx

* proto message

* fix

* lint
2021-07-30 11:40:17 +00: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
bc2a2eb8f3
evm: fix get storage (#375) 2021-07-27 14:33:56 +00:00
yihuang
54581269b8
evm: change log tx index to index in block (#354)
Closes #334
2021-07-26 04:40:59 -04:00
yihuang
2828fa1e62
evm: fix keep balance when resetting an account (#353)
* keep balance when override account

* Update CHANGELOG.md

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
2021-07-26 08:15:59 +00:00
yihuang
f6dc80d949
evm: estimate gas unit tests (#324)
* add some unit tests for estimateGas

Also add some test environment setup, Closes #323

test estimateGas of erc20 token transfer

fix failed test case

the trick is to keep a clean transient store, by doing a commit

put artifacts to external file

* fix test failure

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
2021-07-23 14:24:36 +00:00
yihuang
d54663c0b8
evm: fix infinite context usage on EndBlock (#329)
The previous code is not incorrect since the method `SetBlockBloom` use the `ctx` passed in rather than the `k.ctx`.
It's confusing that sometimes methods use ctx in parameter, sometimes use `k.ctx`, but that's another issue.

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
2021-07-21 11:57:30 +00: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
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
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
9d1ce30ecd
evm: use block proposer address for COINBASE opcode (#291)
* evm: use block proposer address for COINBASE opcode

* test

* c++
2021-07-14 20:44:51 +00:00
yihuang
84febdddae
evm: fix ExtraEIP activation (#288)
Closes: #287
2021-07-14 11:10:31 +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
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
Federico Kunze Küllmer
c6dae31231
evm: fix BlockBloom not found for latest height (#263) 2021-07-12 10:25:15 +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
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
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
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
yihuang
036ffb7a39
evm: update block bloom (#193)
Closes #139
2021-06-30 03:37:03 -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
crypto-facs
1363a45e93
fix: remove zero address validation (#205)
* fix: remove zero address validation

* test: update test invalid Ethereum address

* test: fix ValidateBassic test for invalid To address input

* remove unnecesary comment

* fix: remove zero address validation

* test: update test invalid Ethereum address

* test: fix ValidateBassic test for invalid To address input

* remove unnecesary comment
2021-06-29 11:08:07 -04:00
yihuang
336703cfc9
evm: fix AddLog unmarshaling tx (#192)
* fix `AddLog` unmarshaling tx

Closes #187

* use cosmos tx in AddLog unit test

* Apply suggestions from code review

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
2021-06-29 06:54:29 -04:00