Skip to content

Commit

Permalink
release candidate
Browse files Browse the repository at this point in the history
  • Loading branch information
dzmitry-lahoda committed May 18, 2023
1 parent feb48a5 commit 2a27ba1
Show file tree
Hide file tree
Showing 8 changed files with 59 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -576,20 +576,10 @@ jobs:
echo "build-all-benchmarks-packages" ${{ needs.build-all-benchmarks-packages.outputs.ok }}
echo "build-product-darwin" ${{ needs.build-product-darwin.outputs.ok }}
echo "devnet-integration-tests" ${{ needs.devnet-integration-tests.outputs.ok }}
- if: |
${{
needs.nix-flake-check.outputs.ok == 'true' && needs.dependency-review.outputs.ok == 'true' && needs.build-all-production-deps.outputs.ok == 'true' && needs.build-all-misc-packages.outputs.ok == 'true' && needs.build-all-docs-packages.outputs.ok == 'true' && needs.build-all-ci-packages.outputs.ok == 'true' && needs.build-all-benchmarks-packages.outputs.ok == 'true'
&& needs.build-product-darwin.outputs.ok == 'true'
&& needs.devnet-integration-tests.outputs.ok == 'true'
}}
- if: ${{ needs.nix-flake-check.outputs.ok == 'true' && needs.dependency-review.outputs.ok == 'true' && needs.build-all-production-deps.outputs.ok == 'true' && needs.build-all-misc-packages.outputs.ok == 'true' && needs.build-all-docs-packages.outputs.ok == 'true' && needs.build-all-ci-packages.outputs.ok == 'true' && needs.build-all-benchmarks-packages.outputs.ok == 'true' && needs.build-product-darwin.outputs.ok == 'true' && needs.devnet-integration-tests.outputs.ok == 'true' }}
run: |
echo "All dependencies built well"
- if: |
${{
needs.nix-flake-check.outputs.ok != 'true' || needs.dependency-review.outputs.ok != 'true' || needs.build-all-production-deps.outputs.ok != 'true' || needs.build-all-misc-packages.outputs.ok != 'true' || needs.build-all-docs-packages.outputs.ok != 'true' || needs.build-all-ci-packages.outputs.ok != 'true' || needs.build-all-benchmarks-packages.outputs.ok != 'true'
|| needs.build-product-darwin.outputs.ok != 'true'
|| needs.devnet-integration-tests.outputs.ok != 'true'
}}
- if: ${{ needs.nix-flake-check.outputs.ok != 'true' || needs.dependency-review.outputs.ok != 'true' || needs.build-all-production-deps.outputs.ok != 'true' || needs.build-all-misc-packages.outputs.ok != 'true' || needs.build-all-docs-packages.outputs.ok != 'true' || needs.build-all-ci-packages.outputs.ok != 'true' || needs.build-all-benchmarks-packages.outputs.ok != 'true' || needs.build-product-darwin.outputs.ok != 'true' || needs.devnet-integration-tests.outputs.ok != 'true' }}
run: |
echo "Some of dependencies (see jobs graph or needs attribute) failed to build"
exit 42
Expand Down
12 changes: 6 additions & 6 deletions code/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion code/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ name = "composable"
version = { workspace = true }

[workspace.package]
version = "7.10023.1"
version = "7.10024.0"

[[bin]]
name = "composable"
Expand Down
26 changes: 20 additions & 6 deletions code/parachain/frame/cosmwasm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ pub mod pallet {
pub enum Error<T> {
Instrumentation,
VmCreation,
ContractTrapped,
ContractHasNoInfo,
CodeDecoding,
CodeValidation,
Expand Down Expand Up @@ -187,6 +186,12 @@ pub mod pallet {
OutOfGas,
InvalidSalt,
InvalidAccount,
Interpreter,
VirtualMachine,
AccountConversionFailure,
Aborted,
ReadOnlyViolation,
Rpc,
}

#[pallet::config]
Expand Down Expand Up @@ -706,20 +711,29 @@ impl<T: Config> Pallet<T> {
initial_gas: u64,
remaining_gas: u64,
) -> DispatchResultWithPostInfo {
log::info!(target: "runtime::contracts", "outcome: {:?}", outcome);
log::debug!(target: "runtime::contracts", "outcome: {:?}", outcome);
let post_info = PostDispatchInfo {
actual_weight: Some(Weight::from_ref_time(initial_gas.saturating_sub(remaining_gas))),
pays_fee: Pays::Yes,
};
match outcome {
Ok(()) => Ok(post_info),
Err(e) => {
let e = match e {
Err(error) => {
log::info!(target: "runtime::contracts", "executing contract error with {}", &error);
let error = match error {
CosmwasmVMError::Pallet(e) => e,
CosmwasmVMError::OutOfGas => Error::<T>::OutOfGas,
_ => Error::<T>::ContractTrapped,
CosmwasmVMError::Interpreter(_) => Error::<T>::Interpreter,
CosmwasmVMError::VirtualMachine(_) => Error::<T>::VirtualMachine,
CosmwasmVMError::AccountConversionFailure =>
Error::<T>::AccountConversionFailure,
CosmwasmVMError::Aborted(_) => Error::<T>::Aborted,
CosmwasmVMError::ReadOnlyViolation => Error::<T>::ReadOnlyViolation,
CosmwasmVMError::Unsupported => Error::<T>::Unsupported,
CosmwasmVMError::Rpc(_) => Error::<T>::Rpc,
CosmwasmVMError::Ibc(_) => Error::<T>::Ibc,
};
Err(DispatchErrorWithPostInfo { error: e.into(), post_info })
Err(DispatchErrorWithPostInfo { error: error.into(), post_info })
},
}
}
Expand Down
2 changes: 1 addition & 1 deletion code/parachain/runtime/composable/src/version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
// The version of the runtime specification. A full node will not attempt to use its native
// runtime in substitute for the on-chain Wasm runtime unless all of `spec_name`,
// `spec_version`, and `authoring_version` are the same between Wasm and native.
spec_version: 10023,
spec_version: 10024,
impl_version: 3,
apis: RUNTIME_API_VERSIONS,
transaction_version: 2,
Expand Down
2 changes: 1 addition & 1 deletion code/parachain/runtime/picasso/src/version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
// The version of the runtime specification. A full node will not attempt to use its native
// runtime in substitute for the on-chain Wasm runtime unless all of `spec_name`,
// `spec_version`, and `authoring_version` are the same between Wasm and native.
spec_version: 10023,
spec_version: 10024,
impl_version: 2,
apis: RUNTIME_API_VERSIONS,
transaction_version: 1,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Overview

Follow this guide to upload, initialize and execute cw20 contract on local Picasso Rococo DevNet.

## Prerequisites

You successfully run simple transaction and observe events using Polkadot.js one one of Composable or Picasso runtimes.

It does not require you to know CosmWasm contracts well, but general awareness would be super useful.

You have installed Nix using Zero-to-Nix guide and successfully run package from `composable` registry.

## Steps

1. Run `nix run composable#devnet-picasso`
2. Download [cw20](https://github.com/CosmWasm/cw-plus/releases/download/v1.0.1/cw20_base.wasm) contract
3. Click `Direct Link` in devnet startup output on one of nodes to open Polkadot.js.
4. Go to `Developer -> Extrinsics -> cosmwasm -> upload -> file upload` , input `cw20_base.wasm` file and `Submit Transaction`.
5. Observe `cosmwasm.Uploaded.codeId` in events.
6. Call `cosmwasm -> instantiate` with `codeId` from event, gas `10000000000`, message `{ "decimals" : 18, "initial_balances": [], "name" : "SHIB", "symbol" : "SHIB", "mint": {"minter" : "5yNZjX24n2eg7W6EVamaTXNQbWCwchhThEaSWB7V3GRjtHeL"} }`, salt and labels to unique random numbers like `0x1234` and `0x4321`, other fields `0x`.
7. Observe `cosmwasm.Instantiated` event and click icon to copy `contract` address.
8. `cosmwasm -> execute` , put `contract` address from event, gas `10000000000`, message `{ "mint" : { "amount" : "123456789", "recipient" : "5yNZjX24n2eg7W6EVamaTXNQbWCwchhThEaSWB7V3GRjtHeL" }}`, other fields `0x`.
9. Observe `cosmwasm.Executed` execution success.

### Testnet

Repeat steps on testnet.
2 changes: 1 addition & 1 deletion inputs/paritytech/zombienet/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ in with prelude; rec {
env = [{
name = "RUST_LOG";
value =
"info,runtime=debug,parachain=trace,cumulus-collator=trace,aura=trace,xcm=trace,pallet_ibc=trace,hyperspace=trace,hyperspace_parachain=trace,ics=trace,ics::routing=trace,ics::channel=trace"
"info,runtime::contracts=debug,runtime=debug,parachain=trace,cumulus-collator=trace,aura=trace,xcm=trace,pallet_ibc=trace,hyperspace=trace,hyperspace_parachain=trace,ics=trace,ics::routing=trace,ics::channel=trace"
# RUST_LOG does not eats extra comma well, so fixed conditionally
+ (if rust_log_add != null then "," + rust_log_add else "");
}];
Expand Down

0 comments on commit 2a27ba1

Please sign in to comment.