From 2a205e561acaef4de97b6895f13ef0e05efd696a Mon Sep 17 00:00:00 2001 From: yihuang Date: Wed, 10 Nov 2021 02:38:22 +0800 Subject: [PATCH] rpc: `debug_traceTransaction` fails for succesful tx (#720) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Problem: traceTransaction fails for succesful tx Solution: - Change the context to the begining of the block, rather than the end of it, while override block context to correct one pass predecessors pass current block information to grpc query * changelog * fix build * fix lint * refactor traceBlock * update protobuf * fix Predecessors * traceBlock refactor * refactor traceBlock response * Update proto/ethermint/evm/v1/tx.proto Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com> * Update proto/ethermint/evm/v1/query.proto Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com> * Update proto/ethermint/evm/v1/query.proto Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com> * Update proto/ethermint/evm/v1/query.proto Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com> * Update proto/ethermint/evm/v1/query.proto Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com> * Update proto/ethermint/evm/v1/query.proto Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com> * check tx index is not out of bound * fix build * Update rpc/ethereum/namespaces/debug/api.go Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com> * Update rpc/ethereum/namespaces/debug/api.go Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com> * Update rpc/ethereum/namespaces/debug/api.go Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com> * Update rpc/ethereum/namespaces/debug/api.go Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com> * remove prealloc * add traceBlock test * Update x/evm/keeper/grpc_query.go Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com> * use bytes2Hex * fix error message * add comment * Apply suggestions from code review Co-authored-by: Freddy Caceres Co-authored-by: crypto-facs <84574577+crypto-facs@users.noreply.github.com> Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com> --- CHANGELOG.md | 1 + client/docs/swagger-ui/swagger.yaml | 1855 ++++++++++++++++++++++++-- docs/api/proto-docs.md | 43 +- go.mod | 9 +- go.sum | 8 +- proto/ethermint/evm/v1/query.proto | 35 + proto/ethermint/evm/v1/tx.proto | 2 +- rpc/ethereum/namespaces/debug/api.go | 151 ++- x/evm/keeper/grpc_query.go | 73 +- x/evm/keeper/grpc_query_test.go | 158 ++- x/evm/types/query.go | 14 + x/evm/types/query.pb.go | 957 ++++++++++++- x/evm/types/query.pb.gw.go | 80 ++ x/evm/types/tx.pb.go | 109 +- x/evm/types/tx.pb.gw.go | 166 +++ 15 files changed, 3314 insertions(+), 347 deletions(-) create mode 100644 x/evm/types/tx.pb.gw.go diff --git a/CHANGELOG.md b/CHANGELOG.md index 6bb1dc6e..0e1f963e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -57,6 +57,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (evm) [tharsis#660](https://github.com/tharsis/ethermint/pull/660) Fix `nil` pointer panic in `ApplyNativeMessage`. * (evm, test) [tharsis#649](https://github.com/tharsis/ethermint/pull/649) Test DynamicFeeTx. * (evm) [tharsis#702](https://github.com/tharsis/ethermint/pull/702) Fix panic in web3 RPC handlers +* (rpc) [tharsis#720](https://github.com/tharsis/ethermint/pull/720) Fix `debug_traceTransaction` failure ### Improvements diff --git a/client/docs/swagger-ui/swagger.yaml b/client/docs/swagger-ui/swagger.yaml index eeb289ed..7f4dc762 100644 --- a/client/docs/swagger-ui/swagger.yaml +++ b/client/docs/swagger-ui/swagger.yaml @@ -1,10 +1,10 @@ swagger: '2.0' info: title: Ethermint Chain - Legacy REST and gRPC Gateway docs - description: 'A REST interface for state queries, legacy transactions' + description: A REST interface for state queries, legacy transactions version: 1.0.0 paths: - '/ethermint/evm/v1/account/{address}': + /ethermint/evm/v1/account/{address}: get: summary: Account queries an Ethereum account. operationId: Account @@ -224,7 +224,7 @@ paths: type: string tags: - Query - '/ethermint/evm/v1/balances/{address}': + /ethermint/evm/v1/balances/{address}: get: summary: |- Balance queries the balance of a the EVM denomination for a single @@ -439,7 +439,7 @@ paths: type: string tags: - Query - '/ethermint/evm/v1/codes/{address}': + /ethermint/evm/v1/codes/{address}: get: summary: Code queries the balance of all coins for a single account. operationId: Code @@ -653,7 +653,7 @@ paths: type: string tags: - Query - '/ethermint/evm/v1/cosmos_account/{address}': + /ethermint/evm/v1/cosmos_account/{address}: get: summary: CosmosAccount queries an Ethereum account's Cosmos Address. operationId: CosmosAccount @@ -1131,7 +1131,7 @@ paths: data: type: string format: byte - title: 'supplied by the contract, usually ABI-encoded' + title: supplied by the contract, usually ABI-encoded block_number: type: string format: uint64 @@ -1700,7 +1700,7 @@ paths: } tags: - Query - '/ethermint/evm/v1/storage/{address}/{key}': + /ethermint/evm/v1/storage/{address}/{key}: get: summary: Storage queries the balance of all coins for a single account. operationId: Storage @@ -2250,13 +2250,13 @@ paths: required: false type: boolean - name: trace_config.limit - description: 'maximum length of output, but zero means unlimited.' + description: maximum length of output, but zero means unlimited. in: query required: false type: integer format: int32 - name: trace_config.overrides.homestead_block - description: 'Homestead switch block (nil no fork, 0 = already homestead).' + description: Homestead switch block (nil no fork, 0 = already homestead). in: query required: false type: string @@ -2297,12 +2297,12 @@ paths: required: false type: string - name: trace_config.overrides.byzantium_block - description: 'Byzantium switch block (nil no fork, 0 = already on byzantium).' + description: Byzantium switch block (nil no fork, 0 = already on byzantium). in: query required: false type: string - name: trace_config.overrides.constantinople_block - description: 'Constantinople switch block (nil no fork, 0 = already activated).' + description: Constantinople switch block (nil no fork, 0 = already activated). in: query required: false type: string @@ -2312,7 +2312,7 @@ paths: required: false type: string - name: trace_config.overrides.istanbul_block - description: 'Istanbul switch block (nil no fork, 0 = already on istanbul).' + description: Istanbul switch block (nil no fork, 0 = already on istanbul). in: query required: false type: string @@ -2324,12 +2324,12 @@ paths: required: false type: string - name: trace_config.overrides.berlin_block - description: 'Berlin switch block (nil = no fork, 0 = already on berlin).' + description: Berlin switch block (nil = no fork, 0 = already on berlin). in: query required: false type: string - name: trace_config.overrides.london_block - description: 'London switch block (nil = no fork, 0 = already on london).' + description: London switch block (nil = no fork, 0 = already on london). in: query required: false type: string @@ -2343,9 +2343,23 @@ paths: in: query required: false type: boolean + - name: block_number + in: query + required: false + type: string + format: int64 + - name: block_hash + in: query + required: false + type: string + - name: block_time + in: query + required: false + type: string + format: int64 tags: - Query - '/ethermint/evm/v1/validator_account/{cons_address}': + /ethermint/evm/v1/validator_account/{cons_address}: get: summary: >- ValidatorAccount queries an Ethereum account's from a validator @@ -3026,7 +3040,7 @@ paths: type: boolean tags: - Query - '/cosmos/auth/v1beta1/accounts/{address}': + /cosmos/auth/v1beta1/accounts/{address}: get: summary: Account returns account details based on address. operationId: AuthAccount @@ -3037,7 +3051,6 @@ paths: type: object properties: account: - description: account defines the account of the corresponding address. type: object properties: type_url: @@ -3103,6 +3116,111 @@ paths: description: >- Must be a valid serialized protocol buffer of the above specified type. + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in + the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := ptypes.MarshalAny(foo) + ... + foo := &pb.Foo{} + if err := ptypes.UnmarshalAny(any, foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default + use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last + '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } description: >- QueryAccountResponse is the response type for the Query/Account RPC method. @@ -3526,7 +3644,7 @@ paths: } tags: - Query - '/cosmos/bank/v1beta1/balances/{address}': + /cosmos/bank/v1beta1/balances/{address}: get: summary: AllBalances queries the balance of all coins for a single account. operationId: AllBalances @@ -3660,7 +3778,7 @@ paths: type: boolean tags: - Query - '/cosmos/bank/v1beta1/balances/{address}/{denom}': + /cosmos/bank/v1beta1/balances/{address}/{denom}: get: summary: Balance queries the balance of a single coin for a single account. operationId: BankBalance @@ -3671,13 +3789,20 @@ paths: type: object properties: balance: - description: balance is the balance of the coin. type: object properties: denom: type: string amount: type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. description: >- QueryBalanceResponse is the response type for the Query/Balance RPC method. @@ -3901,7 +4026,7 @@ paths: type: boolean tags: - Query - '/cosmos/bank/v1beta1/denoms_metadata/{denom}': + /cosmos/bank/v1beta1/denoms_metadata/{denom}: get: summary: DenomsMetadata queries the client metadata of a given coin denomination. operationId: DenomMetadata @@ -3912,9 +4037,6 @@ paths: type: object properties: metadata: - description: >- - metadata describes and provides all the client information for - the requested token. type: object properties: description: @@ -3978,6 +4100,9 @@ paths: ATOM). This can be the same as the display. + description: |- + Metadata represents a struct that describes + a basic token. description: >- QueryDenomMetadataResponse is the response type for the Query/DenomMetadata RPC @@ -4199,7 +4324,7 @@ paths: type: boolean tags: - Query - '/cosmos/bank/v1beta1/supply/{denom}': + /cosmos/bank/v1beta1/supply/{denom}: get: summary: SupplyOf queries the supply of a single coin. operationId: SupplyOf @@ -4210,13 +4335,20 @@ paths: type: object properties: amount: - description: amount is the supply of the coin. type: object properties: denom: type: string amount: type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. description: >- QuerySupplyOfResponse is the response type for the Query/SupplyOf RPC method. @@ -4308,7 +4440,7 @@ paths: format: byte tags: - Query - '/cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards': + /cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards: get: summary: |- DelegationTotalRewards queries the total rewards accrued by a each @@ -4401,7 +4533,7 @@ paths: type: string tags: - Query - '/cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards/{validator_address}': + /cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards/{validator_address}: get: summary: DelegationRewards queries the total rewards accrued by a delegation. operationId: DelegationRewards @@ -4468,7 +4600,7 @@ paths: type: string tags: - Query - '/cosmos/distribution/v1beta1/delegators/{delegator_address}/validators': + /cosmos/distribution/v1beta1/delegators/{delegator_address}/validators: get: summary: DelegatorValidators queries the validators of a delegator. operationId: DistDelegatorValidators @@ -4518,7 +4650,7 @@ paths: type: string tags: - Query - '/cosmos/distribution/v1beta1/delegators/{delegator_address}/withdraw_address': + /cosmos/distribution/v1beta1/delegators/{delegator_address}/withdraw_address: get: summary: DelegatorWithdrawAddress queries withdraw address of a delegator. operationId: DelegatorWithdrawAddress @@ -4613,7 +4745,7 @@ paths: format: byte tags: - Query - '/cosmos/distribution/v1beta1/validators/{validator_address}/commission': + /cosmos/distribution/v1beta1/validators/{validator_address}/commission: get: summary: ValidatorCommission queries accumulated commission for a validator. operationId: ValidatorCommission @@ -4678,7 +4810,7 @@ paths: type: string tags: - Query - '/cosmos/distribution/v1beta1/validators/{validator_address}/outstanding_rewards': + /cosmos/distribution/v1beta1/validators/{validator_address}/outstanding_rewards: get: summary: ValidatorOutstandingRewards queries rewards of a validator address. operationId: ValidatorOutstandingRewards @@ -4750,7 +4882,7 @@ paths: type: string tags: - Query - '/cosmos/distribution/v1beta1/validators/{validator_address}/slashes': + /cosmos/distribution/v1beta1/validators/{validator_address}/slashes: get: summary: ValidatorSlashes queries slash events of a validator. operationId: ValidatorSlashes @@ -5047,7 +5179,7 @@ paths: format: byte tags: - Query - '/cosmos/gov/v1beta1/params/{params_type}': + /cosmos/gov/v1beta1/params/{params_type}: get: summary: Params queries all parameters of the gov module. operationId: GovParams @@ -5891,7 +6023,7 @@ paths: type: boolean tags: - Query - '/cosmos/gov/v1beta1/proposals/{proposal_id}': + /cosmos/gov/v1beta1/proposals/{proposal_id}: get: summary: Proposal queries proposal details based on ProposalID. operationId: Proposal @@ -6354,7 +6486,7 @@ paths: format: uint64 tags: - Query - '/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits': + /cosmos/gov/v1beta1/proposals/{proposal_id}/deposits: get: summary: Deposits queries all deposits of a single proposal. operationId: Deposits @@ -6669,7 +6801,7 @@ paths: type: boolean tags: - Query - '/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits/{depositor}': + /cosmos/gov/v1beta1/proposals/{proposal_id}/deposits/{depositor}: get: summary: >- Deposit queries single deposit information based proposalID, @@ -6682,7 +6814,6 @@ paths: type: object properties: deposit: - description: deposit defines the requested deposit. type: object properties: proposal_id: @@ -6707,6 +6838,11 @@ paths: custom method signatures required by gogoproto. + description: >- + Deposit defines an amount deposited by an account address to + an active + + proposal. description: >- QueryDepositResponse is the response type for the Query/Deposit RPC method. @@ -6913,7 +7049,7 @@ paths: type: string tags: - Query - '/cosmos/gov/v1beta1/proposals/{proposal_id}/tally': + /cosmos/gov/v1beta1/proposals/{proposal_id}/tally: get: summary: TallyResult queries the tally of a proposal vote. operationId: TallyResult @@ -6924,7 +7060,6 @@ paths: type: object properties: tally: - description: tally defines the requested tally. type: object properties: 'yes': @@ -6935,6 +7070,9 @@ paths: type: string no_with_veto: type: string + description: >- + TallyResult defines a standard tally for a governance + proposal. description: >- QueryTallyResultResponse is the response type for the Query/Tally RPC method. @@ -7136,7 +7274,7 @@ paths: format: uint64 tags: - Query - '/cosmos/gov/v1beta1/proposals/{proposal_id}/votes': + /cosmos/gov/v1beta1/proposals/{proposal_id}/votes: get: summary: Votes queries votes of a given proposal. operationId: Votes @@ -7480,9 +7618,9 @@ paths: type: boolean tags: - Query - '/cosmos/gov/v1beta1/proposals/{proposal_id}/votes/{voter}': + /cosmos/gov/v1beta1/proposals/{proposal_id}/votes/{voter}: get: - summary: 'Vote queries voted information based on proposalID, voterAddr.' + summary: Vote queries voted information based on proposalID, voterAddr. operationId: Vote responses: '200': @@ -7491,7 +7629,6 @@ paths: type: object properties: vote: - description: vote defined the queried vote. type: object properties: proposal_id: @@ -7545,6 +7682,11 @@ paths: description: >- WeightedVoteOption defines a unit of vote for vote split. + description: >- + Vote defines a vote on a governance proposal. + + A Vote consists of a proposal ID, the voter, and the vote + option. description: >- QueryVoteResponse is the response type for the Query/Vote RPC method. @@ -7751,7 +7893,7 @@ paths: type: string tags: - Query - '/cosmos/staking/v1beta1/delegations/{delegator_addr}': + /cosmos/staking/v1beta1/delegations/{delegator_addr}: get: summary: >- DelegatorDelegations queries all delegations of a given delegator @@ -8087,7 +8229,7 @@ paths: type: boolean tags: - Query - '/cosmos/staking/v1beta1/delegators/{delegator_addr}/redelegations': + /cosmos/staking/v1beta1/delegators/{delegator_addr}/redelegations: get: summary: Redelegations queries redelegations of given address. operationId: Redelegations @@ -8493,7 +8635,7 @@ paths: type: boolean tags: - Query - '/cosmos/staking/v1beta1/delegators/{delegator_addr}/unbonding_delegations': + /cosmos/staking/v1beta1/delegators/{delegator_addr}/unbonding_delegations: get: summary: >- DelegatorUnbondingDelegations queries all unbonding delegations of a @@ -8831,7 +8973,7 @@ paths: type: boolean tags: - Query - '/cosmos/staking/v1beta1/delegators/{delegator_addr}/validators': + /cosmos/staking/v1beta1/delegators/{delegator_addr}/validators: get: summary: |- DelegatorValidators queries all validators info for given delegator @@ -8854,9 +8996,6 @@ paths: operator_address defines the address of the validator's operator; bech encoded in JSON. consensus_pubkey: - description: >- - consensus_pubkey is the consensus public key of the - validator, as a Protobuf Any. type: object properties: type_url: @@ -8923,6 +9062,116 @@ paths: description: >- Must be a valid serialized protocol buffer of the above specified type. + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any + values in the form + + of utility functions or additional generated methods of + the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := ptypes.MarshalAny(foo) + ... + foo := &pb.Foo{} + if err := ptypes.UnmarshalAny(any, foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and + the unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will + yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the + regular + + representation of the deserialized, embedded message, + with an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a + custom JSON + + representation, that representation will be embedded + adding a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message + [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } jailed: type: boolean description: >- @@ -9320,7 +9569,7 @@ paths: type: boolean tags: - Query - '/cosmos/staking/v1beta1/delegators/{delegator_addr}/validators/{validator_addr}': + /cosmos/staking/v1beta1/delegators/{delegator_addr}/validators/{validator_addr}: get: summary: |- DelegatorValidator queries validator info for given delegator validator @@ -9333,7 +9582,6 @@ paths: type: object properties: validator: - description: validator defines the the validator info. type: object properties: operator_address: @@ -9342,9 +9590,6 @@ paths: operator_address defines the address of the validator's operator; bech encoded in JSON. consensus_pubkey: - description: >- - consensus_pubkey is the consensus public key of the - validator, as a Protobuf Any. type: object properties: type_url: @@ -9411,6 +9656,114 @@ paths: description: >- Must be a valid serialized protocol buffer of the above specified type. + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any + values in the form + + of utility functions or additional generated methods of + the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := ptypes.MarshalAny(foo) + ... + foo := &pb.Foo{} + if err := ptypes.UnmarshalAny(any, foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and + the unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will + yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a + custom JSON + + representation, that representation will be embedded + adding a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } jailed: type: boolean description: >- @@ -9512,6 +9865,29 @@ paths: description: >- min_self_delegation is the validator's self declared minimum self delegation. + description: >- + Validator defines a validator, together with the total amount + of the + + Validator's bond shares and their exchange rate to coins. + Slashing results in + + a decrease in the exchange rate, allowing correct calculation + of future + + undelegations without iterating over delegators. When coins + are delegated to + + this validator, the validator is credited with a delegation + whose number of + + bond shares is based on the amount of coins delegated divided + by the current + + exchange rate. Voting power can be calculated as total bonded + shares + + multiplied by exchange rate. description: |- QueryDelegatorValidatorResponse response type for the Query/DelegatorValidator RPC method. @@ -9717,7 +10093,7 @@ paths: type: string tags: - Query - '/cosmos/staking/v1beta1/historical_info/{height}': + /cosmos/staking/v1beta1/historical_info/{height}: get: summary: HistoricalInfo queries the historical info for given height. operationId: HistoricalInfo @@ -9819,9 +10195,6 @@ paths: operator_address defines the address of the validator's operator; bech encoded in JSON. consensus_pubkey: - description: >- - consensus_pubkey is the consensus public key of the - validator, as a Protobuf Any. type: object properties: type_url: @@ -9888,6 +10261,117 @@ paths: description: >- Must be a valid serialized protocol buffer of the above specified type. + description: >- + `Any` contains an arbitrary serialized protocol + buffer message along with a + + URL that describes the type of the serialized + message. + + + Protobuf library provides support to pack/unpack Any + values in the form + + of utility functions or additional generated methods + of the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := ptypes.MarshalAny(foo) + ... + foo := &pb.Foo{} + if err := ptypes.UnmarshalAny(any, foo); err != nil { + ... + } + + The pack methods provided by protobuf library will + by default use + + 'type.googleapis.com/full.type.name' as the type URL + and the unpack + + methods only use the fully qualified type name after + the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" + will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the + regular + + representation of the deserialized, embedded + message, with an + + additional field `@type` which contains the type + URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a + custom JSON + + representation, that representation will be embedded + adding a field + + `value` which holds the custom JSON in addition to + the `@type` + + field. Example (for message + [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } jailed: type: boolean description: >- @@ -10678,9 +11162,6 @@ paths: operator_address defines the address of the validator's operator; bech encoded in JSON. consensus_pubkey: - description: >- - consensus_pubkey is the consensus public key of the - validator, as a Protobuf Any. type: object properties: type_url: @@ -10747,6 +11228,116 @@ paths: description: >- Must be a valid serialized protocol buffer of the above specified type. + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any + values in the form + + of utility functions or additional generated methods of + the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := ptypes.MarshalAny(foo) + ... + foo := &pb.Foo{} + if err := ptypes.UnmarshalAny(any, foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and + the unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will + yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the + regular + + representation of the deserialized, embedded message, + with an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a + custom JSON + + representation, that representation will be embedded + adding a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message + [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } jailed: type: boolean description: >- @@ -11144,7 +11735,7 @@ paths: type: boolean tags: - Query - '/cosmos/staking/v1beta1/validators/{validator_addr}': + /cosmos/staking/v1beta1/validators/{validator_addr}: get: summary: Validator queries validator info for given validator address. operationId: Validator @@ -11155,7 +11746,6 @@ paths: type: object properties: validator: - description: validator defines the the validator info. type: object properties: operator_address: @@ -11164,9 +11754,6 @@ paths: operator_address defines the address of the validator's operator; bech encoded in JSON. consensus_pubkey: - description: >- - consensus_pubkey is the consensus public key of the - validator, as a Protobuf Any. type: object properties: type_url: @@ -11233,6 +11820,114 @@ paths: description: >- Must be a valid serialized protocol buffer of the above specified type. + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any + values in the form + + of utility functions or additional generated methods of + the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := ptypes.MarshalAny(foo) + ... + foo := &pb.Foo{} + if err := ptypes.UnmarshalAny(any, foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and + the unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will + yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a + custom JSON + + representation, that representation will be embedded + adding a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } jailed: type: boolean description: >- @@ -11334,6 +12029,29 @@ paths: description: >- min_self_delegation is the validator's self declared minimum self delegation. + description: >- + Validator defines a validator, together with the total amount + of the + + Validator's bond shares and their exchange rate to coins. + Slashing results in + + a decrease in the exchange rate, allowing correct calculation + of future + + undelegations without iterating over delegators. When coins + are delegated to + + this validator, the validator is credited with a delegation + whose number of + + bond shares is based on the amount of coins delegated divided + by the current + + exchange rate. Voting power can be calculated as total bonded + shares + + multiplied by exchange rate. title: >- QueryValidatorResponse is response type for the Query/Validator RPC method @@ -11534,7 +12252,7 @@ paths: type: string tags: - Query - '/cosmos/staking/v1beta1/validators/{validator_addr}/delegations': + /cosmos/staking/v1beta1/validators/{validator_addr}/delegations: get: summary: ValidatorDelegations queries delegate info for given validator. operationId: ValidatorDelegations @@ -11865,7 +12583,7 @@ paths: type: boolean tags: - Query - '/cosmos/staking/v1beta1/validators/{validator_addr}/delegations/{delegator_addr}': + /cosmos/staking/v1beta1/validators/{validator_addr}/delegations/{delegator_addr}: get: summary: Delegation queries delegate info for given validator delegator pair. operationId: Delegation @@ -11876,9 +12594,6 @@ paths: type: object properties: delegation_response: - description: >- - delegation_responses defines the delegation info of a - delegation. type: object properties: delegation: @@ -11920,6 +12635,12 @@ paths: custom method signatures required by gogoproto. + description: >- + DelegationResponse is equivalent to Delegation except that it + contains a + + balance in addition to shares which is more suitable for + client responses. description: >- QueryDelegationResponse is response type for the Query/Delegation RPC method. @@ -12125,7 +12846,7 @@ paths: type: string tags: - Query - '/cosmos/staking/v1beta1/validators/{validator_addr}/delegations/{delegator_addr}/unbonding_delegation': + /cosmos/staking/v1beta1/validators/{validator_addr}/delegations/{delegator_addr}/unbonding_delegation: get: summary: |- UnbondingDelegation queries unbonding info for given validator delegator @@ -12138,7 +12859,6 @@ paths: type: object properties: unbond: - description: unbond defines the unbonding information of a delegation. type: object properties: delegator_address: @@ -12180,6 +12900,11 @@ paths: UnbondingDelegationEntry defines an unbonding object with relevant metadata. description: entries are the unbonding delegation entries. + description: >- + UnbondingDelegation stores all of a single delegator's + unbonding bonds + + for a single validator in an time-ordered list. description: >- QueryDelegationResponse is response type for the Query/UnbondingDelegation @@ -12387,7 +13112,7 @@ paths: type: string tags: - Query - '/cosmos/staking/v1beta1/validators/{validator_addr}/unbonding_delegations': + /cosmos/staking/v1beta1/validators/{validator_addr}/unbonding_delegations: get: summary: >- ValidatorUnbondingDelegations queries unbonding delegations of a @@ -12729,7 +13454,7 @@ definitions: properties: homestead_block: type: string - title: 'Homestead switch block (nil no fork, 0 = already homestead)' + title: Homestead switch block (nil no fork, 0 = already homestead) dao_fork_block: type: string title: TheDAO hard-fork switch block (nil no fork) @@ -12756,16 +13481,16 @@ definitions: title: EIP158 HF block byzantium_block: type: string - title: 'Byzantium switch block (nil no fork, 0 = already on byzantium)' + title: Byzantium switch block (nil no fork, 0 = already on byzantium) constantinople_block: type: string - title: 'Constantinople switch block (nil no fork, 0 = already activated)' + title: Constantinople switch block (nil no fork, 0 = already activated) petersburg_block: type: string title: Petersburg switch block (nil same as Constantinople) istanbul_block: type: string - title: 'Istanbul switch block (nil no fork, 0 = already on istanbul)' + title: Istanbul switch block (nil no fork, 0 = already on istanbul) muir_glacier_block: type: string title: >- @@ -12773,10 +13498,10 @@ definitions: activated) berlin_block: type: string - title: 'Berlin switch block (nil = no fork, 0 = already on berlin)' + title: Berlin switch block (nil = no fork, 0 = already on berlin) london_block: type: string - title: 'London switch block (nil = no fork, 0 = already on london)' + title: London switch block (nil = no fork, 0 = already on london) description: >- ChainConfig defines the Ethereum ChainConfig parameters using *sdk.Int values @@ -12804,7 +13529,7 @@ definitions: data: type: string format: byte - title: 'supplied by the contract, usually ABI-encoded' + title: supplied by the contract, usually ABI-encoded block_number: type: string format: uint64 @@ -12843,7 +13568,6 @@ definitions: type: object properties: data: - title: inner transaction data type: object properties: type_url: @@ -13002,6 +13726,7 @@ definitions: "@type": "type.googleapis.com/google.protobuf.Duration", "value": "1.212s" } + title: inner transaction data size: type: number format: double @@ -13041,7 +13766,7 @@ definitions: data: type: string format: byte - title: 'supplied by the contract, usually ABI-encoded' + title: supplied by the contract, usually ABI-encoded block_number: type: string format: uint64 @@ -13123,7 +13848,7 @@ definitions: properties: homestead_block: type: string - title: 'Homestead switch block (nil no fork, 0 = already homestead)' + title: Homestead switch block (nil no fork, 0 = already homestead) dao_fork_block: type: string title: TheDAO hard-fork switch block (nil no fork) @@ -13150,16 +13875,16 @@ definitions: title: EIP158 HF block byzantium_block: type: string - title: 'Byzantium switch block (nil no fork, 0 = already on byzantium)' + title: Byzantium switch block (nil no fork, 0 = already on byzantium) constantinople_block: type: string - title: 'Constantinople switch block (nil no fork, 0 = already activated)' + title: Constantinople switch block (nil no fork, 0 = already activated) petersburg_block: type: string title: Petersburg switch block (nil same as Constantinople) istanbul_block: type: string - title: 'Istanbul switch block (nil no fork, 0 = already on istanbul)' + title: Istanbul switch block (nil no fork, 0 = already on istanbul) muir_glacier_block: type: string title: >- @@ -13167,10 +13892,10 @@ definitions: activated) berlin_block: type: string - title: 'Berlin switch block (nil = no fork, 0 = already on berlin)' + title: Berlin switch block (nil = no fork, 0 = already on berlin) london_block: type: string - title: 'London switch block (nil = no fork, 0 = already on london)' + title: London switch block (nil = no fork, 0 = already on london) description: >- ChainConfig defines the Ethereum ChainConfig parameters using *sdk.Int values @@ -13267,7 +13992,7 @@ definitions: properties: homestead_block: type: string - title: 'Homestead switch block (nil no fork, 0 = already homestead)' + title: Homestead switch block (nil no fork, 0 = already homestead) dao_fork_block: type: string title: TheDAO hard-fork switch block (nil no fork) @@ -13294,7 +14019,7 @@ definitions: title: EIP158 HF block byzantium_block: type: string - title: 'Byzantium switch block (nil no fork, 0 = already on byzantium)' + title: Byzantium switch block (nil no fork, 0 = already on byzantium) constantinople_block: type: string title: >- @@ -13305,7 +14030,7 @@ definitions: title: Petersburg switch block (nil same as Constantinople) istanbul_block: type: string - title: 'Istanbul switch block (nil no fork, 0 = already on istanbul)' + title: Istanbul switch block (nil no fork, 0 = already on istanbul) muir_glacier_block: type: string title: >- @@ -13313,10 +14038,10 @@ definitions: activated) berlin_block: type: string - title: 'Berlin switch block (nil = no fork, 0 = already on berlin)' + title: Berlin switch block (nil = no fork, 0 = already on berlin) london_block: type: string - title: 'London switch block (nil = no fork, 0 = already on london)' + title: London switch block (nil = no fork, 0 = already on london) description: >- ChainConfig defines the Ethereum ChainConfig parameters using *sdk.Int values @@ -13391,7 +14116,7 @@ definitions: limit: type: integer format: int32 - title: 'maximum length of output, but zero means unlimited' + title: maximum length of output, but zero means unlimited overrides: title: >- Chain overrides, can be used to execute a trace using future fork @@ -13400,7 +14125,7 @@ definitions: properties: homestead_block: type: string - title: 'Homestead switch block (nil no fork, 0 = already homestead)' + title: Homestead switch block (nil no fork, 0 = already homestead) dao_fork_block: type: string title: TheDAO hard-fork switch block (nil no fork) @@ -13427,16 +14152,16 @@ definitions: title: EIP158 HF block byzantium_block: type: string - title: 'Byzantium switch block (nil no fork, 0 = already on byzantium)' + title: Byzantium switch block (nil no fork, 0 = already on byzantium) constantinople_block: type: string - title: 'Constantinople switch block (nil no fork, 0 = already activated)' + title: Constantinople switch block (nil no fork, 0 = already activated) petersburg_block: type: string title: Petersburg switch block (nil same as Constantinople) istanbul_block: type: string - title: 'Istanbul switch block (nil no fork, 0 = already on istanbul)' + title: Istanbul switch block (nil no fork, 0 = already on istanbul) muir_glacier_block: type: string title: >- @@ -13444,10 +14169,10 @@ definitions: activated) berlin_block: type: string - title: 'Berlin switch block (nil = no fork, 0 = already on berlin)' + title: Berlin switch block (nil = no fork, 0 = already on berlin) london_block: type: string - title: 'London switch block (nil = no fork, 0 = already on london)' + title: London switch block (nil = no fork, 0 = already on london) description: >- ChainConfig defines the Ethereum ChainConfig parameters using *sdk.Int values @@ -13812,7 +14537,6 @@ definitions: type: object properties: account: - description: account defines the account of the corresponding address. type: object properties: type_url: @@ -13873,6 +14597,104 @@ definitions: description: >- Must be a valid serialized protocol buffer of the above specified type. + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := ptypes.MarshalAny(foo) + ... + foo := &pb.Foo{} + if err := ptypes.UnmarshalAny(any, foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } description: >- QueryAccountResponse is the response type for the Query/Account RPC method. @@ -14316,13 +15138,17 @@ definitions: type: object properties: balance: - description: balance is the balance of the coin. type: object properties: denom: type: string amount: type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. description: >- QueryBalanceResponse is the response type for the Query/Balance RPC method. @@ -14330,9 +15156,6 @@ definitions: type: object properties: metadata: - description: >- - metadata describes and provides all the client information for the - requested token. type: object properties: description: @@ -14391,6 +15214,9 @@ definitions: This can be the same as the display. + description: |- + Metadata represents a struct that describes + a basic token. description: >- QueryDenomMetadataResponse is the response type for the Query/DenomMetadata RPC @@ -14519,13 +15345,17 @@ definitions: type: object properties: amount: - description: amount is the supply of the coin. type: object properties: denom: type: string amount: type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. description: >- QuerySupplyOfResponse is the response type for the Query/SupplyOf RPC method. @@ -15297,7 +16127,6 @@ definitions: type: object properties: deposit: - description: deposit defines the requested deposit. type: object properties: proposal_id: @@ -15322,6 +16151,9 @@ definitions: method signatures required by gogoproto. + description: |- + Deposit defines an amount deposited by an account address to an active + proposal. description: >- QueryDepositResponse is the response type for the Query/Deposit RPC method. @@ -15958,7 +16790,6 @@ definitions: type: object properties: tally: - description: tally defines the requested tally. type: object properties: 'yes': @@ -15969,6 +16800,7 @@ definitions: type: string no_with_veto: type: string + description: TallyResult defines a standard tally for a governance proposal. description: >- QueryTallyResultResponse is the response type for the Query/Tally RPC method. @@ -15976,7 +16808,6 @@ definitions: type: object properties: vote: - description: vote defined the queried vote. type: object properties: proposal_id: @@ -16027,6 +16858,9 @@ definitions: weight: type: string description: WeightedVoteOption defines a unit of vote for vote split. + description: |- + Vote defines a vote on a governance proposal. + A Vote consists of a proposal ID, the voter, and the vote option. description: QueryVoteResponse is the response type for the Query/Vote RPC method. cosmos.gov.v1beta1.QueryVotesResponse: type: object @@ -16270,7 +17104,7 @@ definitions: properties: rate: type: string - description: 'rate is the commission rate charged to delegators, as a fraction.' + description: rate is the commission rate charged to delegators, as a fraction. max_rate: type: string description: >- @@ -16291,7 +17125,7 @@ definitions: properties: rate: type: string - description: 'rate is the commission rate charged to delegators, as a fraction.' + description: rate is the commission rate charged to delegators, as a fraction. max_rate: type: string description: >- @@ -16469,9 +17303,6 @@ definitions: operator_address defines the address of the validator's operator; bech encoded in JSON. consensus_pubkey: - description: >- - consensus_pubkey is the consensus public key of the validator, - as a Protobuf Any. type: object properties: type_url: @@ -16537,6 +17368,109 @@ definitions: description: >- Must be a valid serialized protocol buffer of the above specified type. + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in + the form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := ptypes.MarshalAny(foo) + ... + foo := &pb.Foo{} + if err := ptypes.UnmarshalAny(any, foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default + use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last + '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } jailed: type: boolean description: >- @@ -16699,7 +17633,6 @@ definitions: type: object properties: delegation_response: - description: delegation_responses defines the delegation info of a delegation. type: object properties: delegation: @@ -16741,6 +17674,12 @@ definitions: method signatures required by gogoproto. + description: >- + DelegationResponse is equivalent to Delegation except that it contains + a + + balance in addition to shares which is more suitable for client + responses. description: >- QueryDelegationResponse is response type for the Query/Delegation RPC method. @@ -16894,7 +17833,6 @@ definitions: type: object properties: validator: - description: validator defines the the validator info. type: object properties: operator_address: @@ -16903,9 +17841,6 @@ definitions: operator_address defines the address of the validator's operator; bech encoded in JSON. consensus_pubkey: - description: >- - consensus_pubkey is the consensus public key of the validator, as - a Protobuf Any. type: object properties: type_url: @@ -16969,6 +17904,107 @@ definitions: description: >- Must be a valid serialized protocol buffer of the above specified type. + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := ptypes.MarshalAny(foo) + ... + foo := &pb.Foo{} + if err := ptypes.UnmarshalAny(any, foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } jailed: type: boolean description: >- @@ -17060,6 +18096,27 @@ definitions: description: >- min_self_delegation is the validator's self declared minimum self delegation. + description: >- + Validator defines a validator, together with the total amount of the + + Validator's bond shares and their exchange rate to coins. Slashing + results in + + a decrease in the exchange rate, allowing correct calculation of + future + + undelegations without iterating over delegators. When coins are + delegated to + + this validator, the validator is credited with a delegation whose + number of + + bond shares is based on the amount of coins delegated divided by the + current + + exchange rate. Voting power can be calculated as total bonded shares + + multiplied by exchange rate. description: |- QueryDelegatorValidatorResponse response type for the Query/DelegatorValidator RPC method. @@ -17077,9 +18134,6 @@ definitions: operator_address defines the address of the validator's operator; bech encoded in JSON. consensus_pubkey: - description: >- - consensus_pubkey is the consensus public key of the validator, - as a Protobuf Any. type: object properties: type_url: @@ -17145,6 +18199,109 @@ definitions: description: >- Must be a valid serialized protocol buffer of the above specified type. + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in + the form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := ptypes.MarshalAny(foo) + ... + foo := &pb.Foo{} + if err := ptypes.UnmarshalAny(any, foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default + use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last + '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } jailed: type: boolean description: >- @@ -17376,9 +18533,6 @@ definitions: operator_address defines the address of the validator's operator; bech encoded in JSON. consensus_pubkey: - description: >- - consensus_pubkey is the consensus public key of the - validator, as a Protobuf Any. type: object properties: type_url: @@ -17445,6 +18599,114 @@ definitions: description: >- Must be a valid serialized protocol buffer of the above specified type. + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := ptypes.MarshalAny(foo) + ... + foo := &pb.Foo{} + if err := ptypes.UnmarshalAny(any, foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } jailed: type: boolean description: >- @@ -17747,7 +19009,6 @@ definitions: type: object properties: unbond: - description: unbond defines the unbonding information of a delegation. type: object properties: delegator_address: @@ -17783,6 +19044,9 @@ definitions: UnbondingDelegationEntry defines an unbonding object with relevant metadata. description: entries are the unbonding delegation entries. + description: |- + UnbondingDelegation stores all of a single delegator's unbonding bonds + for a single validator in an time-ordered list. description: |- QueryDelegationResponse is response type for the Query/UnbondingDelegation RPC method. @@ -17864,7 +19128,6 @@ definitions: type: object properties: validator: - description: validator defines the the validator info. type: object properties: operator_address: @@ -17873,9 +19136,6 @@ definitions: operator_address defines the address of the validator's operator; bech encoded in JSON. consensus_pubkey: - description: >- - consensus_pubkey is the consensus public key of the validator, as - a Protobuf Any. type: object properties: type_url: @@ -17939,6 +19199,107 @@ definitions: description: >- Must be a valid serialized protocol buffer of the above specified type. + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := ptypes.MarshalAny(foo) + ... + foo := &pb.Foo{} + if err := ptypes.UnmarshalAny(any, foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } jailed: type: boolean description: >- @@ -18030,6 +19391,27 @@ definitions: description: >- min_self_delegation is the validator's self declared minimum self delegation. + description: >- + Validator defines a validator, together with the total amount of the + + Validator's bond shares and their exchange rate to coins. Slashing + results in + + a decrease in the exchange rate, allowing correct calculation of + future + + undelegations without iterating over delegators. When coins are + delegated to + + this validator, the validator is credited with a delegation whose + number of + + bond shares is based on the amount of coins delegated divided by the + current + + exchange rate. Voting power can be calculated as total bonded shares + + multiplied by exchange rate. title: QueryValidatorResponse is response type for the Query/Validator RPC method cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsResponse: type: object @@ -18116,9 +19498,6 @@ definitions: operator_address defines the address of the validator's operator; bech encoded in JSON. consensus_pubkey: - description: >- - consensus_pubkey is the consensus public key of the validator, - as a Protobuf Any. type: object properties: type_url: @@ -18184,6 +19563,109 @@ definitions: description: >- Must be a valid serialized protocol buffer of the above specified type. + description: >- + `Any` contains an arbitrary serialized protocol buffer message + along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in + the form + + of utility functions or additional generated methods of the Any + type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := ptypes.MarshalAny(foo) + ... + foo := &pb.Foo{} + if err := ptypes.UnmarshalAny(any, foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default + use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the last + '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a + field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } jailed: type: boolean description: >- @@ -18604,9 +20086,6 @@ definitions: operator_address defines the address of the validator's operator; bech encoded in JSON. consensus_pubkey: - description: >- - consensus_pubkey is the consensus public key of the validator, as a - Protobuf Any. type: object properties: type_url: @@ -18667,6 +20146,104 @@ definitions: description: >- Must be a valid serialized protocol buffer of the above specified type. + description: >- + `Any` contains an arbitrary serialized protocol buffer message along + with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values in the + form + + of utility functions or additional generated methods of the Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := ptypes.MarshalAny(foo) + ... + foo := &pb.Foo{} + if err := ptypes.UnmarshalAny(any, foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + + 'type.googleapis.com/full.type.name' as the type URL and the unpack + + methods only use the fully qualified type name after the last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield type + + name "y.z". + + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with an + + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom JSON + + representation, that representation will be embedded adding a field + + `value` which holds the custom JSON in addition to the `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } jailed: type: boolean description: >- diff --git a/docs/api/proto-docs.md b/docs/api/proto-docs.md index 48b45adc..0b9c2c9a 100644 --- a/docs/api/proto-docs.md +++ b/docs/api/proto-docs.md @@ -47,6 +47,8 @@ - [QueryParamsResponse](#ethermint.evm.v1.QueryParamsResponse) - [QueryStorageRequest](#ethermint.evm.v1.QueryStorageRequest) - [QueryStorageResponse](#ethermint.evm.v1.QueryStorageResponse) + - [QueryTraceBlockRequest](#ethermint.evm.v1.QueryTraceBlockRequest) + - [QueryTraceBlockResponse](#ethermint.evm.v1.QueryTraceBlockResponse) - [QueryTraceTxRequest](#ethermint.evm.v1.QueryTraceTxRequest) - [QueryTraceTxResponse](#ethermint.evm.v1.QueryTraceTxResponse) - [QueryTxLogsRequest](#ethermint.evm.v1.QueryTxLogsRequest) @@ -508,7 +510,7 @@ Msg defines the evm Msg service. | Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | | ----------- | ------------ | ------------- | ------------| ------- | -------- | -| `EthereumTx` | [MsgEthereumTx](#ethermint.evm.v1.MsgEthereumTx) | [MsgEthereumTxResponse](#ethermint.evm.v1.MsgEthereumTxResponse) | EthereumTx defines a method submitting Ethereum transactions. | | +| `EthereumTx` | [MsgEthereumTx](#ethermint.evm.v1.MsgEthereumTx) | [MsgEthereumTxResponse](#ethermint.evm.v1.MsgEthereumTxResponse) | EthereumTx defines a method submitting Ethereum transactions. | POST|/ethermint/evm/v1/ethereum_tx| @@ -736,6 +738,40 @@ method. + + +### QueryTraceBlockRequest +QueryTraceBlockRequest defines TraceTx request + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `txs` | [MsgEthereumTx](#ethermint.evm.v1.MsgEthereumTx) | repeated | txs messages in the block | +| `trace_config` | [TraceConfig](#ethermint.evm.v1.TraceConfig) | | TraceConfig holds extra parameters to trace functions. | +| `block_number` | [int64](#int64) | | block number | +| `block_hash` | [string](#string) | | block hex hash | +| `block_time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | block time | + + + + + + + + +### QueryTraceBlockResponse +QueryTraceBlockResponse defines TraceBlock response + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `data` | [bytes](#bytes) | | | + + + + + + ### QueryTraceTxRequest @@ -747,6 +783,10 @@ QueryTraceTxRequest defines TraceTx request | `msg` | [MsgEthereumTx](#ethermint.evm.v1.MsgEthereumTx) | | msgEthereumTx for the requested transaction | | `tx_index` | [uint64](#uint64) | | transaction index | | `trace_config` | [TraceConfig](#ethermint.evm.v1.TraceConfig) | | TraceConfig holds extra parameters to trace functions. | +| `predecessors` | [MsgEthereumTx](#ethermint.evm.v1.MsgEthereumTx) | repeated | the predecessor transactions included in the same block need to be replayed first to get correct context for tracing. | +| `block_number` | [int64](#int64) | | block number of requested transaction | +| `block_hash` | [string](#string) | | block hex hash of requested transaction | +| `block_time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | block time of requested transaction | @@ -857,6 +897,7 @@ Query defines the gRPC querier service. | `EthCall` | [EthCallRequest](#ethermint.evm.v1.EthCallRequest) | [MsgEthereumTxResponse](#ethermint.evm.v1.MsgEthereumTxResponse) | EthCall implements the `eth_call` rpc api | GET|/ethermint/evm/v1/eth_call| | `EstimateGas` | [EthCallRequest](#ethermint.evm.v1.EthCallRequest) | [EstimateGasResponse](#ethermint.evm.v1.EstimateGasResponse) | EstimateGas implements the `eth_estimateGas` rpc api | GET|/ethermint/evm/v1/estimate_gas| | `TraceTx` | [QueryTraceTxRequest](#ethermint.evm.v1.QueryTraceTxRequest) | [QueryTraceTxResponse](#ethermint.evm.v1.QueryTraceTxResponse) | TraceTx implements the `debug_traceTransaction` rpc api | GET|/ethermint/evm/v1/trace_tx| +| `TraceBlock` | [QueryTraceBlockRequest](#ethermint.evm.v1.QueryTraceBlockRequest) | [QueryTraceBlockResponse](#ethermint.evm.v1.QueryTraceBlockResponse) | TraceBlock implements the `debug_traceBlockByNumber` and `debug_traceBlockByHash` rpc api | GET|/ethermint/evm/v1/trace_block| diff --git a/go.mod b/go.mod index 74d9e423..72437e6b 100644 --- a/go.mod +++ b/go.mod @@ -8,6 +8,7 @@ require ( github.com/cosmos/cosmos-sdk v0.44.3 github.com/cosmos/go-bip39 v1.0.0 github.com/cosmos/ibc-go/v2 v2.0.0-rc0 + github.com/davecgh/go-spew v1.1.1 github.com/ethereum/go-ethereum v1.10.11 github.com/gogo/protobuf v1.3.3 github.com/golang/protobuf v1.5.2 @@ -34,14 +35,13 @@ require ( github.com/tendermint/tm-db v0.6.4 github.com/tyler-smith/go-bip39 v1.1.0 go.etcd.io/bbolt v1.3.6 // indirect - golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 // indirect - google.golang.org/genproto v0.0.0-20211021150943-2b146023228c + golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa // indirect + google.golang.org/genproto v0.0.0-20211104193956-4c6863e31247 google.golang.org/grpc v1.41.0 + google.golang.org/protobuf v1.27.1 gopkg.in/yaml.v2 v2.4.0 ) -require github.com/davecgh/go-spew v1.1.1 - require ( filippo.io/edwards25519 v1.0.0-beta.2 // indirect github.com/99designs/keyring v1.1.6 // indirect @@ -138,7 +138,6 @@ require ( golang.org/x/sys v0.0.0-20211025112917-711f33c9992c // indirect golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 // indirect golang.org/x/text v0.3.7 // indirect - google.golang.org/protobuf v1.27.1 // indirect gopkg.in/ini.v1 v1.63.2 // indirect gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect gopkg.in/olebedev/go-duktape.v3 v3.0.0-20200619000410-60c24ae608a6 // indirect diff --git a/go.sum b/go.sum index 3d468f4f..9c19a6a6 100644 --- a/go.sum +++ b/go.sum @@ -1293,8 +1293,8 @@ golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWP golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 h1:7I4JAnoQBe7ZtJcBaYHi5UtiO8tQHbUSXxL+pnGRANg= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa h1:idItI2DDfCokpg0N51B2VtiLdJ4vAuXC9fnCb2gACo4= +golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1759,8 +1759,8 @@ google.golang.org/genproto v0.0.0-20210805201207-89edb61ffb67/go.mod h1:ob2IJxKr google.golang.org/genproto v0.0.0-20210813162853-db860fec028c/go.mod h1:cFeNkxwySK631ADgubI+/XFU/xp8FD5KIVV4rj8UC5w= google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20211021150943-2b146023228c h1:FqrtZMB5Wr+/RecOM3uPJNPfWR8Upb5hAPnt7PU6i4k= -google.golang.org/genproto v0.0.0-20211021150943-2b146023228c/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211104193956-4c6863e31247 h1:ZONpjmFT5e+I/0/xE3XXbG5OIvX2hRYzol04MhKBl2E= +google.golang.org/genproto v0.0.0-20211104193956-4c6863e31247/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/grpc v1.33.2 h1:EQyQC3sa8M+p6Ulc8yy9SWSS2GVwyRc83gAbG8lrl4o= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= diff --git a/proto/ethermint/evm/v1/query.proto b/proto/ethermint/evm/v1/query.proto index fd4c0a7f..11a1be2f 100644 --- a/proto/ethermint/evm/v1/query.proto +++ b/proto/ethermint/evm/v1/query.proto @@ -6,6 +6,7 @@ import "cosmos/base/query/v1beta1/pagination.proto"; import "google/api/annotations.proto"; import "ethermint/evm/v1/evm.proto"; import "ethermint/evm/v1/tx.proto"; +import "google/protobuf/timestamp.proto"; option go_package = "github.com/tharsis/ethermint/x/evm/types"; @@ -65,6 +66,11 @@ service Query { rpc TraceTx(QueryTraceTxRequest) returns (QueryTraceTxResponse) { option (google.api.http).get = "/ethermint/evm/v1/trace_tx"; } + + // TraceBlock implements the `debug_traceBlockByNumber` and `debug_traceBlockByHash` rpc api + rpc TraceBlock(QueryTraceBlockRequest) returns (QueryTraceBlockResponse) { + option (google.api.http).get = "/ethermint/evm/v1/trace_block"; + } } // QueryAccountRequest is the request type for the Query/Account RPC method. @@ -228,6 +234,15 @@ message QueryTraceTxRequest { uint64 tx_index = 2; // TraceConfig holds extra parameters to trace functions. TraceConfig trace_config = 3; + // the predecessor transactions included in the same block + // need to be replayed first to get correct context for tracing. + repeated MsgEthereumTx predecessors = 4; + // block number of requested transaction + int64 block_number = 5; + // block hex hash of requested transaction + string block_hash = 6; + // block time of requested transaction + google.protobuf.Timestamp block_time = 7 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; } // QueryTraceTxResponse defines TraceTx response @@ -235,3 +250,23 @@ message QueryTraceTxResponse { // response serialized in bytes bytes data = 1; } + +// QueryTraceBlockRequest defines TraceTx request +message QueryTraceBlockRequest { + // txs messages in the block + repeated MsgEthereumTx txs = 1; + // TraceConfig holds extra parameters to trace functions. + TraceConfig trace_config = 3; + // block number + int64 block_number = 5; + // block hex hash + string block_hash = 6; + // block time + google.protobuf.Timestamp block_time = 7 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; +} + +// QueryTraceBlockResponse defines TraceBlock response +message QueryTraceBlockResponse { + bytes data = 1; +} + diff --git a/proto/ethermint/evm/v1/tx.proto b/proto/ethermint/evm/v1/tx.proto index d9bb7961..1a239689 100644 --- a/proto/ethermint/evm/v1/tx.proto +++ b/proto/ethermint/evm/v1/tx.proto @@ -13,7 +13,7 @@ option go_package = "github.com/tharsis/ethermint/x/evm/types"; service Msg { // EthereumTx defines a method submitting Ethereum transactions. rpc EthereumTx(MsgEthereumTx) returns (MsgEthereumTxResponse) { - option (google.api.http).get = "/ethermint/evm/v1/ethereum_tx"; + option (google.api.http).post = "/ethermint/evm/v1/ethereum_tx"; }; } diff --git a/rpc/ethereum/namespaces/debug/api.go b/rpc/ethereum/namespaces/debug/api.go index 0ddef354..49933ddb 100644 --- a/rpc/ethereum/namespaces/debug/api.go +++ b/rpc/ethereum/namespaces/debug/api.go @@ -14,7 +14,7 @@ import ( "time" "github.com/davecgh/go-spew/spew" - "github.com/tendermint/tendermint/types" + tmrpctypes "github.com/tendermint/tendermint/rpc/core/types" evmtypes "github.com/tharsis/ethermint/x/evm/types" @@ -81,6 +81,35 @@ func (a *API) TraceTransaction(hash common.Hash, config *evmtypes.TraceConfig) ( return nil, errors.New("genesis is not traceable") } + blk, err := a.backend.GetTendermintBlockByNumber(rpctypes.BlockNumber(transaction.Height)) + if err != nil { + a.logger.Debug("block not found", "height", transaction.Height) + return nil, err + } + + // check tx index is not out of bound + if uint32(len(blk.Block.Txs)) < transaction.Index { + a.logger.Debug("tx index out of bounds", "index", transaction.Index, "hash", hash.String(), "height", blk.Block.Height) + return nil, fmt.Errorf("transaction not included in block %v", blk.Block.Height) + } + + // nolint: prealloc + var predecessors []*evmtypes.MsgEthereumTx + for _, txBz := range blk.Block.Txs[:transaction.Index] { + tx, err := a.clientCtx.TxConfig.TxDecoder()(txBz) + if err != nil { + a.logger.Debug("failed to decode transaction in block", "height", blk.Block.Height, "error", err.Error()) + continue + } + msg := tx.GetMsgs()[0] + ethMsg, ok := msg.(*evmtypes.MsgEthereumTx) + if !ok { + continue + } + + predecessors = append(predecessors, ethMsg) + } + tx, err := a.clientCtx.TxConfig.TxDecoder()(transaction.Tx) if err != nil { a.logger.Debug("tx not found", "hash", hash) @@ -94,15 +123,25 @@ func (a *API) TraceTransaction(hash common.Hash, config *evmtypes.TraceConfig) ( } traceTxRequest := evmtypes.QueryTraceTxRequest{ - Msg: ethMessage, - TxIndex: uint64(transaction.Index), + Msg: ethMessage, + TxIndex: uint64(transaction.Index), + Predecessors: predecessors, + BlockNumber: blk.Block.Height, + BlockTime: blk.Block.Time, + BlockHash: common.Bytes2Hex(blk.BlockID.Hash), } if config != nil { traceTxRequest.TraceConfig = config } - traceResult, err := a.queryClient.TraceTx(rpctypes.ContextWithHeight(transaction.Height), &traceTxRequest) + // minus one to get the context of block beginning + contextHeight := transaction.Height - 1 + if contextHeight < 1 { + // 0 is a special value in `ContextWithHeight` + contextHeight = 1 + } + traceResult, err := a.queryClient.TraceTx(rpctypes.ContextWithHeight(contextHeight), &traceTxRequest) if err != nil { return nil, err } @@ -131,13 +170,14 @@ func (a *API) TraceBlockByNumber(height rpctypes.BlockNumber, config *evmtypes.T return nil, err } - return a.traceBlock(height, config, resBlock.Block.Txs) + return a.traceBlock(height, config, resBlock) } // traceBlock configures a new tracer according to the provided configuration, and // executes all the transactions contained within. The return value will be one item // per transaction, dependent on the requested tracer. -func (a API) traceBlock(height rpctypes.BlockNumber, config *evmtypes.TraceConfig, txs types.Txs) ([]*evmtypes.TxTraceResult, error) { +func (a *API) traceBlock(height rpctypes.BlockNumber, config *evmtypes.TraceConfig, block *tmrpctypes.ResultBlock) ([]*evmtypes.TxTraceResult, error) { + txs := block.Block.Txs txsLength := len(txs) if txsLength == 0 { @@ -145,73 +185,56 @@ func (a API) traceBlock(height rpctypes.BlockNumber, config *evmtypes.TraceConfi return []*evmtypes.TxTraceResult{}, nil } - var ( - results = make([]*evmtypes.TxTraceResult, txsLength) - wg = new(sync.WaitGroup) - jobs = make(chan *evmtypes.TxTraceTask, txsLength) - ) + txDecoder := a.clientCtx.TxConfig.TxDecoder() - threads := runtime.NumCPU() - if threads > txsLength { - threads = txsLength + // nolint: prealloc + var txsMessages []*evmtypes.MsgEthereumTx + for i, tx := range txs { + decodedTx, err := txDecoder(tx) + if err != nil { + a.logger.Error("failed to decode transaction", "hash", txs[i].Hash(), "error", err.Error()) + continue + } + + messages := decodedTx.GetMsgs() + if len(messages) == 0 { + continue + } + ethMessage, ok := messages[0].(*evmtypes.MsgEthereumTx) + if !ok { + // Just considers Ethereum transactions + continue + } + txsMessages = append(txsMessages, ethMessage) } - ctxWithHeight := rpctypes.ContextWithHeight(int64(height)) + // minus one to get the context at the beginning of the block + contextHeight := height - 1 + if contextHeight < 1 { + // 0 is a special value for `ContextWithHeight`. + contextHeight = 1 + } + ctxWithHeight := rpctypes.ContextWithHeight(int64(contextHeight)) - wg.Add(threads) - for th := 0; th < threads; th++ { - go func() { - defer wg.Done() - txDecoder := a.clientCtx.TxConfig.TxDecoder() - // Fetch and execute the next transaction trace tasks - for task := range jobs { - tx, err := txDecoder(txs[task.Index]) - if err != nil { - a.logger.Error("failed to decode transaction", "hash", txs[task.Index].Hash(), "error", err.Error()) - continue - } - - messages := tx.GetMsgs() - if len(messages) == 0 { - continue - } - ethMessage, ok := messages[0].(*evmtypes.MsgEthereumTx) - if !ok { - // Just considers Ethereum transactions - continue - } - - traceTxRequest := &evmtypes.QueryTraceTxRequest{ - Msg: ethMessage, - TxIndex: uint64(task.Index), - TraceConfig: config, - } - - res, err := a.queryClient.TraceTx(ctxWithHeight, traceTxRequest) - if err != nil { - results[task.Index] = &evmtypes.TxTraceResult{Error: err.Error()} - continue - } - // Response format is unknown due to custom tracer config param - // More information can be found here https://geth.ethereum.org/docs/dapp/tracing-filtered - var decodedResult interface{} - if err := json.Unmarshal(res.Data, &decodedResult); err != nil { - results[task.Index] = &evmtypes.TxTraceResult{Error: err.Error()} - continue - } - results[task.Index] = &evmtypes.TxTraceResult{Result: decodedResult} - } - }() + traceBlockRequest := &evmtypes.QueryTraceBlockRequest{ + Txs: txsMessages, + TraceConfig: config, + BlockNumber: block.Block.Height, + BlockTime: block.Block.Time, + BlockHash: common.Bytes2Hex(block.BlockID.Hash), } - for i := range txs { - jobs <- &evmtypes.TxTraceTask{Index: i} + res, err := a.queryClient.TraceBlock(ctxWithHeight, traceBlockRequest) + if err != nil { + return nil, err } - close(jobs) - wg.Wait() + decodedResults := make([]*evmtypes.TxTraceResult, txsLength) + if err := json.Unmarshal(res.Data, &decodedResults); err != nil { + return nil, err + } - return results, nil + return decodedResults, nil } // BlockProfile turns on goroutine profiling for nsec seconds and writes profile data to diff --git a/x/evm/keeper/grpc_query.go b/x/evm/keeper/grpc_query.go index b6477a94..4f34d85b 100644 --- a/x/evm/keeper/grpc_query.go +++ b/x/evm/keeper/grpc_query.go @@ -360,16 +360,34 @@ func (k Keeper) TraceTx(c context.Context, req *types.QueryTraceTxRequest) (*typ } ctx := sdk.UnwrapSDKContext(c) + ctx = ctx.WithBlockHeight(req.BlockNumber) + ctx = ctx.WithBlockTime(req.BlockTime) + ctx = ctx.WithHeaderHash(common.Hex2Bytes(req.BlockHash)) k.WithContext(ctx) params := k.GetParams(ctx) ethCfg := params.ChainConfig.EthereumConfig(k.eip155ChainID) signer := ethtypes.MakeSigner(ethCfg, big.NewInt(ctx.BlockHeight())) - tx := req.Msg.AsTransaction() baseFee := k.feeMarketKeeper.GetBaseFee(ctx) - result, err := k.traceTx(ctx, signer, req.TxIndex, ethCfg, tx, baseFee, req.TraceConfig) + for i, tx := range req.Predecessors { + ethTx := tx.AsTransaction() + msg, err := ethTx.AsMessage(signer, baseFee) + if err != nil { + continue + } + k.SetTxHashTransient(ethTx.Hash()) + k.SetTxIndexTransient(uint64(i)) + + if _, err := k.ApplyMessage(msg, types.NewNoOpTracer(), true); err != nil { + continue + } + } + + tx := req.Msg.AsTransaction() + result, err := k.traceTx(ctx, signer, req.TxIndex, ethCfg, tx, baseFee, req.TraceConfig, false) if err != nil { + // error will be returned with detail status from traceTx return nil, err } @@ -383,6 +401,54 @@ func (k Keeper) TraceTx(c context.Context, req *types.QueryTraceTxRequest) (*typ }, nil } +// TraceBlock configures a new tracer according to the provided configuration, and +// executes the given message in the provided environment for all the transactions in the queried block. +// The return value will be tracer dependent. +func (k Keeper) TraceBlock(c context.Context, req *types.QueryTraceBlockRequest) (*types.QueryTraceBlockResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "empty request") + } + + if req.TraceConfig != nil && req.TraceConfig.Limit < 0 { + return nil, status.Errorf(codes.InvalidArgument, "output limit cannot be negative, got %d", req.TraceConfig.Limit) + } + + ctx := sdk.UnwrapSDKContext(c) + ctx = ctx.WithBlockHeight(req.BlockNumber) + ctx = ctx.WithBlockTime(req.BlockTime) + ctx = ctx.WithHeaderHash(common.Hex2Bytes(req.BlockHash)) + k.WithContext(ctx) + + params := k.GetParams(ctx) + ethCfg := params.ChainConfig.EthereumConfig(k.eip155ChainID) + signer := ethtypes.MakeSigner(ethCfg, big.NewInt(ctx.BlockHeight())) + baseFee := k.feeMarketKeeper.GetBaseFee(ctx) + + txsLength := len(req.Txs) + results := make([]*types.TxTraceResult, 0, txsLength) + + for i, tx := range req.Txs { + result := types.TxTraceResult{} + ethTx := tx.AsTransaction() + traceResult, err := k.traceTx(ctx, signer, uint64(i), ethCfg, ethTx, baseFee, req.TraceConfig, true) + if err != nil { + result.Error = err.Error() + continue + } + result.Result = traceResult + results = append(results, &result) + } + + resultData, err := json.Marshal(results) + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + return &types.QueryTraceBlockResponse{ + Data: resultData, + }, nil +} + func (k *Keeper) traceTx( ctx sdk.Context, signer ethtypes.Signer, @@ -391,6 +457,7 @@ func (k *Keeper) traceTx( tx *ethtypes.Transaction, baseFee *big.Int, traceConfig *types.TraceConfig, + commitMessage bool, ) (*interface{}, error) { // Assemble the structured logger or the JavaScript tracer var ( @@ -462,7 +529,7 @@ func (k *Keeper) traceTx( k.SetTxHashTransient(txHash) k.SetTxIndexTransient(txIndex) - res, err := k.ApplyMessage(msg, tracer, false) + res, err := k.ApplyMessage(msg, tracer, commitMessage) if err != nil { return nil, status.Error(codes.Internal, err.Error()) } diff --git a/x/evm/keeper/grpc_query_test.go b/x/evm/keeper/grpc_query_test.go index eb94046a..7ccdcb7e 100644 --- a/x/evm/keeper/grpc_query_test.go +++ b/x/evm/keeper/grpc_query_test.go @@ -596,8 +596,10 @@ func (suite *KeeperTestSuite) TestTraceTx() { ctx := sdk.WrapSDKContext(suite.ctx) // TODO deploy contract that triggers internal transactions var ( - txMsg *types.MsgEthereumTx - traceConfig *types.TraceConfig + txMsg *types.MsgEthereumTx + traceConfig *types.TraceConfig + txIndex uint64 + predecessors []*types.MsgEthereumTx ) testCases := []struct { @@ -610,16 +612,20 @@ func (suite *KeeperTestSuite) TestTraceTx() { { msg: "default trace", malleate: func() { + txIndex = 0 traceConfig = nil + predecessors = []*types.MsgEthereumTx{} }, expPass: true, traceResponse: []byte{0x7b, 0x22, 0x67, 0x61, 0x73, 0x22, 0x3a, 0x33, 0x34, 0x38, 0x32, 0x38, 0x2c, 0x22, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x22, 0x3a, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x2c, 0x22, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x3a, 0x22, 0x22, 0x2c, 0x22, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x22, 0x3a, 0x5b, 0x5d, 0x7d}, }, { msg: "javascript tracer", malleate: func() { + txIndex = 0 traceConfig = &types.TraceConfig{ Tracer: "{data: [], fault: function(log) {}, step: function(log) { if(log.op.toString() == \"CALL\") this.data.push(log.stack.peek(0)); }, result: function() { return this.data; }}", } + predecessors = []*types.MsgEthereumTx{} }, expPass: true, traceResponse: []byte{0x5b, 0x5d}, @@ -627,7 +633,9 @@ func (suite *KeeperTestSuite) TestTraceTx() { { msg: "default trace with dynamicTxFee", malleate: func() { + txIndex = 0 traceConfig = nil + predecessors = []*types.MsgEthereumTx{} }, expPass: true, traceResponse: []byte{0x7b, 0x22, 0x67, 0x61, 0x73, 0x22, 0x3a, 0x33, 0x34, 0x38, 0x32, 0x38, 0x2c, 0x22, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x22, 0x3a, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x2c, 0x22, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x3a, 0x22, 0x22, 0x2c, 0x22, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x22, 0x3a, 0x5b, 0x5d, 0x7d}, @@ -635,14 +643,35 @@ func (suite *KeeperTestSuite) TestTraceTx() { }, { msg: "javascript tracer with dynamicTxFee", malleate: func() { + txIndex = 0 traceConfig = &types.TraceConfig{ Tracer: "{data: [], fault: function(log) {}, step: function(log) { if(log.op.toString() == \"CALL\") this.data.push(log.stack.peek(0)); }, result: function() { return this.data; }}", } + predecessors = []*types.MsgEthereumTx{} }, expPass: true, traceResponse: []byte{0x5b, 0x5d}, dynamicTxFee: true, }, + { + msg: "default tracer with predecessors", + malleate: func() { + txIndex = 1 + traceConfig = nil + + contractAddr := suite.DeployTestContract(suite.T(), suite.address, sdk.NewIntWithDecimal(1000, 18).BigInt()) + suite.Commit() + // Generate token transfer transaction + firstTx := suite.TransferERC20Token(suite.T(), contractAddr, suite.address, common.HexToAddress("0x378c50D9264C63F3F92B806d4ee56E9D86FfB3Ec"), sdk.NewIntWithDecimal(1, 18).BigInt()) + txMsg = suite.TransferERC20Token(suite.T(), contractAddr, suite.address, common.HexToAddress("0x378c50D9264C63F3F92B806d4ee56E9D86FfB3Ec"), sdk.NewIntWithDecimal(1, 18).BigInt()) + suite.Commit() + + predecessors = append(predecessors, firstTx) + }, + expPass: true, + traceResponse: []byte{0x7b, 0x22, 0x67, 0x61, 0x73, 0x22, 0x3a, 0x33, 0x30, 0x38, 0x32, 0x38, 0x2c, 0x22, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x22, 0x3a, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x2c, 0x22, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x3a, 0x22, 0x22, 0x2c, 0x22, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x22, 0x3a, 0x5b, 0x5d, 0x7d}, + dynamicTxFee: false, + }, } for _, tc := range testCases { @@ -658,9 +687,10 @@ func (suite *KeeperTestSuite) TestTraceTx() { tc.malleate() traceReq := types.QueryTraceTxRequest{ - Msg: txMsg, - TraceConfig: traceConfig, - TxIndex: 1, // Can be hardcoded as this will be the only tx included in the block + Msg: txMsg, + TraceConfig: traceConfig, + TxIndex: txIndex, + Predecessors: predecessors, } res, err := suite.queryClient.TraceTx(ctx, &traceReq) @@ -675,3 +705,121 @@ func (suite *KeeperTestSuite) TestTraceTx() { suite.dynamicTxFee = false // reset flag } + +func (suite *KeeperTestSuite) TestTraceBlock() { + ctx := sdk.WrapSDKContext(suite.ctx) + var ( + txs []*types.MsgEthereumTx + traceConfig *types.TraceConfig + ) + + testCases := []struct { + msg string + malleate func() + expPass bool + traceResponse []byte + dynamicTxFee bool + }{ + { + msg: "default trace", + malleate: func() { + traceConfig = nil + }, + expPass: true, + traceResponse: []byte{0x5b, 0x7b, 0x22, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x3a, 0x7b, 0x22, 0x67, 0x61, 0x73, 0x22, 0x3a, 0x33, 0x34, 0x38, 0x32, 0x38, 0x2c, 0x22, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x22, 0x3a, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x2c, 0x22, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x3a, 0x22, 0x22, 0x2c, 0x22, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x22, 0x3a, 0x5b, 0x5d, 0x7d, 0x7d, 0x5d}, + }, + { + msg: "filtered trace", + malleate: func() { + traceConfig = &types.TraceConfig{ + DisableStack: true, + DisableStorage: true, + EnableMemory: false, + } + }, + expPass: true, + traceResponse: []byte{0x5b, 0x7b, 0x22, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x3a, 0x7b, 0x22, 0x67, 0x61, 0x73, 0x22, 0x3a, 0x33, 0x34, 0x38, 0x32, 0x38, 0x2c, 0x22, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x22, 0x3a, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x2c, 0x22, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x3a, 0x22, 0x22, 0x2c, 0x22, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x22, 0x3a, 0x5b, 0x5d, 0x7d, 0x7d, 0x5d}, + }, { + msg: "javascript tracer", + malleate: func() { + traceConfig = &types.TraceConfig{ + Tracer: "{data: [], fault: function(log) {}, step: function(log) { if(log.op.toString() == \"CALL\") this.data.push(log.stack.peek(0)); }, result: function() { return this.data; }}", + } + }, + expPass: true, + traceResponse: []byte{0x5b, 0x7b, 0x22, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x3a, 0x5b, 0x5d, 0x7d, 0x5d}, + }, + { + msg: "default trace with dynamicTxFee and filtered return", + malleate: func() { + traceConfig = &types.TraceConfig{ + DisableStack: true, + DisableStorage: true, + EnableMemory: false, + } + }, + expPass: true, + traceResponse: []byte{0x5b, 0x7b, 0x22, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x3a, 0x7b, 0x22, 0x67, 0x61, 0x73, 0x22, 0x3a, 0x33, 0x34, 0x38, 0x32, 0x38, 0x2c, 0x22, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x22, 0x3a, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x2c, 0x22, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x3a, 0x22, 0x22, 0x2c, 0x22, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x22, 0x3a, 0x5b, 0x5d, 0x7d, 0x7d, 0x5d}, + dynamicTxFee: true, + }, { + msg: "javascript tracer with dynamicTxFee", + malleate: func() { + traceConfig = &types.TraceConfig{ + Tracer: "{data: [], fault: function(log) {}, step: function(log) { if(log.op.toString() == \"CALL\") this.data.push(log.stack.peek(0)); }, result: function() { return this.data; }}", + } + }, + expPass: true, + traceResponse: []byte{0x5b, 0x7b, 0x22, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x3a, 0x5b, 0x5d, 0x7d, 0x5d}, + dynamicTxFee: true, + }, + { + msg: "tracer with multiple transactions", + malleate: func() { + traceConfig = nil + contractAddr := suite.DeployTestContract(suite.T(), suite.address, sdk.NewIntWithDecimal(1000, 18).BigInt()) + suite.Commit() + // create multiple transactions in the same block + firstTx := suite.TransferERC20Token(suite.T(), contractAddr, suite.address, common.HexToAddress("0x378c50D9264C63F3F92B806d4ee56E9D86FfB3Ec"), sdk.NewIntWithDecimal(1, 18).BigInt()) + secondTx := suite.TransferERC20Token(suite.T(), contractAddr, suite.address, common.HexToAddress("0x378c50D9264C63F3F92B806d4ee56E9D86FfB3Ec"), sdk.NewIntWithDecimal(1, 18).BigInt()) + suite.Commit() + // overwrite txs to include only the ones on new block + txs = append([]*types.MsgEthereumTx{}, firstTx, secondTx) + }, + expPass: true, + traceResponse: []byte{0x5b, 0x7b, 0x22, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x3a, 0x7b, 0x22, 0x67, 0x61, 0x73, 0x22, 0x3a, 0x33, 0x34, 0x38, 0x32, 0x38, 0x2c, 0x22, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x22, 0x3a, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x2c, 0x22, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x3a, 0x22, 0x22, 0x2c, 0x22, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x22, 0x3a, 0x5b, 0x5d, 0x7d, 0x7d, 0x2c, 0x7b, 0x22, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x3a, 0x7b, 0x22, 0x67, 0x61, 0x73, 0x22, 0x3a, 0x33, 0x30, 0x38, 0x32, 0x38, 0x2c, 0x22, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x22, 0x3a, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x2c, 0x22, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x3a, 0x22, 0x22, 0x2c, 0x22, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x22, 0x3a, 0x5b, 0x5d, 0x7d, 0x7d, 0x5d}, + dynamicTxFee: false, + }, + } + + for _, tc := range testCases { + suite.Run(fmt.Sprintf("Case %s", tc.msg), func() { + txs = []*types.MsgEthereumTx{} + suite.dynamicTxFee = tc.dynamicTxFee + suite.SetupTest() + // Deploy contract + contractAddr := suite.DeployTestContract(suite.T(), suite.address, sdk.NewIntWithDecimal(1000, 18).BigInt()) + suite.Commit() + // Generate token transfer transaction + txMsg := suite.TransferERC20Token(suite.T(), contractAddr, suite.address, common.HexToAddress("0x378c50D9264C63F3F92B806d4ee56E9D86FfB3Ec"), sdk.NewIntWithDecimal(1, 18).BigInt()) + suite.Commit() + + txs = append(txs, txMsg) + + tc.malleate() + traceReq := types.QueryTraceBlockRequest{ + Txs: txs, + TraceConfig: traceConfig, + } + res, err := suite.queryClient.TraceBlock(ctx, &traceReq) + + if tc.expPass { + suite.Require().NoError(err) + suite.Require().Equal(tc.traceResponse, res.Data) + } else { + suite.Require().Error(err) + } + }) + } + + suite.dynamicTxFee = false // reset flag +} diff --git a/x/evm/types/query.go b/x/evm/types/query.go index f92b0ba3..677d918c 100644 --- a/x/evm/types/query.go +++ b/x/evm/types/query.go @@ -6,5 +6,19 @@ import ( // UnpackInterfaces implements UnpackInterfacesMesssage.UnpackInterfaces func (m QueryTraceTxRequest) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error { + for _, msg := range m.Predecessors { + if err := msg.UnpackInterfaces(unpacker); err != nil { + return err + } + } return m.Msg.UnpackInterfaces(unpacker) } + +func (m QueryTraceBlockRequest) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error { + for _, msg := range m.Txs { + if err := msg.UnpackInterfaces(unpacker); err != nil { + return err + } + } + return nil +} diff --git a/x/evm/types/query.pb.go b/x/evm/types/query.pb.go index 13f128ab..65672721 100644 --- a/x/evm/types/query.pb.go +++ b/x/evm/types/query.pb.go @@ -10,19 +10,23 @@ import ( _ "github.com/gogo/protobuf/gogoproto" grpc1 "github.com/gogo/protobuf/grpc" proto "github.com/gogo/protobuf/proto" + github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" _ "google.golang.org/genproto/googleapis/api/annotations" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" + _ "google.golang.org/protobuf/types/known/timestamppb" io "io" math "math" math_bits "math/bits" + time "time" ) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf +var _ = time.Kitchen // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. @@ -890,6 +894,15 @@ type QueryTraceTxRequest struct { TxIndex uint64 `protobuf:"varint,2,opt,name=tx_index,json=txIndex,proto3" json:"tx_index,omitempty"` // TraceConfig holds extra parameters to trace functions. TraceConfig *TraceConfig `protobuf:"bytes,3,opt,name=trace_config,json=traceConfig,proto3" json:"trace_config,omitempty"` + // the predecessor transactions included in the same block + // need to be replayed first to get correct context for tracing. + Predecessors []*MsgEthereumTx `protobuf:"bytes,4,rep,name=predecessors,proto3" json:"predecessors,omitempty"` + // block number of requested transaction + BlockNumber int64 `protobuf:"varint,5,opt,name=block_number,json=blockNumber,proto3" json:"block_number,omitempty"` + // block hex hash of requested transaction + BlockHash string `protobuf:"bytes,6,opt,name=block_hash,json=blockHash,proto3" json:"block_hash,omitempty"` + // block time of requested transaction + BlockTime time.Time `protobuf:"bytes,7,opt,name=block_time,json=blockTime,proto3,stdtime" json:"block_time"` } func (m *QueryTraceTxRequest) Reset() { *m = QueryTraceTxRequest{} } @@ -946,6 +959,34 @@ func (m *QueryTraceTxRequest) GetTraceConfig() *TraceConfig { return nil } +func (m *QueryTraceTxRequest) GetPredecessors() []*MsgEthereumTx { + if m != nil { + return m.Predecessors + } + return nil +} + +func (m *QueryTraceTxRequest) GetBlockNumber() int64 { + if m != nil { + return m.BlockNumber + } + return 0 +} + +func (m *QueryTraceTxRequest) GetBlockHash() string { + if m != nil { + return m.BlockHash + } + return "" +} + +func (m *QueryTraceTxRequest) GetBlockTime() time.Time { + if m != nil { + return m.BlockTime + } + return time.Time{} +} + // QueryTraceTxResponse defines TraceTx response type QueryTraceTxResponse struct { // response serialized in bytes @@ -992,6 +1033,133 @@ func (m *QueryTraceTxResponse) GetData() []byte { return nil } +// QueryTraceBlockRequest defines TraceTx request +type QueryTraceBlockRequest struct { + // txs messages in the block + Txs []*MsgEthereumTx `protobuf:"bytes,1,rep,name=txs,proto3" json:"txs,omitempty"` + // TraceConfig holds extra parameters to trace functions. + TraceConfig *TraceConfig `protobuf:"bytes,3,opt,name=trace_config,json=traceConfig,proto3" json:"trace_config,omitempty"` + // block number + BlockNumber int64 `protobuf:"varint,5,opt,name=block_number,json=blockNumber,proto3" json:"block_number,omitempty"` + // block hex hash + BlockHash string `protobuf:"bytes,6,opt,name=block_hash,json=blockHash,proto3" json:"block_hash,omitempty"` + // block time + BlockTime time.Time `protobuf:"bytes,7,opt,name=block_time,json=blockTime,proto3,stdtime" json:"block_time"` +} + +func (m *QueryTraceBlockRequest) Reset() { *m = QueryTraceBlockRequest{} } +func (m *QueryTraceBlockRequest) String() string { return proto.CompactTextString(m) } +func (*QueryTraceBlockRequest) ProtoMessage() {} +func (*QueryTraceBlockRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_e15a877459347994, []int{20} +} +func (m *QueryTraceBlockRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryTraceBlockRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryTraceBlockRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryTraceBlockRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryTraceBlockRequest.Merge(m, src) +} +func (m *QueryTraceBlockRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryTraceBlockRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryTraceBlockRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryTraceBlockRequest proto.InternalMessageInfo + +func (m *QueryTraceBlockRequest) GetTxs() []*MsgEthereumTx { + if m != nil { + return m.Txs + } + return nil +} + +func (m *QueryTraceBlockRequest) GetTraceConfig() *TraceConfig { + if m != nil { + return m.TraceConfig + } + return nil +} + +func (m *QueryTraceBlockRequest) GetBlockNumber() int64 { + if m != nil { + return m.BlockNumber + } + return 0 +} + +func (m *QueryTraceBlockRequest) GetBlockHash() string { + if m != nil { + return m.BlockHash + } + return "" +} + +func (m *QueryTraceBlockRequest) GetBlockTime() time.Time { + if m != nil { + return m.BlockTime + } + return time.Time{} +} + +// QueryTraceBlockResponse defines TraceBlock response +type QueryTraceBlockResponse struct { + Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` +} + +func (m *QueryTraceBlockResponse) Reset() { *m = QueryTraceBlockResponse{} } +func (m *QueryTraceBlockResponse) String() string { return proto.CompactTextString(m) } +func (*QueryTraceBlockResponse) ProtoMessage() {} +func (*QueryTraceBlockResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_e15a877459347994, []int{21} +} +func (m *QueryTraceBlockResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryTraceBlockResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryTraceBlockResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryTraceBlockResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryTraceBlockResponse.Merge(m, src) +} +func (m *QueryTraceBlockResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryTraceBlockResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryTraceBlockResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryTraceBlockResponse proto.InternalMessageInfo + +func (m *QueryTraceBlockResponse) GetData() []byte { + if m != nil { + return m.Data + } + return nil +} + func init() { proto.RegisterType((*QueryAccountRequest)(nil), "ethermint.evm.v1.QueryAccountRequest") proto.RegisterType((*QueryAccountResponse)(nil), "ethermint.evm.v1.QueryAccountResponse") @@ -1013,83 +1181,95 @@ func init() { proto.RegisterType((*EstimateGasResponse)(nil), "ethermint.evm.v1.EstimateGasResponse") proto.RegisterType((*QueryTraceTxRequest)(nil), "ethermint.evm.v1.QueryTraceTxRequest") proto.RegisterType((*QueryTraceTxResponse)(nil), "ethermint.evm.v1.QueryTraceTxResponse") + proto.RegisterType((*QueryTraceBlockRequest)(nil), "ethermint.evm.v1.QueryTraceBlockRequest") + proto.RegisterType((*QueryTraceBlockResponse)(nil), "ethermint.evm.v1.QueryTraceBlockResponse") } func init() { proto.RegisterFile("ethermint/evm/v1/query.proto", fileDescriptor_e15a877459347994) } var fileDescriptor_e15a877459347994 = []byte{ - // 1123 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x96, 0x4d, 0x6f, 0x1b, 0x45, - 0x18, 0xc7, 0xbd, 0x89, 0x13, 0xa7, 0x8f, 0x93, 0x12, 0xa6, 0x41, 0x24, 0x4b, 0xea, 0xa4, 0x9b, - 0xe6, 0x3d, 0xda, 0xc5, 0x06, 0x55, 0xa2, 0x12, 0x82, 0x24, 0x0a, 0x05, 0xb5, 0x45, 0xc5, 0x44, - 0x1c, 0xb8, 0x58, 0xe3, 0xf5, 0xb0, 0xb6, 0x6a, 0xef, 0xb8, 0x3b, 0x63, 0xe3, 0xb4, 0x84, 0x03, - 0x12, 0x15, 0xa8, 0x17, 0x24, 0xee, 0xa8, 0x17, 0xce, 0x7c, 0x8d, 0x1e, 0x2b, 0x71, 0xe1, 0x84, - 0x50, 0x82, 0x10, 0x1f, 0x03, 0xcd, 0xcb, 0xda, 0xbb, 0x5e, 0x6f, 0x9d, 0xa2, 0xde, 0xe6, 0xe5, - 0x99, 0xe7, 0xff, 0x9b, 0x99, 0x67, 0xff, 0xb3, 0xb0, 0x4c, 0x78, 0x9d, 0x04, 0xad, 0x86, 0xcf, - 0x1d, 0xd2, 0x6d, 0x39, 0xdd, 0xa2, 0xf3, 0xa0, 0x43, 0x82, 0x13, 0xbb, 0x1d, 0x50, 0x4e, 0xd1, - 0x7c, 0x7f, 0xd6, 0x26, 0xdd, 0x96, 0xdd, 0x2d, 0x9a, 0x0b, 0x1e, 0xf5, 0xa8, 0x9c, 0x74, 0x44, - 0x4b, 0xc5, 0x99, 0x3b, 0x2e, 0x65, 0x2d, 0xca, 0x9c, 0x2a, 0x66, 0x44, 0x25, 0x70, 0xba, 0xc5, - 0x2a, 0xe1, 0xb8, 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cf, 0x0b, 0x99, 0x3f, 0xce, 0x0b, 0x99, 0x2f, 0xb7, 0xbc, 0x06, 0xaf, 0x77, 0xaa, 0xb6, 0x4b, - 0x5b, 0x0e, 0xaf, 0xe3, 0x80, 0x35, 0x58, 0x24, 0x4f, 0x4f, 0x66, 0xe2, 0x27, 0x6d, 0xc2, 0xaa, - 0xd3, 0xf2, 0x57, 0xff, 0x9d, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, 0x55, 0x07, 0x68, 0x0c, 0xb3, - 0x0c, 0x00, 0x00, + // 1295 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x56, 0x4d, 0x6f, 0x1b, 0xc5, + 0x1b, 0xcf, 0x26, 0x4e, 0x9c, 0x3e, 0x4e, 0xfb, 0xcf, 0x7f, 0x1a, 0xa8, 0xbb, 0x24, 0x76, 0xba, + 0x6d, 0xde, 0xda, 0xb0, 0x4b, 0x0c, 0xaa, 0x44, 0x25, 0x04, 0x4d, 0x54, 0x0a, 0x6a, 0x8b, 0x8a, + 0x89, 0x38, 0x70, 0xb1, 0xc6, 0xeb, 0xe9, 0xda, 0xaa, 0x77, 0xc7, 0xdd, 0x19, 0x9b, 0x4d, 0x4b, + 0x39, 0x20, 0x51, 0x15, 0xf5, 0x52, 0x09, 0xce, 0xa8, 0xdf, 0x80, 0xaf, 0xd1, 0x63, 0x25, 0x2e, + 0x9c, 0x00, 0xb5, 0x1c, 0xb8, 0xf6, 0x1b, 0xa0, 0x79, 0x59, 0x7b, 0xed, 0xf5, 0xc6, 0x29, 0xea, + 0x81, 0xdb, 0xbc, 0x3c, 0xf3, 0xfc, 0x7e, 0xcf, 0xcb, 0xcc, 0x6f, 0x60, 0x99, 0xf0, 0x26, 0x09, + 0xfd, 0x56, 0xc0, 0x1d, 0xd2, 0xf3, 0x9d, 0xde, 0x8e, 0x73, 0xa7, 0x4b, 0xc2, 0x03, 0xb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ad, 0x64, 0xf1, 0x90, 0x32, 0xb1, 0xbb, 0xfb, 0xf4, 0x79, 0xc9, 0x78, + 0xf6, 0xbc, 0x64, 0xfc, 0xf9, 0xbc, 0x64, 0x3c, 0x7e, 0x51, 0x9a, 0x7a, 0xf6, 0xa2, 0x34, 0xf5, + 0xdb, 0x8b, 0xd2, 0xd4, 0x57, 0x9b, 0x5e, 0x8b, 0x37, 0xbb, 0x75, 0xdb, 0xa5, 0xbe, 0xc3, 0x9b, + 0x38, 0x64, 0x2d, 0x96, 0x70, 0x15, 0x49, 0x67, 0xfc, 0xa0, 0x43, 0x58, 0x7d, 0x4e, 0xea, 0xd1, + 0xbb, 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, 0x05, 0x8b, 0x73, 0xeb, 0x71, 0x0f, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1126,6 +1306,8 @@ type QueryClient interface { EstimateGas(ctx context.Context, in *EthCallRequest, opts ...grpc.CallOption) (*EstimateGasResponse, error) // TraceTx implements the `debug_traceTransaction` rpc api TraceTx(ctx context.Context, in *QueryTraceTxRequest, opts ...grpc.CallOption) (*QueryTraceTxResponse, error) + // TraceBlock implements the `debug_traceBlockByNumber` and `debug_traceBlockByHash` rpc api + TraceBlock(ctx context.Context, in *QueryTraceBlockRequest, opts ...grpc.CallOption) (*QueryTraceBlockResponse, error) } type queryClient struct { @@ -1226,6 +1408,15 @@ func (c *queryClient) TraceTx(ctx context.Context, in *QueryTraceTxRequest, opts return out, nil } +func (c *queryClient) TraceBlock(ctx context.Context, in *QueryTraceBlockRequest, opts ...grpc.CallOption) (*QueryTraceBlockResponse, error) { + out := new(QueryTraceBlockResponse) + err := c.cc.Invoke(ctx, "/ethermint.evm.v1.Query/TraceBlock", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. type QueryServer interface { // Account queries an Ethereum account. @@ -1250,6 +1441,8 @@ type QueryServer interface { EstimateGas(context.Context, *EthCallRequest) (*EstimateGasResponse, error) // TraceTx implements the `debug_traceTransaction` rpc api TraceTx(context.Context, *QueryTraceTxRequest) (*QueryTraceTxResponse, error) + // TraceBlock implements the `debug_traceBlockByNumber` and `debug_traceBlockByHash` rpc api + TraceBlock(context.Context, *QueryTraceBlockRequest) (*QueryTraceBlockResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -1286,6 +1479,9 @@ func (*UnimplementedQueryServer) EstimateGas(ctx context.Context, req *EthCallRe func (*UnimplementedQueryServer) TraceTx(ctx context.Context, req *QueryTraceTxRequest) (*QueryTraceTxResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method TraceTx not implemented") } +func (*UnimplementedQueryServer) TraceBlock(ctx context.Context, req *QueryTraceBlockRequest) (*QueryTraceBlockResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method TraceBlock not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -1471,6 +1667,24 @@ func _Query_TraceTx_Handler(srv interface{}, ctx context.Context, dec func(inter return interceptor(ctx, in, info, handler) } +func _Query_TraceBlock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryTraceBlockRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).TraceBlock(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ethermint.evm.v1.Query/TraceBlock", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).TraceBlock(ctx, req.(*QueryTraceBlockRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "ethermint.evm.v1.Query", HandlerType: (*QueryServer)(nil), @@ -1515,6 +1729,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "TraceTx", Handler: _Query_TraceTx_Handler, }, + { + MethodName: "TraceBlock", + Handler: _Query_TraceBlock_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "ethermint/evm/v1/query.proto", @@ -2149,6 +2367,40 @@ func (m *QueryTraceTxRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + n4, err4 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.BlockTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.BlockTime):]) + if err4 != nil { + return 0, err4 + } + i -= n4 + i = encodeVarintQuery(dAtA, i, uint64(n4)) + i-- + dAtA[i] = 0x3a + if len(m.BlockHash) > 0 { + i -= len(m.BlockHash) + copy(dAtA[i:], m.BlockHash) + i = encodeVarintQuery(dAtA, i, uint64(len(m.BlockHash))) + i-- + dAtA[i] = 0x32 + } + if m.BlockNumber != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.BlockNumber)) + i-- + dAtA[i] = 0x28 + } + if len(m.Predecessors) > 0 { + for iNdEx := len(m.Predecessors) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Predecessors[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } if m.TraceConfig != nil { { size, err := m.TraceConfig.MarshalToSizedBuffer(dAtA[:i]) @@ -2211,6 +2463,105 @@ func (m *QueryTraceTxResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *QueryTraceBlockRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryTraceBlockRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryTraceBlockRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + n7, err7 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.BlockTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.BlockTime):]) + if err7 != nil { + return 0, err7 + } + i -= n7 + i = encodeVarintQuery(dAtA, i, uint64(n7)) + i-- + dAtA[i] = 0x3a + if len(m.BlockHash) > 0 { + i -= len(m.BlockHash) + copy(dAtA[i:], m.BlockHash) + i = encodeVarintQuery(dAtA, i, uint64(len(m.BlockHash))) + i-- + dAtA[i] = 0x32 + } + if m.BlockNumber != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.BlockNumber)) + i-- + dAtA[i] = 0x28 + } + if m.TraceConfig != nil { + { + size, err := m.TraceConfig.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.Txs) > 0 { + for iNdEx := len(m.Txs) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Txs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryTraceBlockResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryTraceBlockResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryTraceBlockResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Data) > 0 { + i -= len(m.Data) + copy(dAtA[i:], m.Data) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Data))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { offset -= sovQuery(v) base := offset @@ -2502,6 +2853,21 @@ func (m *QueryTraceTxRequest) Size() (n int) { l = m.TraceConfig.Size() n += 1 + l + sovQuery(uint64(l)) } + if len(m.Predecessors) > 0 { + for _, e := range m.Predecessors { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.BlockNumber != 0 { + n += 1 + sovQuery(uint64(m.BlockNumber)) + } + l = len(m.BlockHash) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.BlockTime) + n += 1 + l + sovQuery(uint64(l)) return n } @@ -2518,6 +2884,47 @@ func (m *QueryTraceTxResponse) Size() (n int) { return n } +func (m *QueryTraceBlockRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Txs) > 0 { + for _, e := range m.Txs { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.TraceConfig != nil { + l = m.TraceConfig.Size() + n += 1 + l + sovQuery(uint64(l)) + } + if m.BlockNumber != 0 { + n += 1 + sovQuery(uint64(m.BlockNumber)) + } + l = len(m.BlockHash) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.BlockTime) + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryTraceBlockResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Data) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + func sovQuery(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -4332,6 +4739,124 @@ func (m *QueryTraceTxRequest) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Predecessors", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Predecessors = append(m.Predecessors, &MsgEthereumTx{}) + if err := m.Predecessors[len(m.Predecessors)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockNumber", wireType) + } + m.BlockNumber = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BlockNumber |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockHash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BlockHash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.BlockTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -4437,6 +4962,294 @@ func (m *QueryTraceTxResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryTraceBlockRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryTraceBlockRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryTraceBlockRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Txs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Txs = append(m.Txs, &MsgEthereumTx{}) + if err := m.Txs[len(m.Txs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TraceConfig", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TraceConfig == nil { + m.TraceConfig = &TraceConfig{} + } + if err := m.TraceConfig.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockNumber", wireType) + } + m.BlockNumber = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BlockNumber |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockHash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BlockHash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.BlockTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryTraceBlockResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryTraceBlockResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryTraceBlockResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) + if m.Data == nil { + m.Data = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipQuery(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/evm/types/query.pb.gw.go b/x/evm/types/query.pb.gw.go index f7882251..06d6cd50 100644 --- a/x/evm/types/query.pb.gw.go +++ b/x/evm/types/query.pb.gw.go @@ -503,6 +503,42 @@ func local_request_Query_TraceTx_0(ctx context.Context, marshaler runtime.Marsha } +var ( + filter_Query_TraceBlock_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_TraceBlock_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryTraceBlockRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_TraceBlock_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.TraceBlock(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_TraceBlock_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryTraceBlockRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_TraceBlock_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.TraceBlock(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -709,6 +745,26 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_TraceBlock_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_TraceBlock_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_TraceBlock_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -950,6 +1006,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_TraceBlock_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_TraceBlock_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_TraceBlock_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -973,6 +1049,8 @@ var ( pattern_Query_EstimateGas_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ethermint", "evm", "v1", "estimate_gas"}, "", runtime.AssumeColonVerbOpt(true))) pattern_Query_TraceTx_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ethermint", "evm", "v1", "trace_tx"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_TraceBlock_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ethermint", "evm", "v1", "trace_block"}, "", runtime.AssumeColonVerbOpt(true))) ) var ( @@ -995,4 +1073,6 @@ var ( forward_Query_EstimateGas_0 = runtime.ForwardResponseMessage forward_Query_TraceTx_0 = runtime.ForwardResponseMessage + + forward_Query_TraceBlock_0 = runtime.ForwardResponseMessage ) diff --git a/x/evm/types/tx.pb.go b/x/evm/types/tx.pb.go index ff9da3a2..8c98006d 100644 --- a/x/evm/types/tx.pb.go +++ b/x/evm/types/tx.pb.go @@ -13,6 +13,7 @@ import ( grpc1 "github.com/gogo/protobuf/grpc" proto "github.com/gogo/protobuf/proto" _ "github.com/regen-network/cosmos-proto" + _ "google.golang.org/genproto/googleapis/api/annotations" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -351,59 +352,61 @@ func init() { func init() { proto.RegisterFile("ethermint/evm/v1/tx.proto", fileDescriptor_f75ac0a12d075f21) } var fileDescriptor_f75ac0a12d075f21 = []byte{ - // 818 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x55, 0x3f, 0x6f, 0xdb, 0x46, - 0x14, 0x17, 0x25, 0x4a, 0xa4, 0x4e, 0xaa, 0x61, 0x10, 0x36, 0x40, 0x09, 0xa8, 0x28, 0x68, 0x68, - 0xd5, 0x02, 0x22, 0x61, 0xb7, 0x93, 0xa7, 0x9a, 0xfe, 0x07, 0x1b, 0x32, 0x5a, 0x10, 0x6a, 0x87, - 0x1a, 0x85, 0x70, 0xa6, 0xce, 0x14, 0x51, 0x91, 0x47, 0xf0, 0x4e, 0x84, 0xd4, 0x4f, 0xd0, 0x2d, - 0xf9, 0x08, 0x19, 0x32, 0x65, 0x4d, 0x3e, 0x40, 0x46, 0x8f, 0x46, 0xa6, 0x20, 0x03, 0x13, 0xc8, - 0x9b, 0xb7, 0xe4, 0x13, 0x04, 0x77, 0xa4, 0x2c, 0x2b, 0x82, 0x9c, 0xc4, 0x71, 0x90, 0x49, 0xef, - 0xf1, 0xbd, 0x7b, 0xff, 0x7e, 0x3f, 0xbd, 0x07, 0x2a, 0x88, 0xf6, 0x51, 0xe8, 0xb9, 0x3e, 0x35, - 0x50, 0xe4, 0x19, 0xd1, 0x86, 0x41, 0x47, 0x7a, 0x10, 0x62, 0x8a, 0x95, 0xd5, 0x6b, 0x93, 0x8e, - 0x22, 0x4f, 0x8f, 0x36, 0xaa, 0x6b, 0x0e, 0x76, 0x30, 0x37, 0x1a, 0x4c, 0x4a, 0xfc, 0xaa, 0x15, - 0x07, 0x63, 0x67, 0x80, 0x0c, 0xae, 0x9d, 0x0e, 0xcf, 0x0c, 0xe8, 0x8f, 0xa7, 0x26, 0x1b, 0x13, - 0x0f, 0x93, 0x6e, 0xf2, 0x26, 0x51, 0x52, 0x53, 0x75, 0x21, 0x31, 0x4b, 0xc2, 0x6d, 0x8d, 0x07, - 0x02, 0xf8, 0xee, 0x98, 0x38, 0x7b, 0xcc, 0x03, 0x0d, 0xbd, 0xce, 0x48, 0x69, 0x02, 0xb1, 0x07, - 0x29, 0x54, 0x85, 0xba, 0xd0, 0x2c, 0x6d, 0x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x9d, - 0xc4, 0x5a, 0x61, 0xdb, 0xc3, 0x43, 0x9f, 0x5a, 0x49, 0x08, 0x36, 0x01, 0x3e, 0xe7, 0x42, 0x5d, - 0x68, 0x96, 0xd3, 0x89, 0x96, 0x81, 0x10, 0xa9, 0x12, 0xff, 0x20, 0x44, 0x4c, 0x0b, 0x55, 0x39, - 0xd1, 0x42, 0xa6, 0x11, 0xb5, 0x98, 0x68, 0x64, 0x6b, 0x85, 0xcd, 0xea, 0xc5, 0xb3, 0x56, 0xa1, - 0x33, 0xda, 0x85, 0x14, 0x36, 0xde, 0xe6, 0x40, 0x79, 0xdb, 0xb6, 0x11, 0x21, 0x6d, 0x97, 0xd0, - 0xce, 0x48, 0x39, 0x01, 0xb2, 0xdd, 0x87, 0xae, 0xdf, 0x75, 0x7b, 0x7c, 0x78, 0x45, 0xf3, 0xb7, - 0xcf, 0xaa, 0x56, 0xda, 0x61, 0xaf, 0x0f, 0x77, 0xaf, 0x62, 0x4d, 0xb2, 0x13, 0xd1, 0x4a, 0x85, - 0xde, 0x0c, 0x96, 0xec, 0x52, 0x58, 0x72, 0x5f, 0x0e, 0x8b, 0x78, 0x3b, 0x2c, 0xf9, 0x45, 0x58, - 0x0a, 0xf7, 0x07, 0x8b, 0x74, 0x03, 0x96, 0x13, 0x20, 0x43, 0x3e, 0x5b, 0x44, 0x54, 0xb9, 0x9e, - 0x6b, 0x96, 0x36, 0xbf, 0xd7, 0x3f, 0xfc, 0xc7, 0xea, 0xc9, 0xf4, 0x3b, 0xc3, 0x60, 0x80, 0xcc, - 0xfa, 0x79, 0xac, 0x65, 0xae, 0x62, 0x0d, 0xc0, 0x6b, 0x48, 0x9e, 0xbc, 0xd6, 0xc0, 0x0c, 0x20, - 0xeb, 0x3a, 0x60, 0x82, 0x79, 0x71, 0x0e, 0x73, 0x30, 0x87, 0x79, 0x69, 0x19, 0xe6, 0xcf, 0x45, - 0x50, 0xde, 0x1d, 0xfb, 0xd0, 0x73, 0xed, 0x7d, 0x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a, - 0xe3, 0x47, 0x1c, 0xa6, 0xbd, 0x9a, 0xe6, 0xf9, 0xa4, 0x26, 0x5c, 0x4c, 0x6a, 0xc2, 0x9b, 0x49, - 0x4d, 0x78, 0x78, 0x59, 0xcb, 0x5c, 0x5c, 0xd6, 0x32, 0x2f, 0x2f, 0x6b, 0x99, 0xbf, 0x9b, 0x37, - 0x78, 0x42, 0xfb, 0x30, 0x24, 0x2e, 0x31, 0x66, 0x17, 0x77, 0xc4, 0x6f, 0x2e, 0x67, 0xcb, 0x69, - 0x81, 0x1f, 0xd1, 0x5f, 0xde, 0x07, 0x00, 0x00, 0xff, 0xff, 0x03, 0xe3, 0x68, 0xe8, 0x0a, 0x08, - 0x00, 0x00, + // 853 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x55, 0x31, 0x8f, 0xe3, 0x44, + 0x14, 0xce, 0x24, 0x4e, 0xec, 0x4c, 0xc2, 0xe9, 0x64, 0xed, 0x49, 0x4e, 0xc4, 0xc5, 0x91, 0x25, + 0x20, 0x20, 0xc5, 0xd6, 0x2d, 0x54, 0x5b, 0xb1, 0xbe, 0xdd, 0x3b, 0xdd, 0x29, 0x27, 0x90, 0x15, + 0x1a, 0xae, 0x88, 0x66, 0x9d, 0x59, 0x67, 0x44, 0xec, 0xb1, 0x3c, 0x13, 0xcb, 0x41, 0xa2, 0x41, + 0x14, 0x74, 0x20, 0xf1, 0x07, 0x28, 0xa8, 0x68, 0xe1, 0x07, 0x50, 0x5e, 0x79, 0x82, 0x06, 0x51, + 0x18, 0x94, 0xa5, 0xda, 0x0e, 0x7e, 0x01, 0x9a, 0xb1, 0xb3, 0x9b, 0x10, 0xe5, 0x80, 0xe3, 0x10, + 0x55, 0xe6, 0xf9, 0x7b, 0xf3, 0xe6, 0xbd, 0xf7, 0x7d, 0x79, 0x0f, 0x76, 0x30, 0x9f, 0xe1, 0x24, + 0x24, 0x11,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f, 0xfe, 0x11, 0x00, 0x00, 0xff, 0xff, 0x4a, 0x54, 0xa7, + 0x4c, 0x50, 0x08, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/evm/types/tx.pb.gw.go b/x/evm/types/tx.pb.gw.go new file mode 100644 index 00000000..a74e123e --- /dev/null +++ b/x/evm/types/tx.pb.gw.go @@ -0,0 +1,166 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: ethermint/evm/v1/tx.proto + +/* +Package types is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package types + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage + +var ( + filter_Msg_EthereumTx_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Msg_EthereumTx_0(ctx context.Context, marshaler runtime.Marshaler, client MsgClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq MsgEthereumTx + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_EthereumTx_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.EthereumTx(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Msg_EthereumTx_0(ctx context.Context, marshaler runtime.Marshaler, server MsgServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq MsgEthereumTx + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_EthereumTx_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.EthereumTx(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterMsgHandlerServer registers the http handlers for service Msg to "mux". +// UnaryRPC :call MsgServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features (such as grpc.SendHeader, etc) to stop working. Consider using RegisterMsgHandlerFromEndpoint instead. +func RegisterMsgHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MsgServer) error { + + mux.Handle("POST", pattern_Msg_EthereumTx_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Msg_EthereumTx_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Msg_EthereumTx_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterMsgHandlerFromEndpoint is same as RegisterMsgHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterMsgHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterMsgHandler(ctx, mux, conn) +} + +// RegisterMsgHandler registers the http handlers for service Msg to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterMsgHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterMsgHandlerClient(ctx, mux, NewMsgClient(conn)) +} + +// RegisterMsgHandlerClient registers the http handlers for service Msg +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "MsgClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "MsgClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "MsgClient" to call the correct interceptors. +func RegisterMsgHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MsgClient) error { + + mux.Handle("POST", pattern_Msg_EthereumTx_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Msg_EthereumTx_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Msg_EthereumTx_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_Msg_EthereumTx_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ethermint", "evm", "v1", "ethereum_tx"}, "", runtime.AssumeColonVerbOpt(true))) +) + +var ( + forward_Msg_EthereumTx_0 = runtime.ForwardResponseMessage +)