diff --git a/client/docs/swagger-ui/swagger.yaml b/client/docs/swagger-ui/swagger.yaml index 7ded4d2d7..ef947e9a4 100644 --- a/client/docs/swagger-ui/swagger.yaml +++ b/client/docs/swagger-ui/swagger.yaml @@ -7284,12 +7284,14 @@ paths: collectionFormat: multi tags: - Query - /babylon/zoneconcierge/v1/finalized_chain_info/{chain_id}: + /babylon/zoneconcierge/v1/finalized_chain_info/{chain_id}/height/{height}: get: summary: >- - FinalizedChainInfo queries the BTC-finalised info of a chain, with - proofs - operationId: FinalizedChainInfo + FinalizedChainInfoUntilHeight queries the BTC-finalised info no later + than + + the provided CZ height, with proofs + operationId: FinalizedChainInfoUntilHeight responses: '200': description: A successful response. @@ -8062,9 +8064,11 @@ paths: (i.e., earliest) checkpoint submission - description: |- - QueryFinalizedChainInfoResponse is response type for the - Query/FinalizedChainInfo RPC method. + description: >- + QueryFinalizedChainInfoUntilHeightResponse is response type for + the + + Query/FinalizedChainInfoUntilHeight RPC method. default: description: An unexpected error response. schema: @@ -8262,6 +8266,18 @@ paths: in: path required: true type: string + - name: height + description: >- + height is the height of the CZ chain + + such that the returned finalised chain info will be no later than + this + + height + in: path + required: true + type: string + format: uint64 - name: prove description: >- prove indicates whether the querier wants to get proofs of this @@ -8271,155 +8287,36 @@ paths: type: boolean tags: - Query - /babylon/zoneconcierge/v1/finalized_chain_info/{chain_id}/height/{height}: + /babylon/zoneconcierge/v1/finalized_chains_info: get: summary: >- - FinalizedChainInfoUntilHeight queries the BTC-finalised info no later - than - - the provided CZ height, with proofs - operationId: FinalizedChainInfoUntilHeight + FinalizedChainsInfo queries the BTC-finalised info of chains with given + IDs, with proofs + operationId: FinalizedChainsInfo responses: '200': description: A successful response. schema: type: object properties: - finalized_chain_info: - type: object - properties: - chain_id: - type: string - title: chain_id is the ID of the chain - latest_header: - title: latest_header is the latest header in CZ's canonical chain - type: object - properties: - chain_id: - type: string - title: chain_id is the unique ID of the chain - hash: - type: string - format: byte - title: hash is the hash of this header - height: - type: string - format: uint64 - title: >- - height is the height of this header on CZ ledger - - (hash, height) jointly provides the position of the - header on CZ ledger - babylon_header: - title: >- - babylon_header is the header of the babylon block that - includes this CZ - - header - type: object - properties: - version: - title: basic block info - type: object - properties: - block: - type: string - format: uint64 - app: - type: string - format: uint64 - description: >- - Consensus captures the consensus rules for - processing a block in the blockchain, - - including all blockchain data structures and the - rules of the application's - - state transition machine. - chain_id: - type: string - height: - type: string - format: int64 - time: - type: string - format: date-time - last_block_id: - title: prev block info - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - last_commit_hash: - type: string - format: byte - title: hashes of block data - data_hash: - type: string - format: byte - validators_hash: - type: string - format: byte - title: hashes from the app output from the prev block - next_validators_hash: - type: string - format: byte - consensus_hash: - type: string - format: byte - app_hash: - type: string - format: byte - last_results_hash: - type: string - format: byte - evidence_hash: - type: string - format: byte - title: consensus info - proposer_address: - type: string - format: byte - description: Header defines the structure of a block header. - babylon_epoch: - type: string - format: uint64 - title: >- - epoch is the epoch number of this header on Babylon - ledger - babylon_tx_hash: - type: string - format: byte - title: >- - babylon_tx_hash is the hash of the tx that includes - this header - - (babylon_block_height, babylon_tx_hash) jointly - provides the position of - - the header on Babylon ledger - latest_forks: - title: >- - latest_forks is the latest forks, formed as a series of - IndexedHeader (from - - low to high) - type: object - properties: - headers: - type: array - items: + finalized_chains_info: + type: array + items: + type: object + properties: + chain_id: + type: string + title: chain_id is the ID of the chain + finalized_chain_info: + type: object + properties: + chain_id: + type: string + title: chain_id is the ID of the chain + latest_header: + title: >- + latest_header is the latest header in CZ's canonical + chain type: object properties: chain_id: @@ -8538,524 +8435,664 @@ paths: provides the position of the header on Babylon ledger - title: IndexedHeader is the metadata of a CZ header - title: >- - blocks is the list of non-canonical indexed headers at - the same height - description: >- - Forks is a list of non-canonical `IndexedHeader`s at the - same height. + latest_forks: + title: >- + latest_forks is the latest forks, formed as a series + of IndexedHeader (from - For example, assuming the following blockchain + low to high) + type: object + properties: + headers: + type: array + items: + type: object + properties: + chain_id: + type: string + title: chain_id is the unique ID of the chain + hash: + type: string + format: byte + title: hash is the hash of this header + height: + type: string + format: uint64 + title: >- + height is the height of this header on CZ + ledger - ``` + (hash, height) jointly provides the + position of the header on CZ ledger + babylon_header: + title: >- + babylon_header is the header of the + babylon block that includes this CZ - A <- B <- C <- D <- E - \ -- D1 - \ -- D2 - ``` + header + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules + for processing a block in the + blockchain, - Then the fork will be {[D1, D2]} where each item is in - struct `IndexedBlock`. + including all blockchain data structures + and the rules of the application's + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + title: prev block info + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + last_commit_hash: + type: string + format: byte + title: hashes of block data + data_hash: + type: string + format: byte + validators_hash: + type: string + format: byte + title: >- + hashes from the app output from the prev + block + next_validators_hash: + type: string + format: byte + consensus_hash: + type: string + format: byte + app_hash: + type: string + format: byte + last_results_hash: + type: string + format: byte + evidence_hash: + type: string + format: byte + title: consensus info + proposer_address: + type: string + format: byte + description: >- + Header defines the structure of a block + header. + babylon_epoch: + type: string + format: uint64 + title: >- + epoch is the epoch number of this header + on Babylon ledger + babylon_tx_hash: + type: string + format: byte + title: >- + babylon_tx_hash is the hash of the tx that + includes this header - Note that each `IndexedHeader` in the fork should have a - valid quorum + (babylon_block_height, babylon_tx_hash) + jointly provides the position of - certificate. Such forks exist since Babylon considers CZs - might have + the header on Babylon ledger + title: IndexedHeader is the metadata of a CZ header + title: >- + blocks is the list of non-canonical indexed + headers at the same height + description: >- + Forks is a list of non-canonical `IndexedHeader`s at + the same height. - dishonest majority. Also note that the IBC-Go - implementation will only + For example, assuming the following blockchain - consider the first header in a fork valid, since the - subsequent headers + ``` - cannot be verified without knowing the validator set in - the previous header. - timestamped_headers_count: - type: string - format: uint64 - title: >- - timestamped_headers_count is the number of timestamped - headers in CZ's + A <- B <- C <- D <- E + \ -- D1 + \ -- D2 + ``` - canonical chain - title: ChainInfo is the information of a CZ - epoch_info: - title: epoch_info is the metadata of the last BTC-finalised epoch - type: object - properties: - epoch_number: - type: string - format: uint64 - current_epoch_interval: - type: string - format: uint64 - first_block_height: - type: string - format: uint64 - last_block_header: - description: >- - last_block_header is the header of the last block in this - epoch. + Then the fork will be {[D1, D2]} where each item is + in struct `IndexedBlock`. - Babylon needs to remember the last header of each epoch to - complete - unbonding validators/delegations when a previous epoch's - checkpoint is + Note that each `IndexedHeader` in the fork should + have a valid quorum - finalised. The last_block_header field is nil in the - epoch's beginning, and + certificate. Such forks exist since Babylon + considers CZs might have - is set upon the end of this epoch. - type: object - properties: - version: - title: basic block info - type: object - properties: - block: - type: string - format: uint64 - app: - type: string - format: uint64 - description: >- - Consensus captures the consensus rules for processing - a block in the blockchain, + dishonest majority. Also note that the IBC-Go + implementation will only - including all blockchain data structures and the rules - of the application's + consider the first header in a fork valid, since the + subsequent headers - state transition machine. - chain_id: - type: string - height: - type: string - format: int64 - time: - type: string - format: date-time - last_block_id: - title: prev block info - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - last_commit_hash: - type: string - format: byte - title: hashes of block data - data_hash: - type: string - format: byte - validators_hash: - type: string - format: byte - title: hashes from the app output from the prev block - next_validators_hash: - type: string - format: byte - consensus_hash: - type: string - format: byte - app_hash: - type: string - format: byte - last_results_hash: - type: string - format: byte - evidence_hash: - type: string - format: byte - title: consensus info - proposer_address: - type: string - format: byte - app_hash_root: - type: string - format: byte - title: >- - app_hash_root is the Merkle root of all AppHashs in this - epoch + cannot be verified without knowing the validator set + in the previous header. + timestamped_headers_count: + type: string + format: uint64 + title: >- + timestamped_headers_count is the number of + timestamped headers in CZ's - It will be used for proving a block is in an epoch - sealer_header: - title: >- - sealer_header is the 2nd header of the next epoch + canonical chain + title: ChainInfo is the information of a CZ + epoch_info: + title: >- + epoch_info is the metadata of the last BTC-finalised + epoch + type: object + properties: + epoch_number: + type: string + format: uint64 + current_epoch_interval: + type: string + format: uint64 + first_block_height: + type: string + format: uint64 + last_block_header: + description: >- + last_block_header is the header of the last block in + this epoch. - This validator set has generated a BLS multisig on - `last_commit_hash` of + Babylon needs to remember the last header of each + epoch to complete - the sealer header - type: object - properties: - version: - title: basic block info - type: object - properties: - block: - type: string - format: uint64 - app: - type: string - format: uint64 - description: >- - Consensus captures the consensus rules for processing - a block in the blockchain, + unbonding validators/delegations when a previous + epoch's checkpoint is - including all blockchain data structures and the rules - of the application's + finalised. The last_block_header field is nil in the + epoch's beginning, and - state transition machine. - chain_id: - type: string - height: - type: string - format: int64 - time: - type: string - format: date-time - last_block_id: - title: prev block info - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - last_commit_hash: - type: string - format: byte - title: hashes of block data - data_hash: - type: string - format: byte - validators_hash: - type: string - format: byte - title: hashes from the app output from the prev block - next_validators_hash: - type: string - format: byte - consensus_hash: - type: string - format: byte - app_hash: - type: string - format: byte - last_results_hash: - type: string - format: byte - evidence_hash: - type: string - format: byte - title: consensus info - proposer_address: - type: string - format: byte - description: Header defines the structure of a block header. - raw_checkpoint: - title: raw_checkpoint is the raw checkpoint of this epoch - type: object - properties: - epoch_num: - type: string - format: uint64 - title: >- - epoch_num defines the epoch number the raw checkpoint is - for - last_commit_hash: - type: string - format: byte - title: >- - last_commit_hash defines the 'LastCommitHash' that - individual BLS sigs are + is set upon the end of this epoch. + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules for + processing a block in the blockchain, - signed on - bitmap: - type: string - format: byte - title: >- - bitmap defines the bitmap that indicates the signers of - the BLS multi sig - bls_multi_sig: - type: string - format: byte - title: >- - bls_multi_sig defines the multi sig that is aggregated - from individual BLS + including all blockchain data structures and the + rules of the application's - sigs - btc_submission_key: - title: >- - btc_submission_key is position of two BTC txs that include the - raw - - checkpoint of this epoch - type: object - properties: - key: - type: array - items: - type: object - properties: - index: - type: integer - format: int64 - hash: - type: string - format: byte - title: >- - Each provided OP_RETURN transaction can be idendtified - by hash of block in - - which transaction was included and transaction index in - the block - proof: - title: proof is the proof that the chain info is finalized - type: object - properties: - proof_tx_in_block: - title: >- - proof_tx_in_block is the proof that tx that carries the - header is included - - in a certain Babylon block - type: object - properties: - root_hash: - type: string - format: byte - data: - type: string - format: byte - proof: - type: object - properties: - total: - type: string - format: int64 - index: - type: string - format: int64 - leaf_hash: - type: string - format: byte - aunts: - type: array - items: + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + title: prev block info + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + last_commit_hash: type: string format: byte - description: >- - TxProof represents a Merkle proof of the presence of a - transaction in the Merkle tree. - proof_header_in_epoch: - type: object - properties: - total: - type: string - format: int64 - index: - type: string - format: int64 - leaf_hash: - type: string - format: byte - aunts: - type: array - items: - type: string - format: byte - title: >- - proof_header_in_epoch is the proof that the Babylon header - is in a certain - - epoch - proof_epoch_sealed: - title: proof_epoch_sealed is the proof that the epoch is sealed - type: object - properties: - validator_set: - type: array - items: - type: object - properties: - validator_address: + title: hashes of block data + data_hash: type: string - bls_pub_key: + format: byte + validators_hash: type: string format: byte - voting_power: + title: hashes from the app output from the prev block + next_validators_hash: type: string - format: uint64 + format: byte + consensus_hash: + type: string + format: byte + app_hash: + type: string + format: byte + last_results_hash: + type: string + format: byte + evidence_hash: + type: string + format: byte + title: consensus info + proposer_address: + type: string + format: byte + app_hash_root: + type: string + format: byte title: >- - ValidatorWithBlsKey couples validator address, - voting power, and its bls - - public key - title: >- - validator_set is the validator set of the sealed epoch + app_hash_root is the Merkle root of all AppHashs in + this epoch - This validator set has generated a BLS multisig on - `last_commit_hash` of + It will be used for proving a block is in an epoch + sealer_header: + title: >- + sealer_header is the 2nd header of the next epoch - the sealer header - proof_epoch_info: - title: >- - proof_epoch_info is the Merkle proof that the epoch's - metadata is committed + This validator set has generated a BLS multisig on + `last_commit_hash` of - to `app_hash` of the sealer header - type: object - properties: - ops: - type: array - items: + the sealer header + type: object + properties: + version: + title: basic block info type: object properties: - type: - type: string - key: + block: type: string - format: byte - data: + format: uint64 + app: type: string - format: byte - title: >- - ProofOp defines an operation used for - calculating Merkle root - - The data could be arbitrary format, providing - nessecary data + format: uint64 + description: >- + Consensus captures the consensus rules for + processing a block in the blockchain, - for example neighbouring node hash - proof_epoch_val_set: - title: >- - proof_epoch_info is the Merkle proof that the epoch's - validator set is + including all blockchain data structures and the + rules of the application's - committed to `app_hash` of the sealer header - type: object - properties: - ops: - type: array - items: + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + title: prev block info type: object properties: - type: - type: string - key: - type: string - format: byte - data: + hash: type: string format: byte - title: >- - ProofOp defines an operation used for - calculating Merkle root - - The data could be arbitrary format, providing - nessecary data - - for example neighbouring node hash - proof_epoch_submitted: - type: array - items: - type: object - properties: - key: - type: object - properties: - index: - type: integer - format: int64 - hash: + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + last_commit_hash: type: string format: byte - title: >- - Each provided OP_RETURN transaction can be - idendtified by hash of block in - - which transaction was included and transaction index - in the block - description: >- - key is the position (txIdx, blockHash) of this tx on - BTC blockchain - - Although it is already a part of SubmissionKey, we - store it here again - - to make TransactionInfo self-contained. - - For example, storing the key allows TransactionInfo - to not relay on - - the fact that TransactionInfo will be ordered in the - same order as + title: hashes of block data + data_hash: + type: string + format: byte + validators_hash: + type: string + format: byte + title: hashes from the app output from the prev block + next_validators_hash: + type: string + format: byte + consensus_hash: + type: string + format: byte + app_hash: + type: string + format: byte + last_results_hash: + type: string + format: byte + evidence_hash: + type: string + format: byte + title: consensus info + proposer_address: + type: string + format: byte + description: Header defines the structure of a block header. + raw_checkpoint: + title: raw_checkpoint is the raw checkpoint of this epoch + type: object + properties: + epoch_num: + type: string + format: uint64 + title: >- + epoch_num defines the epoch number the raw + checkpoint is for + last_commit_hash: + type: string + format: byte + title: >- + last_commit_hash defines the 'LastCommitHash' that + individual BLS sigs are - TransactionKeys in SubmissionKey. - transaction: + signed on + bitmap: type: string format: byte - title: transaction is the full transaction in bytes - proof: + title: >- + bitmap defines the bitmap that indicates the signers + of the BLS multi sig + bls_multi_sig: type: string format: byte title: >- - proof is the Merkle proof that this tx is included - in the position in `key` - - TODO: maybe it could use here better format as we - already processed and + bls_multi_sig defines the multi sig that is + aggregated from individual BLS - valideated the proof? + sigs + btc_submission_key: title: >- - TransactionInfo is the info of a tx that contains - Babylon checkpoint, + btc_submission_key is position of two BTC txs that + include the raw - including + checkpoint of this epoch + type: object + properties: + key: + type: array + items: + type: object + properties: + index: + type: integer + format: int64 + hash: + type: string + format: byte + title: >- + Each provided OP_RETURN transaction can be + idendtified by hash of block in - - the position of the tx on BTC blockchain + which transaction was included and transaction + index in the block + proof: + title: proof is the proof that the chain info is finalized + type: object + properties: + proof_tx_in_block: + title: >- + proof_tx_in_block is the proof that tx that carries + the header is included - - the full tx content + in a certain Babylon block + type: object + properties: + root_hash: + type: string + format: byte + data: + type: string + format: byte + proof: + type: object + properties: + total: + type: string + format: int64 + index: + type: string + format: int64 + leaf_hash: + type: string + format: byte + aunts: + type: array + items: + type: string + format: byte + description: >- + TxProof represents a Merkle proof of the presence of + a transaction in the Merkle tree. + proof_header_in_epoch: + type: object + properties: + total: + type: string + format: int64 + index: + type: string + format: int64 + leaf_hash: + type: string + format: byte + aunts: + type: array + items: + type: string + format: byte + title: >- + proof_header_in_epoch is the proof that the Babylon + header is in a certain - - the Merkle proof that this tx is on the above position - title: >- - proof_epoch_submitted is the proof that the epoch's - checkpoint is included + epoch + proof_epoch_sealed: + title: >- + proof_epoch_sealed is the proof that the epoch is + sealed + type: object + properties: + validator_set: + type: array + items: + type: object + properties: + validator_address: + type: string + bls_pub_key: + type: string + format: byte + voting_power: + type: string + format: uint64 + title: >- + ValidatorWithBlsKey couples validator address, + voting power, and its bls - in BTC ledger It is the two TransactionInfo in the best - (i.e., earliest) + public key + title: >- + validator_set is the validator set of the sealed + epoch - checkpoint submission - description: >- - QueryFinalizedChainInfoUntilHeightResponse is response type for - the + This validator set has generated a BLS multisig + on `last_commit_hash` of - Query/FinalizedChainInfoUntilHeight RPC method. + the sealer header + proof_epoch_info: + title: >- + proof_epoch_info is the Merkle proof that the + epoch's metadata is committed + + to `app_hash` of the sealer header + type: object + properties: + ops: + type: array + items: + type: object + properties: + type: + type: string + key: + type: string + format: byte + data: + type: string + format: byte + title: >- + ProofOp defines an operation used for + calculating Merkle root + + The data could be arbitrary format, + providing nessecary data + + for example neighbouring node hash + proof_epoch_val_set: + title: >- + proof_epoch_info is the Merkle proof that the + epoch's validator set is + + committed to `app_hash` of the sealer header + type: object + properties: + ops: + type: array + items: + type: object + properties: + type: + type: string + key: + type: string + format: byte + data: + type: string + format: byte + title: >- + ProofOp defines an operation used for + calculating Merkle root + + The data could be arbitrary format, + providing nessecary data + + for example neighbouring node hash + proof_epoch_submitted: + type: array + items: + type: object + properties: + key: + type: object + properties: + index: + type: integer + format: int64 + hash: + type: string + format: byte + title: >- + Each provided OP_RETURN transaction can be + idendtified by hash of block in + + which transaction was included and transaction + index in the block + description: >- + key is the position (txIdx, blockHash) of this + tx on BTC blockchain + + Although it is already a part of + SubmissionKey, we store it here again + + to make TransactionInfo self-contained. + + For example, storing the key allows + TransactionInfo to not relay on + + the fact that TransactionInfo will be ordered + in the same order as + + TransactionKeys in SubmissionKey. + transaction: + type: string + format: byte + title: transaction is the full transaction in bytes + proof: + type: string + format: byte + title: >- + proof is the Merkle proof that this tx is + included in the position in `key` + + TODO: maybe it could use here better format as + we already processed and + + valideated the proof? + title: >- + TransactionInfo is the info of a tx that contains + Babylon checkpoint, + + including + + - the position of the tx on BTC blockchain + + - the full tx content + + - the Merkle proof that this tx is on the above + position + title: >- + proof_epoch_submitted is the proof that the epoch's + checkpoint is included + + in BTC ledger It is the two TransactionInfo in the + best (i.e., earliest) + + checkpoint submission + title: >- + FinalizedChainInfo is the information of a CZ that is + BTC-finalised + description: |- + QueryFinalizedChainsInfoResponse is response type for the + Query/FinalizedChainsInfo RPC method. default: description: An unexpected error response. schema: @@ -9248,23 +9285,14 @@ paths: "value": "1.212s" } parameters: - - name: chain_id - description: chain_id is the ID of the CZ - in: path - required: true - type: string - - name: height - description: >- - height is the height of the CZ chain - - such that the returned finalised chain info will be no later than - this - - height - in: path - required: true - type: string - format: uint64 + - name: chain_ids + description: chain_ids is the list of ids of CZs. + in: query + required: false + type: array + items: + type: string + collectionFormat: multi - name: prove description: >- prove indicates whether the querier wants to get proofs of this @@ -15128,228 +15156,990 @@ definitions: timestamped_headers_count is the number of timestamped headers in CZ's canonical chain title: ChainInfo is the information of a CZ - babylon.zoneconcierge.v1.Forks: - type: object - properties: - headers: - type: array - items: - type: object - properties: - chain_id: - type: string - title: chain_id is the unique ID of the chain - hash: - type: string - format: byte - title: hash is the hash of this header - height: - type: string - format: uint64 - title: >- - height is the height of this header on CZ ledger - - (hash, height) jointly provides the position of the header on CZ - ledger - babylon_header: - title: >- - babylon_header is the header of the babylon block that includes - this CZ - - header - type: object - properties: - version: - title: basic block info - type: object - properties: - block: - type: string - format: uint64 - app: - type: string - format: uint64 - description: >- - Consensus captures the consensus rules for processing a - block in the blockchain, - - including all blockchain data structures and the rules of - the application's - - state transition machine. - chain_id: - type: string - height: - type: string - format: int64 - time: - type: string - format: date-time - last_block_id: - title: prev block info - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - last_commit_hash: - type: string - format: byte - title: hashes of block data - data_hash: - type: string - format: byte - validators_hash: - type: string - format: byte - title: hashes from the app output from the prev block - next_validators_hash: - type: string - format: byte - consensus_hash: - type: string - format: byte - app_hash: - type: string - format: byte - last_results_hash: - type: string - format: byte - evidence_hash: - type: string - format: byte - title: consensus info - proposer_address: - type: string - format: byte - description: Header defines the structure of a block header. - babylon_epoch: - type: string - format: uint64 - title: epoch is the epoch number of this header on Babylon ledger - babylon_tx_hash: - type: string - format: byte - title: >- - babylon_tx_hash is the hash of the tx that includes this header - - (babylon_block_height, babylon_tx_hash) jointly provides the - position of - - the header on Babylon ledger - title: IndexedHeader is the metadata of a CZ header - title: blocks is the list of non-canonical indexed headers at the same height - description: >- - Forks is a list of non-canonical `IndexedHeader`s at the same height. - - For example, assuming the following blockchain - - ``` - - A <- B <- C <- D <- E - \ -- D1 - \ -- D2 - ``` - - Then the fork will be {[D1, D2]} where each item is in struct - `IndexedBlock`. - - - Note that each `IndexedHeader` in the fork should have a valid quorum - - certificate. Such forks exist since Babylon considers CZs might have - - dishonest majority. Also note that the IBC-Go implementation will only - - consider the first header in a fork valid, since the subsequent headers - - cannot be verified without knowing the validator set in the previous - header. - babylon.zoneconcierge.v1.IndexedHeader: + babylon.zoneconcierge.v1.FinalizedChainInfo: type: object properties: chain_id: type: string - title: chain_id is the unique ID of the chain - hash: - type: string - format: byte - title: hash is the hash of this header - height: - type: string - format: uint64 - title: >- - height is the height of this header on CZ ledger - - (hash, height) jointly provides the position of the header on CZ - ledger - babylon_header: - title: >- - babylon_header is the header of the babylon block that includes this - CZ - - header + title: chain_id is the ID of the chain + finalized_chain_info: type: object properties: - version: - title: basic block info - type: object - properties: - block: - type: string - format: uint64 - app: - type: string - format: uint64 - description: >- - Consensus captures the consensus rules for processing a block in - the blockchain, - - including all blockchain data structures and the rules of the - application's - - state transition machine. chain_id: type: string - height: - type: string - format: int64 - time: - type: string - format: date-time - last_block_id: - title: prev block info + title: chain_id is the ID of the chain + latest_header: + title: latest_header is the latest header in CZ's canonical chain type: object properties: + chain_id: + type: string + title: chain_id is the unique ID of the chain hash: type: string format: byte - part_set_header: + title: hash is the hash of this header + height: + type: string + format: uint64 + title: >- + height is the height of this header on CZ ledger + + (hash, height) jointly provides the position of the header on + CZ ledger + babylon_header: + title: >- + babylon_header is the header of the babylon block that + includes this CZ + + header type: object properties: - total: - type: integer + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules for processing a + block in the blockchain, + + including all blockchain data structures and the rules of + the application's + + state transition machine. + chain_id: + type: string + height: + type: string format: int64 - hash: + time: + type: string + format: date-time + last_block_id: + title: prev block info + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + last_commit_hash: type: string format: byte - title: PartsetHeader - last_commit_hash: - type: string - format: byte - title: hashes of block data - data_hash: - type: string + title: hashes of block data + data_hash: + type: string + format: byte + validators_hash: + type: string + format: byte + title: hashes from the app output from the prev block + next_validators_hash: + type: string + format: byte + consensus_hash: + type: string + format: byte + app_hash: + type: string + format: byte + last_results_hash: + type: string + format: byte + evidence_hash: + type: string + format: byte + title: consensus info + proposer_address: + type: string + format: byte + description: Header defines the structure of a block header. + babylon_epoch: + type: string + format: uint64 + title: epoch is the epoch number of this header on Babylon ledger + babylon_tx_hash: + type: string + format: byte + title: >- + babylon_tx_hash is the hash of the tx that includes this + header + + (babylon_block_height, babylon_tx_hash) jointly provides the + position of + + the header on Babylon ledger + latest_forks: + title: >- + latest_forks is the latest forks, formed as a series of + IndexedHeader (from + + low to high) + type: object + properties: + headers: + type: array + items: + type: object + properties: + chain_id: + type: string + title: chain_id is the unique ID of the chain + hash: + type: string + format: byte + title: hash is the hash of this header + height: + type: string + format: uint64 + title: >- + height is the height of this header on CZ ledger + + (hash, height) jointly provides the position of the + header on CZ ledger + babylon_header: + title: >- + babylon_header is the header of the babylon block that + includes this CZ + + header + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules for + processing a block in the blockchain, + + including all blockchain data structures and the + rules of the application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + title: prev block info + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + last_commit_hash: + type: string + format: byte + title: hashes of block data + data_hash: + type: string + format: byte + validators_hash: + type: string + format: byte + title: hashes from the app output from the prev block + next_validators_hash: + type: string + format: byte + consensus_hash: + type: string + format: byte + app_hash: + type: string + format: byte + last_results_hash: + type: string + format: byte + evidence_hash: + type: string + format: byte + title: consensus info + proposer_address: + type: string + format: byte + description: Header defines the structure of a block header. + babylon_epoch: + type: string + format: uint64 + title: >- + epoch is the epoch number of this header on Babylon + ledger + babylon_tx_hash: + type: string + format: byte + title: >- + babylon_tx_hash is the hash of the tx that includes this + header + + (babylon_block_height, babylon_tx_hash) jointly provides + the position of + + the header on Babylon ledger + title: IndexedHeader is the metadata of a CZ header + title: >- + blocks is the list of non-canonical indexed headers at the + same height + description: >- + Forks is a list of non-canonical `IndexedHeader`s at the same + height. + + For example, assuming the following blockchain + + ``` + + A <- B <- C <- D <- E + \ -- D1 + \ -- D2 + ``` + + Then the fork will be {[D1, D2]} where each item is in struct + `IndexedBlock`. + + + Note that each `IndexedHeader` in the fork should have a valid + quorum + + certificate. Such forks exist since Babylon considers CZs might + have + + dishonest majority. Also note that the IBC-Go implementation will + only + + consider the first header in a fork valid, since the subsequent + headers + + cannot be verified without knowing the validator set in the + previous header. + timestamped_headers_count: + type: string + format: uint64 + title: >- + timestamped_headers_count is the number of timestamped headers in + CZ's + + canonical chain + title: ChainInfo is the information of a CZ + epoch_info: + title: epoch_info is the metadata of the last BTC-finalised epoch + type: object + properties: + epoch_number: + type: string + format: uint64 + current_epoch_interval: + type: string + format: uint64 + first_block_height: + type: string + format: uint64 + last_block_header: + description: >- + last_block_header is the header of the last block in this epoch. + + Babylon needs to remember the last header of each epoch to + complete + + unbonding validators/delegations when a previous epoch's + checkpoint is + + finalised. The last_block_header field is nil in the epoch's + beginning, and + + is set upon the end of this epoch. + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules for processing a block + in the blockchain, + + including all blockchain data structures and the rules of the + application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + title: prev block info + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + last_commit_hash: + type: string + format: byte + title: hashes of block data + data_hash: + type: string + format: byte + validators_hash: + type: string + format: byte + title: hashes from the app output from the prev block + next_validators_hash: + type: string + format: byte + consensus_hash: + type: string + format: byte + app_hash: + type: string + format: byte + last_results_hash: + type: string + format: byte + evidence_hash: + type: string + format: byte + title: consensus info + proposer_address: + type: string + format: byte + app_hash_root: + type: string + format: byte + title: |- + app_hash_root is the Merkle root of all AppHashs in this epoch + It will be used for proving a block is in an epoch + sealer_header: + title: >- + sealer_header is the 2nd header of the next epoch + + This validator set has generated a BLS multisig on + `last_commit_hash` of + + the sealer header + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules for processing a block + in the blockchain, + + including all blockchain data structures and the rules of the + application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + title: prev block info + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + last_commit_hash: + type: string + format: byte + title: hashes of block data + data_hash: + type: string + format: byte + validators_hash: + type: string + format: byte + title: hashes from the app output from the prev block + next_validators_hash: + type: string + format: byte + consensus_hash: + type: string + format: byte + app_hash: + type: string + format: byte + last_results_hash: + type: string + format: byte + evidence_hash: + type: string + format: byte + title: consensus info + proposer_address: + type: string + format: byte + description: Header defines the structure of a block header. + raw_checkpoint: + title: raw_checkpoint is the raw checkpoint of this epoch + type: object + properties: + epoch_num: + type: string + format: uint64 + title: epoch_num defines the epoch number the raw checkpoint is for + last_commit_hash: + type: string + format: byte + title: >- + last_commit_hash defines the 'LastCommitHash' that individual BLS + sigs are + + signed on + bitmap: + type: string + format: byte + title: >- + bitmap defines the bitmap that indicates the signers of the BLS + multi sig + bls_multi_sig: + type: string + format: byte + title: >- + bls_multi_sig defines the multi sig that is aggregated from + individual BLS + + sigs + btc_submission_key: + title: |- + btc_submission_key is position of two BTC txs that include the raw + checkpoint of this epoch + type: object + properties: + key: + type: array + items: + type: object + properties: + index: + type: integer + format: int64 + hash: + type: string + format: byte + title: >- + Each provided OP_RETURN transaction can be idendtified by hash + of block in + + which transaction was included and transaction index in the + block + proof: + title: proof is the proof that the chain info is finalized + type: object + properties: + proof_tx_in_block: + title: >- + proof_tx_in_block is the proof that tx that carries the header is + included + + in a certain Babylon block + type: object + properties: + root_hash: + type: string + format: byte + data: + type: string + format: byte + proof: + type: object + properties: + total: + type: string + format: int64 + index: + type: string + format: int64 + leaf_hash: + type: string + format: byte + aunts: + type: array + items: + type: string + format: byte + description: >- + TxProof represents a Merkle proof of the presence of a transaction + in the Merkle tree. + proof_header_in_epoch: + type: object + properties: + total: + type: string + format: int64 + index: + type: string + format: int64 + leaf_hash: + type: string + format: byte + aunts: + type: array + items: + type: string + format: byte + title: >- + proof_header_in_epoch is the proof that the Babylon header is in a + certain + + epoch + proof_epoch_sealed: + title: proof_epoch_sealed is the proof that the epoch is sealed + type: object + properties: + validator_set: + type: array + items: + type: object + properties: + validator_address: + type: string + bls_pub_key: + type: string + format: byte + voting_power: + type: string + format: uint64 + title: >- + ValidatorWithBlsKey couples validator address, voting power, + and its bls + + public key + title: >- + validator_set is the validator set of the sealed epoch + + This validator set has generated a BLS multisig on + `last_commit_hash` of + + the sealer header + proof_epoch_info: + title: >- + proof_epoch_info is the Merkle proof that the epoch's metadata + is committed + + to `app_hash` of the sealer header + type: object + properties: + ops: + type: array + items: + type: object + properties: + type: + type: string + key: + type: string + format: byte + data: + type: string + format: byte + title: >- + ProofOp defines an operation used for calculating Merkle + root + + The data could be arbitrary format, providing nessecary + data + + for example neighbouring node hash + proof_epoch_val_set: + title: >- + proof_epoch_info is the Merkle proof that the epoch's + validator set is + + committed to `app_hash` of the sealer header + type: object + properties: + ops: + type: array + items: + type: object + properties: + type: + type: string + key: + type: string + format: byte + data: + type: string + format: byte + title: >- + ProofOp defines an operation used for calculating Merkle + root + + The data could be arbitrary format, providing nessecary + data + + for example neighbouring node hash + proof_epoch_submitted: + type: array + items: + type: object + properties: + key: + type: object + properties: + index: + type: integer + format: int64 + hash: + type: string + format: byte + title: >- + Each provided OP_RETURN transaction can be idendtified by + hash of block in + + which transaction was included and transaction index in the + block + description: >- + key is the position (txIdx, blockHash) of this tx on BTC + blockchain + + Although it is already a part of SubmissionKey, we store it + here again + + to make TransactionInfo self-contained. + + For example, storing the key allows TransactionInfo to not + relay on + + the fact that TransactionInfo will be ordered in the same + order as + + TransactionKeys in SubmissionKey. + transaction: + type: string + format: byte + title: transaction is the full transaction in bytes + proof: + type: string + format: byte + title: >- + proof is the Merkle proof that this tx is included in the + position in `key` + + TODO: maybe it could use here better format as we already + processed and + + valideated the proof? + title: >- + TransactionInfo is the info of a tx that contains Babylon + checkpoint, + + including + + - the position of the tx on BTC blockchain + + - the full tx content + + - the Merkle proof that this tx is on the above position + title: >- + proof_epoch_submitted is the proof that the epoch's checkpoint is + included + + in BTC ledger It is the two TransactionInfo in the best (i.e., + earliest) + + checkpoint submission + title: FinalizedChainInfo is the information of a CZ that is BTC-finalised + babylon.zoneconcierge.v1.Forks: + type: object + properties: + headers: + type: array + items: + type: object + properties: + chain_id: + type: string + title: chain_id is the unique ID of the chain + hash: + type: string + format: byte + title: hash is the hash of this header + height: + type: string + format: uint64 + title: >- + height is the height of this header on CZ ledger + + (hash, height) jointly provides the position of the header on CZ + ledger + babylon_header: + title: >- + babylon_header is the header of the babylon block that includes + this CZ + + header + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules for processing a + block in the blockchain, + + including all blockchain data structures and the rules of + the application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + title: prev block info + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + last_commit_hash: + type: string + format: byte + title: hashes of block data + data_hash: + type: string + format: byte + validators_hash: + type: string + format: byte + title: hashes from the app output from the prev block + next_validators_hash: + type: string + format: byte + consensus_hash: + type: string + format: byte + app_hash: + type: string + format: byte + last_results_hash: + type: string + format: byte + evidence_hash: + type: string + format: byte + title: consensus info + proposer_address: + type: string + format: byte + description: Header defines the structure of a block header. + babylon_epoch: + type: string + format: uint64 + title: epoch is the epoch number of this header on Babylon ledger + babylon_tx_hash: + type: string + format: byte + title: >- + babylon_tx_hash is the hash of the tx that includes this header + + (babylon_block_height, babylon_tx_hash) jointly provides the + position of + + the header on Babylon ledger + title: IndexedHeader is the metadata of a CZ header + title: blocks is the list of non-canonical indexed headers at the same height + description: >- + Forks is a list of non-canonical `IndexedHeader`s at the same height. + + For example, assuming the following blockchain + + ``` + + A <- B <- C <- D <- E + \ -- D1 + \ -- D2 + ``` + + Then the fork will be {[D1, D2]} where each item is in struct + `IndexedBlock`. + + + Note that each `IndexedHeader` in the fork should have a valid quorum + + certificate. Such forks exist since Babylon considers CZs might have + + dishonest majority. Also note that the IBC-Go implementation will only + + consider the first header in a fork valid, since the subsequent headers + + cannot be verified without knowing the validator set in the previous + header. + babylon.zoneconcierge.v1.IndexedHeader: + type: object + properties: + chain_id: + type: string + title: chain_id is the unique ID of the chain + hash: + type: string + format: byte + title: hash is the hash of this header + height: + type: string + format: uint64 + title: >- + height is the height of this header on CZ ledger + + (hash, height) jointly provides the position of the header on CZ + ledger + babylon_header: + title: >- + babylon_header is the header of the babylon block that includes this + CZ + + header + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules for processing a block in + the blockchain, + + including all blockchain data structures and the rules of the + application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + title: prev block info + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + last_commit_hash: + type: string + format: byte + title: hashes of block data + data_hash: + type: string format: byte validators_hash: type: string @@ -16342,7 +17132,7 @@ definitions: RPC method. - babylon.zoneconcierge.v1.QueryFinalizedChainInfoResponse: + babylon.zoneconcierge.v1.QueryFinalizedChainInfoUntilHeightResponse: type: object properties: finalized_chain_info: @@ -17101,144 +17891,27 @@ definitions: checkpoint submission description: |- - QueryFinalizedChainInfoResponse is response type for the - Query/FinalizedChainInfo RPC method. - babylon.zoneconcierge.v1.QueryFinalizedChainInfoUntilHeightResponse: + QueryFinalizedChainInfoUntilHeightResponse is response type for the + Query/FinalizedChainInfoUntilHeight RPC method. + babylon.zoneconcierge.v1.QueryFinalizedChainsInfoResponse: type: object properties: - finalized_chain_info: - type: object - properties: - chain_id: - type: string - title: chain_id is the ID of the chain - latest_header: - title: latest_header is the latest header in CZ's canonical chain - type: object - properties: - chain_id: - type: string - title: chain_id is the unique ID of the chain - hash: - type: string - format: byte - title: hash is the hash of this header - height: - type: string - format: uint64 - title: >- - height is the height of this header on CZ ledger - - (hash, height) jointly provides the position of the header on - CZ ledger - babylon_header: - title: >- - babylon_header is the header of the babylon block that - includes this CZ - - header - type: object - properties: - version: - title: basic block info - type: object - properties: - block: - type: string - format: uint64 - app: - type: string - format: uint64 - description: >- - Consensus captures the consensus rules for processing a - block in the blockchain, - - including all blockchain data structures and the rules of - the application's - - state transition machine. - chain_id: - type: string - height: - type: string - format: int64 - time: - type: string - format: date-time - last_block_id: - title: prev block info - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - last_commit_hash: - type: string - format: byte - title: hashes of block data - data_hash: - type: string - format: byte - validators_hash: - type: string - format: byte - title: hashes from the app output from the prev block - next_validators_hash: - type: string - format: byte - consensus_hash: - type: string - format: byte - app_hash: - type: string - format: byte - last_results_hash: - type: string - format: byte - evidence_hash: - type: string - format: byte - title: consensus info - proposer_address: - type: string - format: byte - description: Header defines the structure of a block header. - babylon_epoch: - type: string - format: uint64 - title: epoch is the epoch number of this header on Babylon ledger - babylon_tx_hash: - type: string - format: byte - title: >- - babylon_tx_hash is the hash of the tx that includes this - header - - (babylon_block_height, babylon_tx_hash) jointly provides the - position of - - the header on Babylon ledger - latest_forks: - title: >- - latest_forks is the latest forks, formed as a series of - IndexedHeader (from - - low to high) - type: object - properties: - headers: - type: array - items: + finalized_chains_info: + type: array + items: + type: object + properties: + chain_id: + type: string + title: chain_id is the ID of the chain + finalized_chain_info: + type: object + properties: + chain_id: + type: string + title: chain_id is the ID of the chain + latest_header: + title: latest_header is the latest header in CZ's canonical chain type: object properties: chain_id: @@ -17355,515 +18028,648 @@ definitions: the position of the header on Babylon ledger - title: IndexedHeader is the metadata of a CZ header - title: >- - blocks is the list of non-canonical indexed headers at the - same height - description: >- - Forks is a list of non-canonical `IndexedHeader`s at the same - height. - - For example, assuming the following blockchain - - ``` - - A <- B <- C <- D <- E - \ -- D1 - \ -- D2 - ``` - - Then the fork will be {[D1, D2]} where each item is in struct - `IndexedBlock`. - - - Note that each `IndexedHeader` in the fork should have a valid - quorum - - certificate. Such forks exist since Babylon considers CZs might - have - - dishonest majority. Also note that the IBC-Go implementation will - only - - consider the first header in a fork valid, since the subsequent - headers - - cannot be verified without knowing the validator set in the - previous header. - timestamped_headers_count: - type: string - format: uint64 - title: >- - timestamped_headers_count is the number of timestamped headers in - CZ's + latest_forks: + title: >- + latest_forks is the latest forks, formed as a series of + IndexedHeader (from - canonical chain - title: ChainInfo is the information of a CZ - epoch_info: - title: epoch_info is the metadata of the last BTC-finalised epoch - type: object - properties: - epoch_number: - type: string - format: uint64 - current_epoch_interval: - type: string - format: uint64 - first_block_height: - type: string - format: uint64 - last_block_header: - description: >- - last_block_header is the header of the last block in this epoch. + low to high) + type: object + properties: + headers: + type: array + items: + type: object + properties: + chain_id: + type: string + title: chain_id is the unique ID of the chain + hash: + type: string + format: byte + title: hash is the hash of this header + height: + type: string + format: uint64 + title: >- + height is the height of this header on CZ ledger - Babylon needs to remember the last header of each epoch to - complete + (hash, height) jointly provides the position of + the header on CZ ledger + babylon_header: + title: >- + babylon_header is the header of the babylon block + that includes this CZ - unbonding validators/delegations when a previous epoch's - checkpoint is + header + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules for + processing a block in the blockchain, - finalised. The last_block_header field is nil in the epoch's - beginning, and + including all blockchain data structures and + the rules of the application's - is set upon the end of this epoch. - type: object - properties: - version: - title: basic block info - type: object - properties: - block: - type: string - format: uint64 - app: - type: string - format: uint64 - description: >- - Consensus captures the consensus rules for processing a block - in the blockchain, + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + title: prev block info + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + last_commit_hash: + type: string + format: byte + title: hashes of block data + data_hash: + type: string + format: byte + validators_hash: + type: string + format: byte + title: hashes from the app output from the prev block + next_validators_hash: + type: string + format: byte + consensus_hash: + type: string + format: byte + app_hash: + type: string + format: byte + last_results_hash: + type: string + format: byte + evidence_hash: + type: string + format: byte + title: consensus info + proposer_address: + type: string + format: byte + description: Header defines the structure of a block header. + babylon_epoch: + type: string + format: uint64 + title: >- + epoch is the epoch number of this header on + Babylon ledger + babylon_tx_hash: + type: string + format: byte + title: >- + babylon_tx_hash is the hash of the tx that + includes this header - including all blockchain data structures and the rules of the - application's + (babylon_block_height, babylon_tx_hash) jointly + provides the position of - state transition machine. - chain_id: - type: string - height: - type: string - format: int64 - time: - type: string - format: date-time - last_block_id: - title: prev block info - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - last_commit_hash: - type: string - format: byte - title: hashes of block data - data_hash: - type: string - format: byte - validators_hash: - type: string - format: byte - title: hashes from the app output from the prev block - next_validators_hash: - type: string - format: byte - consensus_hash: - type: string - format: byte - app_hash: - type: string - format: byte - last_results_hash: - type: string - format: byte - evidence_hash: - type: string - format: byte - title: consensus info - proposer_address: - type: string - format: byte - app_hash_root: - type: string - format: byte - title: |- - app_hash_root is the Merkle root of all AppHashs in this epoch - It will be used for proving a block is in an epoch - sealer_header: - title: >- - sealer_header is the 2nd header of the next epoch + the header on Babylon ledger + title: IndexedHeader is the metadata of a CZ header + title: >- + blocks is the list of non-canonical indexed headers at + the same height + description: >- + Forks is a list of non-canonical `IndexedHeader`s at the + same height. - This validator set has generated a BLS multisig on - `last_commit_hash` of + For example, assuming the following blockchain - the sealer header - type: object - properties: - version: - title: basic block info - type: object - properties: - block: - type: string - format: uint64 - app: - type: string - format: uint64 - description: >- - Consensus captures the consensus rules for processing a block - in the blockchain, + ``` - including all blockchain data structures and the rules of the - application's + A <- B <- C <- D <- E + \ -- D1 + \ -- D2 + ``` - state transition machine. - chain_id: - type: string - height: - type: string - format: int64 - time: - type: string - format: date-time - last_block_id: - title: prev block info - type: object - properties: - hash: - type: string - format: byte - part_set_header: - type: object - properties: - total: - type: integer - format: int64 - hash: - type: string - format: byte - title: PartsetHeader - last_commit_hash: - type: string - format: byte - title: hashes of block data - data_hash: - type: string - format: byte - validators_hash: - type: string - format: byte - title: hashes from the app output from the prev block - next_validators_hash: - type: string - format: byte - consensus_hash: - type: string - format: byte - app_hash: - type: string - format: byte - last_results_hash: - type: string - format: byte - evidence_hash: - type: string - format: byte - title: consensus info - proposer_address: - type: string - format: byte - description: Header defines the structure of a block header. - raw_checkpoint: - title: raw_checkpoint is the raw checkpoint of this epoch - type: object - properties: - epoch_num: - type: string - format: uint64 - title: epoch_num defines the epoch number the raw checkpoint is for - last_commit_hash: - type: string - format: byte - title: >- - last_commit_hash defines the 'LastCommitHash' that individual BLS - sigs are + Then the fork will be {[D1, D2]} where each item is in + struct `IndexedBlock`. - signed on - bitmap: - type: string - format: byte - title: >- - bitmap defines the bitmap that indicates the signers of the BLS - multi sig - bls_multi_sig: - type: string - format: byte - title: >- - bls_multi_sig defines the multi sig that is aggregated from - individual BLS - sigs - btc_submission_key: - title: |- - btc_submission_key is position of two BTC txs that include the raw - checkpoint of this epoch - type: object - properties: - key: - type: array - items: + Note that each `IndexedHeader` in the fork should have a + valid quorum + + certificate. Such forks exist since Babylon considers CZs + might have + + dishonest majority. Also note that the IBC-Go implementation + will only + + consider the first header in a fork valid, since the + subsequent headers + + cannot be verified without knowing the validator set in the + previous header. + timestamped_headers_count: + type: string + format: uint64 + title: >- + timestamped_headers_count is the number of timestamped + headers in CZ's + + canonical chain + title: ChainInfo is the information of a CZ + epoch_info: + title: epoch_info is the metadata of the last BTC-finalised epoch type: object properties: - index: - type: integer - format: int64 - hash: + epoch_number: + type: string + format: uint64 + current_epoch_interval: + type: string + format: uint64 + first_block_height: + type: string + format: uint64 + last_block_header: + description: >- + last_block_header is the header of the last block in this + epoch. + + Babylon needs to remember the last header of each epoch to + complete + + unbonding validators/delegations when a previous epoch's + checkpoint is + + finalised. The last_block_header field is nil in the epoch's + beginning, and + + is set upon the end of this epoch. + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules for processing a + block in the blockchain, + + including all blockchain data structures and the rules + of the application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + title: prev block info + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + last_commit_hash: + type: string + format: byte + title: hashes of block data + data_hash: + type: string + format: byte + validators_hash: + type: string + format: byte + title: hashes from the app output from the prev block + next_validators_hash: + type: string + format: byte + consensus_hash: + type: string + format: byte + app_hash: + type: string + format: byte + last_results_hash: + type: string + format: byte + evidence_hash: + type: string + format: byte + title: consensus info + proposer_address: + type: string + format: byte + app_hash_root: type: string format: byte - title: >- - Each provided OP_RETURN transaction can be idendtified by hash - of block in + title: >- + app_hash_root is the Merkle root of all AppHashs in this + epoch - which transaction was included and transaction index in the - block - proof: - title: proof is the proof that the chain info is finalized - type: object - properties: - proof_tx_in_block: - title: >- - proof_tx_in_block is the proof that tx that carries the header is - included + It will be used for proving a block is in an epoch + sealer_header: + title: >- + sealer_header is the 2nd header of the next epoch - in a certain Babylon block - type: object - properties: - root_hash: - type: string - format: byte - data: - type: string - format: byte - proof: - type: object - properties: - total: - type: string - format: int64 - index: - type: string - format: int64 - leaf_hash: - type: string - format: byte - aunts: - type: array - items: + This validator set has generated a BLS multisig on + `last_commit_hash` of + + the sealer header + type: object + properties: + version: + title: basic block info + type: object + properties: + block: + type: string + format: uint64 + app: + type: string + format: uint64 + description: >- + Consensus captures the consensus rules for processing a + block in the blockchain, + + including all blockchain data structures and the rules + of the application's + + state transition machine. + chain_id: + type: string + height: + type: string + format: int64 + time: + type: string + format: date-time + last_block_id: + title: prev block info + type: object + properties: + hash: + type: string + format: byte + part_set_header: + type: object + properties: + total: + type: integer + format: int64 + hash: + type: string + format: byte + title: PartsetHeader + last_commit_hash: type: string format: byte - description: >- - TxProof represents a Merkle proof of the presence of a transaction - in the Merkle tree. - proof_header_in_epoch: - type: object - properties: - total: - type: string - format: int64 - index: - type: string - format: int64 - leaf_hash: - type: string - format: byte - aunts: - type: array - items: + title: hashes of block data + data_hash: + type: string + format: byte + validators_hash: + type: string + format: byte + title: hashes from the app output from the prev block + next_validators_hash: + type: string + format: byte + consensus_hash: + type: string + format: byte + app_hash: + type: string + format: byte + last_results_hash: + type: string + format: byte + evidence_hash: + type: string + format: byte + title: consensus info + proposer_address: + type: string + format: byte + description: Header defines the structure of a block header. + raw_checkpoint: + title: raw_checkpoint is the raw checkpoint of this epoch + type: object + properties: + epoch_num: + type: string + format: uint64 + title: epoch_num defines the epoch number the raw checkpoint is for + last_commit_hash: + type: string + format: byte + title: >- + last_commit_hash defines the 'LastCommitHash' that + individual BLS sigs are + + signed on + bitmap: + type: string + format: byte + title: >- + bitmap defines the bitmap that indicates the signers of the + BLS multi sig + bls_multi_sig: type: string format: byte - title: >- - proof_header_in_epoch is the proof that the Babylon header is in a - certain + title: >- + bls_multi_sig defines the multi sig that is aggregated from + individual BLS - epoch - proof_epoch_sealed: - title: proof_epoch_sealed is the proof that the epoch is sealed - type: object - properties: - validator_set: - type: array - items: + sigs + btc_submission_key: + title: >- + btc_submission_key is position of two BTC txs that include the + raw + + checkpoint of this epoch + type: object + properties: + key: + type: array + items: + type: object + properties: + index: + type: integer + format: int64 + hash: + type: string + format: byte + title: >- + Each provided OP_RETURN transaction can be idendtified by + hash of block in + + which transaction was included and transaction index in + the block + proof: + title: proof is the proof that the chain info is finalized + type: object + properties: + proof_tx_in_block: + title: >- + proof_tx_in_block is the proof that tx that carries the + header is included + + in a certain Babylon block type: object properties: - validator_address: - type: string - bls_pub_key: + root_hash: type: string format: byte - voting_power: + data: type: string - format: uint64 - title: >- - ValidatorWithBlsKey couples validator address, voting power, - and its bls - - public key - title: >- - validator_set is the validator set of the sealed epoch - - This validator set has generated a BLS multisig on - `last_commit_hash` of - - the sealer header - proof_epoch_info: - title: >- - proof_epoch_info is the Merkle proof that the epoch's metadata - is committed - - to `app_hash` of the sealer header - type: object - properties: - ops: - type: array - items: + format: byte + proof: type: object properties: - type: + total: type: string - key: + format: int64 + index: type: string - format: byte - data: + format: int64 + leaf_hash: type: string format: byte + aunts: + type: array + items: + type: string + format: byte + description: >- + TxProof represents a Merkle proof of the presence of a + transaction in the Merkle tree. + proof_header_in_epoch: + type: object + properties: + total: + type: string + format: int64 + index: + type: string + format: int64 + leaf_hash: + type: string + format: byte + aunts: + type: array + items: + type: string + format: byte + title: >- + proof_header_in_epoch is the proof that the Babylon header + is in a certain + + epoch + proof_epoch_sealed: + title: proof_epoch_sealed is the proof that the epoch is sealed + type: object + properties: + validator_set: + type: array + items: + type: object + properties: + validator_address: + type: string + bls_pub_key: + type: string + format: byte + voting_power: + type: string + format: uint64 + title: >- + ValidatorWithBlsKey couples validator address, voting + power, and its bls + + public key title: >- - ProofOp defines an operation used for calculating Merkle - root + validator_set is the validator set of the sealed epoch - The data could be arbitrary format, providing nessecary - data + This validator set has generated a BLS multisig on + `last_commit_hash` of - for example neighbouring node hash - proof_epoch_val_set: - title: >- - proof_epoch_info is the Merkle proof that the epoch's - validator set is + the sealer header + proof_epoch_info: + title: >- + proof_epoch_info is the Merkle proof that the epoch's + metadata is committed - committed to `app_hash` of the sealer header - type: object - properties: - ops: - type: array - items: + to `app_hash` of the sealer header type: object properties: - type: - type: string - key: - type: string - format: byte - data: - type: string - format: byte + ops: + type: array + items: + type: object + properties: + type: + type: string + key: + type: string + format: byte + data: + type: string + format: byte + title: >- + ProofOp defines an operation used for calculating + Merkle root + + The data could be arbitrary format, providing + nessecary data + + for example neighbouring node hash + proof_epoch_val_set: title: >- - ProofOp defines an operation used for calculating Merkle - root + proof_epoch_info is the Merkle proof that the epoch's + validator set is - The data could be arbitrary format, providing nessecary - data + committed to `app_hash` of the sealer header + type: object + properties: + ops: + type: array + items: + type: object + properties: + type: + type: string + key: + type: string + format: byte + data: + type: string + format: byte + title: >- + ProofOp defines an operation used for calculating + Merkle root - for example neighbouring node hash - proof_epoch_submitted: - type: array - items: - type: object - properties: - key: - type: object - properties: - index: - type: integer - format: int64 - hash: - type: string - format: byte - title: >- - Each provided OP_RETURN transaction can be idendtified by - hash of block in + The data could be arbitrary format, providing + nessecary data - which transaction was included and transaction index in the - block - description: >- - key is the position (txIdx, blockHash) of this tx on BTC - blockchain + for example neighbouring node hash + proof_epoch_submitted: + type: array + items: + type: object + properties: + key: + type: object + properties: + index: + type: integer + format: int64 + hash: + type: string + format: byte + title: >- + Each provided OP_RETURN transaction can be idendtified + by hash of block in - Although it is already a part of SubmissionKey, we store it - here again + which transaction was included and transaction index + in the block + description: >- + key is the position (txIdx, blockHash) of this tx on + BTC blockchain - to make TransactionInfo self-contained. + Although it is already a part of SubmissionKey, we + store it here again - For example, storing the key allows TransactionInfo to not - relay on + to make TransactionInfo self-contained. - the fact that TransactionInfo will be ordered in the same - order as + For example, storing the key allows TransactionInfo to + not relay on - TransactionKeys in SubmissionKey. - transaction: - type: string - format: byte - title: transaction is the full transaction in bytes - proof: - type: string - format: byte - title: >- - proof is the Merkle proof that this tx is included in the - position in `key` + the fact that TransactionInfo will be ordered in the + same order as - TODO: maybe it could use here better format as we already - processed and + TransactionKeys in SubmissionKey. + transaction: + type: string + format: byte + title: transaction is the full transaction in bytes + proof: + type: string + format: byte + title: >- + proof is the Merkle proof that this tx is included in + the position in `key` - valideated the proof? - title: >- - TransactionInfo is the info of a tx that contains Babylon - checkpoint, + TODO: maybe it could use here better format as we + already processed and - including + valideated the proof? + title: >- + TransactionInfo is the info of a tx that contains Babylon + checkpoint, - - the position of the tx on BTC blockchain + including - - the full tx content + - the position of the tx on BTC blockchain - - the Merkle proof that this tx is on the above position - title: >- - proof_epoch_submitted is the proof that the epoch's checkpoint is - included + - the full tx content - in BTC ledger It is the two TransactionInfo in the best (i.e., - earliest) + - the Merkle proof that this tx is on the above position + title: >- + proof_epoch_submitted is the proof that the epoch's + checkpoint is included - checkpoint submission + in BTC ledger It is the two TransactionInfo in the best + (i.e., earliest) + + checkpoint submission + title: FinalizedChainInfo is the information of a CZ that is BTC-finalised description: |- - QueryFinalizedChainInfoUntilHeightResponse is response type for the - Query/FinalizedChainInfoUntilHeight RPC method. + QueryFinalizedChainsInfoResponse is response type for the + Query/FinalizedChainsInfo RPC method. babylon.zoneconcierge.v1.QueryHeaderResponse: type: object properties: diff --git a/proto/babylon/zoneconcierge/v1/query.proto b/proto/babylon/zoneconcierge/v1/query.proto index 0a33dea00..e9b7cd267 100644 --- a/proto/babylon/zoneconcierge/v1/query.proto +++ b/proto/babylon/zoneconcierge/v1/query.proto @@ -46,11 +46,11 @@ service Query { option (google.api.http).get = "/babylon/zoneconcierge/v1/headers/{chain_id}/epochs/{epoch_num}"; } - // FinalizedChainInfo queries the BTC-finalised info of a chain, with proofs - rpc FinalizedChainInfo(QueryFinalizedChainInfoRequest) - returns (QueryFinalizedChainInfoResponse) { + // FinalizedChainsInfo queries the BTC-finalised info of chains with given IDs, with proofs + rpc FinalizedChainsInfo(QueryFinalizedChainsInfoRequest) + returns (QueryFinalizedChainsInfoResponse) { option (google.api.http).get = - "/babylon/zoneconcierge/v1/finalized_chain_info/{chain_id}"; + "/babylon/zoneconcierge/v1/finalized_chains_info"; } // FinalizedChainInfoUntilHeight queries the BTC-finalised info no later than // the provided CZ height, with proofs @@ -140,31 +140,19 @@ message QueryListEpochHeadersResponse { repeated babylon.zoneconcierge.v1.IndexedHeader headers = 1; } -// QueryFinalizedChainInfoRequest is request type for the -// Query/FinalizedChainInfo RPC method. -message QueryFinalizedChainInfoRequest { - // chain_id is the ID of the CZ - string chain_id = 1; +// QueryFinalizedChainsInfoRequest is request type for the +// Query/FinalizedChainsInfo RPC method. +message QueryFinalizedChainsInfoRequest { + // chain_ids is the list of ids of CZs + repeated string chain_ids = 1; // prove indicates whether the querier wants to get proofs of this timestamp bool prove = 2; } -// QueryFinalizedChainInfoResponse is response type for the -// Query/FinalizedChainInfo RPC method. -message QueryFinalizedChainInfoResponse { - // finalized_chain_info is the info of the CZ - babylon.zoneconcierge.v1.ChainInfo finalized_chain_info = 1; - - // epoch_info is the metadata of the last BTC-finalised epoch - babylon.epoching.v1.Epoch epoch_info = 2; - // raw_checkpoint is the raw checkpoint of this epoch - babylon.checkpointing.v1.RawCheckpoint raw_checkpoint = 3; - // btc_submission_key is position of two BTC txs that include the raw - // checkpoint of this epoch - babylon.btccheckpoint.v1.SubmissionKey btc_submission_key = 4; - - // proof is the proof that the chain info is finalized - babylon.zoneconcierge.v1.ProofFinalizedChainInfo proof = 5; +// QueryFinalizedChainsInfoResponse is response type for the +// Query/FinalizedChainsInfo RPC method. +message QueryFinalizedChainsInfoResponse { + repeated babylon.zoneconcierge.v1.FinalizedChainInfo finalized_chains_info = 1; } // QueryFinalizedChainInfoUntilHeightRequest is request type for the diff --git a/proto/babylon/zoneconcierge/v1/zoneconcierge.proto b/proto/babylon/zoneconcierge/v1/zoneconcierge.proto index ef52447ff..c19a34bba 100644 --- a/proto/babylon/zoneconcierge/v1/zoneconcierge.proto +++ b/proto/babylon/zoneconcierge/v1/zoneconcierge.proto @@ -5,6 +5,8 @@ import "tendermint/types/types.proto"; import "tendermint/crypto/proof.proto"; import "babylon/btccheckpoint/v1/btccheckpoint.proto"; import "babylon/checkpointing/v1/bls_key.proto"; +import "babylon/checkpointing/v1/checkpoint.proto"; +import "babylon/epoching/v1/epoching.proto"; option go_package = "github.com/babylonchain/babylon/x/zoneconcierge/types"; @@ -61,6 +63,25 @@ message ChainInfo { uint64 timestamped_headers_count = 4; } +// FinalizedChainInfo is the information of a CZ that is BTC-finalised +message FinalizedChainInfo { + // chain_id is the ID of the chain + string chain_id = 1; + // finalized_chain_info is the info of the CZ + babylon.zoneconcierge.v1.ChainInfo finalized_chain_info = 2; + + // epoch_info is the metadata of the last BTC-finalised epoch + babylon.epoching.v1.Epoch epoch_info = 3; + // raw_checkpoint is the raw checkpoint of this epoch + babylon.checkpointing.v1.RawCheckpoint raw_checkpoint = 4; + // btc_submission_key is position of two BTC txs that include the raw + // checkpoint of this epoch + babylon.btccheckpoint.v1.SubmissionKey btc_submission_key = 5; + + // proof is the proof that the chain info is finalized + babylon.zoneconcierge.v1.ProofFinalizedChainInfo proof = 6; +} + // ProofEpochSealed is the proof that an epoch is sealed by the sealer header, // i.e., the 2nd header of the next epoch With the access of metadata // - Metadata of this epoch, which includes the sealer header diff --git a/test/e2e/configurer/chain/queries.go b/test/e2e/configurer/chain/queries.go index 58af85ccb..16f3d5460 100644 --- a/test/e2e/configurer/chain/queries.go +++ b/test/e2e/configurer/chain/queries.go @@ -6,6 +6,7 @@ import ( "fmt" "io" "net/http" + "net/url" "time" sdkmath "cosmossdk.io/math" @@ -23,12 +24,8 @@ import ( zctypes "github.com/babylonchain/babylon/x/zoneconcierge/types" ) -func (n *NodeConfig) QueryGRPCGateway(path string, parameters ...string) ([]byte, error) { - if len(parameters)%2 != 0 { - return nil, fmt.Errorf("invalid number of parameters, must follow the format of key + value") - } - - // add the URL for the given validator ID, and pre-pend to to path. +func (n *NodeConfig) QueryGRPCGateway(path string, queryParams url.Values) ([]byte, error) { + // add the URL for the given validator ID, and pre-pend to path. hostPort, err := n.containerManager.GetHostPort(n.Name, "1317/tcp") require.NoError(n.t, err) endpoint := fmt.Sprintf("http://%s", hostPort) @@ -41,12 +38,8 @@ func (n *NodeConfig) QueryGRPCGateway(path string, parameters ...string) ([]byte return false } - if len(parameters) > 0 { - q := req.URL.Query() - for i := 0; i < len(parameters); i += 2 { - q.Add(parameters[i], parameters[i+1]) - } - req.URL.RawQuery = q.Encode() + if len(queryParams) > 0 { + req.URL.RawQuery = queryParams.Encode() } resp, err = http.DefaultClient.Do(req) @@ -70,10 +63,10 @@ func (n *NodeConfig) QueryGRPCGateway(path string, parameters ...string) ([]byte return bz, nil } -// QueryBalancer returns balances at the address. +// QueryBalances returns balances at the address. func (n *NodeConfig) QueryBalances(address string) (sdk.Coins, error) { path := fmt.Sprintf("cosmos/bank/v1beta1/balances/%s", address) - bz, err := n.QueryGRPCGateway(path) + bz, err := n.QueryGRPCGateway(path, url.Values{}) require.NoError(n.t, err) var balancesResp banktypes.QueryAllBalancesResponse @@ -85,7 +78,7 @@ func (n *NodeConfig) QueryBalances(address string) (sdk.Coins, error) { func (n *NodeConfig) QuerySupplyOf(denom string) (sdkmath.Int, error) { path := fmt.Sprintf("cosmos/bank/v1beta1/supply/%s", denom) - bz, err := n.QueryGRPCGateway(path) + bz, err := n.QueryGRPCGateway(path, url.Values{}) require.NoError(n.t, err) var supplyResp banktypes.QuerySupplyOfResponse @@ -151,7 +144,7 @@ func (n *NodeConfig) QueryListSnapshots() ([]*tmabcitypes.Snapshot, error) { func (n *NodeConfig) QueryCheckpointForEpoch(epoch uint64) (*ct.RawCheckpointWithMeta, error) { path := fmt.Sprintf("babylon/checkpointing/v1/raw_checkpoint/%d", epoch) - bz, err := n.QueryGRPCGateway(path) + bz, err := n.QueryGRPCGateway(path, url.Values{}) require.NoError(n.t, err) var checkpointingResponse ct.QueryRawCheckpointResponse @@ -163,7 +156,7 @@ func (n *NodeConfig) QueryCheckpointForEpoch(epoch uint64) (*ct.RawCheckpointWit } func (n *NodeConfig) QueryBtcBaseHeader() (*blc.BTCHeaderInfo, error) { - bz, err := n.QueryGRPCGateway("babylon/btclightclient/v1/baseheader") + bz, err := n.QueryGRPCGateway("babylon/btclightclient/v1/baseheader", url.Values{}) require.NoError(n.t, err) var blcResponse blc.QueryBaseHeaderResponse @@ -175,7 +168,7 @@ func (n *NodeConfig) QueryBtcBaseHeader() (*blc.BTCHeaderInfo, error) { } func (n *NodeConfig) QueryTip() (*blc.BTCHeaderInfo, error) { - bz, err := n.QueryGRPCGateway("babylon/btclightclient/v1/tip") + bz, err := n.QueryGRPCGateway("babylon/btclightclient/v1/tip", url.Values{}) require.NoError(n.t, err) var blcResponse blc.QueryTipResponse @@ -186,21 +179,25 @@ func (n *NodeConfig) QueryTip() (*blc.BTCHeaderInfo, error) { return blcResponse.Header, nil } -func (n *NodeConfig) QueryFinalizedChainInfo(chainId string) (*zctypes.QueryFinalizedChainInfoResponse, error) { - finalizedPath := fmt.Sprintf("babylon/zoneconcierge/v1/finalized_chain_info/%s", chainId) - bz, err := n.QueryGRPCGateway(finalizedPath) +func (n *NodeConfig) QueryFinalizedChainsInfo(chainIDs []string) (*zctypes.QueryFinalizedChainsInfoResponse, error) { + queryParams := url.Values{} + for _, chainId := range chainIDs { + queryParams.Add("chain_ids", chainId) + } + + bz, err := n.QueryGRPCGateway("babylon/zoneconcierge/v1/finalized_chains_info", queryParams) require.NoError(n.t, err) - var finalizedResponse zctypes.QueryFinalizedChainInfoResponse - if err := util.Cdc.UnmarshalJSON(bz, &finalizedResponse); err != nil { + var resp zctypes.QueryFinalizedChainsInfoResponse + if err := util.Cdc.UnmarshalJSON(bz, &resp); err != nil { return nil, err } - return &finalizedResponse, nil + return &resp, nil } func (n *NodeConfig) QueryCheckpointChains() (*[]string, error) { - bz, err := n.QueryGRPCGateway("babylon/zoneconcierge/v1/chains") + bz, err := n.QueryGRPCGateway("babylon/zoneconcierge/v1/chains", url.Values{}) require.NoError(n.t, err) var chainsResponse zctypes.QueryChainListResponse if err := util.Cdc.UnmarshalJSON(bz, &chainsResponse); err != nil { @@ -209,8 +206,13 @@ func (n *NodeConfig) QueryCheckpointChains() (*[]string, error) { return &chainsResponse.ChainIds, nil } -func (n *NodeConfig) QueryCheckpointChainsInfo(chainID string) ([]*zctypes.ChainInfo, error) { - bz, err := n.QueryGRPCGateway("/babylon/zoneconcierge/v1/chains_info", "chain_ids", chainID) +func (n *NodeConfig) QueryCheckpointChainsInfo(chainIDs []string) ([]*zctypes.ChainInfo, error) { + queryParams := url.Values{} + for _, chainId := range chainIDs { + queryParams.Add("chain_ids", chainId) + } + + bz, err := n.QueryGRPCGateway("/babylon/zoneconcierge/v1/chains_info", queryParams) require.NoError(n.t, err) var infoResponse zctypes.QueryChainsInfoResponse if err := util.Cdc.UnmarshalJSON(bz, &infoResponse); err != nil { @@ -220,7 +222,7 @@ func (n *NodeConfig) QueryCheckpointChainsInfo(chainID string) ([]*zctypes.Chain } func (n *NodeConfig) QueryCurrentEpoch() (uint64, error) { - bz, err := n.QueryGRPCGateway("/babylon/epoching/v1/current_epoch") + bz, err := n.QueryGRPCGateway("/babylon/epoching/v1/current_epoch", url.Values{}) require.NoError(n.t, err) var epochResponse etypes.QueryCurrentEpochResponse if err := util.Cdc.UnmarshalJSON(bz, &epochResponse); err != nil { @@ -231,7 +233,7 @@ func (n *NodeConfig) QueryCurrentEpoch() (uint64, error) { func (n *NodeConfig) QueryLightClientHeightEpochEnd(epoch uint64) (uint64, error) { monitorPath := fmt.Sprintf("/babylon/monitor/v1/epochs/%d", epoch) - bz, err := n.QueryGRPCGateway(monitorPath) + bz, err := n.QueryGRPCGateway(monitorPath, url.Values{}) require.NoError(n.t, err) var mResponse mtypes.QueryEndedEpochBtcHeightResponse if err := util.Cdc.UnmarshalJSON(bz, &mResponse); err != nil { @@ -242,7 +244,7 @@ func (n *NodeConfig) QueryLightClientHeightEpochEnd(epoch uint64) (uint64, error func (n *NodeConfig) QueryLightClientHeightCheckpointReported(ckptHash []byte) (uint64, error) { monitorPath := fmt.Sprintf("/babylon/monitor/v1/checkpoints/%x", ckptHash) - bz, err := n.QueryGRPCGateway(monitorPath) + bz, err := n.QueryGRPCGateway(monitorPath, url.Values{}) require.NoError(n.t, err) var mResponse mtypes.QueryReportedCheckpointBtcHeightResponse if err := util.Cdc.UnmarshalJSON(bz, &mResponse); err != nil { diff --git a/test/e2e/e2e_test.go b/test/e2e/e2e_test.go index e70e0b01a..c86c512a7 100644 --- a/test/e2e/e2e_test.go +++ b/test/e2e/e2e_test.go @@ -30,7 +30,7 @@ func (s *IntegrationTestSuite) TestIbcCheckpointing() { s.NoError(err) // Query checkpoint chain info for opposing chain - chainInfo, err := nonValidatorNode.QueryCheckpointChainsInfo(initialization.ChainBID) + chainInfo, err := nonValidatorNode.QueryCheckpointChainsInfo([]string{initialization.ChainBID}) s.NoError(err) s.Equal(chainInfo[0].ChainId, initialization.ChainBID) @@ -45,11 +45,13 @@ func (s *IntegrationTestSuite) TestIbcCheckpointing() { } // Check we have finalized epoch info for opposing chain and some basic assertions - fininfo, err := nonValidatorNode.QueryFinalizedChainInfo(initialization.ChainBID) + finalizedResp, err := nonValidatorNode.QueryFinalizedChainsInfo([]string{initialization.ChainBID}) s.NoError(err) + + finalizedInfo := finalizedResp.FinalizedChainsInfo[0] // TODO Add more assertion here. Maybe check proofs ? - s.Equal(fininfo.FinalizedChainInfo.ChainId, initialization.ChainBID) - s.Equal(fininfo.EpochInfo.EpochNumber, uint64(3)) + s.Equal(finalizedInfo.FinalizedChainInfo.ChainId, initialization.ChainBID) + s.Equal(finalizedInfo.EpochInfo.EpochNumber, uint64(3)) currEpoch, err := nonValidatorNode.QueryCurrentEpoch() s.NoError(err) diff --git a/types/utils.go b/types/utils.go index 0f8145042..59d9eb82c 100644 --- a/types/utils.go +++ b/types/utils.go @@ -1,6 +1,7 @@ package types import ( + "fmt" "reflect" ) @@ -11,3 +12,20 @@ func Reverse(s interface{}) { swap(i, j) } } + +func CheckForDuplicatesAndEmptyStrings(input []string) error { + encountered := map[string]bool{} + for _, str := range input { + if len(str) == 0 { + return fmt.Errorf("empty string is not allowed") + } + + if encountered[str] { + return fmt.Errorf("duplicate entry found: %s", str) + } + + encountered[str] = true + } + + return nil +} diff --git a/x/zoneconcierge/client/cli/query.go b/x/zoneconcierge/client/cli/query.go index 98d9e74ca..67d8069c4 100644 --- a/x/zoneconcierge/client/cli/query.go +++ b/x/zoneconcierge/client/cli/query.go @@ -23,6 +23,7 @@ func GetQueryCmd(queryRoute string) *cobra.Command { } cmd.AddCommand(CmdChainsInfo()) + cmd.AddCommand(CmdFinalizedChainsInfo()) return cmd } @@ -47,3 +48,25 @@ func CmdChainsInfo() *cobra.Command { flags.AddQueryFlagsToCmd(cmd) return cmd } + +func CmdFinalizedChainsInfo() *cobra.Command { + cmd := &cobra.Command{ + Use: "finalized-chains-info ", + Short: "retrieves the finalized info for a list of chains with given IDs", + Args: cobra.ArbitraryArgs, + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx := client.GetClientContextFromCmd(cmd) + queryClient := types.NewQueryClient(clientCtx) + req := types.QueryFinalizedChainsInfoRequest{ChainIds: args} + resp, err := queryClient.FinalizedChainsInfo(cmd.Context(), &req) + if err != nil { + return err + } + + return clientCtx.PrintProto(resp) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + return cmd +} diff --git a/x/zoneconcierge/keeper/epoch_chain_info_indexer.go b/x/zoneconcierge/keeper/epoch_chain_info_indexer.go index f9d92e628..286c36c1e 100644 --- a/x/zoneconcierge/keeper/epoch_chain_info_indexer.go +++ b/x/zoneconcierge/keeper/epoch_chain_info_indexer.go @@ -1,54 +1,32 @@ package keeper import ( - bbn "github.com/babylonchain/babylon/types" - "github.com/babylonchain/babylon/x/zoneconcierge/types" "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" + + bbn "github.com/babylonchain/babylon/types" + "github.com/babylonchain/babylon/x/zoneconcierge/types" ) // GetEpochChainInfo gets the latest chain info of a given epoch for a given chain ID func (k Keeper) GetEpochChainInfo(ctx sdk.Context, chainID string, epochNumber uint64) (*types.ChainInfo, error) { - store := k.epochChainInfoStore(ctx, chainID) - epochNumberBytes := sdk.Uint64ToBigEndian(epochNumber) - if !store.Has(epochNumberBytes) { + if !k.EpochChainInfoExists(ctx, chainID, epochNumber) { return nil, types.ErrEpochChainInfoNotFound } + + store := k.epochChainInfoStore(ctx, chainID) + epochNumberBytes := sdk.Uint64ToBigEndian(epochNumber) epochChainInfoBytes := store.Get(epochNumberBytes) var chainInfo types.ChainInfo k.cdc.MustUnmarshal(epochChainInfoBytes, &chainInfo) return &chainInfo, nil } -// GetLastFinalizedChainInfo gets the last finalised chain info recorded for a given chain ID -// and the earliest epoch that snapshots this chain info -func (k Keeper) GetLastFinalizedChainInfo(ctx sdk.Context, chainID string) (uint64, *types.ChainInfo, error) { - // find the last finalised epoch - finalizedEpoch, err := k.GetFinalizedEpoch(ctx) - if err != nil { - return 0, nil, err - } - - // find the chain info of this epoch - chainInfo, err := k.GetEpochChainInfo(ctx, chainID, finalizedEpoch) - if err != nil { - return finalizedEpoch, nil, err - } - - // It's possible that the chain info's epoch is way before the last finalised epoch - // e.g., when there is no relayer for many epochs - // NOTE: if an epoch is finalised then all of its previous epochs are also finalised - if chainInfo.LatestHeader.BabylonEpoch < finalizedEpoch { - // remember the last finalised epoch - finalizedEpoch = chainInfo.LatestHeader.BabylonEpoch - // replace the chain info w.r.t. this last finalised epoch - chainInfo, err = k.GetEpochChainInfo(ctx, chainID, finalizedEpoch) - if err != nil { - return finalizedEpoch, nil, err - } - } - - return finalizedEpoch, chainInfo, nil +// EpochChainInfoExists checks if the latest chain info exists of a given epoch for a given chain ID +func (k Keeper) EpochChainInfoExists(ctx sdk.Context, chainID string, epochNumber uint64) bool { + store := k.epochChainInfoStore(ctx, chainID) + epochNumberBytes := sdk.Uint64ToBigEndian(epochNumber) + return store.Has(epochNumberBytes) } // GetEpochHeaders gets the headers timestamped in a given epoch, in the ascending order diff --git a/x/zoneconcierge/keeper/grpc_query.go b/x/zoneconcierge/keeper/grpc_query.go index 8acc2efd4..e67554c59 100644 --- a/x/zoneconcierge/keeper/grpc_query.go +++ b/x/zoneconcierge/keeper/grpc_query.go @@ -8,6 +8,8 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + bbntypes "github.com/babylonchain/babylon/types" + "github.com/babylonchain/babylon/x/zoneconcierge/types" ) @@ -46,26 +48,19 @@ func (k Keeper) ChainsInfo(c context.Context, req *types.QueryChainsInfoRequest) return nil, status.Error(codes.InvalidArgument, "invalid request") } + // return if no chain IDs are provided if len(req.ChainIds) == 0 { return nil, status.Error(codes.InvalidArgument, "chain IDs cannot be empty") } + // return if chain IDs exceed the limit if len(req.ChainIds) > maxQueryChainsInfoLimit { return nil, status.Errorf(codes.InvalidArgument, "cannot query more than %d chains", maxQueryChainsInfoLimit) } - encountered := map[string]bool{} - for _, chainID := range req.ChainIds { - if len(chainID) == 0 { - return nil, status.Error(codes.InvalidArgument, "chain ID cannot be empty") - } - - // check for duplicates and return error on first duplicate found - if encountered[chainID] { - return nil, status.Errorf(codes.InvalidArgument, "duplicate chain ID %s", chainID) - } else { - encountered[chainID] = true - } + // return if chain IDs contain duplicates or empty strings + if err := bbntypes.CheckForDuplicatesAndEmptyStrings(req.ChainIds); err != nil { + return nil, status.Error(codes.InvalidArgument, types.ErrInvalidChainIDs.Wrap(err.Error()).Error()) } ctx := sdk.UnwrapSDKContext(c) @@ -184,54 +179,90 @@ func (k Keeper) ListEpochHeaders(c context.Context, req *types.QueryListEpochHea return resp, nil } -func (k Keeper) FinalizedChainInfo(c context.Context, req *types.QueryFinalizedChainInfoRequest) (*types.QueryFinalizedChainInfoResponse, error) { +// FinalizedChainsInfo returns the finalized info of chains with given IDs +func (k Keeper) FinalizedChainsInfo(c context.Context, req *types.QueryFinalizedChainsInfoRequest) (*types.QueryFinalizedChainsInfoResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "invalid request") } - if len(req.ChainId) == 0 { + // return if no chain IDs are provided + if len(req.ChainIds) == 0 { return nil, status.Error(codes.InvalidArgument, "chain ID cannot be empty") } - ctx := sdk.UnwrapSDKContext(c) - resp := &types.QueryFinalizedChainInfoResponse{} - - // find the last finalised chain info and the earliest epoch that snapshots this chain info - finalizedEpoch, chainInfo, err := k.GetLastFinalizedChainInfo(ctx, req.ChainId) - if err != nil { - return nil, err + // return if chain IDs exceed the limit + if len(req.ChainIds) > maxQueryChainsInfoLimit { + return nil, status.Errorf(codes.InvalidArgument, "cannot query more than %d chains", maxQueryChainsInfoLimit) } - resp.FinalizedChainInfo = chainInfo - // find the epoch metadata of the finalised epoch - resp.EpochInfo, err = k.epochingKeeper.GetHistoricalEpoch(ctx, finalizedEpoch) - if err != nil { - return nil, err + // return if chain IDs contain duplicates or empty strings + if err := bbntypes.CheckForDuplicatesAndEmptyStrings(req.ChainIds); err != nil { + return nil, status.Error(codes.InvalidArgument, types.ErrInvalidChainIDs.Wrap(err.Error()).Error()) } - rawCheckpoint, err := k.checkpointingKeeper.GetRawCheckpoint(ctx, finalizedEpoch) + ctx := sdk.UnwrapSDKContext(c) + resp := &types.QueryFinalizedChainsInfoResponse{FinalizedChainsInfo: []*types.FinalizedChainInfo{}} + // find the last finalised epoch + lastFinalizedEpoch, err := k.GetFinalizedEpoch(ctx) if err != nil { return nil, err } - resp.RawCheckpoint = rawCheckpoint.Ckpt + for _, chainID := range req.ChainIds { + data := &types.FinalizedChainInfo{ChainId: chainID} - // find the raw checkpoint and the best submission key for the finalised epoch - _, resp.BtcSubmissionKey, err = k.btccKeeper.GetBestSubmission(ctx, finalizedEpoch) - if err != nil { - return nil, err - } + // if the chain info is not found in the last finalised epoch, return the chain info with empty fields + if !k.EpochChainInfoExists(ctx, chainID, lastFinalizedEpoch) { + resp.FinalizedChainsInfo = append(resp.FinalizedChainsInfo, data) + continue + } - // if the query does not want the proofs, return here - if !req.Prove { - return resp, nil - } + // find the chain info in the last finalised epoch + chainInfo, err := k.GetEpochChainInfo(ctx, chainID, lastFinalizedEpoch) + if err != nil { + return nil, err + } - // generate all proofs - resp.Proof, err = k.proveFinalizedChainInfo(ctx, chainInfo, resp.EpochInfo, resp.BtcSubmissionKey) - if err != nil { - return nil, err + // set finalizedEpoch as the earliest epoch that snapshots this chain info. + // it's possible that the chain info's epoch is way before the last finalised epoch + // e.g., when there is no relayer for many epochs + // NOTE: if an epoch is finalised then all of its previous epochs are also finalised + finalizedEpoch := lastFinalizedEpoch + if chainInfo.LatestHeader.BabylonEpoch < finalizedEpoch { + finalizedEpoch = chainInfo.LatestHeader.BabylonEpoch + } + + data.FinalizedChainInfo = chainInfo + + // find the epoch metadata of the finalised epoch + data.EpochInfo, err = k.epochingKeeper.GetHistoricalEpoch(ctx, finalizedEpoch) + if err != nil { + return nil, err + } + + rawCheckpoint, err := k.checkpointingKeeper.GetRawCheckpoint(ctx, finalizedEpoch) + if err != nil { + return nil, err + } + + data.RawCheckpoint = rawCheckpoint.Ckpt + + // find the raw checkpoint and the best submission key for the finalised epoch + _, data.BtcSubmissionKey, err = k.btccKeeper.GetBestSubmission(ctx, finalizedEpoch) + if err != nil { + return nil, err + } + + // generate all proofs + if req.Prove { + data.Proof, err = k.proveFinalizedChainInfo(ctx, chainInfo, data.EpochInfo, data.BtcSubmissionKey) + if err != nil { + return nil, err + } + } + + resp.FinalizedChainsInfo = append(resp.FinalizedChainsInfo, data) } return resp, nil @@ -249,11 +280,27 @@ func (k Keeper) FinalizedChainInfoUntilHeight(c context.Context, req *types.Quer ctx := sdk.UnwrapSDKContext(c) resp := &types.QueryFinalizedChainInfoUntilHeightResponse{} - // find and assign the last finalised chain info and the earliest epoch that snapshots this chain info - finalizedEpoch, chainInfo, err := k.GetLastFinalizedChainInfo(ctx, req.ChainId) + // find the last finalised epoch + lastFinalizedEpoch, err := k.GetFinalizedEpoch(ctx) if err != nil { return nil, err } + + // find the chain info in the last finalised epoch + chainInfo, err := k.GetEpochChainInfo(ctx, req.ChainId, lastFinalizedEpoch) + if err != nil { + return nil, err + } + + // set finalizedEpoch as the earliest epoch that snapshots this chain info. + // it's possible that the chain info's epoch is way before the last finalised epoch + // e.g., when there is no relayer for many epochs + // NOTE: if an epoch is finalised then all of its previous epochs are also finalised + finalizedEpoch := lastFinalizedEpoch + if chainInfo.LatestHeader.BabylonEpoch < finalizedEpoch { + finalizedEpoch = chainInfo.LatestHeader.BabylonEpoch + } + resp.FinalizedChainInfo = chainInfo if chainInfo.LatestHeader.Height <= req.Height { // the requested height is after the last finalised chain info diff --git a/x/zoneconcierge/keeper/grpc_query_test.go b/x/zoneconcierge/keeper/grpc_query_test.go index 31483706f..e699942f7 100644 --- a/x/zoneconcierge/keeper/grpc_query_test.go +++ b/x/zoneconcierge/keeper/grpc_query_test.go @@ -19,6 +19,12 @@ import ( zctypes "github.com/babylonchain/babylon/x/zoneconcierge/types" ) +type chainInfo struct { + chainID string + numHeaders uint64 + numForkHeaders uint64 +} + func FuzzChainList(f *testing.F) { datagen.AddRandomSeedsToFuzzer(f, 10) @@ -68,11 +74,6 @@ func FuzzChainList(f *testing.F) { func FuzzChainsInfo(f *testing.F) { datagen.AddRandomSeedsToFuzzer(f, 10) - type chainInfo struct { - chainID string - numHeaders uint64 - numForkHeaders uint64 - } f.Fuzz(func(t *testing.T, seed int64) { r := rand.New(rand.NewSource(seed)) @@ -312,9 +313,6 @@ func FuzzFinalizedChainInfo(f *testing.F) { ctrl := gomock.NewController(t) defer ctrl.Finish() - czChainIDLen := datagen.RandomInt(r, 50) + 1 - czChainID := string(datagen.GenRandomByteArray(r, czChainIDLen)) - // simulate the scenario that a random epoch has ended and finalised epoch := datagen.GenRandomEpoch(r) @@ -358,20 +356,40 @@ func FuzzFinalizedChainInfo(f *testing.F) { zcKeeper, ctx := testkeeper.ZoneConciergeKeeper(t, checkpointingKeeper, btccKeeper, epochingKeeper, tmClient) hooks := zcKeeper.Hooks() - // invoke the hook a random number of times to simulate a random number of blocks - numHeaders := datagen.RandomInt(r, 100) + 1 - numForkHeaders := datagen.RandomInt(r, 10) + 1 - SimulateHeadersAndForksViaHook(ctx, r, hooks, czChainID, 0, numHeaders, numForkHeaders) + var ( + chainsInfo []chainInfo + chainIDs []string + ) + numChains := datagen.RandomInt(r, 100) + 1 + for i := uint64(0); i < numChains; i++ { + czChainIDLen := datagen.RandomInt(r, 50) + 1 + czChainID := string(datagen.GenRandomByteArray(r, czChainIDLen)) + + // invoke the hook a random number of times to simulate a random number of blocks + numHeaders := datagen.RandomInt(r, 100) + 1 + numForkHeaders := datagen.RandomInt(r, 10) + 1 + SimulateHeadersAndForksViaHook(ctx, r, hooks, czChainID, 0, numHeaders, numForkHeaders) + + chainIDs = append(chainIDs, czChainID) + chainsInfo = append(chainsInfo, chainInfo{ + chainID: czChainID, + numHeaders: numHeaders, + numForkHeaders: numForkHeaders, + }) + } hooks.AfterEpochEnds(ctx, epoch.EpochNumber) err := hooks.AfterRawCheckpointFinalized(ctx, epoch.EpochNumber) require.NoError(t, err) // check if the chain info of this epoch is recorded or not - resp, err := zcKeeper.FinalizedChainInfo(ctx, &zctypes.QueryFinalizedChainInfoRequest{ChainId: czChainID, Prove: true}) + resp, err := zcKeeper.FinalizedChainsInfo(ctx, &zctypes.QueryFinalizedChainsInfoRequest{ChainIds: chainIDs, Prove: true}) require.NoError(t, err) - chainInfo := resp.FinalizedChainInfo - require.Equal(t, numHeaders-1, chainInfo.LatestHeader.Height) - require.Equal(t, numForkHeaders, uint64(len(chainInfo.LatestForks.Headers))) + for i, data := range resp.FinalizedChainsInfo { + finalizedInfo := data.FinalizedChainInfo + require.Equal(t, chainsInfo[i].chainID, data.ChainId) + require.Equal(t, chainsInfo[i].numHeaders-1, finalizedInfo.LatestHeader.Height) + require.Equal(t, chainsInfo[i].numForkHeaders, uint64(len(finalizedInfo.LatestForks.Headers))) + } }) } diff --git a/x/zoneconcierge/types/errors.go b/x/zoneconcierge/types/errors.go index 9dc7587a6..a9d28f4bd 100644 --- a/x/zoneconcierge/types/errors.go +++ b/x/zoneconcierge/types/errors.go @@ -23,4 +23,5 @@ var ( ErrInvalidProofEpochSealed = errorsmod.Register(ModuleName, 1112, "invalid ProofEpochSealed") ErrInvalidMerkleProof = errorsmod.Register(ModuleName, 1113, "invalid Merkle inclusion proof") ErrInvalidChainInfo = errorsmod.Register(ModuleName, 1114, "invalid chain info") + ErrInvalidChainIDs = errorsmod.Register(ModuleName, 1115, "chain ids contain duplicates or empty strings") ) diff --git a/x/zoneconcierge/types/query.pb.go b/x/zoneconcierge/types/query.pb.go index 88988b821..ca1f0842c 100644 --- a/x/zoneconcierge/types/query.pb.go +++ b/x/zoneconcierge/types/query.pb.go @@ -641,27 +641,27 @@ func (m *QueryListEpochHeadersResponse) GetHeaders() []*IndexedHeader { return nil } -// QueryFinalizedChainInfoRequest is request type for the -// Query/FinalizedChainInfo RPC method. -type QueryFinalizedChainInfoRequest struct { - // chain_id is the ID of the CZ - ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` +// QueryFinalizedChainsInfoRequest is request type for the +// Query/FinalizedChainsInfo RPC method. +type QueryFinalizedChainsInfoRequest struct { + // chain_ids is the list of ids of CZs + ChainIds []string `protobuf:"bytes,1,rep,name=chain_ids,json=chainIds,proto3" json:"chain_ids,omitempty"` // prove indicates whether the querier wants to get proofs of this timestamp Prove bool `protobuf:"varint,2,opt,name=prove,proto3" json:"prove,omitempty"` } -func (m *QueryFinalizedChainInfoRequest) Reset() { *m = QueryFinalizedChainInfoRequest{} } -func (m *QueryFinalizedChainInfoRequest) String() string { return proto.CompactTextString(m) } -func (*QueryFinalizedChainInfoRequest) ProtoMessage() {} -func (*QueryFinalizedChainInfoRequest) Descriptor() ([]byte, []int) { +func (m *QueryFinalizedChainsInfoRequest) Reset() { *m = QueryFinalizedChainsInfoRequest{} } +func (m *QueryFinalizedChainsInfoRequest) String() string { return proto.CompactTextString(m) } +func (*QueryFinalizedChainsInfoRequest) ProtoMessage() {} +func (*QueryFinalizedChainsInfoRequest) Descriptor() ([]byte, []int) { return fileDescriptor_cd665af90102da38, []int{12} } -func (m *QueryFinalizedChainInfoRequest) XXX_Unmarshal(b []byte) error { +func (m *QueryFinalizedChainsInfoRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryFinalizedChainInfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryFinalizedChainsInfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryFinalizedChainInfoRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryFinalizedChainsInfoRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -671,60 +671,50 @@ func (m *QueryFinalizedChainInfoRequest) XXX_Marshal(b []byte, deterministic boo return b[:n], nil } } -func (m *QueryFinalizedChainInfoRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryFinalizedChainInfoRequest.Merge(m, src) +func (m *QueryFinalizedChainsInfoRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryFinalizedChainsInfoRequest.Merge(m, src) } -func (m *QueryFinalizedChainInfoRequest) XXX_Size() int { +func (m *QueryFinalizedChainsInfoRequest) XXX_Size() int { return m.Size() } -func (m *QueryFinalizedChainInfoRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryFinalizedChainInfoRequest.DiscardUnknown(m) +func (m *QueryFinalizedChainsInfoRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryFinalizedChainsInfoRequest.DiscardUnknown(m) } -var xxx_messageInfo_QueryFinalizedChainInfoRequest proto.InternalMessageInfo +var xxx_messageInfo_QueryFinalizedChainsInfoRequest proto.InternalMessageInfo -func (m *QueryFinalizedChainInfoRequest) GetChainId() string { +func (m *QueryFinalizedChainsInfoRequest) GetChainIds() []string { if m != nil { - return m.ChainId + return m.ChainIds } - return "" + return nil } -func (m *QueryFinalizedChainInfoRequest) GetProve() bool { +func (m *QueryFinalizedChainsInfoRequest) GetProve() bool { if m != nil { return m.Prove } return false } -// QueryFinalizedChainInfoResponse is response type for the -// Query/FinalizedChainInfo RPC method. -type QueryFinalizedChainInfoResponse struct { - // finalized_chain_info is the info of the CZ - FinalizedChainInfo *ChainInfo `protobuf:"bytes,1,opt,name=finalized_chain_info,json=finalizedChainInfo,proto3" json:"finalized_chain_info,omitempty"` - // epoch_info is the metadata of the last BTC-finalised epoch - EpochInfo *types.Epoch `protobuf:"bytes,2,opt,name=epoch_info,json=epochInfo,proto3" json:"epoch_info,omitempty"` - // raw_checkpoint is the raw checkpoint of this epoch - RawCheckpoint *types1.RawCheckpoint `protobuf:"bytes,3,opt,name=raw_checkpoint,json=rawCheckpoint,proto3" json:"raw_checkpoint,omitempty"` - // btc_submission_key is position of two BTC txs that include the raw - // checkpoint of this epoch - BtcSubmissionKey *types2.SubmissionKey `protobuf:"bytes,4,opt,name=btc_submission_key,json=btcSubmissionKey,proto3" json:"btc_submission_key,omitempty"` - // proof is the proof that the chain info is finalized - Proof *ProofFinalizedChainInfo `protobuf:"bytes,5,opt,name=proof,proto3" json:"proof,omitempty"` +// QueryFinalizedChainsInfoResponse is response type for the +// Query/FinalizedChainsInfo RPC method. +type QueryFinalizedChainsInfoResponse struct { + FinalizedChainsInfo []*FinalizedChainInfo `protobuf:"bytes,1,rep,name=finalized_chains_info,json=finalizedChainsInfo,proto3" json:"finalized_chains_info,omitempty"` } -func (m *QueryFinalizedChainInfoResponse) Reset() { *m = QueryFinalizedChainInfoResponse{} } -func (m *QueryFinalizedChainInfoResponse) String() string { return proto.CompactTextString(m) } -func (*QueryFinalizedChainInfoResponse) ProtoMessage() {} -func (*QueryFinalizedChainInfoResponse) Descriptor() ([]byte, []int) { +func (m *QueryFinalizedChainsInfoResponse) Reset() { *m = QueryFinalizedChainsInfoResponse{} } +func (m *QueryFinalizedChainsInfoResponse) String() string { return proto.CompactTextString(m) } +func (*QueryFinalizedChainsInfoResponse) ProtoMessage() {} +func (*QueryFinalizedChainsInfoResponse) Descriptor() ([]byte, []int) { return fileDescriptor_cd665af90102da38, []int{13} } -func (m *QueryFinalizedChainInfoResponse) XXX_Unmarshal(b []byte) error { +func (m *QueryFinalizedChainsInfoResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryFinalizedChainInfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryFinalizedChainsInfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryFinalizedChainInfoResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryFinalizedChainsInfoResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -734,49 +724,21 @@ func (m *QueryFinalizedChainInfoResponse) XXX_Marshal(b []byte, deterministic bo return b[:n], nil } } -func (m *QueryFinalizedChainInfoResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryFinalizedChainInfoResponse.Merge(m, src) +func (m *QueryFinalizedChainsInfoResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryFinalizedChainsInfoResponse.Merge(m, src) } -func (m *QueryFinalizedChainInfoResponse) XXX_Size() int { +func (m *QueryFinalizedChainsInfoResponse) XXX_Size() int { return m.Size() } -func (m *QueryFinalizedChainInfoResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryFinalizedChainInfoResponse.DiscardUnknown(m) +func (m *QueryFinalizedChainsInfoResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryFinalizedChainsInfoResponse.DiscardUnknown(m) } -var xxx_messageInfo_QueryFinalizedChainInfoResponse proto.InternalMessageInfo +var xxx_messageInfo_QueryFinalizedChainsInfoResponse proto.InternalMessageInfo -func (m *QueryFinalizedChainInfoResponse) GetFinalizedChainInfo() *ChainInfo { +func (m *QueryFinalizedChainsInfoResponse) GetFinalizedChainsInfo() []*FinalizedChainInfo { if m != nil { - return m.FinalizedChainInfo - } - return nil -} - -func (m *QueryFinalizedChainInfoResponse) GetEpochInfo() *types.Epoch { - if m != nil { - return m.EpochInfo - } - return nil -} - -func (m *QueryFinalizedChainInfoResponse) GetRawCheckpoint() *types1.RawCheckpoint { - if m != nil { - return m.RawCheckpoint - } - return nil -} - -func (m *QueryFinalizedChainInfoResponse) GetBtcSubmissionKey() *types2.SubmissionKey { - if m != nil { - return m.BtcSubmissionKey - } - return nil -} - -func (m *QueryFinalizedChainInfoResponse) GetProof() *ProofFinalizedChainInfo { - if m != nil { - return m.Proof + return m.FinalizedChainsInfo } return nil } @@ -953,8 +915,8 @@ func init() { proto.RegisterType((*QueryListHeadersResponse)(nil), "babylon.zoneconcierge.v1.QueryListHeadersResponse") proto.RegisterType((*QueryListEpochHeadersRequest)(nil), "babylon.zoneconcierge.v1.QueryListEpochHeadersRequest") proto.RegisterType((*QueryListEpochHeadersResponse)(nil), "babylon.zoneconcierge.v1.QueryListEpochHeadersResponse") - proto.RegisterType((*QueryFinalizedChainInfoRequest)(nil), "babylon.zoneconcierge.v1.QueryFinalizedChainInfoRequest") - proto.RegisterType((*QueryFinalizedChainInfoResponse)(nil), "babylon.zoneconcierge.v1.QueryFinalizedChainInfoResponse") + proto.RegisterType((*QueryFinalizedChainsInfoRequest)(nil), "babylon.zoneconcierge.v1.QueryFinalizedChainsInfoRequest") + proto.RegisterType((*QueryFinalizedChainsInfoResponse)(nil), "babylon.zoneconcierge.v1.QueryFinalizedChainsInfoResponse") proto.RegisterType((*QueryFinalizedChainInfoUntilHeightRequest)(nil), "babylon.zoneconcierge.v1.QueryFinalizedChainInfoUntilHeightRequest") proto.RegisterType((*QueryFinalizedChainInfoUntilHeightResponse)(nil), "babylon.zoneconcierge.v1.QueryFinalizedChainInfoUntilHeightResponse") } @@ -964,76 +926,76 @@ func init() { } var fileDescriptor_cd665af90102da38 = []byte{ - // 1094 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x57, 0xcf, 0x6f, 0x1b, 0x45, - 0x14, 0xce, 0xc6, 0x49, 0x9a, 0x3c, 0x97, 0xaa, 0x1a, 0x4a, 0x31, 0xdb, 0xd6, 0x8d, 0x96, 0x1f, - 0x4d, 0xab, 0x74, 0x17, 0x9b, 0x06, 0x88, 0x38, 0x54, 0xf9, 0x41, 0xd2, 0x50, 0x54, 0x9a, 0x85, - 0x70, 0xe0, 0xb2, 0xda, 0x5d, 0x8f, 0xed, 0x55, 0xe2, 0x19, 0xd7, 0xb3, 0x76, 0xeb, 0x86, 0x70, - 0xe0, 0x8e, 0x84, 0xc4, 0x05, 0x71, 0x42, 0x42, 0xe2, 0xc0, 0xa1, 0x7f, 0x07, 0x48, 0x3d, 0x54, - 0xe2, 0xc2, 0x11, 0x25, 0xfc, 0x1b, 0x48, 0x68, 0x67, 0x66, 0xd7, 0x5e, 0xaf, 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0xfc, 0x92, 0x03, 0x57, 0xdd, 0xfc, - 0x77, 0x20, 0x32, 0xdf, 0x5d, 0x9e, 0xef, 0x7d, 0xb4, 0x33, 0x71, 0xbe, 0x86, 0x78, 0x4c, 0xa3, - 0x47, 0x75, 0xfd, 0x93, 0x5f, 0x8f, 0x8b, 0xca, 0x8b, 0xe3, 0xa2, 0xf2, 0xe7, 0x71, 0x51, 0xf9, - 0xf6, 0xa4, 0x38, 0xf5, 0xe2, 0xa4, 0x38, 0xf5, 0xc7, 0x49, 0x71, 0xea, 0x8b, 0x95, 0x9a, 0xe7, - 0xd7, 0xdb, 0x8e, 0xee, 0xd2, 0x46, 0x18, 0x8e, 0xc3, 0x44, 0xb1, 0x9f, 0x0c, 0x44, 0xf7, 0xbb, - 0x4d, 0xcc, 0x9c, 0x39, 0xfe, 0x2f, 0xf8, 0x3b, 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, 0xe0, 0xd3, - 0x0e, 0x7d, 0xb9, 0x10, 0x00, 0x00, + // 1103 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x57, 0xcd, 0x6f, 0x1b, 0x45, + 0x14, 0xcf, 0xe4, 0xab, 0xc9, 0x73, 0xa9, 0xaa, 0x49, 0x5b, 0xcc, 0xb6, 0x75, 0xad, 0xe5, 0xa3, + 0x69, 0x95, 0xee, 0x62, 0xd3, 0x50, 0x95, 0x4b, 0xd5, 0x24, 0x24, 0x0d, 0x45, 0xa5, 0x5d, 0x1a, + 0x0e, 0x5c, 0x96, 0xdd, 0xf5, 0xd8, 0x5e, 0x25, 0xde, 0x71, 0x3d, 0x6b, 0xb7, 0x6e, 0x08, 0x07, + 0x84, 0x38, 0x23, 0x71, 0x41, 0x9c, 0x38, 0x71, 0xe0, 0xd0, 0xff, 0x02, 0x09, 0x24, 0x0e, 0x95, + 0xb8, 0x70, 0x44, 0x09, 0xff, 0x06, 0x12, 0x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0xc7, 0x95, 0xba, 0x78, 0xf1, 0xbf, 0x08, 0x2e, 0x1f, 0xbb, 0xb4, 0xf0, + 0xfa, 0x44, 0xb2, 0xd2, 0x37, 0xad, 0xb2, 0xf1, 0xff, 0x40, 0x64, 0x94, 0x8f, 0x78, 0x94, 0xf7, + 0xf1, 0x76, 0xee, 0x28, 0x53, 0x5e, 0xd3, 0x00, 0x31, 0x7a, 0x4d, 0xd7, 0x3e, 0xf9, 0xed, 0xb0, + 0x84, 0x5e, 0x1e, 0x96, 0xd0, 0xdf, 0x87, 0x25, 0xf4, 0xdd, 0x51, 0x69, 0xea, 0xe5, 0x51, 0x69, + 0xea, 0xaf, 0xa3, 0xd2, 0xd4, 0xe7, 0xab, 0x0d, 0xd7, 0x6f, 0x76, 0x6d, 0xcd, 0xa1, 0xad, 0x90, + 0x8e, 0xc3, 0x44, 0xdc, 0xcf, 0x46, 0xd8, 0xfd, 0x7e, 0x9b, 0x30, 0x7b, 0x9e, 0xff, 0x7f, 0xf9, + 0xde, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xd9, 0x74, 0x79, 0x64, 0x96, 0x0f, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1063,8 +1025,8 @@ type QueryClient interface { // ListEpochHeaders queries the headers of a chain timestamped in a given // epoch of Babylon, with pagination support ListEpochHeaders(ctx context.Context, in *QueryListEpochHeadersRequest, opts ...grpc.CallOption) (*QueryListEpochHeadersResponse, error) - // FinalizedChainInfo queries the BTC-finalised info of a chain, with proofs - FinalizedChainInfo(ctx context.Context, in *QueryFinalizedChainInfoRequest, opts ...grpc.CallOption) (*QueryFinalizedChainInfoResponse, error) + // FinalizedChainsInfo queries the BTC-finalised info of chains with given IDs, with proofs + FinalizedChainsInfo(ctx context.Context, in *QueryFinalizedChainsInfoRequest, opts ...grpc.CallOption) (*QueryFinalizedChainsInfoResponse, error) // FinalizedChainInfoUntilHeight queries the BTC-finalised info no later than // the provided CZ height, with proofs FinalizedChainInfoUntilHeight(ctx context.Context, in *QueryFinalizedChainInfoUntilHeightRequest, opts ...grpc.CallOption) (*QueryFinalizedChainInfoUntilHeightResponse, error) @@ -1132,9 +1094,9 @@ func (c *queryClient) ListEpochHeaders(ctx context.Context, in *QueryListEpochHe return out, nil } -func (c *queryClient) FinalizedChainInfo(ctx context.Context, in *QueryFinalizedChainInfoRequest, opts ...grpc.CallOption) (*QueryFinalizedChainInfoResponse, error) { - out := new(QueryFinalizedChainInfoResponse) - err := c.cc.Invoke(ctx, "/babylon.zoneconcierge.v1.Query/FinalizedChainInfo", in, out, opts...) +func (c *queryClient) FinalizedChainsInfo(ctx context.Context, in *QueryFinalizedChainsInfoRequest, opts ...grpc.CallOption) (*QueryFinalizedChainsInfoResponse, error) { + out := new(QueryFinalizedChainsInfoResponse) + err := c.cc.Invoke(ctx, "/babylon.zoneconcierge.v1.Query/FinalizedChainsInfo", in, out, opts...) if err != nil { return nil, err } @@ -1167,8 +1129,8 @@ type QueryServer interface { // ListEpochHeaders queries the headers of a chain timestamped in a given // epoch of Babylon, with pagination support ListEpochHeaders(context.Context, *QueryListEpochHeadersRequest) (*QueryListEpochHeadersResponse, error) - // FinalizedChainInfo queries the BTC-finalised info of a chain, with proofs - FinalizedChainInfo(context.Context, *QueryFinalizedChainInfoRequest) (*QueryFinalizedChainInfoResponse, error) + // FinalizedChainsInfo queries the BTC-finalised info of chains with given IDs, with proofs + FinalizedChainsInfo(context.Context, *QueryFinalizedChainsInfoRequest) (*QueryFinalizedChainsInfoResponse, error) // FinalizedChainInfoUntilHeight queries the BTC-finalised info no later than // the provided CZ height, with proofs FinalizedChainInfoUntilHeight(context.Context, *QueryFinalizedChainInfoUntilHeightRequest) (*QueryFinalizedChainInfoUntilHeightResponse, error) @@ -1196,8 +1158,8 @@ func (*UnimplementedQueryServer) ListHeaders(ctx context.Context, req *QueryList func (*UnimplementedQueryServer) ListEpochHeaders(ctx context.Context, req *QueryListEpochHeadersRequest) (*QueryListEpochHeadersResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ListEpochHeaders not implemented") } -func (*UnimplementedQueryServer) FinalizedChainInfo(ctx context.Context, req *QueryFinalizedChainInfoRequest) (*QueryFinalizedChainInfoResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method FinalizedChainInfo not implemented") +func (*UnimplementedQueryServer) FinalizedChainsInfo(ctx context.Context, req *QueryFinalizedChainsInfoRequest) (*QueryFinalizedChainsInfoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method FinalizedChainsInfo not implemented") } func (*UnimplementedQueryServer) FinalizedChainInfoUntilHeight(ctx context.Context, req *QueryFinalizedChainInfoUntilHeightRequest) (*QueryFinalizedChainInfoUntilHeightResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method FinalizedChainInfoUntilHeight not implemented") @@ -1315,20 +1277,20 @@ func _Query_ListEpochHeaders_Handler(srv interface{}, ctx context.Context, dec f return interceptor(ctx, in, info, handler) } -func _Query_FinalizedChainInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryFinalizedChainInfoRequest) +func _Query_FinalizedChainsInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryFinalizedChainsInfoRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(QueryServer).FinalizedChainInfo(ctx, in) + return srv.(QueryServer).FinalizedChainsInfo(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/babylon.zoneconcierge.v1.Query/FinalizedChainInfo", + FullMethod: "/babylon.zoneconcierge.v1.Query/FinalizedChainsInfo", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).FinalizedChainInfo(ctx, req.(*QueryFinalizedChainInfoRequest)) + return srv.(QueryServer).FinalizedChainsInfo(ctx, req.(*QueryFinalizedChainsInfoRequest)) } return interceptor(ctx, in, info, handler) } @@ -1380,8 +1342,8 @@ var _Query_serviceDesc = grpc.ServiceDesc{ Handler: _Query_ListEpochHeaders_Handler, }, { - MethodName: "FinalizedChainInfo", - Handler: _Query_FinalizedChainInfo_Handler, + MethodName: "FinalizedChainsInfo", + Handler: _Query_FinalizedChainsInfo_Handler, }, { MethodName: "FinalizedChainInfoUntilHeight", @@ -1855,7 +1817,7 @@ func (m *QueryListEpochHeadersResponse) MarshalToSizedBuffer(dAtA []byte) (int, return len(dAtA) - i, nil } -func (m *QueryFinalizedChainInfoRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryFinalizedChainsInfoRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1865,12 +1827,12 @@ func (m *QueryFinalizedChainInfoRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryFinalizedChainInfoRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryFinalizedChainsInfoRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryFinalizedChainInfoRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryFinalizedChainsInfoRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1885,17 +1847,19 @@ func (m *QueryFinalizedChainInfoRequest) MarshalToSizedBuffer(dAtA []byte) (int, i-- dAtA[i] = 0x10 } - if len(m.ChainId) > 0 { - i -= len(m.ChainId) - copy(dAtA[i:], m.ChainId) - i = encodeVarintQuery(dAtA, i, uint64(len(m.ChainId))) - i-- - dAtA[i] = 0xa + if len(m.ChainIds) > 0 { + for iNdEx := len(m.ChainIds) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.ChainIds[iNdEx]) + copy(dAtA[i:], m.ChainIds[iNdEx]) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ChainIds[iNdEx]))) + i-- + dAtA[i] = 0xa + } } return len(dAtA) - i, nil } -func (m *QueryFinalizedChainInfoResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryFinalizedChainsInfoResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1905,75 +1869,29 @@ func (m *QueryFinalizedChainInfoResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryFinalizedChainInfoResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryFinalizedChainsInfoResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryFinalizedChainInfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryFinalizedChainsInfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.Proof != nil { - { - size, err := m.Proof.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - if m.BtcSubmissionKey != nil { - { - size, err := m.BtcSubmissionKey.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - if m.RawCheckpoint != nil { - { - size, err := m.RawCheckpoint.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.EpochInfo != nil { - { - size, err := m.EpochInfo.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.FinalizedChainInfo != nil { - { - size, err := m.FinalizedChainInfo.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + if len(m.FinalizedChainsInfo) > 0 { + for iNdEx := len(m.FinalizedChainsInfo) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.FinalizedChainsInfo[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa } - i-- - dAtA[i] = 0xa } return len(dAtA) - i, nil } @@ -2308,15 +2226,17 @@ func (m *QueryListEpochHeadersResponse) Size() (n int) { return n } -func (m *QueryFinalizedChainInfoRequest) Size() (n int) { +func (m *QueryFinalizedChainsInfoRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.ChainId) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) + if len(m.ChainIds) > 0 { + for _, s := range m.ChainIds { + l = len(s) + n += 1 + l + sovQuery(uint64(l)) + } } if m.Prove { n += 2 @@ -2324,31 +2244,17 @@ func (m *QueryFinalizedChainInfoRequest) Size() (n int) { return n } -func (m *QueryFinalizedChainInfoResponse) Size() (n int) { +func (m *QueryFinalizedChainsInfoResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.FinalizedChainInfo != nil { - l = m.FinalizedChainInfo.Size() - n += 1 + l + sovQuery(uint64(l)) - } - if m.EpochInfo != nil { - l = m.EpochInfo.Size() - n += 1 + l + sovQuery(uint64(l)) - } - if m.RawCheckpoint != nil { - l = m.RawCheckpoint.Size() - n += 1 + l + sovQuery(uint64(l)) - } - if m.BtcSubmissionKey != nil { - l = m.BtcSubmissionKey.Size() - n += 1 + l + sovQuery(uint64(l)) - } - if m.Proof != nil { - l = m.Proof.Size() - n += 1 + l + sovQuery(uint64(l)) + if len(m.FinalizedChainsInfo) > 0 { + for _, e := range m.FinalizedChainsInfo { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } } return n } @@ -3610,7 +3516,7 @@ func (m *QueryListEpochHeadersResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryFinalizedChainInfoRequest) Unmarshal(dAtA []byte) error { +func (m *QueryFinalizedChainsInfoRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3633,15 +3539,15 @@ func (m *QueryFinalizedChainInfoRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryFinalizedChainInfoRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryFinalizedChainsInfoRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryFinalizedChainInfoRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryFinalizedChainsInfoRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ChainIds", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -3669,7 +3575,7 @@ func (m *QueryFinalizedChainInfoRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ChainId = string(dAtA[iNdEx:postIndex]) + m.ChainIds = append(m.ChainIds, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex case 2: if wireType != 0 { @@ -3712,7 +3618,7 @@ func (m *QueryFinalizedChainInfoRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryFinalizedChainInfoResponse) Unmarshal(dAtA []byte) error { +func (m *QueryFinalizedChainsInfoResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3735,159 +3641,15 @@ func (m *QueryFinalizedChainInfoResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryFinalizedChainInfoResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryFinalizedChainsInfoResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryFinalizedChainInfoResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryFinalizedChainsInfoResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FinalizedChainInfo", 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.FinalizedChainInfo == nil { - m.FinalizedChainInfo = &ChainInfo{} - } - if err := m.FinalizedChainInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EpochInfo", 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.EpochInfo == nil { - m.EpochInfo = &types.Epoch{} - } - if err := m.EpochInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RawCheckpoint", 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.RawCheckpoint == nil { - m.RawCheckpoint = &types1.RawCheckpoint{} - } - if err := m.RawCheckpoint.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BtcSubmissionKey", 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.BtcSubmissionKey == nil { - m.BtcSubmissionKey = &types2.SubmissionKey{} - } - if err := m.BtcSubmissionKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Proof", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field FinalizedChainsInfo", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -3914,10 +3676,8 @@ func (m *QueryFinalizedChainInfoResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Proof == nil { - m.Proof = &ProofFinalizedChainInfo{} - } - if err := m.Proof.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.FinalizedChainsInfo = append(m.FinalizedChainsInfo, &FinalizedChainInfo{}) + if err := m.FinalizedChainsInfo[len(m.FinalizedChainsInfo)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/x/zoneconcierge/types/query.pb.gw.go b/x/zoneconcierge/types/query.pb.gw.go index 5a9e81fcf..5b7d961fd 100644 --- a/x/zoneconcierge/types/query.pb.gw.go +++ b/x/zoneconcierge/types/query.pb.gw.go @@ -406,73 +406,37 @@ func local_request_Query_ListEpochHeaders_0(ctx context.Context, marshaler runti } var ( - filter_Query_FinalizedChainInfo_0 = &utilities.DoubleArray{Encoding: map[string]int{"chain_id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} + filter_Query_FinalizedChainsInfo_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} ) -func request_Query_FinalizedChainInfo_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryFinalizedChainInfoRequest +func request_Query_FinalizedChainsInfo_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryFinalizedChainsInfoRequest var metadata runtime.ServerMetadata - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["chain_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "chain_id") - } - - protoReq.ChainId, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "chain_id", err) - } - if err := req.ParseForm(); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_FinalizedChainInfo_0); err != nil { + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_FinalizedChainsInfo_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.FinalizedChainInfo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + msg, err := client.FinalizedChainsInfo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } -func local_request_Query_FinalizedChainInfo_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryFinalizedChainInfoRequest +func local_request_Query_FinalizedChainsInfo_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryFinalizedChainsInfoRequest var metadata runtime.ServerMetadata - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["chain_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "chain_id") - } - - protoReq.ChainId, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "chain_id", err) - } - if err := req.ParseForm(); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_FinalizedChainInfo_0); err != nil { + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_FinalizedChainsInfo_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.FinalizedChainInfo(ctx, &protoReq) + msg, err := server.FinalizedChainsInfo(ctx, &protoReq) return msg, metadata, err } @@ -715,7 +679,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) - mux.Handle("GET", pattern_Query_FinalizedChainInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_FinalizedChainsInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -726,7 +690,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_Query_FinalizedChainInfo_0(rctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Query_FinalizedChainsInfo_0(rctx, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { @@ -734,7 +698,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } - forward_Query_FinalizedChainInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_FinalizedChainsInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -922,7 +886,7 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) - mux.Handle("GET", pattern_Query_FinalizedChainInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_FinalizedChainsInfo_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) @@ -931,14 +895,14 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_Query_FinalizedChainInfo_0(rctx, inboundMarshaler, client, req, pathParams) + resp, md, err := request_Query_FinalizedChainsInfo_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_FinalizedChainInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_FinalizedChainsInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -978,7 +942,7 @@ var ( pattern_Query_ListEpochHeaders_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6}, []string{"babylon", "zoneconcierge", "v1", "headers", "chain_id", "epochs", "epoch_num"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_FinalizedChainInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"babylon", "zoneconcierge", "v1", "finalized_chain_info", "chain_id"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_FinalizedChainsInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"babylon", "zoneconcierge", "v1", "finalized_chains_info"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_FinalizedChainInfoUntilHeight_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 5}, []string{"babylon", "zoneconcierge", "v1", "finalized_chain_info", "chain_id", "height"}, "", runtime.AssumeColonVerbOpt(false))) ) @@ -996,7 +960,7 @@ var ( forward_Query_ListEpochHeaders_0 = runtime.ForwardResponseMessage - forward_Query_FinalizedChainInfo_0 = runtime.ForwardResponseMessage + forward_Query_FinalizedChainsInfo_0 = runtime.ForwardResponseMessage forward_Query_FinalizedChainInfoUntilHeight_0 = runtime.ForwardResponseMessage ) diff --git a/x/zoneconcierge/types/zoneconcierge.pb.go b/x/zoneconcierge/types/zoneconcierge.pb.go index 99082b5b2..f9e732c74 100644 --- a/x/zoneconcierge/types/zoneconcierge.pb.go +++ b/x/zoneconcierge/types/zoneconcierge.pb.go @@ -5,8 +5,9 @@ package types import ( fmt "fmt" - types2 "github.com/babylonchain/babylon/x/btccheckpoint/types" - types1 "github.com/babylonchain/babylon/x/checkpointing/types" + types3 "github.com/babylonchain/babylon/x/btccheckpoint/types" + types2 "github.com/babylonchain/babylon/x/checkpointing/types" + types1 "github.com/babylonchain/babylon/x/epoching/types" crypto "github.com/cometbft/cometbft/proto/tendermint/crypto" types "github.com/cometbft/cometbft/proto/tendermint/types" proto "github.com/cosmos/gogoproto/proto" @@ -257,6 +258,98 @@ func (m *ChainInfo) GetTimestampedHeadersCount() uint64 { return 0 } +// FinalizedChainInfo is the information of a CZ that is BTC-finalised +type FinalizedChainInfo struct { + // chain_id is the ID of the chain + ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + // finalized_chain_info is the info of the CZ + FinalizedChainInfo *ChainInfo `protobuf:"bytes,2,opt,name=finalized_chain_info,json=finalizedChainInfo,proto3" json:"finalized_chain_info,omitempty"` + // epoch_info is the metadata of the last BTC-finalised epoch + EpochInfo *types1.Epoch `protobuf:"bytes,3,opt,name=epoch_info,json=epochInfo,proto3" json:"epoch_info,omitempty"` + // raw_checkpoint is the raw checkpoint of this epoch + RawCheckpoint *types2.RawCheckpoint `protobuf:"bytes,4,opt,name=raw_checkpoint,json=rawCheckpoint,proto3" json:"raw_checkpoint,omitempty"` + // btc_submission_key is position of two BTC txs that include the raw + // checkpoint of this epoch + BtcSubmissionKey *types3.SubmissionKey `protobuf:"bytes,5,opt,name=btc_submission_key,json=btcSubmissionKey,proto3" json:"btc_submission_key,omitempty"` + // proof is the proof that the chain info is finalized + Proof *ProofFinalizedChainInfo `protobuf:"bytes,6,opt,name=proof,proto3" json:"proof,omitempty"` +} + +func (m *FinalizedChainInfo) Reset() { *m = FinalizedChainInfo{} } +func (m *FinalizedChainInfo) String() string { return proto.CompactTextString(m) } +func (*FinalizedChainInfo) ProtoMessage() {} +func (*FinalizedChainInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_ab886e1868e5c5cd, []int{3} +} +func (m *FinalizedChainInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *FinalizedChainInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_FinalizedChainInfo.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 *FinalizedChainInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_FinalizedChainInfo.Merge(m, src) +} +func (m *FinalizedChainInfo) XXX_Size() int { + return m.Size() +} +func (m *FinalizedChainInfo) XXX_DiscardUnknown() { + xxx_messageInfo_FinalizedChainInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_FinalizedChainInfo proto.InternalMessageInfo + +func (m *FinalizedChainInfo) GetChainId() string { + if m != nil { + return m.ChainId + } + return "" +} + +func (m *FinalizedChainInfo) GetFinalizedChainInfo() *ChainInfo { + if m != nil { + return m.FinalizedChainInfo + } + return nil +} + +func (m *FinalizedChainInfo) GetEpochInfo() *types1.Epoch { + if m != nil { + return m.EpochInfo + } + return nil +} + +func (m *FinalizedChainInfo) GetRawCheckpoint() *types2.RawCheckpoint { + if m != nil { + return m.RawCheckpoint + } + return nil +} + +func (m *FinalizedChainInfo) GetBtcSubmissionKey() *types3.SubmissionKey { + if m != nil { + return m.BtcSubmissionKey + } + return nil +} + +func (m *FinalizedChainInfo) GetProof() *ProofFinalizedChainInfo { + if m != nil { + return m.Proof + } + return nil +} + // ProofEpochSealed is the proof that an epoch is sealed by the sealer header, // i.e., the 2nd header of the next epoch With the access of metadata // - Metadata of this epoch, which includes the sealer header @@ -271,7 +364,7 @@ type ProofEpochSealed struct { // validator_set is the validator set of the sealed epoch // This validator set has generated a BLS multisig on `last_commit_hash` of // the sealer header - ValidatorSet []*types1.ValidatorWithBlsKey `protobuf:"bytes,1,rep,name=validator_set,json=validatorSet,proto3" json:"validator_set,omitempty"` + ValidatorSet []*types2.ValidatorWithBlsKey `protobuf:"bytes,1,rep,name=validator_set,json=validatorSet,proto3" json:"validator_set,omitempty"` // proof_epoch_info is the Merkle proof that the epoch's metadata is committed // to `app_hash` of the sealer header ProofEpochInfo *crypto.ProofOps `protobuf:"bytes,2,opt,name=proof_epoch_info,json=proofEpochInfo,proto3" json:"proof_epoch_info,omitempty"` @@ -284,7 +377,7 @@ func (m *ProofEpochSealed) Reset() { *m = ProofEpochSealed{} } func (m *ProofEpochSealed) String() string { return proto.CompactTextString(m) } func (*ProofEpochSealed) ProtoMessage() {} func (*ProofEpochSealed) Descriptor() ([]byte, []int) { - return fileDescriptor_ab886e1868e5c5cd, []int{3} + return fileDescriptor_ab886e1868e5c5cd, []int{4} } func (m *ProofEpochSealed) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -313,7 +406,7 @@ func (m *ProofEpochSealed) XXX_DiscardUnknown() { var xxx_messageInfo_ProofEpochSealed proto.InternalMessageInfo -func (m *ProofEpochSealed) GetValidatorSet() []*types1.ValidatorWithBlsKey { +func (m *ProofEpochSealed) GetValidatorSet() []*types2.ValidatorWithBlsKey { if m != nil { return m.ValidatorSet } @@ -348,14 +441,14 @@ type ProofFinalizedChainInfo struct { // proof_epoch_submitted is the proof that the epoch's checkpoint is included // in BTC ledger It is the two TransactionInfo in the best (i.e., earliest) // checkpoint submission - ProofEpochSubmitted []*types2.TransactionInfo `protobuf:"bytes,7,rep,name=proof_epoch_submitted,json=proofEpochSubmitted,proto3" json:"proof_epoch_submitted,omitempty"` + ProofEpochSubmitted []*types3.TransactionInfo `protobuf:"bytes,7,rep,name=proof_epoch_submitted,json=proofEpochSubmitted,proto3" json:"proof_epoch_submitted,omitempty"` } func (m *ProofFinalizedChainInfo) Reset() { *m = ProofFinalizedChainInfo{} } func (m *ProofFinalizedChainInfo) String() string { return proto.CompactTextString(m) } func (*ProofFinalizedChainInfo) ProtoMessage() {} func (*ProofFinalizedChainInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_ab886e1868e5c5cd, []int{4} + return fileDescriptor_ab886e1868e5c5cd, []int{5} } func (m *ProofFinalizedChainInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -405,7 +498,7 @@ func (m *ProofFinalizedChainInfo) GetProofEpochSealed() *ProofEpochSealed { return nil } -func (m *ProofFinalizedChainInfo) GetProofEpochSubmitted() []*types2.TransactionInfo { +func (m *ProofFinalizedChainInfo) GetProofEpochSubmitted() []*types3.TransactionInfo { if m != nil { return m.ProofEpochSubmitted } @@ -416,6 +509,7 @@ func init() { proto.RegisterType((*IndexedHeader)(nil), "babylon.zoneconcierge.v1.IndexedHeader") proto.RegisterType((*Forks)(nil), "babylon.zoneconcierge.v1.Forks") proto.RegisterType((*ChainInfo)(nil), "babylon.zoneconcierge.v1.ChainInfo") + proto.RegisterType((*FinalizedChainInfo)(nil), "babylon.zoneconcierge.v1.FinalizedChainInfo") proto.RegisterType((*ProofEpochSealed)(nil), "babylon.zoneconcierge.v1.ProofEpochSealed") proto.RegisterType((*ProofFinalizedChainInfo)(nil), "babylon.zoneconcierge.v1.ProofFinalizedChainInfo") } @@ -425,52 +519,60 @@ func init() { } var fileDescriptor_ab886e1868e5c5cd = []byte{ - // 710 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0x41, 0x6f, 0xd3, 0x4a, - 0x10, 0xae, 0x9b, 0xb4, 0x7d, 0xdd, 0x24, 0x7d, 0x7d, 0xae, 0x1e, 0x75, 0x0b, 0x84, 0x28, 0x48, - 0x25, 0x20, 0x70, 0x94, 0x20, 0x2e, 0x5c, 0x10, 0x29, 0xad, 0x9a, 0x16, 0xa9, 0xc8, 0x8d, 0x0a, - 0x42, 0x42, 0xd6, 0xc6, 0xde, 0xc4, 0xab, 0x38, 0xbb, 0x96, 0x77, 0x1b, 0x25, 0xfd, 0x15, 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1, 0x4d, 0x07, - 0x95, 0x46, 0x38, 0xa4, 0x3e, 0x96, 0x3c, 0x76, 0x05, 0x91, 0x96, 0x01, 0xa2, 0x3e, 0x99, 0xb2, - 0x9a, 0x1b, 0xbf, 0x84, 0xd5, 0x69, 0x9a, 0xfe, 0x96, 0xca, 0xa0, 0x15, 0x8a, 0x23, 0x32, 0x71, - 0x8a, 0x53, 0x8c, 0x13, 0x22, 0xcd, 0x3d, 0xb4, 0x0e, 0x73, 0xaf, 0x6c, 0x77, 0x29, 0xeb, 0x71, - 0xad, 0xdc, 0xed, 0xec, 0xec, 0xa8, 0x15, 0xb1, 0x81, 0xd2, 0x71, 0x24, 0x9c, 0xb5, 0x68, 0x4a, - 0x0e, 0x8c, 0x39, 0x44, 0x1b, 0x59, 0x98, 0x11, 0x0e, 0x81, 0x60, 0xee, 0xcf, 0x48, 0xeb, 0x33, - 0xa4, 0x53, 0x1c, 0x9e, 0x10, 0x59, 0xfd, 0xb6, 0x88, 0x36, 0x21, 0xbc, 0x4f, 0x19, 0x0e, 0xe9, - 0x39, 0xf1, 0x67, 0x03, 0xf0, 0x0a, 0xfd, 0xa7, 0xde, 0x91, 0x63, 0x97, 0x32, 0xb7, 0x1b, 0x72, - 0x6f, 0xa0, 0x67, 0x7d, 0xeb, 0xd7, 0x59, 0xef, 0x8c, 0x01, 0x47, 0xb3, 0xed, 0x8c, 0xdb, 0xac, - 0x95, 0x14, 0x98, 0x47, 0xe8, 0x7f, 0x85, 0xa2, 0x3c, 0x49, 0x90, 0x66, 0x53, 0x7f, 0x6d, 0x6b, - 0xb2, 0x7c, 0x1d, 0x13, 0xca, 0x94, 0x53, 0x6d, 0xbd, 0x15, 0xef, 0x90, 0x99, 0x6d, 0x5d, 0x80, - 0x57, 0xb0, 0x18, 0x85, 0xe6, 0xa3, 0x9b, 0x07, 0xe6, 0xba, 0xbb, 0x59, 0x21, 0xb4, 0xdf, 0x1f, - 0x52, 0x9a, 0x1a, 0xf9, 0xac, 0x3b, 0xa4, 0x52, 0x12, 0xdf, 0x5a, 0x01, 0xdf, 0x1f, 0x4e, 0xc1, - 0xe7, 0xbf, 0x49, 0xa3, 0x86, 0xdd, 0x89, 0x31, 0x13, 0xd8, 0x93, 0x94, 0x83, 0x6c, 0xce, 0x46, - 0x06, 0x3b, 0x45, 0x69, 0x1d, 0x7f, 0xba, 0x2c, 0x1b, 0x17, 0x97, 0x65, 0xe3, 0xcb, 0x65, 0xd9, - 0xf8, 0x78, 0x55, 0x5e, 0xb8, 0xb8, 0x2a, 0x2f, 0x7c, 0xbe, 0x2a, 0x2f, 0xbc, 0x7f, 0xd6, 0xa7, - 0x32, 0x38, 0xeb, 0xda, 0x1e, 0x1f, 0xd6, 0xf5, 0x1b, 0xb0, 0x66, 0xe9, 0xa1, 0x3e, 0xbe, 0xf6, - 0x71, 0x06, 0xb9, 0xbb, 0xcb, 0xf0, 0x95, 0x7b, 0xfa, 0x33, 0x00, 0x00, 0xff, 0xff, 0xff, 0x75, - 0xe0, 0xb7, 0xc2, 0x05, 0x00, 0x00, + // 848 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x55, 0xdd, 0x6e, 0x1b, 0x45, + 0x14, 0xce, 0xc6, 0xf9, 0x21, 0xe3, 0x38, 0x84, 0x29, 0xd0, 0x4d, 0x00, 0x63, 0xb9, 0x52, 0x71, + 0x11, 0xac, 0xe5, 0x20, 0x2e, 0xe0, 0x06, 0x91, 0xd0, 0xd2, 0xb4, 0x88, 0xa2, 0x89, 0x5b, 0x10, + 0x12, 0x5a, 0xcd, 0xee, 0x8e, 0xbd, 0x23, 0xaf, 0x67, 0x56, 0x3b, 0x13, 0xd7, 0xee, 0x53, 0xf0, + 0x2a, 0xbc, 0x05, 0x97, 0xbd, 0xe4, 0x12, 0x25, 0xf0, 0x06, 0xdc, 0x70, 0x87, 0xf6, 0xcc, 0xec, + 0x7a, 0x5d, 0x6b,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ba, + 0xd1, 0xfd, 0x9f, 0xa2, 0xb7, 0x47, 0x45, 0x80, 0x6f, 0x41, 0x62, 0x24, 0xad, 0x0d, 0x77, 0xea, + 0x95, 0x97, 0xec, 0x04, 0x8f, 0xd6, 0x33, 0x7e, 0x81, 0x10, 0x34, 0x84, 0x21, 0x33, 0x36, 0x1c, + 0x97, 0x64, 0x65, 0x7f, 0xcf, 0x06, 0x1e, 0xf4, 0x08, 0xd9, 0x83, 0x2d, 0x08, 0xfd, 0x1e, 0x1d, + 0x64, 0xf4, 0xb9, 0xbf, 0x9c, 0x14, 0xdb, 0x94, 0xcb, 0x92, 0xac, 0x4c, 0x55, 0xce, 0x41, 0xe8, + 0xf3, 0xb3, 0x72, 0x8f, 0xb4, 0xb2, 0xea, 0x12, 0x3f, 0x45, 0x38, 0xd0, 0xa1, 0xaf, 0x2e, 0x83, + 0x29, 0x57, 0x8a, 0x4b, 0x91, 0x0f, 0x2a, 0x34, 0x6a, 0x95, 0x73, 0x75, 0xdc, 0x67, 0x03, 0xef, + 0xa2, 0xc4, 0x3f, 0x66, 0x0b, 0x72, 0x18, 0xe8, 0x70, 0x65, 0x07, 0x7f, 0x8b, 0xb6, 0xe1, 0x21, + 0x81, 0x5e, 0x6e, 0x9e, 0x0c, 0xea, 0x9d, 0xfa, 0x21, 0x87, 0xad, 0x57, 0x85, 0x98, 0xf8, 0xee, + 0xbf, 0x0e, 0x3a, 0x04, 0x08, 0x38, 0x71, 0xc1, 0x68, 0xc2, 0x22, 0x4c, 0x50, 0x6b, 0x46, 0x13, + 0x1e, 0x51, 0x2d, 0x33, 0x5f, 0x31, 0xed, 0x3a, 0x30, 0x08, 0x9f, 0xd6, 0x7b, 0xf0, 0xac, 0x80, + 0xff, 0xc8, 0x75, 0x7c, 0x9a, 0xa8, 0x5c, 0xf5, 0x7e, 0xc9, 0x71, 0xc1, 0x34, 0xbe, 0x8f, 0x0e, + 0x21, 0xa3, 0x5f, 0xa9, 0x8c, 0x29, 0xf3, 0x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 0x0b, 0xe5, 0xb4, + 0x6f, 0x73, 0xc0, 0x2b, 0x50, 0x2c, 0xfa, 0xf3, 0x57, 0xbe, 0xcf, 0x60, 0x77, 0xb0, 0x03, 0x5f, + 0xa6, 0xcf, 0xfe, 0x0b, 0x00, 0x00, 0xff, 0xff, 0x4c, 0xe5, 0x71, 0xc2, 0xc5, 0x07, 0x00, 0x00, } func (m *IndexedHeader) Marshal() (dAtA []byte, err error) { @@ -635,6 +737,96 @@ func (m *ChainInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *FinalizedChainInfo) 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 *FinalizedChainInfo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *FinalizedChainInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Proof != nil { + { + size, err := m.Proof.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintZoneconcierge(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + if m.BtcSubmissionKey != nil { + { + size, err := m.BtcSubmissionKey.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintZoneconcierge(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if m.RawCheckpoint != nil { + { + size, err := m.RawCheckpoint.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintZoneconcierge(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.EpochInfo != nil { + { + size, err := m.EpochInfo.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintZoneconcierge(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.FinalizedChainInfo != nil { + { + size, err := m.FinalizedChainInfo.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintZoneconcierge(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.ChainId) > 0 { + i -= len(m.ChainId) + copy(dAtA[i:], m.ChainId) + i = encodeVarintZoneconcierge(dAtA, i, uint64(len(m.ChainId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func (m *ProofEpochSealed) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -850,6 +1042,39 @@ func (m *ChainInfo) Size() (n int) { return n } +func (m *FinalizedChainInfo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ChainId) + if l > 0 { + n += 1 + l + sovZoneconcierge(uint64(l)) + } + if m.FinalizedChainInfo != nil { + l = m.FinalizedChainInfo.Size() + n += 1 + l + sovZoneconcierge(uint64(l)) + } + if m.EpochInfo != nil { + l = m.EpochInfo.Size() + n += 1 + l + sovZoneconcierge(uint64(l)) + } + if m.RawCheckpoint != nil { + l = m.RawCheckpoint.Size() + n += 1 + l + sovZoneconcierge(uint64(l)) + } + if m.BtcSubmissionKey != nil { + l = m.BtcSubmissionKey.Size() + n += 1 + l + sovZoneconcierge(uint64(l)) + } + if m.Proof != nil { + l = m.Proof.Size() + n += 1 + l + sovZoneconcierge(uint64(l)) + } + return n +} + func (m *ProofEpochSealed) Size() (n int) { if m == nil { return 0 @@ -1387,6 +1612,268 @@ func (m *ChainInfo) Unmarshal(dAtA []byte) error { } return nil } +func (m *FinalizedChainInfo) 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 ErrIntOverflowZoneconcierge + } + 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: FinalizedChainInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: FinalizedChainInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowZoneconcierge + } + 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 ErrInvalidLengthZoneconcierge + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthZoneconcierge + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChainId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FinalizedChainInfo", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowZoneconcierge + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthZoneconcierge + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthZoneconcierge + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.FinalizedChainInfo == nil { + m.FinalizedChainInfo = &ChainInfo{} + } + if err := m.FinalizedChainInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EpochInfo", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowZoneconcierge + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthZoneconcierge + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthZoneconcierge + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.EpochInfo == nil { + m.EpochInfo = &types1.Epoch{} + } + if err := m.EpochInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RawCheckpoint", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowZoneconcierge + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthZoneconcierge + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthZoneconcierge + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.RawCheckpoint == nil { + m.RawCheckpoint = &types2.RawCheckpoint{} + } + if err := m.RawCheckpoint.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BtcSubmissionKey", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowZoneconcierge + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthZoneconcierge + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthZoneconcierge + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.BtcSubmissionKey == nil { + m.BtcSubmissionKey = &types3.SubmissionKey{} + } + if err := m.BtcSubmissionKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Proof", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowZoneconcierge + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthZoneconcierge + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthZoneconcierge + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Proof == nil { + m.Proof = &ProofFinalizedChainInfo{} + } + if err := m.Proof.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipZoneconcierge(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthZoneconcierge + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *ProofEpochSealed) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -1445,7 +1932,7 @@ func (m *ProofEpochSealed) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ValidatorSet = append(m.ValidatorSet, &types1.ValidatorWithBlsKey{}) + m.ValidatorSet = append(m.ValidatorSet, &types2.ValidatorWithBlsKey{}) if err := m.ValidatorSet[len(m.ValidatorSet)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -1709,7 +2196,7 @@ func (m *ProofFinalizedChainInfo) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ProofEpochSubmitted = append(m.ProofEpochSubmitted, &types2.TransactionInfo{}) + m.ProofEpochSubmitted = append(m.ProofEpochSubmitted, &types3.TransactionInfo{}) if err := m.ProofEpochSubmitted[len(m.ProofEpochSubmitted)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err }