Skip to content
This repository has been archived by the owner on Nov 30, 2021. It is now read-only.

store logs in keeper after transition #210

Merged
merged 37 commits into from
Mar 18, 2020

Conversation

noot
Copy link
Contributor

@noot noot commented Mar 11, 2020

Closes: #180

Description

  • update TransitionCSDB to return logs, and to store the logs in the sdk result
  • update EncodeReturnData -> EncodeResultData, DecodeReturnData -> DecodeResultData to use rlp encoding
  • update handleETHTxMsg to store logs in KVStore after transition occurs
  • add SetBlockLogs and GetBlockLogs to keeper

.

  • Targeted PR against correct branch (see CONTRIBUTING.md)
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards.
  • Wrote unit and integration tests
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer

@noot noot self-assigned this Mar 11, 2020
x/evm/handler_test.go Outdated Show resolved Hide resolved
x/evm/types/utils.go Outdated Show resolved Hide resolved
x/evm/keeper/keeper.go Outdated Show resolved Hide resolved
x/evm/keeper/keeper.go Outdated Show resolved Hide resolved
x/evm/keeper/keeper.go Outdated Show resolved Hide resolved
x/evm/types/state_transition.go Outdated Show resolved Hide resolved
x/evm/handler_test.go Outdated Show resolved Hide resolved
x/evm/handler_test.go Outdated Show resolved Hide resolved
x/evm/keeper/keeper.go Outdated Show resolved Hide resolved
@noot noot changed the title store logs in KVStore after transition store logs in keeper after transition Mar 13, 2020
@noot noot marked this pull request as ready for review March 13, 2020 19:57
x/evm/keeper/keeper.go Outdated Show resolved Hide resolved
x/evm/types/state_transition.go Show resolved Hide resolved
x/evm/types/state_transition.go Show resolved Hide resolved
x/evm/abci.go Outdated Show resolved Hide resolved
x/evm/keeper/keeper_test.go Outdated Show resolved Hide resolved
@fedekunze fedekunze changed the base branch from development to fedekunze/177-bump-sdk-version March 17, 2020 18:52
Copy link
Contributor

@fedekunze fedekunze left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, minor comments only before merging

x/evm/types/utils.go Outdated Show resolved Hide resolved
x/evm/types/utils.go Outdated Show resolved Hide resolved
x/evm/types/utils.go Show resolved Hide resolved
x/evm/types/utils.go Outdated Show resolved Hide resolved
x/evm/keeper/querier.go Outdated Show resolved Hide resolved
x/evm/keeper/querier.go Outdated Show resolved Hide resolved
x/evm/handler_test.go Outdated Show resolved Hide resolved
x/evm/handler_test.go Outdated Show resolved Hide resolved
@noot noot requested a review from fedekunze March 18, 2020 00:24
Copy link
Contributor

@fedekunze fedekunze left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. One comment only that I missed before. Can you fix the conflicts too 🙏?

x/evm/handler.go Outdated Show resolved Hide resolved
x/evm/handler.go Outdated Show resolved Hide resolved
@noot
Copy link
Contributor Author

noot commented Mar 18, 2020

@fedekunze fixed!

@noot noot requested a review from fedekunze March 18, 2020 15:05
Copy link
Contributor

@fedekunze fedekunze left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

@fedekunze fedekunze merged commit d0aa494 into fedekunze/177-bump-sdk-version Mar 18, 2020
@fedekunze fedekunze deleted the noot/exploration branch March 18, 2020 20:05
fedekunze added a commit that referenced this pull request Apr 22, 2020
* 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>
fedekunze added a commit that referenced this pull request Apr 23, 2020
* 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>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement tx log reconstruction
4 participants