Commit Graph

30 Commits

Author SHA1 Message Date
yihuang
d6a64a275a
evm: fix import/export genesis for contract storage (#590)
* Problem: import/export roundtrip test fail contract storage

Closes: #589

- don't hash the key again in InitGenesis

* changelog

* try to fix estimate-gas undeterministics Closes #536
2021-09-27 12:26:45 +02:00
davcrypto
742b6d1300
evm: fail early on StateDB functions (#566)
* ADD stateErr on keeper

* UPDATE init stateErr

* UPDATE test case

* Update x/evm/keeper/statedb.go

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

* ADD comment

* UPDATE clear evm state error

* REMOVE unnecessary clear

* ADD comment

* UPDATE false value

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
2021-09-17 06:22:52 +00:00
yihuang
116de54617
evm: remove tx logs and block bloom from chain state (#556)
Closes #452

fix unit tests

changelog and fix lint

fix unit test

Update ethereum/rpc/backend/backend.go

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

Update ethereum/rpc/backend/utils.go

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

changelog

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
2021-09-15 09:45:03 +00:00
Federico Kunze Küllmer
26c5eabb18
all: linter (#532)
* add additional linters

* fixes

* rm action
2021-09-05 11:03:06 +00:00
Federico Kunze Küllmer
87c4ea2dc2
evm: benchmark state DB (#514)
* evm: benchmark state DB

* add more bech funcs

* rm func from interface
2021-08-31 12:50:31 +00:00
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
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
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
yihuang
54581269b8
evm: change log tx index to index in block (#354)
Closes #334
2021-07-26 04:40:59 -04: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
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
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
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
6000ab2098
chore: un-fork from cosmos (#166)
* chore: un-fork from cosmos

* rm LoC
2021-06-22 06:49:18 -04:00
Federico Kunze
4ca7c43b62
deps: bump SDK and Tendermint versions (#165)
* deps: bump SDK and Tendermint versions

* use header hash from context

* c++

* typo
2021-06-22 04:25:38 -04:00
hello-bwhour
d7da045fc4
ante: check that sender is a EOA (#125)
* ante: check that sender is a EOA

* fix: GetCodeSize handles nil case and comments

* docs: add TODO comment

* fix: use EmptyCodeHash check

* lint: evmtypes instead of types

* lint: fix suite error

* test: set code to act not as EOA

* undo comment on GetCodeSize

* keeper: fix input checks

* Apply suggestions from code review

Co-authored-by: Akash Khosla <me@akashkhosla.com>
Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
2021-06-15 13:39:41 -04:00
Akash Khosla
e3270aee5d
lint: fix many broken lint issues (#49)
* lint: fix many broken lint issues

* more lint issues resolved

* more lint issues resolved

* all actions issues fixed

* pin variables for websocket

* Update .github/workflows/lint.yml

* more fixes

* fix lint issues in pubsub, rpc, types

* fix lint issues in statedb, journal, pubsub, cli

* fix comment

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
2021-06-08 03:07:11 -04:00
Federico Kunze
e639cb4a82
evm: use TransientStore for AccessList (#75)
* evm: use transient store for access list

* evm: remove address and slot access list mappings

* update tests

* update

* changelog

* update types
2021-06-07 06:05:49 -04:00
Federico Kunze
c08dcfad0c
keeper: StateDB unit tests (#47)
* keeper: statedb unit tests

* evm: balance tests

* evm: nonce and code tests

* evm: refund test

* evm: fix tx encoding

* storage and access list tests
2021-06-02 04:06:12 -04:00
Federico Kunze
abcfc9a6ba
evm: error and block hash map updates (#60)
* evm: error and block hash map updates

* evm: update tests
2021-05-31 10:54:59 -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
614e62fb7e
additions 2021-04-18 17:54:18 +02:00
Ray Pierre
75fb3ccb89
fix incorrect blockHash in evm (#780)
* Fix wrong blockHash value in evm

* fix ut

* store current block hash in BeginBlock

* update ut

* update comment

* add changelog
2021-03-18 20:04:29 -07: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
Federico Kunze
c8b8f49675
run make format (#351)
* run make format

* fix yaml

* fixes
2020-07-02 11:19:48 -04:00
noot
28e28f2a7b
x/evm: fix EndBlock consensus failure (#334)
* add test for sending tx w/ 21000 gas

* improve rpc transfer test

* use ctx in EndBlock

* UpdateAccounts and ClearStateObjects with passed in context

* log ethereum address on error

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: Federico Kunze <federico.kunze94@gmail.com>
2020-06-22 12:07:35 -04:00
Federico Kunze
427e96c1de
evm: various fixes (#319)
* evm: use prefix stores, move SetBlockBloom to EndBlock, bug fixes

* add logs to genesis state

* log tests

* commit and finalize on InitGenesis

* validate TransactionLogs

* changelog

* fix test-import

* fix lint

* add more tests
2020-06-04 06:40:21 -04:00
Federico Kunze
16df7725c5
evm: add missing genesis fields and export genesis state logic (#255)
* evm: export genesis state

* x/evm: split keeper.go

* x/evm: retrieve storage from address

* changelog

* fixes

* add check for nil logs

* update validation func

* fixes

* fix non-determinism

* stop storage iteration

* remove error return value

* update changelog

* fix test

* lint
2020-05-18 15:21:12 -04:00