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

fix(rpc): wrong block number in debug trace related api #1591

Merged
merged 10 commits into from
Jan 20, 2023

Conversation

mmsqe
Copy link
Contributor

@mmsqe mmsqe commented Jan 6, 2023

Closes: #XXX

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 Jan 6, 2023

Codecov Report

Merging #1591 (e67f579) into main (47fdfd3) will not change coverage.
The diff coverage is 100.00%.

❗ Current head e67f579 differs from pull request most recent head 36bb123. Consider uploading reports for the commit 36bb123 to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1591   +/-   ##
=======================================
  Coverage   68.33%   68.33%           
=======================================
  Files         110      110           
  Lines       10184    10184           
=======================================
  Hits         6959     6959           
  Misses       2821     2821           
  Partials      404      404           
Impacted Files Coverage Δ
x/evm/keeper/grpc_query.go 85.90% <100.00%> (ø)

@mmsqe mmsqe changed the title fix(rpc): wrong block number when trace tnx fix(rpc): wrong block number in debug trace related api Jan 6, 2023
@mmsqe mmsqe marked this pull request as ready for review January 6, 2023 08:17
@mmsqe mmsqe requested a review from a team as a code owner January 6, 2023 08:17
@mmsqe mmsqe requested review from 0a1c and MalteHerrmann and removed request for a team January 6, 2023 08:17
@VictorTrustyDev
Copy link
Contributor

VictorTrustyDev commented Jan 6, 2023

block height already minus by one in rpc

contextHeight := transaction.Height - 1
if contextHeight < 1 {
// 0 is a special value in `ContextWithHeight`
contextHeight = 1
}

Oh no, so currently it keep minus by one in grpc so actually minus by 2? If calling via API debug_traceTransaction?

@mmsqe
Copy link
Contributor Author

mmsqe commented Jan 6, 2023

block height already minus by one in rpc

contextHeight := transaction.Height - 1
if contextHeight < 1 {
// 0 is a special value in `ContextWithHeight`
contextHeight = 1
}

Oh no, so currently it keep minus by one in grpc so actually minus by 2? If calling via API debug_traceTransaction?

Fixing BlockNumber from request, no need minus 1

@yihuang
Copy link
Contributor

yihuang commented Jan 9, 2023

The contextHeight is minus one to get to the state of block beginning, but the block number pass to evm context should not minus one.

Copy link
Contributor

@4rgon4ut 4rgon4ut left a comment

Choose a reason for hiding this comment

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

LGTM! Good job @mmsqe

@facs95
Copy link
Contributor

facs95 commented Jan 12, 2023

Hey @yihuang have you ever seen the fixed-output derivation.. nix issues that are making the integration tests fail?

@fedekunze fedekunze enabled auto-merge (squash) January 20, 2023 15:56
@fedekunze fedekunze merged commit b990a83 into evmos:main Jan 20, 2023
mmsqe added a commit to mmsqe/ethermint that referenced this pull request Mar 7, 2023
* fix wrong block number in debug_traceTransaction

* add change doc

* update nix

* update nix

Co-authored-by: Freddy Caceres <[email protected]>
Co-authored-by: Federico Kunze Küllmer <[email protected]>
yihuang pushed a commit to crypto-org-chain/ethermint that referenced this pull request Mar 7, 2023
…mos#1591) (#213)

* update nix

* fix(rpc): wrong block number in debug trace related api (evmos#1591)

* fix wrong block number in debug_traceTransaction

* add change doc

* update nix

* update nix

Co-authored-by: Freddy Caceres <[email protected]>
Co-authored-by: Federico Kunze Küllmer <[email protected]>

---------

Co-authored-by: Freddy Caceres <[email protected]>
Co-authored-by: Federico Kunze Küllmer <[email protected]>
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.

6 participants