Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to SDK v0.43+ #948

Merged
merged 45 commits into from
Aug 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
f896b01
Adapted proto compiler. Regenerated Rust files
adizere May 10, 2021
33a0e19
Adapt to newer namespace for apps.
adizere May 10, 2021
fc0eab5
Manual fix for Staking erroneous compilation
adizere May 10, 2021
30688a4
Workaround: disabled chain upgrade
adizere May 10, 2021
abf6dba
Added specific GRPC-web port to prevent conflict on 9091.
adizere May 11, 2021
2d1e51a
Merge branch 'master' into adi/ibc-go-1-proto
ancazamfir May 14, 2021
9c64b9f
Upgrade protos
ancazamfir May 14, 2021
b824869
Add support for new message action strings
ancazamfir May 15, 2021
0e9bdb8
Improved output for one-chain script
adizere May 11, 2021
c06fc0c
Merge branch 'master' into adi/ibc-go-1-proto
adizere May 17, 2021
d4ec4a8
CLI for chain upgrade proposal adapted to gaia v5.
adizere May 17, 2021
cb77abe
Merge branch 'master' into adi/ibc-go-1-proto
adizere Jun 11, 2021
b32e28b
Re-generated proto files with updated proto-compiler (fmt enabled).
adizere Jun 11, 2021
261e5ec
Manual fix for staking::Validators erroneous compilation; added the .…
adizere Jun 11, 2021
03abf7a
Quick feature for parametrizing upgraded chain
adizere Jun 14, 2021
8592959
Clippy fix. Meta for params for better display.
adizere Jun 14, 2021
f103b96
Merge branch 'master' into adi/ibc-go-1-proto
adizere Jun 15, 2021
c306530
Adapted query_upgraded_client_state
adizere Jun 15, 2021
16228aa
Adapted query_upgraded_consensus_state to ibc-go-v1
adizere Jun 15, 2021
75f3fc2
Moved from gRPC to ABCI
adizere Jun 16, 2021
e460126
Merge branch 'master' into adi/ibc-go-1-proto
adizere Jul 3, 2021
ac4899f
Adapted send_tx_simulate to new def of SimulateRequest
adizere Jul 3, 2021
800aa3d
Added parametrizable upgrade plan name
adizere Jul 3, 2021
d26d80d
Fix unwraps. Retain unbonding period if none specified.
adizere Jul 7, 2021
8c42e3b
Merge branch 'master' into adi/ibc-go-1-proto
adizere Jul 15, 2021
edfc21b
Missing post-merge bracket
adizere Jul 15, 2021
09ad7b8
Removed register and send match arms for rpc events
adizere Jul 15, 2021
b912347
Support for new message.actions strings of ICS27
adizere Jul 15, 2021
5e0639a
Merge branch 'master' into adi/ibc-go-1-proto
adizere Aug 2, 2021
0027ce5
Update protos sdk(v0.43.0-rc2) & ibc-go(v1.0.0-rc3)
hu55a1n1 Aug 4, 2021
56b8cdd
Revert "Added specific GRPC-web port to prevent conflict on 9091."
hu55a1n1 Aug 4, 2021
324bb06
Add missing fields in upgrade Plan
hu55a1n1 Aug 5, 2021
a395bb5
Fix clippy warnings
hu55a1n1 Aug 6, 2021
01bc67d
Merge branch 'master' into adi/ibc-go-1-proto
adizere Aug 9, 2021
97360a0
Added another action field to match intertx MsgSend
adizere Aug 10, 2021
e173d74
Merge branch 'adi/ibc-go-1-proto' of github.com:informalsystems/ibc-r…
hu55a1n1 Aug 11, 2021
bd8cdb4
Update protos sdk(v0.43.0) & ibc-go(v1.0.0)
hu55a1n1 Aug 12, 2021
ac7f92d
Update cosmos SDK module version requirement in compatibility.rs
hu55a1n1 Aug 12, 2021
a44193d
Merge branch 'master' into adi/ibc-go-1-proto
hu55a1n1 Aug 13, 2021
7e38aff
Merge branch 'master' into adi/ibc-go-1-proto
hu55a1n1 Aug 16, 2021
4bf511c
Add legacy upgrade support (#1289)
hu55a1n1 Aug 17, 2021
1b32a0c
Merge branch 'adi/ibc-go-1-proto' of github.com:informalsystems/ibc-r…
hu55a1n1 Aug 17, 2021
abca556
Apply suggestions
hu55a1n1 Aug 18, 2021
147cc35
Update .changelog
hu55a1n1 Aug 18, 2021
61642a5
Fix .changelog entry
hu55a1n1 Aug 18, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/unreleased/features/1287-upgrade-legacy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- Add `--legacy | -l` flag to support upgrades for chains built with Cosmos SDK < v0.43.0 ([#1287])

[#1287]: https://github.com/informalsystems/ibc-rs/issues/1287
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- Upgrade to Cosmos SDK proto (v0.43.0) & ibc-go proto (v1.0.0) ([#948])

- [#948]: https://github.com/informalsystems/ibc-rs/pull/948
5 changes: 5 additions & 0 deletions modules/src/application/mod.rs
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
pub mod ics20_fungible_token_transfer;

// TODO: These consts should move into the ICS27 namespace
pub const ICS27_BANK_SEND_TYPE_URL: &str = "/cosmos.bank.v1beta1.MsgSend";
pub const ICS27_SEND_TYPE_URL: &str = "/intertx.MsgSend";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI to share context: this is necessary for the Interchain Accounts module that @seantking is doing. Adding these lines is a temporary fix, so we'll need a permanent fix instead. Will open an issue for tracking that and detailing the problem.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Later edit: these constants should be deleted with PR https://github.com/informalsystems/ibc-rs/pull/1172/files.

pub const ICS27_REGISTER_TYPE_URL: &str = "/intertx.MsgRegister";
2 changes: 1 addition & 1 deletion modules/src/ics02_client/msgs/create_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use crate::ics02_client::error::Error;
use crate::signer::Signer;
use crate::tx_msg::Msg;

pub(crate) const TYPE_URL: &str = "/ibc.core.client.v1.MsgCreateClient";
pub const TYPE_URL: &str = "/ibc.core.client.v1.MsgCreateClient";

/// A type of message that triggers the creation of a new on-chain (IBC) client.
#[derive(Clone, Debug, PartialEq, Eq)]
Expand Down
2 changes: 1 addition & 1 deletion modules/src/ics02_client/msgs/update_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use crate::ics24_host::identifier::ClientId;
use crate::signer::Signer;
use crate::tx_msg::Msg;

pub(crate) const TYPE_URL: &str = "/ibc.core.client.v1.MsgUpdateClient";
pub const TYPE_URL: &str = "/ibc.core.client.v1.MsgUpdateClient";

/// A type of message that triggers the update of an on-chain (IBC) client with new headers.
#[derive(Clone, Debug, PartialEq)] // TODO: Add Eq bound when possible
Expand Down
2 changes: 1 addition & 1 deletion proto-compiler/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ cargo build --locked
Run the following command to clone the Cosmos SDK and the IBC-Go repositories, and check out a specific commit:

```bash
$ cargo run -- clone --out /tmp/cosmos --sdk-commit 7648bfca45b9d0897103ec739210607dce77c4fb --ibc-go-commit 333c1f338b2a14a1928a6f8ab64c37123c0e97b6
$ cargo run -- clone --out /tmp/cosmos --sdk-commit 8cfa2c26738276d895caf9eb98b3f70616218e17 --ibc-go-commit d70f49c8f612d60f1b7e2f1d1f160f28988962e1
romac marked this conversation as resolved.
Show resolved Hide resolved
```

Note:
Expand Down
18 changes: 9 additions & 9 deletions proto-compiler/src/cmd/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,9 @@ pub struct CompileCmd {

impl CompileCmd {
pub fn run(&self) {
let with_ibc = self.ibc.is_none();
let tmp_sdk = TempDir::new("ibc-proto-sdk").unwrap();
Self::output_version(&self.sdk, tmp_sdk.as_ref(), "COSMOS_SDK_COMMIT");
Self::compile_sdk_protos(&self.sdk, tmp_sdk.as_ref(), with_ibc);
Self::compile_sdk_protos(&self.sdk, tmp_sdk.as_ref(), self.ibc.clone());

match &self.ibc {
None => {
Expand Down Expand Up @@ -121,7 +120,7 @@ impl CompileCmd {
}
}

fn compile_sdk_protos(sdk_dir: &Path, out_dir: &Path, with_ibc: bool) {
fn compile_sdk_protos(sdk_dir: &Path, out_dir: &Path, ibc_dep: Option<PathBuf>) {
println!(
"[info ] Compiling Cosmos-SDK .proto files to Rust into '{}'...",
out_dir.display()
Expand All @@ -130,7 +129,7 @@ impl CompileCmd {
let root = env!("CARGO_MANIFEST_DIR");

// Paths
let mut proto_paths = vec![
let proto_paths = vec![
format!("{}/../proto/definitions/mock", root),
format!("{}/proto/cosmos/auth", sdk_dir.display()),
format!("{}/proto/cosmos/gov", sdk_dir.display()),
Expand All @@ -140,17 +139,18 @@ impl CompileCmd {
format!("{}/proto/cosmos/upgrade", sdk_dir.display()),
];

if with_ibc {
// Use the IBC proto files from the SDK
proto_paths.push(format!("{}/proto/ibc", sdk_dir.display()));
}

let proto_includes_paths = [
let mut proto_includes_paths = vec![
format!("{}/../proto", root),
format!("{}/proto", sdk_dir.display()),
format!("{}/third_party/proto", sdk_dir.display()),
];

if let Some(ibc_dir) = ibc_dep {
// Use the IBC proto files from the SDK
proto_includes_paths.push(format!("{}/proto", ibc_dir.display()),);
}

// List available proto files
let mut protos: Vec<PathBuf> = vec![];
for proto_path in &proto_paths {
Expand Down
1 change: 1 addition & 0 deletions proto/src/prost/COSMOS_IBC_COMMIT
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
e9f1dc2a4f8631749c72e48957848cab3eb10762
2 changes: 1 addition & 1 deletion proto/src/prost/COSMOS_SDK_COMMIT
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7648bfca45b9d0897103ec739210607dce77c4fb
v0.43.0
44 changes: 38 additions & 6 deletions proto/src/prost/cosmos.auth.v1beta1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,22 @@ pub struct Params {
#[prost(uint64, tag = "5")]
pub sig_verify_cost_secp256k1: u64,
}
/// GenesisState defines the auth module's genesis state.
/// QueryAccountsRequest is the request type for the Query/Accounts RPC method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GenesisState {
/// params defines all the paramaters of the module.
pub struct QueryAccountsRequest {
/// pagination defines an optional pagination for the request.
#[prost(message, optional, tag = "1")]
pub params: ::core::option::Option<Params>,
/// accounts are the accounts present at genesis.
#[prost(message, repeated, tag = "2")]
pub pagination: ::core::option::Option<super::super::base::query::v1beta1::PageRequest>,
}
/// QueryAccountsResponse is the response type for the Query/Accounts RPC method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryAccountsResponse {
/// accounts are the existing accounts
#[prost(message, repeated, tag = "1")]
pub accounts: ::prost::alloc::vec::Vec<::prost_types::Any>,
/// pagination defines the pagination in the response.
#[prost(message, optional, tag = "2")]
pub pagination: ::core::option::Option<super::super::base::query::v1beta1::PageResponse>,
}
/// QueryAccountRequest is the request type for the Query/Account RPC method.
#[derive(Clone, PartialEq, ::prost::Message)]
Expand Down Expand Up @@ -104,6 +111,21 @@ pub mod query_client {
let inner = tonic::client::Grpc::with_interceptor(inner, interceptor);
Self { inner }
}
#[doc = " Accounts returns all the existing accounts"]
pub async fn accounts(
&mut self,
request: impl tonic::IntoRequest<super::QueryAccountsRequest>,
) -> Result<tonic::Response<super::QueryAccountsResponse>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/cosmos.auth.v1beta1.Query/Accounts");
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Account returns account details based on address."]
pub async fn account(
&mut self,
Expand Down Expand Up @@ -148,3 +170,13 @@ pub mod query_client {
}
}
}
/// GenesisState defines the auth module's genesis state.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GenesisState {
/// params defines all the paramaters of the module.
#[prost(message, optional, tag = "1")]
pub params: ::core::option::Option<Params>,
/// accounts are the accounts present at genesis.
#[prost(message, repeated, tag = "2")]
pub accounts: ::prost::alloc::vec::Vec<::prost_types::Any>,
}
3 changes: 3 additions & 0 deletions proto/src/prost/cosmos.base.query.v1beta1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ pub struct PageRequest {
/// is set.
#[prost(bool, tag = "4")]
pub count_total: bool,
/// reverse is set to true if results are to be returned in the descending order.
#[prost(bool, tag = "5")]
pub reverse: bool,
}
/// PageResponse is to be embedded in gRPC response messages where the
/// corresponding request message has used PageRequest.
Expand Down
Loading