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

fix(rpc): align fee history #1611

Merged
merged 19 commits into from
Jan 20, 2023
Merged

fix(rpc): align fee history #1611

merged 19 commits into from
Jan 20, 2023

Conversation

mmsqe
Copy link
Contributor

@mmsqe mmsqe commented Jan 18, 2023

Closes: #1559

Description

  • eth_feeHistory returns less item in baseFeePerGas array
  • eth_feeHistory returns oldestBlock - 1 compare with eth
  • fix broken earliest input

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)

@mmsqe mmsqe marked this pull request as ready for review January 18, 2023 10:05
@mmsqe mmsqe requested a review from a team as a code owner January 18, 2023 10:05
@mmsqe mmsqe requested review from 0a1c and adisaran64 and removed request for a team January 18, 2023 10:05
@codecov
Copy link

codecov bot commented Jan 18, 2023

Codecov Report

Merging #1611 (b2b58d6) into main (6505f6e) will decrease coverage by 0.03%.
The diff coverage is 73.68%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1611      +/-   ##
==========================================
- Coverage   68.35%   68.33%   -0.03%     
==========================================
  Files         110      110              
  Lines       10181    10184       +3     
==========================================
  Hits         6959     6959              
- Misses       2819     2821       +2     
- Partials      403      404       +1     
Impacted Files Coverage Δ
rpc/backend/utils.go 43.50% <50.00%> (-0.43%) ⬇️
rpc/backend/chain_info.go 82.73% <84.61%> (-0.11%) ⬇️

rpc/backend/utils.go Show resolved Hide resolved
tests/integration_tests/test_fee_history.py Outdated Show resolved Hide resolved
blockNumber, err := b.BlockNumber()
if err != nil {
return nil, err
}
blockEnd = int64(blockNumber)
}

userBlockCountInt := int64(userBlockCount)
blocks := int64(userBlockCount)

Check failure

Code scanning / gosec

Potential integer overflow by integer type conversion

Potential integer overflow by integer type conversion
@fedekunze fedekunze merged commit 47fdfd3 into evmos:main Jan 20, 2023
@MalteHerrmann
Copy link
Contributor

@Mergifyio backport release/v0.21.x

mergify bot pushed a commit that referenced this pull request Jan 20, 2023
* update nix

* add next fee in fee history

* fix test

* add change doc

* height + 1 for next fee

* cross check baseFeePerGas len

* Update tests/integration_tests/test_fee_history.py

Co-authored-by: MalteHerrmann <42640438+MalteHerrmann@users.noreply.github.com>

* fix oldestBlock & align earliest input as eth

* update doc

* update nix

* isort test_fee_history.py

* fix test

* align rpc res as eth

* add cross check

* add baseFeePerGas len check

* add oldestBlock check

Co-authored-by: MalteHerrmann <42640438+MalteHerrmann@users.noreply.github.com>
Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
(cherry picked from commit 47fdfd3)

# Conflicts:
#	CHANGELOG.md
@mergify
Copy link
Contributor

mergify bot commented Jan 20, 2023

backport release/v0.21.x

✅ Backports have been created

fedekunze added a commit that referenced this pull request Jan 20, 2023
* fix(rpc): align fee history (#1611)

* update nix

* add next fee in fee history

* fix test

* add change doc

* height + 1 for next fee

* cross check baseFeePerGas len

* Update tests/integration_tests/test_fee_history.py

Co-authored-by: MalteHerrmann <42640438+MalteHerrmann@users.noreply.github.com>

* fix oldestBlock & align earliest input as eth

* update doc

* update nix

* isort test_fee_history.py

* fix test

* align rpc res as eth

* add cross check

* add baseFeePerGas len check

* add oldestBlock check

Co-authored-by: MalteHerrmann <42640438+MalteHerrmann@users.noreply.github.com>
Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
(cherry picked from commit 47fdfd3)

# Conflicts:
#	CHANGELOG.md

* address merge conflicts

Co-authored-by: mmsqe <mavis@crypto.com>
Co-authored-by: MalteHerrmann <malte@evmos.org>
Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
fedekunze added a commit that referenced this pull request Jan 25, 2023
* release: v0.21.0-rc1 changelog (#1606)

* changelog: added rc-1 changelog entry

* fix: typo fix rc1

* fix(rpc): bind default json-rpc listen address to localhost (backport #1613) (#1621)

* fix(rpc): bind default json-rpc listen address to localhost (#1613)

* update nix

* bind default json-rpc to 127.0.0.1

* add change doc

* Update CHANGELOG.md

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

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
(cherry picked from commit 3587015)

# Conflicts:
#	CHANGELOG.md

* address merge conflicts

Co-authored-by: mmsqe <tqd0800210105@gmail.com>
Co-authored-by: MalteHerrmann <malte@evmos.org>

* fix(rpc): align fee history (backport #1611) (#1620)

* fix(rpc): align fee history (#1611)

* update nix

* add next fee in fee history

* fix test

* add change doc

* height + 1 for next fee

* cross check baseFeePerGas len

* Update tests/integration_tests/test_fee_history.py

Co-authored-by: MalteHerrmann <42640438+MalteHerrmann@users.noreply.github.com>

* fix oldestBlock & align earliest input as eth

* update doc

* update nix

* isort test_fee_history.py

* fix test

* align rpc res as eth

* add cross check

* add baseFeePerGas len check

* add oldestBlock check

Co-authored-by: MalteHerrmann <42640438+MalteHerrmann@users.noreply.github.com>
Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
(cherry picked from commit 47fdfd3)

# Conflicts:
#	CHANGELOG.md

* address merge conflicts

Co-authored-by: mmsqe <mavis@crypto.com>
Co-authored-by: MalteHerrmann <malte@evmos.org>
Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>

* support customize db opener in `StartCmd` (backport #1615) (#1622)

* support customize db opener in `StartCmd` (#1615)

* support customize db opener in `StartCmd`

* Update CHANGELOG.md

* pass  to dbOpener, so we can control different options through cli flags

* add comments

(cherry picked from commit f1337aa)

# Conflicts:
#	CHANGELOG.md

* conflicts

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

* tests(evm): add benchmark tests setup for params (#1623) (#1627)

* tests: add benchmark tests setup

* fix: localized benchmark tests to keeper

* update benchmark

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
(cherry picked from commit 9305788)

Co-authored-by: Vladislav Varadinov <vladislav.varadinov@gmail.com>

* refactor(params): store all params under one key in evm module (backport #1617) (#1626)

* refactor(params): store all params under one key in evm module (#1617)

* refactor(params): store all params under one key in evm module

* refactor(params): add changelog entry

* refactor(params): update based on review comments. Remove params getter functions

* refactor(params): refactor params store key

* refactor(params): remove unnecessary store keys

* refactor(params): add paramSetPairs for backwards compatibility

* Update CHANGELOG.md

* refactor(params): add license to params_legacy file

* Apply suggestions from code review

* fix(evm): handle RC1 params during migration (#1624)

* fix(evm): handle RC1 params during migration

* migration

* fix: test case updated for RC1

* v5 migration

* tests

* tests pt2

* comment

* execute make proto-all

Co-authored-by: Vladislav Varadinov <vladislav.varadinov@gmail.com>
Co-authored-by: MalteHerrmann <malte@evmos.org>

* Apply suggestions from code review

* rm dup vars

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: Vladislav Varadinov <vladislav.varadinov@gmail.com>
Co-authored-by: MalteHerrmann <malte@evmos.org>
(cherry picked from commit f07b14f)

# Conflicts:
#	CHANGELOG.md

* update changelog

Co-authored-by: Tomas Guerra <54514587+GAtom22@users.noreply.github.com>
Co-authored-by: MalteHerrmann <42640438+MalteHerrmann@users.noreply.github.com>
Co-authored-by: MalteHerrmann <malte@evmos.org>

* fix(evm): revert v4 migration changes (#1625) (#1628)

* fix(evm): revert v4 migration changes

* add check for chainID

* fix: renamed vars to avoid duplicate proto

* test

* fix: set default extraEIPs to nil

* fix: updated tests

Co-authored-by: Vladislav Varadinov <vladislav.varadinov@gmail.com>
(cherry picked from commit 9bfa1ff)

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

* minor improvement to changelog (#1629)

* adjust year to 2023 for v0.21.0-rc2 release (#1630)

* Update CHANGELOG.md

Co-authored-by: Vladislav Varadinov <vladislav.varadinov@gmail.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: mmsqe <tqd0800210105@gmail.com>
Co-authored-by: mmsqe <mavis@crypto.com>
Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: yihuang <huang@crypto.com>
Co-authored-by: Tomas Guerra <54514587+GAtom22@users.noreply.github.com>
mmsqe added a commit to mmsqe/ethermint that referenced this pull request Mar 14, 2023
* update nix

* add next fee in fee history

* fix test

* add change doc

* height + 1 for next fee

* cross check baseFeePerGas len

* Update tests/integration_tests/test_fee_history.py

Co-authored-by: MalteHerrmann <42640438+MalteHerrmann@users.noreply.github.com>

* fix oldestBlock & align earliest input as eth

* update doc

* update nix

* isort test_fee_history.py

* fix test

* align rpc res as eth

* add cross check

* add baseFeePerGas len check

* add oldestBlock check

Co-authored-by: MalteHerrmann <42640438+MalteHerrmann@users.noreply.github.com>
Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
mmsqe added a commit to crypto-org-chain/ethermint that referenced this pull request Mar 14, 2023
* update nix

* add next fee in fee history

* fix test

* add change doc

* height + 1 for next fee

* cross check baseFeePerGas len

* Update tests/integration_tests/test_fee_history.py



* fix oldestBlock & align earliest input as eth

* update doc

* update nix

* isort test_fee_history.py

* fix test

* align rpc res as eth

* add cross check

* add baseFeePerGas len check

* add oldestBlock check

Co-authored-by: MalteHerrmann <42640438+MalteHerrmann@users.noreply.github.com>
Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@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.

JSON RPC method eth_feeHistory returns 1 less item in baseFeePerGas
3 participants