From 872fb68104dacc1ef81d74de36dc677f6a082317 Mon Sep 17 00:00:00 2001 From: mmsqe Date: Sat, 21 Jan 2023 00:01:02 +0800 Subject: [PATCH] fix(rpc): wrong block number in debug trace related api (#1591) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix wrong block number in debug_traceTransaction * add change doc * update nix * update nix Co-authored-by: Freddy Caceres Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com> --- CHANGELOG.md | 2 ++ x/evm/keeper/grpc_query.go | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 401f92f7ee..2ae0045552 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -87,6 +87,8 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (rpc) [#1405](https://github.com/evmos/ethermint/pull/1405) Pass chain-id to grpc query through request, otherwise it's not initialized if abci event don't happens. * (rpc) [#1431](https://github.com/evmos/ethermint/pull/1431) Align hex-strings proof fields in `eth_getProof` as Ethereum. * (rpc) [#1503](https://github.com/evmos/ethermint/pull/1503) Fix block hashes returned on JSON-RPC filter `eth_newBlockFilter`. +running transaction in `ReCheckMode` +* (rpc) [#1591](https://github.com/evmos/ethermint/pull/1591) Fix block number returned in opcode for debug trace related api. ## [v0.19.3] - 2022-10-14 diff --git a/x/evm/keeper/grpc_query.go b/x/evm/keeper/grpc_query.go index 489380790b..f616be1271 100644 --- a/x/evm/keeper/grpc_query.go +++ b/x/evm/keeper/grpc_query.go @@ -369,8 +369,8 @@ func (k Keeper) TraceTx(c context.Context, req *types.QueryTraceTxRequest) (*typ return nil, status.Errorf(codes.InvalidArgument, "output limit cannot be negative, got %d", req.TraceConfig.Limit) } - // minus one to get the context of block beginning - contextHeight := req.BlockNumber - 1 + // get the context of block beginning + contextHeight := req.BlockNumber if contextHeight < 1 { // 0 is a special value in `ContextWithHeight` contextHeight = 1 @@ -440,8 +440,8 @@ func (k Keeper) TraceBlock(c context.Context, req *types.QueryTraceBlockRequest) return nil, status.Errorf(codes.InvalidArgument, "output limit cannot be negative, got %d", req.TraceConfig.Limit) } - // minus one to get the context of block beginning - contextHeight := req.BlockNumber - 1 + // get the context of block beginning + contextHeight := req.BlockNumber if contextHeight < 1 { // 0 is a special value in `ContextWithHeight` contextHeight = 1