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

impr(evm): add check msg.Validate check to prevent 0 gas txs #1174

Merged
merged 10 commits into from
Jul 18, 2022

Conversation

danburck
Copy link
Contributor

@danburck danburck commented Jul 11, 2022

Description

This PR adds a MsgEthereumTx msg validation to prevent the spam through 0 gas txs. It also adds a integration test suite to the evm module.

Closes: ENG-541 https://linear.app/evmos/issue/ENG-541/devs-can-spamdos-a-network-by-submitting-a-many-txs-with-0-gas

@codecov
Copy link

codecov bot commented Jul 11, 2022

Codecov Report

Merging #1174 (e25dd5b) into main (da8fcc3) will increase coverage by 0.19%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1174      +/-   ##
==========================================
+ Coverage   62.06%   62.25%   +0.19%     
==========================================
  Files          91       91              
  Lines        7355     7358       +3     
==========================================
+ Hits         4565     4581      +16     
+ Misses       2562     2551      -11     
+ Partials      228      226       -2     
Impacted Files Coverage Δ
x/evm/types/errors.go 100.00% <ø> (ø)
x/evm/types/msg.go 83.91% <100.00%> (+0.24%) ⬆️
x/evm/keeper/state_transition.go 76.27% <0.00%> (+1.50%) ⬆️
x/evm/keeper/keeper.go 81.01% <0.00%> (+1.89%) ⬆️
x/evm/keeper/msg_server.go 90.42% <0.00%> (+5.31%) ⬆️

@danburck danburck marked this pull request as ready for review July 11, 2022 17:08
@github-actions github-actions bot added the C:CLI label Jul 11, 2022
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. Pending comment in changelog

CHANGELOG.md Outdated Show resolved Hide resolved
@danburck danburck enabled auto-merge (squash) July 18, 2022 16:02
@danburck danburck disabled auto-merge July 18, 2022 16:28
@fedekunze fedekunze merged commit 969794c into main Jul 18, 2022
@fedekunze fedekunze deleted the prevent-0-gas-txs branch July 18, 2022 20:21
hoanguyenkh pushed a commit to AstraProtocol/ethermint that referenced this pull request Jul 27, 2022
)

* impr(evm): add check msg.Validate check to prevent 0 gas txs

* add changelog

* impr(evm): add integration tests for zero gas txs

* go mod tidy and proto swagger

* fix comment

* move changelog to state machine breaking

* add ReadHeaderTimeout`

* revert ReadHeaderTimeout config change

Co-authored-by: Federico Kunze Küllmer <[email protected]>
fedekunze pushed a commit that referenced this pull request Aug 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants