Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

prepare access list for eth_call #348

Merged
merged 2 commits into from
Aug 16, 2021
Merged

Conversation

yihuang
Copy link
Contributor

@yihuang yihuang commented Jul 24, 2021

Closes: #335

Description


For contributor use:

  • 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

For admin use:

  • Added appropriate labels to PR (ex. WIP, R4R, docs, etc)
  • Reviewers assigned
  • Squashed all commits, uses message "Merge pull request #XYZ: [title]" (coding standards)

@codecov
Copy link

codecov bot commented Jul 24, 2021

Codecov Report

Merging #348 (2758671) into main (df13b39) will increase coverage by 0.04%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #348      +/-   ##
==========================================
+ Coverage   50.68%   50.72%   +0.04%     
==========================================
  Files          49       49              
  Lines        4881     4885       +4     
==========================================
+ Hits         2474     2478       +4     
  Misses       2300     2300              
  Partials      107      107              
Impacted Files Coverage Δ
app/ante/ante.go 48.05% <ø> (-0.67%) ⬇️
x/evm/keeper/state_transition.go 58.11% <100.00%> (+0.91%) ⬆️

@yihuang yihuang changed the title prepare access list in eth_call prepare access list for eth_call Jul 24, 2021
@FrancoCRO
Copy link

Checked that this PR resolves the problem

@@ -70,7 +70,6 @@ func NewAnteHandler(
NewEthNonceVerificationDecorator(ak),
NewEthGasConsumeDecorator(ak, bankKeeper, evmKeeper),
NewCanTransferDecorator(evmKeeper),
NewAccessListDecorator(evmKeeper),
Copy link
Contributor

Choose a reason for hiding this comment

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

what is the issue with this decorator? the logic is pretty much the same one

Copy link
Contributor Author

@yihuang yihuang Jul 26, 2021

Choose a reason for hiding this comment

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

The issue is ante handler is not executed for eth_call, which is handled by grpc query.

Copy link
Contributor

Choose a reason for hiding this comment

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

ok that makes sense. Why aren't we using the Simulate gRPC method again? then we could easily solve this issue from arising in the future if we add more logic to the ante handler

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Simulate don't support execute on historical block height, and cosmos-sdk team seems reluctant to support that cosmos/cosmos-sdk#9636 (comment).

Copy link
Contributor Author

@yihuang yihuang Jul 26, 2021

Choose a reason for hiding this comment

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

Also to support eth_call with simulate, we need to change the ante handler logic a little bit, since in eth_call the MsgEthereumTx is not signed, and from could be empty.

@evmos evmos deleted a comment from netlify bot Aug 16, 2021
@fedekunze
Copy link
Contributor

we should add additional notes on the code about this logic but will merge this to speed up things. Please add another PR describing the rationale

@fedekunze fedekunze enabled auto-merge (squash) August 16, 2021 07:06
@yihuang
Copy link
Contributor Author

yihuang commented Aug 16, 2021

we should add additional notes on the code about this logic but will merge this to speed up things. Please add another PR describing the rationale

Sure, I just added a comment, also rebased to recent main branch.

@fedekunze fedekunze merged commit 353455d into evmos:main Aug 16, 2021
yihuang referenced this pull request in yihuang/ethermint Sep 13, 2023
* Problem: event converter don't have to be global

Solution:
- support custom event converter on each ExecuteNativeAction call.

* remove ExtStateDB interface

* fix build
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.

eth_call panic in some access list logic
3 participants