Commit Graph

95 Commits

Author SHA1 Message Date
noot
ca0a79f103
fix state object bugs causing tx reverts (#445) 2020-08-17 09:49:13 -04:00
Federico Kunze
375a7a074d
local testnet command (#378)
* evm: fix non-determinism

* fixes

* typo

* fix tests

* local testnet command

* fix testnet cmd (#383)

fix export-eth-key

generate eth type account in genesis.json file

* fixes

* update docker

* minor changes

* fix build-docker-local-ethermint

* fix dockerfile

* update Makefile

* update denoms

* update genesis file

* update makefile

* fix docker-compose.yml images

* fix localnet execution (#398)

* finish documentation

* changelog and comment rpc tests workflow

* update codecov

* update testnet docs

* fix docker-compose execution

* update docs

* fix errors and make testnet work (#403)

* fix errors and make testnet work

* Update Dockerfile

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

* wip - fix db

* fixes emintd nodes and syncs nodes

* starts daemon and rpc server in bg

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: Federico Kunze <federico.kunze94@gmail.com>

* update entrypoint and docs

* update logs

* try fix rpc

* build docker image

* Update Dockerfile

Co-authored-by: Holechain <nrgh@foxmail.com>
Co-authored-by: Alessio Treglia <quadrispro@ubuntu.com>
Co-authored-by: Daniel Choi <choidanielw@gmail.com>
2020-07-31 17:42:04 -04:00
Federico Kunze
de8d8acf77
x/evm: StateBD tests (#407)
* draft state_transition

* working test

* keeper test

* statedb rewrite

* fix tests

* add keeper statedb test

* minor changes

* x/evm: StateBD tests

* try fix

* fix stateObject.setState

* Update x/evm/types/state_object.go

* update stateObject.setState

* uncomment test

* increase coverage

* fix test-import

* update rpc tests

Co-authored-by: Justin Thompson <justin.thompson12@hotmail.com>
Co-authored-by: noot <elizabethjbinks@gmail.com>
2020-07-27 15:33:16 -04:00
noot
cc6b5d04f2
fix rpc-test action (#402) 2020-07-23 15:38:47 -04:00
Justin Thompson
d69aad2016
x/evm: stateDB and keeper tests (#396)
* draft state_transition

* working test

* keeper test

* statedb rewrite

* fix tests

* add keeper statedb test

* minor changes

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: Federico Kunze <federico.kunze94@gmail.com>
2020-07-23 14:30:31 -04:00
Federico Kunze
2fb4ab4862
x/evm: contract deploy test (#392)
* Add deploy and call test example to handler_test.go (#271)

* Add deploy and call test example to handler_test.go

* fmt the file

* remove the smartcontract Bytecode comment

Co-authored-by: liuxiong <xiong.liu@okcoin.net>
Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>

* fix test

Co-authored-by: Louis Liu <35095310+louisliu2048@users.noreply.github.com>
Co-authored-by: liuxiong <xiong.liu@okcoin.net>
2020-07-15 10:52:21 -04:00
Justin Thompson
6bc80c5357
x/evm: state_transition test (#389)
* draft state_transition

* working test

* keeper test

* Update x/evm/types/state_transition_test.go

* update state_transition_test.go

* failed Finalize test case

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: Federico Kunze <federico.kunze94@gmail.com>
2020-07-15 06:36:55 -04:00
Federico Kunze
90f39390bc
evm: fix non-determinism (#352)
* evm: fix non-determinism

* fixes

* typo

* fix tests

* use Storage slice

* more fixes

* lint

* merge development

* additional tests
2020-07-13 16:01:45 -04:00
Federico Kunze
42fc796595
x/evm: state_object tests (#388)
* x/evm: state_object tests

* tests

* commit tests

* finalize tests

* update
2020-07-13 13:44:28 -04:00
Federico Kunze
fef16af382
x/evm: journal tests (#384)
* x/evm: journal tests

* comment tests

* cleanup setup

* fixes

* add test for various logs

* lint

* minor fix
2020-07-13 12:30:24 -04:00
Federico Kunze
0cc1c40e34
x/evm: tests (#381)
* run suite

* add a few tests (#340)

* add a few tests

* fixes to tests

* add more tests

* check err to fix lint

* add preimage and refund tests

* add more more tests

* fix linting errs

* lint err

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

* set stateDB on suite

* fix genesis

* logs tests

* remove dup imports

Co-authored-by: Daniel Choi <choidanielw@gmail.com>
2020-07-08 14:11:02 -04:00
Federico Kunze
c8b8f49675
run make format (#351)
* run make format

* fix yaml

* fixes
2020-07-02 11:19:48 -04:00
Federico Kunze
d4fe9b234c
docs: vuepress setup and section titles (#311)
* vuepress

* docs: vuepress setup and TODOs

* doc scripts

* update Makefile and gitignore

* more docs updates

* gitignore

* metamask instructions

* update image

* updates

* updates from call

* docs: vuepress config and home.vue (#350)

* update uncles return (#337)

* 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>

* update Ethermint color variables

* add header and footer logo

* tweak config.js

* WIP custom homepage.vue

* add layout to docs/README

* update color variables

* add eth logo black and white

* tweak docs/README

* update logo and logo-bw svg

* bump 1.0.167

* homepage → home

* add icon-code, icon-rocket

* layout: home, remove configurable frontmatter: label, read, use

* clean up config.js

* bump 1.0.168

* fix missing comma from resolving conflicts

* update sidebar, config nav, path

* remove left whitespace on the header and footer logos

* clean up home.vue, docs/README

* update ethermint forum url in footer.links

* comment out custom true to enable searchbar in subpages

* remove external link icon for Guides

* comments, revert custom true

* clean up config.js, add specifications icon

Co-authored-by: noot <36753753+noot@users.noreply.github.com>
Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: Federico Kunze <federico.kunze94@gmail.com>

* final touches

Co-authored-by: Cyrus Goh <hello@lovincyrus.com>
Co-authored-by: noot <36753753+noot@users.noreply.github.com>
2020-07-02 04:22:45 -04:00
Federico Kunze
edf4357176
build: github actions (#346)
* add workflows

* fix

* fix lint

* rpc tests

* build and format

* fix build errors

* remove dontcover

* update importer test

* more fixes

* lint

* split importer test

* fix

* remove tmp dir

* revert

* comment test import
2020-06-26 18:26:55 -04:00
noot
8ba6400e88
fix value transfer (#341)
* debugging balance and gas

* add prints

* remove gas consumption in ante handler

* cleanup

* fix test
2020-06-24 05:38:53 -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
noot
9f573690a6
implement eth_exportAccount (#331) 2020-06-17 14:23:36 -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
noot
4fd9ec3a26
genesis functions cleanup, testing (#318) 2020-05-29 11:50:22 -04:00
Federico Kunze
3526ac12b2
evm: GenesisAccount validation (#317)
* evm: GenesisAccount validation

* changelog

* fix tests

* typo
2020-05-28 17:22:41 -04:00
Federico Kunze
5d15be6adb
update init script (#309)
* update init script

* rename faucet cmd
2020-05-20 17:29:26 -04:00
Federico Kunze
0351bef644
testnet faucet (#281)
* testnet faucet

* commands

* updates

* faucet module

* genesis state

* fixes

* module.go

* add module to app

* update Fund

* querier route

* querier

* CLI query

* fix query

* add rest routes

* update cli query
2020-05-18 17:33:08 -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
noot
846f48a572
get account sequence in GetTransactionCount (#303)
* get account sequence if querying latest in GetTransactionCount

* use ctx WithHeight in GetTransactionCount; remove nonce query from querier
2020-05-17 11:15:32 -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
noot
ce0feb307b
update rpc tests (#276)
* update rpc tests

* cleanup

* add log assertion to getTransacionReceipt

* fix queurier_test

* address comment
2020-05-04 18:02:26 -04:00
Federico Kunze
26d4e968e0
remove duplicate query in receipts (#273)
* logs tests

* updates

* String()

* remove extra query, add comments

* test fixes

* lint

* lint
2020-05-02 21:56:18 -04:00
Federico Kunze
d3c802f99e
x/evm: logger (#272)
* x/evm: logger

* changelog

* go mod verify and tidy

* typo
2020-04-29 23:36:30 -04:00
thomasmodeneis
5417b4bb54
migrate build to Travis #258 (#259)
* add travis file
* update lint so it reports properly
* disable circleci
* separate test structure into Verify deps & Lint, Unit Tests, Race Tests, Integration Tests
* fix path issue now evident on ci build err
* fixed golangci version to latest stable
* Upgrade ci lint to go script and avoid cache issues #268
* fix lint issues #268
* bump go version for travis build to match go.mod version recently updated with Cosmos SDK upgrade
* add panic for err edge cases on os.Stat
* increase timeout to 10m since its failing on jenkins
* bump GOLANGCI_VERSION to 1.23.8 in order to try avoiding some weird errors on CI
2020-04-29 22:38:57 +02:00
dependabot-preview[bot]
716181d9d5
Bump github.com/ethereum/go-ethereum from 1.9.0 to 1.9.13 (#256)
* Bump github.com/ethereum/go-ethereum from 1.9.0 to 1.9.13

Bumps [github.com/ethereum/go-ethereum](https://github.com/ethereum/go-ethereum) from 1.9.0 to 1.9.13.
- [Release notes](https://github.com/ethereum/go-ethereum/releases)
- [Commits](https://github.com/ethereum/go-ethereum/compare/v1.9.0...v1.9.13)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* add isEIP2028 param to IntrinsicGas

* go mod verify and tidy

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: Federico Kunze <federico.kunze94@gmail.com>
2020-04-23 13:21:23 -04:00
Federico Kunze
8ec7edf5bd
x/evm: unit tests and fixes (#223)
* 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

* rename GasLimit->Gas and Price ->GasPrice

* msg cleanup and tests

* cleanup TxData

* fix marshaling

* revert rename

* move types

* evm/keeper: querier tests

* switch MarshalLengthPrefixed -> BinaryBare; remove panics

* fix event sender

* fix panic

* try fix txDecoder error

* evm: handler tests

* evm: handler MsgEthermint test

* fix tests

* 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

* evm: handler test

* 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 evm test

* fix pubkey registration

* lint

* cleanup

* more test checks for importer

* minor change

* codec fixes

* rm init func

* fix importer test build

* fixes

* test fixes

* fix bloom key

* rm unnecesary func

* remove comment

Co-authored-by: austinabell <austinabell8@gmail.com>
Co-authored-by: noot <36753753+noot@users.noreply.github.com>
2020-04-23 11:49:25 -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
thomasmodeneis
2693718662
fix lint (#264) 2020-04-22 19:39:09 +02: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
Austin Abell
33ab63ef15
update web3 transaction hash from RLP (#250)
* remove ethereum hash of web3 transaction type (always amino hash)

* Update changelog
2020-04-13 19:08:43 -04:00
noot
199484fc2e
eth_getFilterLogs, eth_getLogs implementation (#248) 2020-04-13 15:18:50 -04:00
Austin Abell
9b8dd598bb
Remove recomputing of tx bytes (#217) 2020-04-10 16:47:56 -04:00
noot
db4cee7eac
eth_newBlockFilter and related functionality (#232)
* add filter types for block, pending tx, log
* implement pollForBlocks for block filters
* implement getFilterChanges for block filter
* implement uninstall filter by stopping polling
2020-04-07 16:00:06 -04:00
noot
35e7a98ab2
filters: begin implementation (#230)
* adds Filter type and related methods
* updates PublicFilterAPI to include backend, filter mapping
* stub out filter related eth_ functions
2020-04-01 20:43:59 -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
Federico Kunze
87b625ed50
Tools configuration and linters (#215)
* tools config

* lint

* lint

* codecov
2020-03-16 19:53:24 -03:00
Federico Kunze
30f34e6c59
evm: move Keeper and Querier to /keeper package (#182)
* evm: move Keeper and Querier to /keeper package

* keeper: update keeper_test.go

* fix format

* evm: use aliased types

* add comments from review

* changelog
2020-03-09 10:17:23 -03:00
Austin Abell
c99d5cf6c5
Switch EVM context to use header time (#167) 2020-01-09 09:03:39 +13:00
Austin Abell
51adade59f
Update golangci-lint config and fix linting issues (#168)
* update golangci

* update golang lint yml and updated linting issues
2020-01-08 09:56:49 +13:00
Austin Abell
a4d88188bc
Add statedb bloom filter test (#160) 2019-12-19 16:18:50 +10:00
Austin Abell
ce8a94a98e
Cosmos PR changes (#158)
* Changes necessary for enforced custom account encoding/decoding and keyring keybase changes

* updates cosmos dependency and fixes inconsistency in gas usage for simulated/real txs

* Update PR changes

* Remove unused password prompt when using OS keyring

* Update from changes to sdk

* Update to merged PR commit :the_horns:

* updated code to handle keyring backend options

* update documentation and replace cosmos-sdk with fork (temporarily)

* update cosmos dependency from fork

* update documentation
2019-12-13 14:50:19 -05:00
Austin Abell
6eef37b0c6
Finish and clean up module queries and txs (#152)
* Basic transactions set up (to be separated)

* Change transaction command to not include create operation (to include other command in next commit)

* set up create command and made minor changes

* wip implements module queries

* Added tests for query address decoding

* Added ambiguous encoding of to address in transaction and added tests

* Fix linting issue

* Move registering key types to application level to allow module usage to ignore

* Move genaccounts code to be reused

* Switches nonce increase to always happen in ante handler

* change SetNonce from keeper to point to actual nonce operation

* Remove no op nonce switch (not needed with clearing cache)

* Changes to update all accounts pre state transition and clear cache at end of block

* Update accounts before end of block commit (edge case where necessary)

* Fix nonce of sender going into evm in case it's checked, and let evm set contract starting nonce
2019-11-15 12:02:13 -05:00
Austin Abell
9311f9efd0
Update keybase back to cosmos-sdk with support (#147)
* Migrate keybase back to Cosmos-sdk using temporary fork

* Cleaned up other affected code

* Change to updated tendermint

* fmt

* Change auth codec update

* clean up codec registration to respective packages

* Fix import fmt

* Remove no longer necessary replace

* Fix function comment
2019-11-13 12:00:21 -05:00
Austin Abell
97f73063a5
Updates SDK and implement application genaccounts (#143)
* Transition to updated sdk with modular ante handler and new genaccounts setup

* Update genesis account type to be an Ethermint account

* Change default keybase and tidy modules

* Fix lint
2019-11-04 15:45:02 -05:00