Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* [4070](https://github.com/zeta-chain/node/pull/4070) - remove support for v1 revert address for BTC
* [4144](https://github.com/zeta-chain/node/pull/4144) - standardize structured logging for zetaclient
* [4180](https://github.com/zeta-chain/node/pull/4180) - remove unused loggers and log fields
* [4200](https://github.com/zeta-chain/node/pull/4200) - remove `LastBlockHeight` state variable

### Fixes

Expand Down
109 changes: 0 additions & 109 deletions docs/openapi/openapi.swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27322,85 +27322,6 @@ paths:
type: boolean
tags:
- Query
/zeta-chain/crosschain/lastBlockHeight:
get:
summary: Queries a list of lastBlockHeight items.
operationId: LastBlockHeightAll
responses:
"200":
description: A successful response.
schema:
$ref: '#/definitions/zetachain.zetacore.crosschain.QueryAllLastBlockHeightResponse'
default:
description: An unexpected error response.
schema:
$ref: '#/definitions/google.rpc.Status'
parameters:
- name: pagination.key
description: |-
key is a value returned in PageResponse.next_key to begin
querying the next page most efficiently. Only one of offset or key
should be set.
in: query
required: false
type: string
format: byte
- name: pagination.offset
description: |-
offset is a numeric offset that can be used when key is unavailable.
It is less efficient than using key. Only one of offset or key should
be set.
in: query
required: false
type: string
format: uint64
- name: pagination.limit
description: |-
limit is the total number of results to be returned in the result page.
If left empty it will default to a value to be set by each app.
in: query
required: false
type: string
format: uint64
- name: pagination.countTotal
description: |-
count_total is set to true to indicate that the result set should include
a count of the total number of items available for pagination in UIs.
count_total is only respected when offset is used. It is ignored when key
is set.
in: query
required: false
type: boolean
- name: pagination.reverse
description: |-
reverse is set to true if results are to be returned in the descending order.

Since: cosmos-sdk 0.43
in: query
required: false
type: boolean
tags:
- Query
/zeta-chain/crosschain/lastBlockHeight/{index}:
get:
summary: Queries a lastBlockHeight by index.
operationId: LastBlockHeight
responses:
"200":
description: A successful response.
schema:
$ref: '#/definitions/zetachain.zetacore.crosschain.QueryGetLastBlockHeightResponse'
default:
description: An unexpected error response.
schema:
$ref: '#/definitions/google.rpc.Status'
parameters:
- name: index
in: path
required: true
type: string
tags:
- Query
/zeta-chain/crosschain/lastZetaHeight:
get:
summary: Queries a list of lastMetaHeight items.
Expand Down Expand Up @@ -54431,21 +54352,6 @@ definitions:
type: string
coinType:
$ref: '#/definitions/zetachain.zetacore.pkg.coin.CoinType'
zetachain.zetacore.crosschain.LastBlockHeight:
type: object
properties:
creator:
type: string
index:
type: string
chain:
type: string
lastInboundHeight:
type: string
format: uint64
lastOutboundHeight:
type: string
format: uint64
zetachain.zetacore.crosschain.MsgAbortStuckCCTXResponse:
type: object
zetachain.zetacore.crosschain.MsgAddInboundTrackerResponse:
Expand Down Expand Up @@ -54617,16 +54523,6 @@ definitions:
$ref: '#/definitions/zetachain.zetacore.crosschain.InboundTracker'
pagination:
$ref: '#/definitions/cosmos.base.query.v1beta1.PageResponse'
zetachain.zetacore.crosschain.QueryAllLastBlockHeightResponse:
type: object
properties:
LastBlockHeight:
type: array
items:
type: object
$ref: '#/definitions/zetachain.zetacore.crosschain.LastBlockHeight'
pagination:
$ref: '#/definitions/cosmos.base.query.v1beta1.PageResponse'
zetachain.zetacore.crosschain.QueryAllOutboundTrackerByChainResponse:
type: object
properties:
Expand Down Expand Up @@ -54672,11 +54568,6 @@ definitions:
properties:
inboundHashToCctx:
$ref: '#/definitions/zetachain.zetacore.crosschain.InboundHashToCctx'
zetachain.zetacore.crosschain.QueryGetLastBlockHeightResponse:
type: object
properties:
LastBlockHeight:
$ref: '#/definitions/zetachain.zetacore.crosschain.LastBlockHeight'
zetachain.zetacore.crosschain.QueryGetOutboundTrackerResponse:
type: object
properties:
Expand Down
10 changes: 0 additions & 10 deletions pkg/rpc/clients_crosschain.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,6 @@ import (
// 32MB
var maxSizeOption = grpc.MaxCallRecvMsgSize(32 * 1024 * 1024)

// GetLastBlockHeight returns the zetachain block height
func (c *Clients) GetLastBlockHeight(ctx context.Context) (uint64, error) {
resp, err := c.Crosschain.LastBlockHeight(ctx, &types.QueryGetLastBlockHeightRequest{})
if err != nil {
return 0, errors.Wrap(err, "failed to get block height")
}

return resp.GetLastBlockHeight().LastInboundHeight, nil
}

// GetBlockHeight returns the zetachain block height
func (c *Clients) GetBlockHeight(ctx context.Context) (int64, error) {
resp, err := c.Crosschain.LastZetaHeight(ctx, &types.QueryLastZetaHeightRequest{})
Expand Down
5 changes: 3 additions & 2 deletions proto/zetachain/zetacore/crosschain/genesis.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import "zetachain/zetacore/crosschain/cross_chain_tx.proto";
import "zetachain/zetacore/crosschain/gas_price.proto";
import "zetachain/zetacore/crosschain/inbound_hash_to_cctx.proto";
import "zetachain/zetacore/crosschain/inbound_tracker.proto";
import "zetachain/zetacore/crosschain/last_block_height.proto";
import "zetachain/zetacore/crosschain/outbound_tracker.proto";
import "zetachain/zetacore/crosschain/rate_limiter_flags.proto";
import "gogoproto/gogo.proto";
Expand All @@ -14,11 +13,13 @@ option go_package = "github.com/zeta-chain/node/x/crosschain/types";

// GenesisState defines the crosschain module's genesis state.
message GenesisState {
reserved 8;
reserved "lastBlockHeightList";

repeated OutboundTracker outboundTrackerList = 2
[ (gogoproto.nullable) = false ];
repeated GasPrice gasPriceList = 5;
repeated CrossChainTx CrossChainTxs = 7;
repeated LastBlockHeight lastBlockHeightList = 8;
repeated InboundHashToCctx inboundHashToCctxList = 9
[ (gogoproto.nullable) = false ];
repeated InboundTracker inbound_tracker_list = 11
Expand Down
12 changes: 0 additions & 12 deletions proto/zetachain/zetacore/crosschain/last_block_height.proto

This file was deleted.

26 changes: 0 additions & 26 deletions proto/zetachain/zetacore/crosschain/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import "zetachain/zetacore/crosschain/cross_chain_tx.proto";
import "zetachain/zetacore/crosschain/gas_price.proto";
import "zetachain/zetacore/crosschain/inbound_hash_to_cctx.proto";
import "zetachain/zetacore/crosschain/inbound_tracker.proto";
import "zetachain/zetacore/crosschain/last_block_height.proto";
import "zetachain/zetacore/crosschain/outbound_tracker.proto";
import "zetachain/zetacore/crosschain/rate_limiter_flags.proto";
import "gogoproto/gogo.proto";
Expand Down Expand Up @@ -93,18 +92,6 @@ service Query {
option (google.api.http).get = "/zeta-chain/crosschain/protocolFee";
}

// Queries a lastBlockHeight by index.
rpc LastBlockHeight(QueryGetLastBlockHeightRequest)
returns (QueryGetLastBlockHeightResponse) {
option (google.api.http).get =
"/zeta-chain/crosschain/lastBlockHeight/{index}";
}

// Queries a list of lastBlockHeight items.
rpc LastBlockHeightAll(QueryAllLastBlockHeightRequest)
returns (QueryAllLastBlockHeightResponse) {
option (google.api.http).get = "/zeta-chain/crosschain/lastBlockHeight";
}
// Queries a send by index.
rpc Cctx(QueryGetCctxRequest) returns (QueryGetCctxResponse) {
option (google.api.http).get = "/zeta-chain/crosschain/cctx/{index}";
Expand Down Expand Up @@ -244,19 +231,6 @@ message QueryAllGasPriceResponse {
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}

message QueryGetLastBlockHeightRequest { string index = 1; }

message QueryGetLastBlockHeightResponse { LastBlockHeight LastBlockHeight = 1; }

message QueryAllLastBlockHeightRequest {
cosmos.base.query.v1beta1.PageRequest pagination = 1;
}

message QueryAllLastBlockHeightResponse {
repeated LastBlockHeight LastBlockHeight = 1;
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}

message QueryGetCctxRequest { string index = 1; }

message QueryGetCctxByNonceRequest {
Expand Down
6 changes: 0 additions & 6 deletions testutil/network/genesis_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,12 +230,6 @@ func AddCrosschainData(
},
)
}
for i := 0; i < n; i++ {
state.LastBlockHeightList = append(
state.LastBlockHeightList,
&types.LastBlockHeight{Creator: "ANY", Index: strconv.Itoa(i)},
)
}

for i := 0; i < n; i++ {
inboundTracker := types.InboundTracker{
Expand Down
12 changes: 0 additions & 12 deletions testutil/sample/crosschain.go
Original file line number Diff line number Diff line change
Expand Up @@ -324,18 +324,6 @@ func CustomCctxsInBlockRange(
return cctxs
}

func LastBlockHeight(t *testing.T, index string) *types.LastBlockHeight {
r := newRandFromStringSeed(t, index)

return &types.LastBlockHeight{
Creator: AccAddress(),
Index: index,
Chain: StringRandom(r, 32),
LastInboundHeight: r.Uint64(),
LastOutboundHeight: r.Uint64(),
}
}

func InboundHashToCctx(t *testing.T, inboundHash string) types.InboundHashToCctx {
r := newRandFromStringSeed(t, inboundHash)

Expand Down
9 changes: 1 addition & 8 deletions typescript/zetachain/zetacore/crosschain/genesis_pb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ import type { InboundHashToCctx } from "./inbound_hash_to_cctx_pb";
import { file_zetachain_zetacore_crosschain_inbound_hash_to_cctx } from "./inbound_hash_to_cctx_pb";
import type { InboundTracker } from "./inbound_tracker_pb";
import { file_zetachain_zetacore_crosschain_inbound_tracker } from "./inbound_tracker_pb";
import type { LastBlockHeight } from "./last_block_height_pb";
import { file_zetachain_zetacore_crosschain_last_block_height } from "./last_block_height_pb";
import type { OutboundTracker } from "./outbound_tracker_pb";
import { file_zetachain_zetacore_crosschain_outbound_tracker } from "./outbound_tracker_pb";
import type { RateLimiterFlags } from "./rate_limiter_flags_pb";
Expand All @@ -25,7 +23,7 @@ import type { Message } from "@bufbuild/protobuf";
* Describes the file zetachain/zetacore/crosschain/genesis.proto.
*/
export const file_zetachain_zetacore_crosschain_genesis: GenFile = /*@__PURE__*/
fileDesc("Cit6ZXRhY2hhaW4vemV0YWNvcmUvY3Jvc3NjaGFpbi9nZW5lc2lzLnByb3RvEh16ZXRhY2hhaW4uemV0YWNvcmUuY3Jvc3NjaGFpbiKoBQo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NjaGFpbsoCHVpldGFjaGFpblxaZXRhY29yZVxDcm9zc2NoYWlu4gIpWmV0YWNoYWluXFpldGFjb3JlXENyb3NzY2hhaW5cR1BCTWV0YWRhdGHqAh9aZXRhY2hhaW46OlpldGFjb3JlOjpDcm9zc2NoYWluYgZwcm90bzM", [file_zetachain_zetacore_crosschain_cross_chain_tx, file_zetachain_zetacore_crosschain_gas_price, file_zetachain_zetacore_crosschain_inbound_hash_to_cctx, file_zetachain_zetacore_crosschain_inbound_tracker, file_zetachain_zetacore_crosschain_last_block_height, file_zetachain_zetacore_crosschain_outbound_tracker, file_zetachain_zetacore_crosschain_rate_limiter_flags, file_gogoproto_gogo]);
fileDesc("Cit6ZXRhY2hhaW4vemV0YWNvcmUvY3Jvc3NjaGFpbi9nZW5lc2lzLnByb3RvEh16ZXRhY2hhaW4uemV0YWNvcmUuY3Jvc3NjaGFpbiL2BAoMR2VuZXNpc1N0YXRlElEKE291dGJvdW5kVHJhY2tlckxpc3QYAiADKAsyLi56ZXRhY2hhaW4uemV0YWNvcmUuY3Jvc3NjaGFpbi5PdXRib3VuZFRyYWNrZXJCBMjeHwASPQoMZ2FzUHJpY2VMaXN0GAUgAygLMicuemV0YWNoYWluLnpldGFjb3JlLmNyb3NzY2hhaW4uR2FzUHJpY2USQgoNQ3Jvc3NDaGFpblR4cxgHIAMoCzIrLnpldGFjaGFpbi56ZXRhY29yZS5jcm9zc2NoYWluLkNyb3NzQ2hhaW5UeBJVChVpbmJvdW5kSGFzaFRvQ2N0eExpc3QYCSADKAsyMC56ZXRhY2hhaW4uemV0YWNvcmUuY3Jvc3NjaGFpbi5JbmJvdW5kSGFzaFRvQ2N0eEIEyN4fABJRChRpbmJvdW5kX3RyYWNrZXJfbGlzdBgLIAMoCzItLnpldGFjaGFpbi56ZXRhY29yZS5jcm9zc2NoYWluLkluYm91bmRUcmFja2VyQgTI3h8AEkwKD3pldGFfYWNjb3VudGluZxgMIAEoCzItLnpldGFjaGFpbi56ZXRhY29yZS5jcm9zc2NoYWluLlpldGFBY2NvdW50aW5nQgTI3h8AEhkKEUZpbmFsaXplZEluYm91bmRzGBAgAygJElEKEnJhdGVfbGltaXRlcl9mbGFncxgRIAEoCzIvLnpldGFjaGFpbi56ZXRhY29yZS5jcm9zc2NoYWluLlJhdGVMaW1pdGVyRmxhZ3NCBMjeHwASDwoHY291bnRlchgSIAEoBEoECAgQCVITbGFzdEJsb2NrSGVpZ2h0TGlzdEL2AQohY29tLnpldGFjaGFpbi56ZXRhY29yZS5jcm9zc2NoYWluQgxHZW5lc2lzUHJvdG9QAVotZ2l0aHViLmNvbS96ZXRhLWNoYWluL25vZGUveC9jcm9zc2NoYWluL3R5cGVzogIDWlpDqgIdWmV0YWNoYWluLlpldGFjb3JlLkNyb3NzY2hhaW7KAh1aZXRhY2hhaW5cWmV0YWNvcmVcQ3Jvc3NjaGFpbuICKVpldGFjaGFpblxaZXRhY29yZVxDcm9zc2NoYWluXEdQQk1ldGFkYXRh6gIfWmV0YWNoYWluOjpaZXRhY29yZTo6Q3Jvc3NjaGFpbmIGcHJvdG8z", [file_zetachain_zetacore_crosschain_cross_chain_tx, file_zetachain_zetacore_crosschain_gas_price, file_zetachain_zetacore_crosschain_inbound_hash_to_cctx, file_zetachain_zetacore_crosschain_inbound_tracker, file_zetachain_zetacore_crosschain_outbound_tracker, file_zetachain_zetacore_crosschain_rate_limiter_flags, file_gogoproto_gogo]);

/**
* GenesisState defines the crosschain module's genesis state.
Expand All @@ -48,11 +46,6 @@ export type GenesisState = Message<"zetachain.zetacore.crosschain.GenesisState">
*/
CrossChainTxs: CrossChainTx[];

/**
* @generated from field: repeated zetachain.zetacore.crosschain.LastBlockHeight lastBlockHeightList = 8;
*/
lastBlockHeightList: LastBlockHeight[];

/**
* @generated from field: repeated zetachain.zetacore.crosschain.InboundHashToCctx inboundHashToCctxList = 9;
*/
Expand Down

This file was deleted.

Loading