Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: force revert #603

Merged
merged 2 commits into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ Ref: https://keepachangelog.com/en/1.0.0/

# Change log

## [v6.1.0]

* Fix: precompile contract revert issue

---

## [v6.0.0]

### Features
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -210,5 +210,5 @@ replace (
// use for precompile
replace (
github.com/ethereum/go-ethereum => github.com/evmos/go-ethereum v1.10.26-evmos-rc1
github.com/evmos/ethermint => github.com/functionx/ethermint v0.22.0-fxcore-precompile-rc2
github.com/evmos/ethermint => github.com/functionx/ethermint v0.22.0-fxcore-precompile-rc2.0.20240701110919-286276c8a9bd
)
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -513,8 +513,8 @@ github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMo
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY=
github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw=
github.com/functionx/ethermint v0.22.0-fxcore-precompile-rc2 h1:Nd8qs+f/z9QFDYa2gEM9Hobq+0jCEYMMO+YBXj8FsQo=
github.com/functionx/ethermint v0.22.0-fxcore-precompile-rc2/go.mod h1:56iaMZDPOeBb1CA219jbZ8PttNFj/yrGKDqljLDSn64=
github.com/functionx/ethermint v0.22.0-fxcore-precompile-rc2.0.20240701110919-286276c8a9bd h1:tZDGwwYhAqUlzCUIIeV/EOSV444yhCr73Y9AR0yBGsE=
github.com/functionx/ethermint v0.22.0-fxcore-precompile-rc2.0.20240701110919-286276c8a9bd/go.mod h1:56iaMZDPOeBb1CA219jbZ8PttNFj/yrGKDqljLDSn64=
github.com/garslo/gogen v0.0.0-20170306192744-1d203ffc1f61/go.mod h1:Q0X6pkwTILDlzrGEckF6HKjXe48EgsY/l7K7vhY4MW8=
github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff h1:tY80oXqGNY4FhTFhk+o9oFHGINQ/+vhlm8HFzi6znCI=
github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww=
Expand Down
5 changes: 5 additions & 0 deletions x/evm/keeper/state_transition.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,11 @@ func (k *Keeper) ApplyMessageWithConfig(ctx sdk.Context,
temporaryGasUsed := msg.Gas() - leftoverGas
leftoverGas += evmkeeper.GasToRefund(stateDB.GetRefund(), temporaryGasUsed, refundQuotient)

// force revert error
if vmErr == nil && stateDB.ForceRevert() {
vmErr = types.ErrExecutionForceReverted
}

// EVM execution error needs to be available for the JSON-RPC client
var vmError string
if vmErr != nil {
Expand Down
Loading