Commit Graph

36 Commits

Author SHA1 Message Date
Prajjwol Gautam
0777d0b670
Merge pull request from GHSA-mx3r-7hpq-fr4g
* reject invalid `MsgEthereumTx` wrapping tx

Update CHANGELOG.md

* added a unit test

* reject invalid `MsgEthereumTx` wrapping tx in a non-breaking way

Update CHANGELOG.md

* delete code and state on suicide

* fix suicide tests

* update changelog

* update changelog

* delete code hash on suicide

* simplifies delete code

* Apply suggestions from code review

* Update app/ante/ante.go

Co-authored-by: Tomas Tauber <2410580+tomtau@users.noreply.github.com>
Co-authored-by: Freddy Caceres <freddy.caceres@crypto.com>
Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
2021-12-23 08:07:23 -08:00
yihuang
9828964f1f
fix: remove redundant ante handler (#819)
* remove redundant ante handler

They are already checked in EthValidateBasicDecorator

* changelog
2021-12-15 02:53:03 +00:00
yihuang
ccc6f5b53d
fix: use EffectiveGasPrice in ante handler for dynamic fee tx (#817)
* Use effectiveGasPrice in ante handler for dynamic fee tx

Closes: #814

Solution:
- use effectiveGasPrice when check minimal-gas-prices, and deduct fee in ante handler
- implement an EthMempoolFeeDecorator

* add effectiveGasPrice to tx receipt

* changelog

* fix unit test

* fix comments

* add comments

* Apply suggestions from code review

Co-authored-by: Thomas Nguy <81727899+thomas-nguy@users.noreply.github.com>

* review suggestions

Co-authored-by: Thomas Nguy <81727899+thomas-nguy@users.noreply.github.com>
Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
2021-12-15 02:17:03 +00:00
yihuang
c8d4d3f9a3
fix: improve error message in SendTransaction json-rpc api (#786)
* fix error message in `SendTransaction` json-rpc api

Closes: #785

Solution:
- Remove `stacktrace.Propagate`s, and recover error message in jsonrpc server

changelog

fix error messages

* Update x/evm/keeper/msg_server.go

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
2021-11-26 15:19:28 +01:00
Adu
e04422b6ff
fix: tx fields are not authenticated by signature (#703)
Co-authored-by: Muggle-Du <adudu@CNMAC0342.local>
2021-11-08 14:00:35 +01:00
Federico Kunze Küllmer
b1aedf9a2a
deps: bump IBC-go (#693)
* deps: bump IBC-go

* fix
2021-10-22 15:38:52 +02:00
Federico Kunze Küllmer
fb9adf979c
evm: geth 1.10.9 fee market changes to Keeper and AnteHandler (#620)
* evm: geth 1.10.9 fee market changes

* update

* changelog
2021-10-04 14:58:06 +00:00
Federico Kunze Küllmer
692fd9548a
ante: move deduct gas to EVM keeper (#584) 2021-09-22 10:26:29 +00:00
Ramiro Carlucho
3f19217d7f
ante, evm: AnteHandler refactor (#517)
* Refactor fees function

* Implement suggestions

* wip test

* checksenderbalance tests

* wip deductcost test

* Tests fixes

* Merge master and fix conflicts

* Merging account and bank interfaces

* Update x/evm/keeper/utils.go

Co-authored-by: Hanchon <guillermo.paoletti@gmail.com>
Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
2021-09-03 15:55:37 +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
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
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
d40c49834c
deps: bump ibc-go (#360)
* deps: bump ibc-go

* ibc ante decorator

* c++
2021-07-26 19:26:53 +00: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
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
Federico Kunze
6000ab2098
chore: un-fork from cosmos (#166)
* chore: un-fork from cosmos

* rm LoC
2021-06-22 06:49:18 -04:00
yihuang
91ad6387bf
ante: ignore no signature error for evm transactions (#143)
fixes #118

don't sign unit test tx

since that's the same case as real tx

comment EthValidateBasicDecorator
2021-06-21 06:44:37 -04:00
yihuang
eee53a9500
ante: add ValidateMemoDecorator evm tx (#150)
fixes #149
2021-06-21 03:59:45 -04:00
Federico Kunze
7f72891c09
ante: add stacktrace (#123) 2021-06-15 03:19:31 -04:00
Federico Kunze
b77aab43bb
evm: refactor state transition (#41)
* evm: keeper statedb refactor

* keeper: implement stateDB account, balance, nonce and suicide functions

* keeper: implement stateDB code and iterator functions

* keeper: implement stateDB log and preimage functions

* update code to use CommitStateDB

* tests updates

* journal changes (wip)

* cache fields

* journal and logs

* minor cleanup

* evm: state transition refactor

* evm: unpack revert errors

* evm: update state transition (wip)

* evm: remove journal related changes

* evm: delete empty account code and storage state

* update gas limit

* evm: header hash to/from context

* evm: minor params and state transition changes

* ante: state transition changes

* ante: refactor default sig gas consumer

* ante: ignore gas costs from ops other than intrinsic gas

* ante: CanTransferDecorator

* evm: refund gas

* update comments

* state transition comments

* ante: CanTransfer and AccessList decorator tests

* evm: cleanup state transition

* ignore nonce increment during ante handler on contract creation

* fix ante tests

* more test fixes
2021-06-02 04:52:53 -04:00
Federico Kunze
9a5654f70d
ante: AnteHandler changes from state transition refactor (#56)
* ante: cherry-pick changes from state transition refactor

* ante: test setup

* ante: fixes

* ante: test (wip)

* ante: finish unit tests

* ante: intrinsic gas test

* ante: chaindecorators test (wip)

* update tests

* ante: cleanup tests

* ante: add test consuption test
2021-05-31 05:05:32 -04:00
Federico Kunze
6c1e7fec01
app, ante, evm: Keeper StateDB refactor (#30)
* evm: keeper statedb refactor

* keeper: implement stateDB account, balance, nonce and suicide functions

* keeper: implement stateDB code and iterator functions

* keeper: implement stateDB log and preimage functions

* update code to use CommitStateDB

* tests updates

* journal changes (wip)

* cache fields

* journal and logs

* minor cleanup

* evm: remove journal related changes

* evm: delete empty account code and storage state

* app, evm: transient store

* ante, evm: refund gas transient

* evm: remove transient keeper state fields

* address comments from review

* evm: undo revision change
2021-05-25 08:56:36 -04:00
Federico Kunze
65453e4aa0
rpc, evm: secure tx signing (#20)
* rpc, evm: secure signing

* evm, ante: test signer

* tests
2021-05-12 09:08:31 -04:00
Federico Kunze
117342b1b3
all, deps: bump go-ethereum version (#5)
* evm, rpc: access lists, JSON-RPC and transaction updates (wip)

* ante, evm, rpc: update signature verification

* evm: msg server and tests updates

* evm: tests (wip)

* evm: fix cdc and params

* evm: cleanup state transition

* fix nil cases

* lint
2021-05-10 12:34:00 -04:00
Federico Kunze
cb2ab3d95d
more fixes 2021-04-18 18:39:15 +02:00
Federico Kunze
5a3d514ba0
conflicts 2021-04-17 12:00:07 +02:00
Federico Kunze
4e01da905a
crypto: refactor for stargate (#559)
* changelog

* update changelog

* crypto: refactor for stargate

* fixes

* fix keys

* changelog
2020-10-06 20:57:55 +02:00
Federico Kunze
1f4f7fb017
ante: add message validation decorator (#525)
* ante: add message validation decorator

* changelog

* fix lint

* fix lint

* rename
2020-09-23 11:49:20 -03:00
noot
517de55720
fix account sending from new accounts (#517)
* fix account sending from new accounts

* cleanup

* more cleanup

* fix rpc tests

Co-authored-by: araskachoi <choidanielw@gmail.com>
2020-09-17 15:04:36 -07:00
Federico Kunze
792c1ff756
evm: params (#458)
* evm: params

* setup

* bump commit

* fixes

* increase gas usage

* tests

* evm denom param

* more config updates

* update genesis

* update ante handler

* csdb param test

* more tests and fixes

* update statedb.Copy

* lint

* additional test

* fix importer tests

* fix AnteHandler test

* minor update

* revert

* undo gas update

* stringer test

* changelog

* fix csdb index error (#493)

* attempt to fix

* cleanup

* add idx check

* update csdb.Copy

* update default hash

* update querier

* update rpc tests

* fix estimate gas test

Co-authored-by: noot <36753753+noot@users.noreply.github.com>
Co-authored-by: noot <elizabethjbinks@gmail.com>
2020-09-02 15:41:05 -04:00
Federico Kunze
261f86fdf2
bump SDK to v0.39.1 (#386)
* bump sdk version to v0.39.0 candidate

* updates

* update evm

* bump commit

* more changes

* build

* genesis

* fix tests

* fix tests

* bump commit

* bump commit

* bump commit

* add keygen func

* bump version to 0.39.0-rc0

* update AnteHandler

* fix TxDecoder

* lint

* fix test

* update statedb

* changelog

* fixes

* remove extra files

* update make test-import

* rename test

* bump SDK version to final release

* update to 0.39.1-rc1

* fix evm tests

* update RPC

* minor fixes

* update to rc2

* bump to v0.39.1

* fix personal API

* fix string type cast ambiguity (#449)

* init

* fix estimate gas test

* minor genesis change

* remove comments from unstable commit (stargate release)

Co-authored-by: Alessio Treglia <quadrispro@ubuntu.com>
2020-08-23 17:41:54 -04:00
noot
1f63ddfe96
evm: update msgs to accept zero gas price (#299)
* update keeper to accept gas price=0; default pending to latest

* cleanup

* more cleanup

* more cleanup

* more cleanup

* more cleanup

* ante: copy IncrementSequenceDecorator from SDK's AnteHandler

* improve bloom test

* lint

* update msg error

Co-authored-by: Federico Kunze <federico.kunze94@gmail.com>
Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
2020-05-14 22:08:13 -04:00
Federico Kunze
4d609b2a22
bump Cosmos SDK version to v0.38.2 (#183)
* evm: move Keeper and Querier to /keeper package

* keeper: update keeper_test.go

* fix format

* evm: use aliased types

* bump SDK version to v0.38.1

* app: updates from new version

* errors: switch sdk.Error -> error

* errors: switch sdk.Error -> error. Continuation

* more fixes

* update app/

* update keys and client pkgs

* build

* fix tests

* lint

* minor changes

* changelog

* address @austinbell comments

* Fix keyring usage in rpc API and CLI

* fix keyring

* break line

* Misc cleanup (#188)

* evm: move Begin and EndBlock to abci.go

* evm: use expected keeper interfaces

* app: use EthermintApp for integration and unit test setup

* evm: remove count type; update codec

* go mod verify

* evm: rename msgs for consistency

* evm: events

* minor cleanup

* lint

* ante: update tests

* changelog

* nolint

* evm: update statedb to create ethermint Account instead of BaseAccount

* fix importer test

* address @austinabell comments

* update README

* changelog

* evm: update codec

* fix event sender

* store logs in keeper after transition (#210)

* add some comments

* begin log handler test

* update TransitionCSDB to return ReturnData

* use rlp for result data encode/decode

* update tests

* implement SetBlockLogs

* implement GetBlockLogs

* test log set/get

* update keeper get/set logs to use hash as key

* fix test

* move logsKey to csdb

* attempt to fix test

* attempt to fix test

* attempt to fix test

* lint

* lint

* lint

* save logs after handling msg

* update k.Logs

* cleanup

* remove unused

* fix issues

* comment out handler test

* address comments

* lint

* fix handler test

* address comments

* use amino

* lint

* address comments

* merge

* fix encoding bug

* minor fix

* rpc: error handling

* rpc: simulate only returns gasConsumed

* rpc: error ineffassign

* go: bump version to 1.14 and SDK version to latest master

* rpc: fix simulation return value

* breaking changes from SDK

* sdk: breaking changes; build

* tests: fixes

* minor fix

* proto: ethermint types attempt

* proto: define EthAccount proto type and extend sdk std.Codec

* evm: fix panic on handler test

* evm: minor state object changes

* cleanup

* tests: update test-importer

* fix pubkey registration

* lint

* cleanup

* more test checks for importer

* minor change

* codec fixes

* rm init func

* fix importer test build

* fix marshaling for TxDecoder

* use amino codec for evm

* fix marshaling for SimulationResponse

* use jsonpb for unmarshaling

* fix method handler crashed

* return err on VerifySig

* switch stateObject balance to sdk.Int

* fixes to codec and encoding

* cleanup

* set tmhash -> ethhash in state transition

* add tmhash->ethereumhash to csdb.GetLogs

* attempt to  fix tests

* update GetLogs to switch with Has

* ante panic

* diff changes

* update SetLogs

* evm/cli: use ethermint codec

* use LengthPrefixed for encoding

* add check for nil *big.Int

* add balance to UpdateAccounts

* fix previous balance

* fix balance bug

* prevent panic on make test-import

Co-authored-by: austinabell <austinabell8@gmail.com>
Co-authored-by: noot <36753753+noot@users.noreply.github.com>
Co-authored-by: noot <elizabethjbinks@gmail.com>
2020-04-22 15:26:01 -04:00
Federico Kunze
5b2f068a03
ante: switch ethAnteHandler to use AnteDecorators (#252)
* ante: switch ethAnteHandler to use AnteDecorators

* ante: cleanup panic recover, update MsgEthereumTx GetSigners

* ante: remove EthIntrinsicGasDecorator in favor of EthGasConsumeDecorator

* migrate errors
2020-04-17 18:32:01 -04:00
Federico Kunze
c30205cae9
error migration (#254)
* migrate errors

* ante handler errors

* return err instead of panic
2020-04-16 11:47:39 -04:00
Federico Kunze
da9157e406
upgrade changes cleanup (#236)
* changes from update version

* app changes

* cmd changes

* build and send tx

* fix tests

* eth_rpc fixes

* lint

* add WithEventManager to handler ctx

* changelog

* go mod verify and tidy
2020-04-01 15:49:21 -03:00