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

consistent baseFee check logic #855

Merged
merged 2 commits into from
Dec 28, 2021
Merged

Conversation

yihuang
Copy link
Contributor

@yihuang yihuang commented Dec 23, 2021

Closes: #755

Description

if not london_hardfork {
    # reject DynamicFeeTx
    # no `baseFeePerGas` field in block response
    # baseFee = nil
} else {
    # allow DynamicFeeTx
    # add `baseFeePerGas` field in block response
    if feemarketParams.NoBaseFee or height < feemarketParams.EnableHeight {
        # baseFee = 0
    } else {
        # init baseFee to initBaseFee and adjust in later blocks
    }
}

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)

@yihuang yihuang force-pushed the check-base-fee branch 2 times, most recently from bc26de7 to db3d931 Compare December 23, 2021 08:08
@codecov
Copy link

codecov bot commented Dec 23, 2021

Codecov Report

Merging #855 (29a51f2) into main (8bc3cc4) will decrease coverage by 0.16%.
The diff coverage is 50.79%.

❗ Current head 29a51f2 differs from pull request most recent head fb235dd. Consider uploading reports for the commit fb235dd to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##             main     #855      +/-   ##
==========================================
- Coverage   56.79%   56.63%   -0.17%     
==========================================
  Files          72       72              
  Lines        6060     6060              
==========================================
- Hits         3442     3432      -10     
- Misses       2420     2429       +9     
- Partials      198      199       +1     
Impacted Files Coverage Δ
app/test_helpers.go 0.00% <0.00%> (ø)
x/feemarket/keeper/keeper.go 90.90% <ø> (ø)
x/evm/keeper/grpc_query.go 64.85% <45.83%> (-1.25%) ⬇️
app/ante/eth.go 83.95% <48.00%> (-0.80%) ⬇️
x/evm/keeper/keeper.go 79.88% <75.00%> (-0.59%) ⬇️
x/evm/keeper/state_transition.go 75.74% <100.00%> (-1.60%) ⬇️
x/evm/types/params.go 100.00% <100.00%> (ø)
... and 1 more

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.

suggested changes LGTM. I'd add more test cases for the new behavior and also add a changelog entry.

x/evm/keeper/keeper.go Outdated Show resolved Hide resolved
app/ante/eth.go Show resolved Hide resolved
app/ante/eth.go Show resolved Hide resolved
x/evm/keeper/keeper.go Show resolved Hide resolved
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.

ACK, can you add a changelog entry?

app/ante/utils_test.go Outdated Show resolved Hide resolved
Closes: evmos#755

```
if not london_hardfork {
    # reject DynamicFeeTx
    # no `baseFeePerGas` field in block response
    # baseFee = nil
} else {
    # allow DynamicFeeTx
    # add `baseFeePerGas` field in block response
    if feemarketParams.NoBaseFee or height < feemarketParams.EnableHeight {
        # baseFee = 0
    } else {
        # init baseFee to initBaseFee and adjust in later blocks
    }
}
```

Update x/evm/keeper/keeper.go

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

add unit tests

Update app/ante/utils_test.go

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

changelog
@yihuang
Copy link
Contributor Author

yihuang commented Dec 27, 2021

ACK, can you add a changelog entry?

done, also added unit test for EvmKeeper.BaseFee.

@fedekunze fedekunze enabled auto-merge (squash) December 27, 2021 12:18
@fedekunze fedekunze merged commit eb17366 into evmos:main Dec 28, 2021
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.

Inconsistent baseFee check logic in code
2 participants