From d043dc4bf41c6a230600a697c3f86b7db2d13e24 Mon Sep 17 00:00:00 2001 From: Thomas Nguy Date: Tue, 20 Jul 2021 09:23:54 +0900 Subject: [PATCH] add comments --- CHANGELOG.md | 1 + docs/core/proto-docs.md | 2 +- ethereum/rpc/types/block.go | 1 + proto/ethermint/evm/v1alpha1/query.proto | 5 ++++- x/evm/types/query.pb.go | 5 ++++- 5 files changed, 11 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 35646bf822..f0ed81a34b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -57,6 +57,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (eth) [\#845](https://github.com/cosmos/ethermint/pull/845) The `eth` namespace must be included in the list of API's as default to run the rpc server without error. * (evm) [#202](https://github.com/tharsis/ethermint/pull/202) Web3 api `SendTransaction`/`SendRawTransaction` returns ethereum compatible transaction hash, and query api `GetTransaction*` also accept that. * (rpc) [tharsis#258](https://github.com/tharsis/ethermint/pull/258) Return empty `BloomFilter` instead of throwing an error when it cannot be found (`nil` or empty). +* (rpc) [tharsis#277](https://github.com/tharsis/ethermint/pull/321) Fix `BloomFilter` response. ### Improvements diff --git a/docs/core/proto-docs.md b/docs/core/proto-docs.md index 7b744c34c1..4cc85e14b7 100644 --- a/docs/core/proto-docs.md +++ b/docs/core/proto-docs.md @@ -570,7 +570,7 @@ method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `height` | [int64](#int64) | | height of the block which we want to query the bloom filter | +| `height` | [int64](#int64) | | height of the block which we want to query the bloom filter. Tendermint always replace the query request header by the current context header, height cannot be extracted from there, so we need to explicitly pass it in parameter. | diff --git a/ethereum/rpc/types/block.go b/ethereum/rpc/types/block.go index 6300b03242..6986305ae2 100644 --- a/ethereum/rpc/types/block.go +++ b/ethereum/rpc/types/block.go @@ -30,6 +30,7 @@ func NewBlockNumber(n *big.Int) BlockNumber { // ContextWithHeight wraps a context with the a gRPC block height header. If the provided height is // 0, it will return an empty context and the gRPC query will use the latest block height for querying. +// Note that all metadata are processed and removed by tendermint layer, so it wont be accessible at gRPC server level. func ContextWithHeight(height int64) context.Context { if height == 0 { return context.Background() diff --git a/proto/ethermint/evm/v1alpha1/query.proto b/proto/ethermint/evm/v1alpha1/query.proto index 9f28aa65b7..ce2fe9840c 100644 --- a/proto/ethermint/evm/v1alpha1/query.proto +++ b/proto/ethermint/evm/v1alpha1/query.proto @@ -223,7 +223,10 @@ message QueryBlockLogsResponse { // QueryBlockBloomRequest is the request type for the Query/BlockBloom RPC // method. message QueryBlockBloomRequest { - // height of the block which we want to query the bloom filter + // height of the block which we want to query the bloom filter. + // Tendermint always replace the query request header by the current context + // header, height cannot be extracted from there, so we need to explicitly pass + // it in parameter. int64 height = 1; } diff --git a/x/evm/types/query.pb.go b/x/evm/types/query.pb.go index 3173415396..92695569c5 100644 --- a/x/evm/types/query.pb.go +++ b/x/evm/types/query.pb.go @@ -782,7 +782,10 @@ func (m *QueryBlockLogsResponse) GetPagination() *query.PageResponse { // QueryBlockBloomRequest is the request type for the Query/BlockBloom RPC // method. type QueryBlockBloomRequest struct { - // height of the block which we want to query the bloom filter + // height of the block which we want to query the bloom filter. + // Tendermint always replace the query request header by the current context + // header, height cannot be extracted from there, so we need to explicitly pass + // it in parameter. Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` }