celestiaorg / celestia-app

PoS application for the consensus portion of the Celestia network. Built using celestia-core (fork of CometBFT) and the cosmos-sdk
https://celestia.org
Apache License 2.0
327 stars 265 forks source link

Expose all celestia-node required endpoints through gRPC #3421

Open liamsi opened 2 months ago

liamsi commented 2 months ago

Summary

Node has to use core's/comet's RPC additionally to gRPC. That is very confusing. The current app API is not sufficient and lead to bad design decisions in celestia-node which led to proposals that will manifest these even further https://github.com/celestiaorg/celestia-node/issues/2931

Problem Definition

Node currently uses both RPC (comet) and gRPC (app). Apparently, the only one reason for that is only comet's RPC exposes proofs for state queries currently, or rather ABCI queries (see #3422). Another reason, is that bridge nodes currently get their block data via RPC. That is also not ideal as the block data should be binary/protobuf encoded instead of a large JSON file.

If these two changed, celestia-node could solely rely on app's gRPC.

One of the places The only place where node uses rpc is here:

Proposal

liamsi commented 2 months ago

false alarm: https://github.com/celestiaorg/cosmos-sdk/blob/02244ae2a73e053234ca2de6e68a97974edb952a/client/grpc/tmservice/service.go#L221

liamsi commented 2 months ago

Actually, not quite: https://github.com/celestiaorg/celestia-app/pull/3423

Ferret-san commented 2 months ago

is it possible to expose these two methods from core, and eventually move the logic to node if possible?

https://github.com/celestiaorg/celestia-core/blob/793ece9bbd732aec3e09018e37dc31f4bfe122d9/rpc/core/routes.go#L33-L34

liamsi commented 2 months ago

is it possible to expose these two methods from core, and eventually move the logic to node if possible?

Yes, should be very, very easy!

and eventually move the logic to node if possible?

Also. Do you mind opening an issue in node for that? NVM: https://github.com/celestiaorg/celestia-node/issues/3364

walldiss commented 2 months ago

In addition to the subscribeBlock, bridge nodes rely on several other RPC endpoints from the celestia-core SignClient interface. Most can be replaced by implemented by the cosmos-sdk gRPC. Below is a comprehensive list of RPC methods used by bridge nodes, along with the corresponding gRPC methods in cosmos-sdk that can fetch the same data:

EventsClient:

SignClient:

Additional functionalities like ProveShares and DataRootInclusionProof are also missing in gRPC and should be proxied.

liamsi commented 1 month ago
Current services exposed by app (click to expand): ``` ⋊> ~/G/L/lazyledger-app on ad18465a grpcurl -plaintext localhost:9090 list celestia.blob.v1.Query celestia.mint.v1.Query celestia.qgb.v1.Query cosmos.auth.v1beta1.Query cosmos.authz.v1beta1.Query cosmos.bank.v1beta1.Query cosmos.base.node.v1beta1.Service cosmos.base.reflection.v1beta1.ReflectionService cosmos.base.reflection.v2alpha1.ReflectionService cosmos.base.tendermint.v1beta1.Service cosmos.distribution.v1beta1.Query cosmos.evidence.v1beta1.Query cosmos.feegrant.v1beta1.Query cosmos.gov.v1.Query cosmos.gov.v1beta1.Query cosmos.params.v1beta1.Query cosmos.slashing.v1beta1.Query cosmos.staking.v1beta1.Query cosmos.tx.v1beta1.Service grpc.reflection.v1alpha.ServerReflection ibc.applications.transfer.v1.Query ibc.core.channel.v1.Query ibc.core.client.v1.Query ibc.core.connection.v1.Query ----- ----- ⋊> ~/G/L/lazyledger-app on ad18465a grpcurl -plaintext localhost:9090 describe celestia.blob.v1.Query is a service: service Query { rpc Params ( .celestia.blob.v1.QueryParamsRequest ) returns ( .celestia.blob.v1.QueryParamsResponse ) { option (.google.api.http) = { get: "/blob/v1/params" }; } } celestia.mint.v1.Query is a service: service Query { rpc AnnualProvisions ( .celestia.mint.v1.QueryAnnualProvisionsRequest ) returns ( .celestia.mint.v1.QueryAnnualProvisionsResponse ) { option (.google.api.http) = { get: "/cosmos/mint/v1beta1/annual_provisions" }; } rpc GenesisTime ( .celestia.mint.v1.QueryGenesisTimeRequest ) returns ( .celestia.mint.v1.QueryGenesisTimeResponse ) { option (.google.api.http) = { get: "/cosmos/mint/v1beta1/genesis_time" }; } rpc InflationRate ( .celestia.mint.v1.QueryInflationRateRequest ) returns ( .celestia.mint.v1.QueryInflationRateResponse ) { option (.google.api.http) = { get: "/cosmos/mint/v1beta1/inflation_rate" }; } } celestia.qgb.v1.Query is a service: service Query { rpc AttestationRequestByNonce ( .celestia.qgb.v1.QueryAttestationRequestByNonceRequest ) returns ( .celestia.qgb.v1.QueryAttestationRequestByNonceResponse ) { option (.google.api.http) = { get: "/qgb/v1/attestations/requests/{nonce}" }; } rpc DataCommitmentRangeForHeight ( .celestia.qgb.v1.QueryDataCommitmentRangeForHeightRequest ) returns ( .celestia.qgb.v1.QueryDataCommitmentRangeForHeightResponse ) { option (.google.api.http) = { get: "/qgb/v1/data_commitment/range/height" }; } rpc EVMAddress ( .celestia.qgb.v1.QueryEVMAddressRequest ) returns ( .celestia.qgb.v1.QueryEVMAddressResponse ) { option (.google.api.http) = { get: "/qgb/v1/evm_address" }; } rpc EarliestAttestationNonce ( .celestia.qgb.v1.QueryEarliestAttestationNonceRequest ) returns ( .celestia.qgb.v1.QueryEarliestAttestationNonceResponse ) { option (.google.api.http) = { get: "/qgb/v1/attestations/nonce/earliest" }; } rpc LatestAttestationNonce ( .celestia.qgb.v1.QueryLatestAttestationNonceRequest ) returns ( .celestia.qgb.v1.QueryLatestAttestationNonceResponse ) { option (.google.api.http) = { get: "/qgb/v1/attestations/nonce/latest" }; } rpc LatestDataCommitment ( .celestia.qgb.v1.QueryLatestDataCommitmentRequest ) returns ( .celestia.qgb.v1.QueryLatestDataCommitmentResponse ) { option (.google.api.http) = { get: "/qgb/v1/data_commitment/latest" }; } rpc LatestUnbondingHeight ( .celestia.qgb.v1.QueryLatestUnbondingHeightRequest ) returns ( .celestia.qgb.v1.QueryLatestUnbondingHeightResponse ) { option (.google.api.http) = { get: "/qgb/v1/unbonding" }; } rpc LatestValsetRequestBeforeNonce ( .celestia.qgb.v1.QueryLatestValsetRequestBeforeNonceRequest ) returns ( .celestia.qgb.v1.QueryLatestValsetRequestBeforeNonceResponse ) { option (.google.api.http) = { get: "/qgb/v1/valset/request/before/{nonce}" }; } rpc Params ( .celestia.qgb.v1.QueryParamsRequest ) returns ( .celestia.qgb.v1.QueryParamsResponse ) { option (.google.api.http) = { get: "/qgb/v1/params" }; } } cosmos.auth.v1beta1.Query is a service: service Query { rpc Account ( .cosmos.auth.v1beta1.QueryAccountRequest ) returns ( .cosmos.auth.v1beta1.QueryAccountResponse ) { option (.google.api.http) = { get: "/cosmos/auth/v1beta1/accounts/{address}" }; } rpc AccountAddressByID ( .cosmos.auth.v1beta1.QueryAccountAddressByIDRequest ) returns ( .cosmos.auth.v1beta1.QueryAccountAddressByIDResponse ) { option (.google.api.http) = { get: "/cosmos/auth/v1beta1/address_by_id/{id}" }; } rpc Accounts ( .cosmos.auth.v1beta1.QueryAccountsRequest ) returns ( .cosmos.auth.v1beta1.QueryAccountsResponse ) { option (.google.api.http) = { get: "/cosmos/auth/v1beta1/accounts" }; } rpc AddressBytesToString ( .cosmos.auth.v1beta1.AddressBytesToStringRequest ) returns ( .cosmos.auth.v1beta1.AddressBytesToStringResponse ) { option (.google.api.http) = { get: "/cosmos/auth/v1beta1/bech32/{address_bytes}" }; } rpc AddressStringToBytes ( .cosmos.auth.v1beta1.AddressStringToBytesRequest ) returns ( .cosmos.auth.v1beta1.AddressStringToBytesResponse ) { option (.google.api.http) = { get: "/cosmos/auth/v1beta1/bech32/{address_string}" }; } rpc Bech32Prefix ( .cosmos.auth.v1beta1.Bech32PrefixRequest ) returns ( .cosmos.auth.v1beta1.Bech32PrefixResponse ) { option (.google.api.http) = { get: "/cosmos/auth/v1beta1/bech32" }; } rpc ModuleAccountByName ( .cosmos.auth.v1beta1.QueryModuleAccountByNameRequest ) returns ( .cosmos.auth.v1beta1.QueryModuleAccountByNameResponse ) { option (.google.api.http) = { get: "/cosmos/auth/v1beta1/module_accounts/{name}" }; } rpc ModuleAccounts ( .cosmos.auth.v1beta1.QueryModuleAccountsRequest ) returns ( .cosmos.auth.v1beta1.QueryModuleAccountsResponse ) { option (.google.api.http) = { get: "/cosmos/auth/v1beta1/module_accounts" }; } rpc Params ( .cosmos.auth.v1beta1.QueryParamsRequest ) returns ( .cosmos.auth.v1beta1.QueryParamsResponse ) { option (.google.api.http) = { get: "/cosmos/auth/v1beta1/params" }; } } cosmos.authz.v1beta1.Query is a service: service Query { rpc GranteeGrants ( .cosmos.authz.v1beta1.QueryGranteeGrantsRequest ) returns ( .cosmos.authz.v1beta1.QueryGranteeGrantsResponse ) { option (.google.api.http) = { get: "/cosmos/authz/v1beta1/grants/grantee/{grantee}" }; } rpc GranterGrants ( .cosmos.authz.v1beta1.QueryGranterGrantsRequest ) returns ( .cosmos.authz.v1beta1.QueryGranterGrantsResponse ) { option (.google.api.http) = { get: "/cosmos/authz/v1beta1/grants/granter/{granter}" }; } rpc Grants ( .cosmos.authz.v1beta1.QueryGrantsRequest ) returns ( .cosmos.authz.v1beta1.QueryGrantsResponse ) { option (.google.api.http) = { get: "/cosmos/authz/v1beta1/grants" }; } } cosmos.bank.v1beta1.Query is a service: service Query { rpc AllBalances ( .cosmos.bank.v1beta1.QueryAllBalancesRequest ) returns ( .cosmos.bank.v1beta1.QueryAllBalancesResponse ) { option (.google.api.http) = { get: "/cosmos/bank/v1beta1/balances/{address}" }; } rpc Balance ( .cosmos.bank.v1beta1.QueryBalanceRequest ) returns ( .cosmos.bank.v1beta1.QueryBalanceResponse ) { option (.google.api.http) = { get: "/cosmos/bank/v1beta1/balances/{address}/by_denom" }; } rpc DenomMetadata ( .cosmos.bank.v1beta1.QueryDenomMetadataRequest ) returns ( .cosmos.bank.v1beta1.QueryDenomMetadataResponse ) { option (.google.api.http) = { get: "/cosmos/bank/v1beta1/denoms_metadata/{denom}" }; } rpc DenomOwners ( .cosmos.bank.v1beta1.QueryDenomOwnersRequest ) returns ( .cosmos.bank.v1beta1.QueryDenomOwnersResponse ) { option (.google.api.http) = { get: "/cosmos/bank/v1beta1/denom_owners/{denom}" }; } rpc DenomsMetadata ( .cosmos.bank.v1beta1.QueryDenomsMetadataRequest ) returns ( .cosmos.bank.v1beta1.QueryDenomsMetadataResponse ) { option (.google.api.http) = { get: "/cosmos/bank/v1beta1/denoms_metadata" }; } rpc Params ( .cosmos.bank.v1beta1.QueryParamsRequest ) returns ( .cosmos.bank.v1beta1.QueryParamsResponse ) { option (.google.api.http) = { get: "/cosmos/bank/v1beta1/params" }; } rpc SpendableBalances ( .cosmos.bank.v1beta1.QuerySpendableBalancesRequest ) returns ( .cosmos.bank.v1beta1.QuerySpendableBalancesResponse ) { option (.google.api.http) = { get: "/cosmos/bank/v1beta1/spendable_balances/{address}" }; } rpc SupplyOf ( .cosmos.bank.v1beta1.QuerySupplyOfRequest ) returns ( .cosmos.bank.v1beta1.QuerySupplyOfResponse ) { option (.google.api.http) = { get: "/cosmos/bank/v1beta1/supply/by_denom" }; } rpc TotalSupply ( .cosmos.bank.v1beta1.QueryTotalSupplyRequest ) returns ( .cosmos.bank.v1beta1.QueryTotalSupplyResponse ) { option (.google.api.http) = { get: "/cosmos/bank/v1beta1/supply" }; } } cosmos.base.node.v1beta1.Service is a service: service Service { rpc Config ( .cosmos.base.node.v1beta1.ConfigRequest ) returns ( .cosmos.base.node.v1beta1.ConfigResponse ) { option (.google.api.http) = { get: "/cosmos/base/node/v1beta1/config" }; } } cosmos.base.reflection.v1beta1.ReflectionService is a service: service ReflectionService { rpc ListAllInterfaces ( .cosmos.base.reflection.v1beta1.ListAllInterfacesRequest ) returns ( .cosmos.base.reflection.v1beta1.ListAllInterfacesResponse ) { option (.google.api.http) = { get: "/cosmos/base/reflection/v1beta1/interfaces" }; } rpc ListImplementations ( .cosmos.base.reflection.v1beta1.ListImplementationsRequest ) returns ( .cosmos.base.reflection.v1beta1.ListImplementationsResponse ) { option (.google.api.http) = { get: "/cosmos/base/reflection/v1beta1/interfaces/{interface_name}/implementations" }; } } cosmos.base.reflection.v2alpha1.ReflectionService is a service: service ReflectionService { rpc GetAuthnDescriptor ( .cosmos.base.reflection.v2alpha1.GetAuthnDescriptorRequest ) returns ( .cosmos.base.reflection.v2alpha1.GetAuthnDescriptorResponse ) { option (.google.api.http) = { get: "/cosmos/base/reflection/v1beta1/app_descriptor/authn" }; } rpc GetChainDescriptor ( .cosmos.base.reflection.v2alpha1.GetChainDescriptorRequest ) returns ( .cosmos.base.reflection.v2alpha1.GetChainDescriptorResponse ) { option (.google.api.http) = { get: "/cosmos/base/reflection/v1beta1/app_descriptor/chain" }; } rpc GetCodecDescriptor ( .cosmos.base.reflection.v2alpha1.GetCodecDescriptorRequest ) returns ( .cosmos.base.reflection.v2alpha1.GetCodecDescriptorResponse ) { option (.google.api.http) = { get: "/cosmos/base/reflection/v1beta1/app_descriptor/codec" }; } rpc GetConfigurationDescriptor ( .cosmos.base.reflection.v2alpha1.GetConfigurationDescriptorRequest ) returns ( .cosmos.base.reflection.v2alpha1.GetConfigurationDescriptorResponse ) { option (.google.api.http) = { get: "/cosmos/base/reflection/v1beta1/app_descriptor/configuration" }; } rpc GetQueryServicesDescriptor ( .cosmos.base.reflection.v2alpha1.GetQueryServicesDescriptorRequest ) returns ( .cosmos.base.reflection.v2alpha1.GetQueryServicesDescriptorResponse ) { option (.google.api.http) = { get: "/cosmos/base/reflection/v1beta1/app_descriptor/query_services" }; } rpc GetTxDescriptor ( .cosmos.base.reflection.v2alpha1.GetTxDescriptorRequest ) returns ( .cosmos.base.reflection.v2alpha1.GetTxDescriptorResponse ) { option (.google.api.http) = { get: "/cosmos/base/reflection/v1beta1/app_descriptor/tx_descriptor" }; } } cosmos.base.tendermint.v1beta1.Service is a service: service Service { rpc ABCIQuery ( .cosmos.base.tendermint.v1beta1.ABCIQueryRequest ) returns ( .cosmos.base.tendermint.v1beta1.ABCIQueryResponse ) { option (.google.api.http) = { get: "/cosmos/base/tendermint/v1beta1/abci_query" }; } rpc GetBlockByHeight ( .cosmos.base.tendermint.v1beta1.GetBlockByHeightRequest ) returns ( .cosmos.base.tendermint.v1beta1.GetBlockByHeightResponse ) { option (.google.api.http) = { get: "/cosmos/base/tendermint/v1beta1/blocks/{height}" }; } rpc GetLatestBlock ( .cosmos.base.tendermint.v1beta1.GetLatestBlockRequest ) returns ( .cosmos.base.tendermint.v1beta1.GetLatestBlockResponse ) { option (.google.api.http) = { get: "/cosmos/base/tendermint/v1beta1/blocks/latest" }; } rpc GetLatestValidatorSet ( .cosmos.base.tendermint.v1beta1.GetLatestValidatorSetRequest ) returns ( .cosmos.base.tendermint.v1beta1.GetLatestValidatorSetResponse ) { option (.google.api.http) = { get: "/cosmos/base/tendermint/v1beta1/validatorsets/latest" }; } rpc GetNodeInfo ( .cosmos.base.tendermint.v1beta1.GetNodeInfoRequest ) returns ( .cosmos.base.tendermint.v1beta1.GetNodeInfoResponse ) { option (.google.api.http) = { get: "/cosmos/base/tendermint/v1beta1/node_info" }; } rpc GetSyncing ( .cosmos.base.tendermint.v1beta1.GetSyncingRequest ) returns ( .cosmos.base.tendermint.v1beta1.GetSyncingResponse ) { option (.google.api.http) = { get: "/cosmos/base/tendermint/v1beta1/syncing" }; } rpc GetValidatorSetByHeight ( .cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightRequest ) returns ( .cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightResponse ) { option (.google.api.http) = { get: "/cosmos/base/tendermint/v1beta1/validatorsets/{height}" }; } } cosmos.distribution.v1beta1.Query is a service: service Query { rpc CommunityPool ( .cosmos.distribution.v1beta1.QueryCommunityPoolRequest ) returns ( .cosmos.distribution.v1beta1.QueryCommunityPoolResponse ) { option (.google.api.http) = { get: "/cosmos/distribution/v1beta1/community_pool" }; } rpc DelegationRewards ( .cosmos.distribution.v1beta1.QueryDelegationRewardsRequest ) returns ( .cosmos.distribution.v1beta1.QueryDelegationRewardsResponse ) { option (.google.api.http) = { get: "/cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards/{validator_address}" }; } rpc DelegationTotalRewards ( .cosmos.distribution.v1beta1.QueryDelegationTotalRewardsRequest ) returns ( .cosmos.distribution.v1beta1.QueryDelegationTotalRewardsResponse ) { option (.google.api.http) = { get: "/cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards" }; } rpc DelegatorValidators ( .cosmos.distribution.v1beta1.QueryDelegatorValidatorsRequest ) returns ( .cosmos.distribution.v1beta1.QueryDelegatorValidatorsResponse ) { option (.google.api.http) = { get: "/cosmos/distribution/v1beta1/delegators/{delegator_address}/validators" }; } rpc DelegatorWithdrawAddress ( .cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressRequest ) returns ( .cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressResponse ) { option (.google.api.http) = { get: "/cosmos/distribution/v1beta1/delegators/{delegator_address}/withdraw_address" }; } rpc Params ( .cosmos.distribution.v1beta1.QueryParamsRequest ) returns ( .cosmos.distribution.v1beta1.QueryParamsResponse ) { option (.google.api.http) = { get: "/cosmos/distribution/v1beta1/params" }; } rpc ValidatorCommission ( .cosmos.distribution.v1beta1.QueryValidatorCommissionRequest ) returns ( .cosmos.distribution.v1beta1.QueryValidatorCommissionResponse ) { option (.google.api.http) = { get: "/cosmos/distribution/v1beta1/validators/{validator_address}/commission" }; } rpc ValidatorOutstandingRewards ( .cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsRequest ) returns ( .cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsResponse ) { option (.google.api.http) = { get: "/cosmos/distribution/v1beta1/validators/{validator_address}/outstanding_rewards" }; } rpc ValidatorSlashes ( .cosmos.distribution.v1beta1.QueryValidatorSlashesRequest ) returns ( .cosmos.distribution.v1beta1.QueryValidatorSlashesResponse ) { option (.google.api.http) = { get: "/cosmos/distribution/v1beta1/validators/{validator_address}/slashes" }; } } cosmos.evidence.v1beta1.Query is a service: service Query { rpc AllEvidence ( .cosmos.evidence.v1beta1.QueryAllEvidenceRequest ) returns ( .cosmos.evidence.v1beta1.QueryAllEvidenceResponse ) { option (.google.api.http) = { get: "/cosmos/evidence/v1beta1/evidence" }; } rpc Evidence ( .cosmos.evidence.v1beta1.QueryEvidenceRequest ) returns ( .cosmos.evidence.v1beta1.QueryEvidenceResponse ) { option (.google.api.http) = { get: "/cosmos/evidence/v1beta1/evidence/{evidence_hash}" }; } } cosmos.feegrant.v1beta1.Query is a service: service Query { rpc Allowance ( .cosmos.feegrant.v1beta1.QueryAllowanceRequest ) returns ( .cosmos.feegrant.v1beta1.QueryAllowanceResponse ) { option (.google.api.http) = { get: "/cosmos/feegrant/v1beta1/allowance/{granter}/{grantee}" }; } rpc Allowances ( .cosmos.feegrant.v1beta1.QueryAllowancesRequest ) returns ( .cosmos.feegrant.v1beta1.QueryAllowancesResponse ) { option (.google.api.http) = { get: "/cosmos/feegrant/v1beta1/allowances/{grantee}" }; } rpc AllowancesByGranter ( .cosmos.feegrant.v1beta1.QueryAllowancesByGranterRequest ) returns ( .cosmos.feegrant.v1beta1.QueryAllowancesByGranterResponse ) { option (.google.api.http) = { get: "/cosmos/feegrant/v1beta1/issued/{granter}" }; } } cosmos.gov.v1.Query is a service: service Query { rpc Deposit ( .cosmos.gov.v1.QueryDepositRequest ) returns ( .cosmos.gov.v1.QueryDepositResponse ) { option (.google.api.http) = { get: "/cosmos/gov/v1/proposals/{proposal_id}/deposits/{depositor}" }; } rpc Deposits ( .cosmos.gov.v1.QueryDepositsRequest ) returns ( .cosmos.gov.v1.QueryDepositsResponse ) { option (.google.api.http) = { get: "/cosmos/gov/v1/proposals/{proposal_id}/deposits" }; } rpc Params ( .cosmos.gov.v1.QueryParamsRequest ) returns ( .cosmos.gov.v1.QueryParamsResponse ) { option (.google.api.http) = { get: "/cosmos/gov/v1/params/{params_type}" }; } rpc Proposal ( .cosmos.gov.v1.QueryProposalRequest ) returns ( .cosmos.gov.v1.QueryProposalResponse ) { option (.google.api.http) = { get: "/cosmos/gov/v1/proposals/{proposal_id}" }; } rpc Proposals ( .cosmos.gov.v1.QueryProposalsRequest ) returns ( .cosmos.gov.v1.QueryProposalsResponse ) { option (.google.api.http) = { get: "/cosmos/gov/v1/proposals" }; } rpc TallyResult ( .cosmos.gov.v1.QueryTallyResultRequest ) returns ( .cosmos.gov.v1.QueryTallyResultResponse ) { option (.google.api.http) = { get: "/cosmos/gov/v1/proposals/{proposal_id}/tally" }; } rpc Vote ( .cosmos.gov.v1.QueryVoteRequest ) returns ( .cosmos.gov.v1.QueryVoteResponse ) { option (.google.api.http) = { get: "/cosmos/gov/v1/proposals/{proposal_id}/votes/{voter}" }; } rpc Votes ( .cosmos.gov.v1.QueryVotesRequest ) returns ( .cosmos.gov.v1.QueryVotesResponse ) { option (.google.api.http) = { get: "/cosmos/gov/v1/proposals/{proposal_id}/votes" }; } } cosmos.gov.v1beta1.Query is a service: service Query { rpc Deposit ( .cosmos.gov.v1beta1.QueryDepositRequest ) returns ( .cosmos.gov.v1beta1.QueryDepositResponse ) { option (.google.api.http) = { get: "/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits/{depositor}" }; } rpc Deposits ( .cosmos.gov.v1beta1.QueryDepositsRequest ) returns ( .cosmos.gov.v1beta1.QueryDepositsResponse ) { option (.google.api.http) = { get: "/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits" }; } rpc Params ( .cosmos.gov.v1beta1.QueryParamsRequest ) returns ( .cosmos.gov.v1beta1.QueryParamsResponse ) { option (.google.api.http) = { get: "/cosmos/gov/v1beta1/params/{params_type}" }; } rpc Proposal ( .cosmos.gov.v1beta1.QueryProposalRequest ) returns ( .cosmos.gov.v1beta1.QueryProposalResponse ) { option (.google.api.http) = { get: "/cosmos/gov/v1beta1/proposals/{proposal_id}" }; } rpc Proposals ( .cosmos.gov.v1beta1.QueryProposalsRequest ) returns ( .cosmos.gov.v1beta1.QueryProposalsResponse ) { option (.google.api.http) = { get: "/cosmos/gov/v1beta1/proposals" }; } rpc TallyResult ( .cosmos.gov.v1beta1.QueryTallyResultRequest ) returns ( .cosmos.gov.v1beta1.QueryTallyResultResponse ) { option (.google.api.http) = { get: "/cosmos/gov/v1beta1/proposals/{proposal_id}/tally" }; } rpc Vote ( .cosmos.gov.v1beta1.QueryVoteRequest ) returns ( .cosmos.gov.v1beta1.QueryVoteResponse ) { option (.google.api.http) = { get: "/cosmos/gov/v1beta1/proposals/{proposal_id}/votes/{voter}" }; } rpc Votes ( .cosmos.gov.v1beta1.QueryVotesRequest ) returns ( .cosmos.gov.v1beta1.QueryVotesResponse ) { option (.google.api.http) = { get: "/cosmos/gov/v1beta1/proposals/{proposal_id}/votes" }; } } cosmos.params.v1beta1.Query is a service: service Query { rpc Params ( .cosmos.params.v1beta1.QueryParamsRequest ) returns ( .cosmos.params.v1beta1.QueryParamsResponse ) { option (.google.api.http) = { get: "/cosmos/params/v1beta1/params" }; } rpc Subspaces ( .cosmos.params.v1beta1.QuerySubspacesRequest ) returns ( .cosmos.params.v1beta1.QuerySubspacesResponse ) { option (.google.api.http) = { get: "/cosmos/params/v1beta1/subspaces" }; } } cosmos.slashing.v1beta1.Query is a service: service Query { rpc Params ( .cosmos.slashing.v1beta1.QueryParamsRequest ) returns ( .cosmos.slashing.v1beta1.QueryParamsResponse ) { option (.google.api.http) = { get: "/cosmos/slashing/v1beta1/params" }; } rpc SigningInfo ( .cosmos.slashing.v1beta1.QuerySigningInfoRequest ) returns ( .cosmos.slashing.v1beta1.QuerySigningInfoResponse ) { option (.google.api.http) = { get: "/cosmos/slashing/v1beta1/signing_infos/{cons_address}" }; } rpc SigningInfos ( .cosmos.slashing.v1beta1.QuerySigningInfosRequest ) returns ( .cosmos.slashing.v1beta1.QuerySigningInfosResponse ) { option (.google.api.http) = { get: "/cosmos/slashing/v1beta1/signing_infos" }; } } cosmos.staking.v1beta1.Query is a service: service Query { rpc Delegation ( .cosmos.staking.v1beta1.QueryDelegationRequest ) returns ( .cosmos.staking.v1beta1.QueryDelegationResponse ) { option (.google.api.http) = { get: "/cosmos/staking/v1beta1/validators/{validator_addr}/delegations/{delegator_addr}" }; } rpc DelegatorDelegations ( .cosmos.staking.v1beta1.QueryDelegatorDelegationsRequest ) returns ( .cosmos.staking.v1beta1.QueryDelegatorDelegationsResponse ) { option (.google.api.http) = { get: "/cosmos/staking/v1beta1/delegations/{delegator_addr}" }; } rpc DelegatorUnbondingDelegations ( .cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsRequest ) returns ( .cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsResponse ) { option (.google.api.http) = { get: "/cosmos/staking/v1beta1/delegators/{delegator_addr}/unbonding_delegations" }; } rpc DelegatorValidator ( .cosmos.staking.v1beta1.QueryDelegatorValidatorRequest ) returns ( .cosmos.staking.v1beta1.QueryDelegatorValidatorResponse ) { option (.google.api.http) = { get: "/cosmos/staking/v1beta1/delegators/{delegator_addr}/validators/{validator_addr}" }; } rpc DelegatorValidators ( .cosmos.staking.v1beta1.QueryDelegatorValidatorsRequest ) returns ( .cosmos.staking.v1beta1.QueryDelegatorValidatorsResponse ) { option (.google.api.http) = { get: "/cosmos/staking/v1beta1/delegators/{delegator_addr}/validators" }; } rpc HistoricalInfo ( .cosmos.staking.v1beta1.QueryHistoricalInfoRequest ) returns ( .cosmos.staking.v1beta1.QueryHistoricalInfoResponse ) { option (.google.api.http) = { get: "/cosmos/staking/v1beta1/historical_info/{height}" }; } rpc Params ( .cosmos.staking.v1beta1.QueryParamsRequest ) returns ( .cosmos.staking.v1beta1.QueryParamsResponse ) { option (.google.api.http) = { get: "/cosmos/staking/v1beta1/params" }; } rpc Pool ( .cosmos.staking.v1beta1.QueryPoolRequest ) returns ( .cosmos.staking.v1beta1.QueryPoolResponse ) { option (.google.api.http) = { get: "/cosmos/staking/v1beta1/pool" }; } rpc Redelegations ( .cosmos.staking.v1beta1.QueryRedelegationsRequest ) returns ( .cosmos.staking.v1beta1.QueryRedelegationsResponse ) { option (.google.api.http) = { get: "/cosmos/staking/v1beta1/delegators/{delegator_addr}/redelegations" }; } rpc UnbondingDelegation ( .cosmos.staking.v1beta1.QueryUnbondingDelegationRequest ) returns ( .cosmos.staking.v1beta1.QueryUnbondingDelegationResponse ) { option (.google.api.http) = { get: "/cosmos/staking/v1beta1/validators/{validator_addr}/delegations/{delegator_addr}/unbonding_delegation" }; } rpc Validator ( .cosmos.staking.v1beta1.QueryValidatorRequest ) returns ( .cosmos.staking.v1beta1.QueryValidatorResponse ) { option (.google.api.http) = { get: "/cosmos/staking/v1beta1/validators/{validator_addr}" }; } rpc ValidatorDelegations ( .cosmos.staking.v1beta1.QueryValidatorDelegationsRequest ) returns ( .cosmos.staking.v1beta1.QueryValidatorDelegationsResponse ) { option (.google.api.http) = { get: "/cosmos/staking/v1beta1/validators/{validator_addr}/delegations" }; } rpc ValidatorUnbondingDelegations ( .cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsRequest ) returns ( .cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsResponse ) { option (.google.api.http) = { get: "/cosmos/staking/v1beta1/validators/{validator_addr}/unbonding_delegations" }; } rpc Validators ( .cosmos.staking.v1beta1.QueryValidatorsRequest ) returns ( .cosmos.staking.v1beta1.QueryValidatorsResponse ) { option (.google.api.http) = { get: "/cosmos/staking/v1beta1/validators" }; } } cosmos.tx.v1beta1.Service is a service: service Service { rpc BroadcastTx ( .cosmos.tx.v1beta1.BroadcastTxRequest ) returns ( .cosmos.tx.v1beta1.BroadcastTxResponse ) { option (.google.api.http) = { post: "/cosmos/tx/v1beta1/txs", body: "*" }; } rpc GetBlockWithTxs ( .cosmos.tx.v1beta1.GetBlockWithTxsRequest ) returns ( .cosmos.tx.v1beta1.GetBlockWithTxsResponse ) { option (.google.api.http) = { get: "/cosmos/tx/v1beta1/txs/block/{height}" }; } rpc GetTx ( .cosmos.tx.v1beta1.GetTxRequest ) returns ( .cosmos.tx.v1beta1.GetTxResponse ) { option (.google.api.http) = { get: "/cosmos/tx/v1beta1/txs/{hash}" }; } rpc GetTxsEvent ( .cosmos.tx.v1beta1.GetTxsEventRequest ) returns ( .cosmos.tx.v1beta1.GetTxsEventResponse ) { option (.google.api.http) = { get: "/cosmos/tx/v1beta1/txs" }; } rpc Simulate ( .cosmos.tx.v1beta1.SimulateRequest ) returns ( .cosmos.tx.v1beta1.SimulateResponse ) { option (.google.api.http) = { post: "/cosmos/tx/v1beta1/simulate", body: "*" }; } } grpc.reflection.v1alpha.ServerReflection is a service: service ServerReflection { rpc ServerReflectionInfo ( stream .grpc.reflection.v1alpha.ServerReflectionRequest ) returns ( stream .grpc.reflection.v1alpha.ServerReflectionResponse ); } ibc.applications.transfer.v1.Query is a service: service Query { rpc DenomHash ( .ibc.applications.transfer.v1.QueryDenomHashRequest ) returns ( .ibc.applications.transfer.v1.QueryDenomHashResponse ) { option (.google.api.http) = { get: "/ibc/apps/transfer/v1/denom_hashes/{trace=**}" }; } rpc DenomTrace ( .ibc.applications.transfer.v1.QueryDenomTraceRequest ) returns ( .ibc.applications.transfer.v1.QueryDenomTraceResponse ) { option (.google.api.http) = { get: "/ibc/apps/transfer/v1/denom_traces/{hash=**}" }; } rpc DenomTraces ( .ibc.applications.transfer.v1.QueryDenomTracesRequest ) returns ( .ibc.applications.transfer.v1.QueryDenomTracesResponse ) { option (.google.api.http) = { get: "/ibc/apps/transfer/v1/denom_traces" }; } rpc EscrowAddress ( .ibc.applications.transfer.v1.QueryEscrowAddressRequest ) returns ( .ibc.applications.transfer.v1.QueryEscrowAddressResponse ) { option (.google.api.http) = { get: "/ibc/apps/transfer/v1/channels/{channel_id}/ports/{port_id}/escrow_address" }; } rpc Params ( .ibc.applications.transfer.v1.QueryParamsRequest ) returns ( .ibc.applications.transfer.v1.QueryParamsResponse ) { option (.google.api.http) = { get: "/ibc/apps/transfer/v1/params" }; } } ibc.core.channel.v1.Query is a service: service Query { rpc Channel ( .ibc.core.channel.v1.QueryChannelRequest ) returns ( .ibc.core.channel.v1.QueryChannelResponse ) { option (.google.api.http) = { get: "/ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}" }; } rpc ChannelClientState ( .ibc.core.channel.v1.QueryChannelClientStateRequest ) returns ( .ibc.core.channel.v1.QueryChannelClientStateResponse ) { option (.google.api.http) = { get: "/ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/client_state" }; } rpc ChannelConsensusState ( .ibc.core.channel.v1.QueryChannelConsensusStateRequest ) returns ( .ibc.core.channel.v1.QueryChannelConsensusStateResponse ) { option (.google.api.http) = { get: "/ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/consensus_state/revision/{revision_number}/height/{revision_height}" }; } rpc Channels ( .ibc.core.channel.v1.QueryChannelsRequest ) returns ( .ibc.core.channel.v1.QueryChannelsResponse ) { option (.google.api.http) = { get: "/ibc/core/channel/v1/channels" }; } rpc ConnectionChannels ( .ibc.core.channel.v1.QueryConnectionChannelsRequest ) returns ( .ibc.core.channel.v1.QueryConnectionChannelsResponse ) { option (.google.api.http) = { get: "/ibc/core/channel/v1/connections/{connection}/channels" }; } rpc NextSequenceReceive ( .ibc.core.channel.v1.QueryNextSequenceReceiveRequest ) returns ( .ibc.core.channel.v1.QueryNextSequenceReceiveResponse ) { option (.google.api.http) = { get: "/ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/next_sequence" }; } rpc PacketAcknowledgement ( .ibc.core.channel.v1.QueryPacketAcknowledgementRequest ) returns ( .ibc.core.channel.v1.QueryPacketAcknowledgementResponse ) { option (.google.api.http) = { get: "/ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/packet_acks/{sequence}" }; } rpc PacketAcknowledgements ( .ibc.core.channel.v1.QueryPacketAcknowledgementsRequest ) returns ( .ibc.core.channel.v1.QueryPacketAcknowledgementsResponse ) { option (.google.api.http) = { get: "/ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/packet_acknowledgements" }; } rpc PacketCommitment ( .ibc.core.channel.v1.QueryPacketCommitmentRequest ) returns ( .ibc.core.channel.v1.QueryPacketCommitmentResponse ) { option (.google.api.http) = { get: "/ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/packet_commitments/{sequence}" }; } rpc PacketCommitments ( .ibc.core.channel.v1.QueryPacketCommitmentsRequest ) returns ( .ibc.core.channel.v1.QueryPacketCommitmentsResponse ) { option (.google.api.http) = { get: "/ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/packet_commitments" }; } rpc PacketReceipt ( .ibc.core.channel.v1.QueryPacketReceiptRequest ) returns ( .ibc.core.channel.v1.QueryPacketReceiptResponse ) { option (.google.api.http) = { get: "/ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/packet_receipts/{sequence}" }; } rpc UnreceivedAcks ( .ibc.core.channel.v1.QueryUnreceivedAcksRequest ) returns ( .ibc.core.channel.v1.QueryUnreceivedAcksResponse ) { option (.google.api.http) = { get: "/ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/packet_commitments/{packet_ack_sequences}/unreceived_acks" }; } rpc UnreceivedPackets ( .ibc.core.channel.v1.QueryUnreceivedPacketsRequest ) returns ( .ibc.core.channel.v1.QueryUnreceivedPacketsResponse ) { option (.google.api.http) = { get: "/ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/packet_commitments/{packet_commitment_sequences}/unreceived_packets" }; } } ibc.core.client.v1.Query is a service: service Query { rpc ClientParams ( .ibc.core.client.v1.QueryClientParamsRequest ) returns ( .ibc.core.client.v1.QueryClientParamsResponse ) { option (.google.api.http) = { get: "/ibc/core/client/v1/params" }; } rpc ClientState ( .ibc.core.client.v1.QueryClientStateRequest ) returns ( .ibc.core.client.v1.QueryClientStateResponse ) { option (.google.api.http) = { get: "/ibc/core/client/v1/client_states/{client_id}" }; } rpc ClientStates ( .ibc.core.client.v1.QueryClientStatesRequest ) returns ( .ibc.core.client.v1.QueryClientStatesResponse ) { option (.google.api.http) = { get: "/ibc/core/client/v1/client_states" }; } rpc ClientStatus ( .ibc.core.client.v1.QueryClientStatusRequest ) returns ( .ibc.core.client.v1.QueryClientStatusResponse ) { option (.google.api.http) = { get: "/ibc/core/client/v1/client_status/{client_id}" }; } rpc ConsensusState ( .ibc.core.client.v1.QueryConsensusStateRequest ) returns ( .ibc.core.client.v1.QueryConsensusStateResponse ) { option (.google.api.http) = { get: "/ibc/core/client/v1/consensus_states/{client_id}/revision/{revision_number}/height/{revision_height}" }; } rpc ConsensusStateHeights ( .ibc.core.client.v1.QueryConsensusStateHeightsRequest ) returns ( .ibc.core.client.v1.QueryConsensusStateHeightsResponse ) { option (.google.api.http) = { get: "/ibc/core/client/v1/consensus_states/{client_id}/heights" }; } rpc ConsensusStates ( .ibc.core.client.v1.QueryConsensusStatesRequest ) returns ( .ibc.core.client.v1.QueryConsensusStatesResponse ) { option (.google.api.http) = { get: "/ibc/core/client/v1/consensus_states/{client_id}" }; } rpc UpgradedClientState ( .ibc.core.client.v1.QueryUpgradedClientStateRequest ) returns ( .ibc.core.client.v1.QueryUpgradedClientStateResponse ) { option (.google.api.http) = { get: "/ibc/core/client/v1/upgraded_client_states" }; } rpc UpgradedConsensusState ( .ibc.core.client.v1.QueryUpgradedConsensusStateRequest ) returns ( .ibc.core.client.v1.QueryUpgradedConsensusStateResponse ) { option (.google.api.http) = { get: "/ibc/core/client/v1/upgraded_consensus_states" }; } } ibc.core.connection.v1.Query is a service: service Query { rpc ClientConnections ( .ibc.core.connection.v1.QueryClientConnectionsRequest ) returns ( .ibc.core.connection.v1.QueryClientConnectionsResponse ) { option (.google.api.http) = { get: "/ibc/core/connection/v1/client_connections/{client_id}" }; } rpc Connection ( .ibc.core.connection.v1.QueryConnectionRequest ) returns ( .ibc.core.connection.v1.QueryConnectionResponse ) { option (.google.api.http) = { get: "/ibc/core/connection/v1/connections/{connection_id}" }; } rpc ConnectionClientState ( .ibc.core.connection.v1.QueryConnectionClientStateRequest ) returns ( .ibc.core.connection.v1.QueryConnectionClientStateResponse ) { option (.google.api.http) = { get: "/ibc/core/connection/v1/connections/{connection_id}/client_state" }; } rpc ConnectionConsensusState ( .ibc.core.connection.v1.QueryConnectionConsensusStateRequest ) returns ( .ibc.core.connection.v1.QueryConnectionConsensusStateResponse ) { option (.google.api.http) = { get: "/ibc/core/connection/v1/connections/{connection_id}/consensus_state/revision/{revision_number}/height/{revision_height}" }; } rpc ConnectionParams ( .ibc.core.connection.v1.QueryConnectionParamsRequest ) returns ( .ibc.core.connection.v1.QueryConnectionParamsResponse ) { option (.google.api.http) = { get: "/ibc/core/connection/v1/params" }; } rpc Connections ( .ibc.core.connection.v1.QueryConnectionsRequest ) returns ( .ibc.core.connection.v1.QueryConnectionsResponse ) { option (.google.api.http) = { get: "/ibc/core/connection/v1/connections" }; } } ```

Decide on adding missing functionality to existing services (e.g. cosmos.base.tendermint.v1beta1.Service) or add a new service that is specific to node/celestia. The latter is probably cleaner and preferable.

walldiss commented 1 month ago

An additional point is that the block gRPC API should be designed to support larger blocks, so we won't need to rework it as block sizes increase.

cmwaters commented 3 weeks ago

Additional functionalities like ProveShares and DataRootInclusionProof are also missing in gRPC and should be proxied.

Full nodes should be able to handle these queries themselves since they have all the relevant data. I think ProveShares should really be deprecated and removed on the celestia-app side because it's a DoS vector (you need to build the square everytime)

cmwaters commented 3 weeks ago

add a new service that is specific to node/celestia. The latter is probably cleaner and preferable.

I think we should just add it as a new service. Generally we should reduce the amount of bespoke code we have in cosmos-sdk if we eventually plan to unfork oursleves