From 837d0b0fa7dc457d4cd94e25f6bb07e6f5851cf9 Mon Sep 17 00:00:00 2001 From: mmsqe Date: Tue, 7 Mar 2023 10:18:53 +0800 Subject: [PATCH] fix(rpc): wrong block number in debug trace related api (backport: #1591) (#213) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * update nix * fix(rpc): wrong block number in debug trace related api (#1591) * 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> --------- Co-authored-by: Freddy Caceres Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com> --- CHANGELOG.md | 2 + gomod2nix.toml | 82 ++++++++++++++++++++------------------ x/evm/keeper/grpc_query.go | 8 ++-- 3 files changed, 50 insertions(+), 42 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/gomod2nix.toml b/gomod2nix.toml index 702f834dc3..af2cd945c5 100644 --- a/gomod2nix.toml +++ b/gomod2nix.toml @@ -2,17 +2,20 @@ schema = 3 [mod] [mod."cloud.google.com/go"] - version = "v0.102.1" - hash = "sha256-rv3MHFvIrN6AcrmWcWGSQwgaZLbjJMmJFi3bsfHoiO4=" + version = "v0.105.0" + hash = "sha256-2nYtHjuN9ghGcM6aPlOxyNNarHebHtj0Xec48sWwdaI=" [mod."cloud.google.com/go/compute"] - version = "v1.7.0" - hash = "sha256-g+n7L36LC+NP4KaiEu9fCMn6S9fkxjp4PCLOp/oXV38=" + version = "v1.12.1" + hash = "sha256-mMsdL+6R1KuFeAFqEJv8oq/cmRc9hSluEisCpGP0GTc=" + [mod."cloud.google.com/go/compute/metadata"] + version = "v0.2.1" + hash = "sha256-gqjkb6y5POkTWXGQtCvgygvXqoLkESB+cykKp7Mp3jI=" [mod."cloud.google.com/go/iam"] - version = "v0.4.0" - hash = "sha256-sPtj6QPPC/QrkDXJW4Y7rMIHk5l1y9XV/DgM47eEtvg=" + version = "v0.7.0" + hash = "sha256-2UTJ/BbZ+YMGJhyo3HRPUYVDXW6+B5znFdqiutboYtA=" [mod."cloud.google.com/go/storage"] - version = "v1.22.1" - hash = "sha256-YZt05wru0kacyi6moTgvocavActKpXx7FlLh+o0HGDs=" + version = "v1.27.0" + hash = "sha256-V4B6A1Ms8cemB5Cs6nAtUe1N1ldaI9oqTdzGU2FUhrc=" [mod."cosmossdk.io/errors"] version = "v1.0.0-beta.7" hash = "sha256-XblGvIx6Wvvq6wggXjp+KbeJGXoe7AZH7hXEdauCezU=" @@ -83,6 +86,9 @@ schema = 3 [mod."github.com/coinbase/rosetta-sdk-go"] version = "v0.7.9" hash = "sha256-ZWIXIXcHGjeCNgMrpXymry8/8esDDauGFfF/+gEoO1Y=" + [mod."github.com/cometbft/cometbft-db"] + version = "v0.7.0" + hash = "sha256-EMvHp+5Hga5KkR9kkCiUBkz1HMfVhSHSxmpA5ZQ/Adw=" [mod."github.com/confio/ics23/go"] version = "v0.9.0" hash = "sha256-guD8w7YygfUp7lpTAUyXQuCPx8F3lXkcg+yR5+JOCbk=" @@ -93,8 +99,8 @@ schema = 3 version = "v1.0.0-alpha7" hash = "sha256-2wCH+toTF2A6MfFjOa13muEH5oBCcxAhZEqirNOrBA0=" [mod."github.com/cosmos/cosmos-sdk"] - version = "v0.46.9" - hash = "sha256-4D8A/8IfzRICpR2mIwilS9HUVhMjKHwNygf7BeVPwNM=" + version = "v0.46.11" + hash = "sha256-RpjzVDZw5n0y4kobBCy2d1oPmDCgL5k47UaZMI67sqU=" [mod."github.com/cosmos/go-bip39"] version = "v1.0.0" hash = "sha256-Qm2aC2vaS8tjtMUbHmlBSagOSqbduEEDwc51qvQaBmA=" @@ -208,8 +214,8 @@ schema = 3 version = "v0.0.4" hash = "sha256-Umx+5xHAQCN/Gi4HbtMhnDCSPFAXSsjVbXd8n5LhjAA=" [mod."github.com/google/btree"] - version = "v1.0.1" - hash = "sha256-1PIeFGgUL4BK/StL/D12pg9bEQ5HfMT/fMLdus4pZTs=" + version = "v1.1.2" + hash = "sha256-K7V2obq3pLM71Mg0vhhHtZ+gtaubwXPQx3xcIyZDCjM=" [mod."github.com/google/go-cmp"] version = "v0.5.9" hash = "sha256-lQc4O00R3QSMGs9LP8Sy7A9kj0cqV5rrUdpnGeipIyg=" @@ -220,14 +226,11 @@ schema = 3 version = "v1.3.0" hash = "sha256-QoR55eBtA94T2tBszyxfDtO7/pjZZSGb5vm7U0Xhs0Y=" [mod."github.com/googleapis/enterprise-certificate-proxy"] - version = "v0.1.0" - hash = "sha256-fxaElfiGGh1mLmltkFpVFdiuaagrLZLTW9btVpK13wg=" + version = "v0.2.0" + hash = "sha256-5gxsS5kDLqNFBkQ4eK6GS/sNn+aFknm6jjfteO+6jl4=" [mod."github.com/googleapis/gax-go/v2"] - version = "v2.4.0" - hash = "sha256-zzat4+3iF2XBTQ6RZAUgsCbfK0HgO0nYhM4utA5dqz0=" - [mod."github.com/googleapis/go-type-adapters"] - version = "v1.0.0" - hash = "sha256-u3ajruRV/EN2E1WKet/zoe3zmRrAy4C5F2Dx8bpQwoc=" + version = "v2.6.0" + hash = "sha256-sSsncbJmv0n5jB3G7tHY1Zr2ucCusIeTrXZH4A8QqYI=" [mod."github.com/gorilla/handlers"] version = "v1.5.1" hash = "sha256-GnBAARgOx1E+hDMQ63SI17hdhGtLQxb31lZOmn5j/pU=" @@ -448,13 +451,16 @@ schema = 3 [mod."github.com/syndtr/goleveldb"] version = "v1.0.1-0.20210819022825-2ae1ddf74ef7" hash = "sha256-36a4hgVQfwtS2zhylKpQuFhrjdc/Y8pF0dxc26jcZIU=" + [mod."github.com/tecbot/gorocksdb"] + version = "v0.0.0-20191217155057-f0fad39f321c" + hash = "sha256-VODgdnIxK9bhCHrt4nKfPYk/LLycTIwSRi930fws3Pk=" [mod."github.com/tendermint/go-amino"] version = "v0.16.0" hash = "sha256-JW4zO/0vMzf1dXLePOqaMtiLUZgNbuIseh9GV+jQlf0=" [mod."github.com/tendermint/tendermint"] - version = "v0.34.25" - hash = "sha256-CbAp72QhxqDnIpnA1JlrBY/yX05fDQ8ErDLiolmUv5U=" - replaced = "github.com/informalsystems/tendermint" + version = "v0.34.27" + hash = "sha256-BbpfLcLRf6PwB1xmgkhTm9ckZekelrDUlXDX0/FSMU8=" + replaced = "github.com/cometbft/cometbft" [mod."github.com/tendermint/tm-db"] version = "v0.6.7" hash = "sha256-hl/3RrBrpkk2zA6dmrNlIYKs1/GfqegSscDSkA5Pjlo=" @@ -492,38 +498,38 @@ schema = 3 version = "v0.0.0-20220722155223-a9213eeb770e" hash = "sha256-kNgzydWRpjm0sZl4uXEs3LX5L0xjJtJRAFf/CTlYUN4=" [mod."golang.org/x/net"] - version = "v0.5.0" - hash = "sha256-HpbIAiLs7S1+tVsaSSdbCPw1IK43A0bFFuSzPSyjLbo=" + version = "v0.7.0" + hash = "sha256-LgZYZRwtMqm+soNh+esxDSeRuIDxRGb9OEfYaFJHCDI=" [mod."golang.org/x/oauth2"] - version = "v0.0.0-20220622183110-fd043fe589d2" - hash = "sha256-VLffpTpx3DlUzXB8mKiJfFzm4ZmgnLSUuLB5Ir0WQUg=" + version = "v0.0.0-20221014153046-6fdb5e3db783" + hash = "sha256-IoygidVNqyAZmN+3macDeIefK8hhJToygpcqlwehdYQ=" [mod."golang.org/x/sync"] version = "v0.1.0" hash = "sha256-Hygjq9euZ0qz6TvHYQwOZEjNiTbTh1nSLRAWZ6KFGR8=" [mod."golang.org/x/sys"] - version = "v0.4.0" - hash = "sha256-jchMzHCH5dg+IL/F+LqaX/fyAcB/nvHQpfBjqwaRJH0=" + version = "v0.5.0" + hash = "sha256-0LTr3KeJ1OMQAwYUQo1513dXJtQAJn5Dq8sFkc8ps1U=" [mod."golang.org/x/term"] - version = "v0.4.0" - hash = "sha256-wQKxHV10TU4vCU8Re2/hFmAbur/jRWEOB8QXBzgTFNY=" + version = "v0.5.0" + hash = "sha256-f3DiX7NkDsEZpPS+PbmnOH9F5WHFZ1sQrfFg/T2UPno=" [mod."golang.org/x/text"] - version = "v0.6.0" - hash = "sha256-+bpeRWR3relKACdal6NPj+eP5dnWCplTViArSN7/qA4=" + version = "v0.7.0" + hash = "sha256-ydgUqX+t5Qke16C6d3FP/06U/N1n+rUKpLRFj4KXjwk=" [mod."golang.org/x/xerrors"] version = "v0.0.0-20220907171357-04be3eba64a2" hash = "sha256-6+zueutgefIYmgXinOflz8qGDDDj0Zhv+2OkGhBTKno=" [mod."google.golang.org/api"] - version = "v0.93.0" - hash = "sha256-W17B79osAhObMbrCHlgywEPg9yIPx0ZISDhp9JwFE5A=" + version = "v0.102.0" + hash = "sha256-q8t08Wu0qzOQOmhY4GSoUrhqLTW/TeXiKhio+5ONfe4=" [mod."google.golang.org/appengine"] version = "v1.6.7" hash = "sha256-zIxGRHiq4QBvRqkrhMGMGCaVL4iM4TtlYpAi/hrivS4=" [mod."google.golang.org/genproto"] - version = "v0.0.0-20221018160656-63c7b68cfc55" - hash = "sha256-Z4ynOw+3NkSkWVOrNaeuQC3G9Q6+joNbTLVoF2HegrU=" + version = "v0.0.0-20221118155620-16455021b5e6" + hash = "sha256-FFSliEzgr7AceO8B+ZoPAlZDFVPLeqAFg+25VQw6cFs=" [mod."google.golang.org/grpc"] - version = "v1.50.1" - hash = "sha256-38nk4qIme+fE57SsCqNxtCZnc8fyzzi4Sb60uDTT2KE=" + version = "v1.52.0" + hash = "sha256-wYJ/ysugKxz1O9u6BxECTIGFJ3sv0XmxOfM+Y0jW3KQ=" [mod."google.golang.org/protobuf"] version = "v1.28.2-0.20220831092852-f930b1dc76e8" hash = "sha256-li5hXlXwTJ5LIZ8bVki1AZ6UFI2gXHl33JwdX1dOrtM=" 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