Skip to content

Commit

Permalink
Update Substrate and other dependencies (#78)
Browse files Browse the repository at this point in the history
* update the deps

* Type Info. Reflect paritytech/substrate#13272

* can't update jsonrpsee because substrate hasn't yet.

* fix warning reflect let executor = sc_service::new_native_or_wasm_executor(&config);

* clippy
  • Loading branch information
JoshOrndorff authored May 3, 2023
1 parent a90dffd commit 4b245d2
Show file tree
Hide file tree
Showing 13 changed files with 822 additions and 535 deletions.
1,191 changes: 738 additions & 453 deletions Cargo.lock

Large diffs are not rendered by default.

56 changes: 28 additions & 28 deletions node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,42 +16,42 @@ name = "node-template"
[dependencies]
clap = { version = "4.0.29", features = ["derive"] }

sc-cli = { git = "https://github.com/paritytech/substrate.git", tag = "monthly-2023-04" }
sp-core = { git = "https://github.com/paritytech/substrate.git", tag = "monthly-2023-04" }
sc-executor = { git = "https://github.com/paritytech/substrate.git", tag = "monthly-2023-04" }
sc-service = { git = "https://github.com/paritytech/substrate.git", tag = "monthly-2023-04" }
sc-telemetry = { git = "https://github.com/paritytech/substrate.git", tag = "monthly-2023-04" }
sc-keystore = { git = "https://github.com/paritytech/substrate.git", tag = "monthly-2023-04" }
sc-transaction-pool = { git = "https://github.com/paritytech/substrate.git", tag = "monthly-2023-04" }
sc-transaction-pool-api = { git = "https://github.com/paritytech/substrate.git", tag = "monthly-2023-04" }
sc-consensus-aura = { git = "https://github.com/paritytech/substrate.git", tag = "monthly-2023-04" }
sp-consensus-aura = { git = "https://github.com/paritytech/substrate.git", tag = "monthly-2023-04" }
sp-consensus = { git = "https://github.com/paritytech/substrate.git", tag = "monthly-2023-04" }
sc-consensus = { git = "https://github.com/paritytech/substrate.git", tag = "monthly-2023-04" }
sc-consensus-grandpa = { git = "https://github.com/paritytech/substrate.git", tag = "monthly-2023-04" }
sp-consensus-grandpa = { git = "https://github.com/paritytech/substrate.git", tag = "monthly-2023-04" }
sc-client-api = { git = "https://github.com/paritytech/substrate.git", tag = "monthly-2023-04" }
sp-runtime = { git = "https://github.com/paritytech/substrate.git", tag = "monthly-2023-04" }
sp-timestamp = { git = "https://github.com/paritytech/substrate.git", tag = "monthly-2023-04" }
sp-inherents = { git = "https://github.com/paritytech/substrate.git", tag = "monthly-2023-04" }
sp-keyring = { git = "https://github.com/paritytech/substrate.git", tag = "monthly-2023-04" }
pallet-transaction-payment = { default-features = false, git = "https://github.com/paritytech/substrate.git", tag = "monthly-2023-04" }
sc-cli = { git = "https://github.com/paritytech/substrate.git", tag = "monthly-2023-05" }
sp-core = { git = "https://github.com/paritytech/substrate.git", tag = "monthly-2023-05" }
sc-executor = { git = "https://github.com/paritytech/substrate.git", tag = "monthly-2023-05" }
sc-service = { git = "https://github.com/paritytech/substrate.git", tag = "monthly-2023-05" }
sc-telemetry = { git = "https://github.com/paritytech/substrate.git", tag = "monthly-2023-05" }
sc-keystore = { git = "https://github.com/paritytech/substrate.git", tag = "monthly-2023-05" }
sc-transaction-pool = { git = "https://github.com/paritytech/substrate.git", tag = "monthly-2023-05" }
sc-transaction-pool-api = { git = "https://github.com/paritytech/substrate.git", tag = "monthly-2023-05" }
sc-consensus-aura = { git = "https://github.com/paritytech/substrate.git", tag = "monthly-2023-05" }
sp-consensus-aura = { git = "https://github.com/paritytech/substrate.git", tag = "monthly-2023-05" }
sp-consensus = { git = "https://github.com/paritytech/substrate.git", tag = "monthly-2023-05" }
sc-consensus = { git = "https://github.com/paritytech/substrate.git", tag = "monthly-2023-05" }
sc-consensus-grandpa = { git = "https://github.com/paritytech/substrate.git", tag = "monthly-2023-05" }
sp-consensus-grandpa = { git = "https://github.com/paritytech/substrate.git", tag = "monthly-2023-05" }
sc-client-api = { git = "https://github.com/paritytech/substrate.git", tag = "monthly-2023-05" }
sp-runtime = { git = "https://github.com/paritytech/substrate.git", tag = "monthly-2023-05" }
sp-timestamp = { git = "https://github.com/paritytech/substrate.git", tag = "monthly-2023-05" }
sp-inherents = { git = "https://github.com/paritytech/substrate.git", tag = "monthly-2023-05" }
sp-keyring = { git = "https://github.com/paritytech/substrate.git", tag = "monthly-2023-05" }
pallet-transaction-payment = { default-features = false, git = "https://github.com/paritytech/substrate.git", tag = "monthly-2023-05" }

# These dependencies are used for the node template's RPCs
jsonrpsee = { version = "0.16.2", features = ["server"] }
sc-rpc = { git = "https://github.com/paritytech/substrate.git", tag = "monthly-2023-04" }
sp-api = { git = "https://github.com/paritytech/substrate.git", tag = "monthly-2023-04" }
sc-rpc-api = { git = "https://github.com/paritytech/substrate.git", tag = "monthly-2023-04" }
sp-blockchain = { git = "https://github.com/paritytech/substrate.git", tag = "monthly-2023-04" }
sp-block-builder = { git = "https://github.com/paritytech/substrate.git", tag = "monthly-2023-04" }
sc-basic-authorship = { git = "https://github.com/paritytech/substrate.git", tag = "monthly-2023-04" }
pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/substrate.git", tag = "monthly-2023-04" }
sc-rpc = { git = "https://github.com/paritytech/substrate.git", tag = "monthly-2023-05" }
sp-api = { git = "https://github.com/paritytech/substrate.git", tag = "monthly-2023-05" }
sc-rpc-api = { git = "https://github.com/paritytech/substrate.git", tag = "monthly-2023-05" }
sp-blockchain = { git = "https://github.com/paritytech/substrate.git", tag = "monthly-2023-05" }
sp-block-builder = { git = "https://github.com/paritytech/substrate.git", tag = "monthly-2023-05" }
sc-basic-authorship = { git = "https://github.com/paritytech/substrate.git", tag = "monthly-2023-05" }
pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/substrate.git", tag = "monthly-2023-05" }

# Local Dependencies
node-template-runtime = { package = "tuxedo-template-runtime", path = "../tuxedo-template-runtime" }

[build-dependencies]
substrate-build-script-utils = { git = "https://github.com/paritytech/substrate.git", tag = "monthly-2023-04" }
substrate-build-script-utils = { git = "https://github.com/paritytech/substrate.git", tag = "monthly-2023-05" }

[features]
default = []
7 changes: 1 addition & 6 deletions node/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,7 @@ pub fn new_partial(
})
.transpose()?;

let executor = NativeElseWasmExecutor::<ExecutorDispatch>::new(
config.wasm_method,
config.default_heap_pages,
config.max_runtime_instances,
config.runtime_cache_size,
);
let executor = sc_service::new_native_or_wasm_executor(config);

let (client, backend, keystore_container, task_manager) =
sc_service::new_full_parts::<Block, RuntimeApi, _>(
Expand Down
14 changes: 7 additions & 7 deletions tuxedo-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ parity-util-mem = { version = '0.12.0', optional = true }

aggregator = { path = "aggregator" }

sp-api = { git = 'https://github.com/paritytech/substrate', tag = "monthly-2023-04", default_features = false}
sp-debug-derive = { git = 'https://github.com/paritytech/substrate', tag = "monthly-2023-04", default_features = false, features = ["force-debug"] }
sp-core = { git = 'https://github.com/paritytech/substrate', tag = "monthly-2023-04", default_features = false}
sp-io = { git = 'https://github.com/paritytech/substrate', tag = "monthly-2023-04", default_features = false, features = ["with-tracing"] }
sp-runtime = { git = 'https://github.com/paritytech/substrate', tag = "monthly-2023-04", default_features = false}
sp-std = { git = 'https://github.com/paritytech/substrate', tag = "monthly-2023-04", default_features = false}
sp-storage = { git = 'https://github.com/paritytech/substrate', tag = "monthly-2023-04", default_features = false}
sp-api = { git = 'https://github.com/paritytech/substrate', tag = "monthly-2023-05", default_features = false}
sp-debug-derive = { git = 'https://github.com/paritytech/substrate', tag = "monthly-2023-05", default_features = false, features = ["force-debug"] }
sp-core = { git = 'https://github.com/paritytech/substrate', tag = "monthly-2023-05", default_features = false}
sp-io = { git = 'https://github.com/paritytech/substrate', tag = "monthly-2023-05", default_features = false, features = ["with-tracing"] }
sp-runtime = { git = 'https://github.com/paritytech/substrate', tag = "monthly-2023-05", default_features = false}
sp-std = { git = 'https://github.com/paritytech/substrate', tag = "monthly-2023-05", default_features = false}
sp-storage = { git = 'https://github.com/paritytech/substrate', tag = "monthly-2023-05", default_features = false}

[dev-dependencies]
array-bytes = "6.0.0"
Expand Down
3 changes: 2 additions & 1 deletion tuxedo-core/src/dynamic_typing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,15 @@
//! around by, for example, hashing the Debug strong, but that is ugly

use parity_scale_codec::{Decode, Encode};
use scale_info::TypeInfo;
#[cfg(feature = "std")]
use serde::{Deserialize, Serialize};
use sp_std::vec::Vec;

/// A piece of encoded data with a type id associated
/// Strongly typed data can be extracted
#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
#[derive(Encode, Decode, Debug, PartialEq, Eq, Clone)]
#[derive(Encode, Decode, Debug, PartialEq, Eq, Clone, TypeInfo)]
pub struct DynamicallyTypedData {
pub data: Vec<u8>,
pub type_id: [u8; 4],
Expand Down
9 changes: 5 additions & 4 deletions tuxedo-core/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

use crate::dynamic_typing::DynamicallyTypedData;
use parity_scale_codec::{Decode, Encode};
use scale_info::TypeInfo;
#[cfg(feature = "std")]
use serde::{Deserialize, Serialize};
use sp_core::H256;
Expand All @@ -10,7 +11,7 @@ use sp_std::vec::Vec;

/// A reference to a output that is expected to exist in the state.
#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
#[derive(Encode, Decode, Debug, PartialEq, Eq, Clone)]
#[derive(Encode, Decode, Debug, PartialEq, Eq, Clone, TypeInfo)]
pub struct OutputRef {
/// A hash of the transaction that created this output
pub tx_hash: H256,
Expand All @@ -33,7 +34,7 @@ pub struct OutputRef {
/// In the future, there may be additional notions of peeks (inputs that are not consumed)
/// and evictions (inputs that are forcefully consumed.)
#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
#[derive(Debug, PartialEq, Eq, Clone)]
#[derive(Debug, PartialEq, Eq, Clone, TypeInfo)]
pub struct Transaction<V, C> {
pub inputs: Vec<Input>,
//Todo peeks: Vec<Input>,
Expand Down Expand Up @@ -101,7 +102,7 @@ impl<V, C> Extrinsic for Transaction<V, C> {

/// A reference the a utxo that will be consumed along with proof that it may be consumed
#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
#[derive(Encode, Decode, Debug, PartialEq, Eq, Clone)]
#[derive(Encode, Decode, Debug, PartialEq, Eq, Clone, TypeInfo)]
pub struct Input {
/// a reference to the output being consumed
pub output_ref: OutputRef,
Expand Down Expand Up @@ -133,7 +134,7 @@ pub type DispatchResult<VerifierError> = Result<(), UtxoError<VerifierError>>;
/// In a cryptocurrency, the data represents a single coin. In Tuxedo, the type of
/// the contained data is generic.
#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
#[derive(Encode, Decode, Debug, PartialEq, Eq, Clone)]
#[derive(Encode, Decode, Debug, PartialEq, Eq, Clone, TypeInfo)]
pub struct Output<V> {
pub payload: DynamicallyTypedData,
pub verifier: V,
Expand Down
7 changes: 4 additions & 3 deletions tuxedo-core/src/verifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//!

use parity_scale_codec::{Decode, Encode};
use scale_info::TypeInfo;
#[cfg(feature = "std")]
use serde::{Deserialize, Serialize};
use sp_core::sr25519::{Public, Signature};
Expand All @@ -25,7 +26,7 @@ pub trait Verifier: Debug + Encode + Decode + Clone {

/// A typical verifier that checks an sr25519 signature
#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
#[derive(Encode, Decode, Debug, PartialEq, Eq, Clone)]
#[derive(Encode, Decode, Debug, PartialEq, Eq, Clone, TypeInfo)]
pub struct SigCheck {
pub owner_pubkey: H256,
}
Expand All @@ -43,7 +44,7 @@ impl Verifier for SigCheck {

/// A simple verifier that allows anyone to consume an output at any time
#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
#[derive(Encode, Decode, Debug, PartialEq, Eq, Clone)]
#[derive(Encode, Decode, Debug, PartialEq, Eq, Clone, TypeInfo)]
pub struct UpForGrabs;

impl Verifier for UpForGrabs {
Expand All @@ -57,7 +58,7 @@ impl Verifier for UpForGrabs {
/// `threshold` of the signatories. If the threshold is greater than the number of signatories
/// the input can never be consumed.
#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
#[derive(Encode, Decode, Debug, PartialEq, Eq, Clone)]
#[derive(Encode, Decode, Debug, PartialEq, Eq, Clone, TypeInfo)]
pub struct ThresholdMultiSignature {
/// The minimum number of valid signatures needed to consume this input
pub threshold: u8,
Expand Down
40 changes: 20 additions & 20 deletions tuxedo-template-runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,35 +13,35 @@ parity-scale-codec = { version = '3.4.0', default-features = false, features = [
scale-info = { version = "2.1.1", default-features = false, features = ["derive"] }
parity-util-mem = { version = '0.12.0', optional = true }

sp-api = { git = 'https://github.com/paritytech/substrate', tag = "monthly-2023-04", default_features = false}
sp-debug-derive = { git = 'https://github.com/paritytech/substrate', tag = "monthly-2023-04", default_features = false, features = ["force-debug"] }
sp-block-builder = { git = 'https://github.com/paritytech/substrate', tag = "monthly-2023-04", default_features = false}
sp-core = { git = 'https://github.com/paritytech/substrate', tag = "monthly-2023-04", default_features = false}
sp-inherents = { git = 'https://github.com/paritytech/substrate', tag = "monthly-2023-04", default_features = false}
sp-io = { git = 'https://github.com/paritytech/substrate', tag = "monthly-2023-04", default_features = false, features = ["with-tracing"] }
sp-offchain = { git = 'https://github.com/paritytech/substrate', tag = "monthly-2023-04", default_features = false}
sp-runtime = { git = 'https://github.com/paritytech/substrate', tag = "monthly-2023-04", default_features = false}
sp-session = { git = 'https://github.com/paritytech/substrate', tag = "monthly-2023-04", default_features = false}
sp-std = { git = 'https://github.com/paritytech/substrate', tag = "monthly-2023-04", default_features = false}
sp-storage = { git = 'https://github.com/paritytech/substrate', tag = "monthly-2023-04", default_features = false}
sp-transaction-pool = { git = 'https://github.com/paritytech/substrate', tag = "monthly-2023-04", default_features = false}
sp-version = { git = 'https://github.com/paritytech/substrate', tag = "monthly-2023-04", default_features = false}
sp-timestamp = { git = 'https://github.com/paritytech/substrate', tag = "monthly-2023-04", default_features = false}
sp-api = { git = 'https://github.com/paritytech/substrate', tag = "monthly-2023-05", default_features = false}
sp-debug-derive = { git = 'https://github.com/paritytech/substrate', tag = "monthly-2023-05", default_features = false, features = ["force-debug"] }
sp-block-builder = { git = 'https://github.com/paritytech/substrate', tag = "monthly-2023-05", default_features = false}
sp-core = { git = 'https://github.com/paritytech/substrate', tag = "monthly-2023-05", default_features = false}
sp-inherents = { git = 'https://github.com/paritytech/substrate', tag = "monthly-2023-05", default_features = false}
sp-io = { git = 'https://github.com/paritytech/substrate', tag = "monthly-2023-05", default_features = false, features = ["with-tracing"] }
sp-offchain = { git = 'https://github.com/paritytech/substrate', tag = "monthly-2023-05", default_features = false}
sp-runtime = { git = 'https://github.com/paritytech/substrate', tag = "monthly-2023-05", default_features = false}
sp-session = { git = 'https://github.com/paritytech/substrate', tag = "monthly-2023-05", default_features = false}
sp-std = { git = 'https://github.com/paritytech/substrate', tag = "monthly-2023-05", default_features = false}
sp-storage = { git = 'https://github.com/paritytech/substrate', tag = "monthly-2023-05", default_features = false}
sp-transaction-pool = { git = 'https://github.com/paritytech/substrate', tag = "monthly-2023-05", default_features = false}
sp-version = { git = 'https://github.com/paritytech/substrate', tag = "monthly-2023-05", default_features = false}
sp-timestamp = { git = 'https://github.com/paritytech/substrate', tag = "monthly-2023-05", default_features = false}

# These were added for Aura / Grandpa API support
hex-literal = "0.3.4"
sp-consensus-aura = { git = 'https://github.com/paritytech/substrate', tag = "monthly-2023-04", default_features = false}
sp-application-crypto = { git = 'https://github.com/paritytech/substrate', tag = "monthly-2023-04", default_features = false}
sp-consensus-grandpa = { git = 'https://github.com/paritytech/substrate', tag = "monthly-2023-04", default_features = false}
hex-literal = "0.4.1"
sp-consensus-aura = { git = 'https://github.com/paritytech/substrate', tag = "monthly-2023-05", default_features = false}
sp-application-crypto = { git = 'https://github.com/paritytech/substrate', tag = "monthly-2023-05", default_features = false}
sp-consensus-grandpa = { git = 'https://github.com/paritytech/substrate', tag = "monthly-2023-05", default_features = false}

# Tuxedo Core
tuxedo-core = { path = '../tuxedo-core', default-features = false }

[build-dependencies]
substrate-wasm-builder = { git = "https://github.com/paritytech/substrate.git", tag = "monthly-2023-04" }
substrate-wasm-builder = { git = "https://github.com/paritytech/substrate.git", tag = "monthly-2023-05" }

[dev-dependencies]
sp-keystore = { git = 'https://github.com/paritytech/substrate', tag = "monthly-2023-04", default_features = false }
sp-keystore = { git = 'https://github.com/paritytech/substrate', tag = "monthly-2023-05", default_features = false }

[features]
default = ["std"]
Expand Down
7 changes: 4 additions & 3 deletions tuxedo-template-runtime/src/amoeba.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
//! mother amoeba and creates, in its place two new daughter amoebas.

use parity_scale_codec::{Decode, Encode};
use scale_info::TypeInfo;
#[cfg(feature = "std")]
use serde::{Deserialize, Serialize};
use sp_runtime::transaction_validity::TransactionPriority;
Expand Down Expand Up @@ -75,7 +76,7 @@ pub enum ConstraintCheckerError {
/// 2. There are exactly two daughter amoebas
/// 3. Each Daughter amoeba has a generation one higher than its mother.
#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
#[derive(Encode, Decode, Debug, PartialEq, Eq, Clone)]
#[derive(Encode, Decode, Debug, PartialEq, Eq, Clone, TypeInfo)]
pub struct AmoebaMitosis;

impl SimpleConstraintChecker for AmoebaMitosis {
Expand Down Expand Up @@ -133,7 +134,7 @@ impl SimpleConstraintChecker for AmoebaMitosis {
/// Any amoeba can be killed by providing it as the sole input to this constraint checker. No
/// new outputs are ever created.
#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
#[derive(Encode, Decode, Debug, PartialEq, Eq, Clone)]
#[derive(Encode, Decode, Debug, PartialEq, Eq, Clone, TypeInfo)]
pub struct AmoebaDeath;

impl SimpleConstraintChecker for AmoebaDeath {
Expand Down Expand Up @@ -172,7 +173,7 @@ impl SimpleConstraintChecker for AmoebaDeath {
/// A new amoeba can be created by providing it as the sole output to this constraint checker. No
/// inputs are ever consumed.
#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
#[derive(Encode, Decode, Debug, PartialEq, Eq, Clone)]
#[derive(Encode, Decode, Debug, PartialEq, Eq, Clone, TypeInfo)]
pub struct AmoebaCreation;

impl SimpleConstraintChecker for AmoebaCreation {
Expand Down
Loading

0 comments on commit 4b245d2

Please sign in to comment.