diff --git a/.docker/subzero-dev.Dockerfile b/.docker/subzero-dev.Dockerfile new file mode 100644 index 0000000000..e389d8e222 --- /dev/null +++ b/.docker/subzero-dev.Dockerfile @@ -0,0 +1,61 @@ +# Note: We don't use Alpine and its packaged Rust/Cargo +# because they're too often out of date, +# preventing them from being used to build subzero/Polkadot. + +FROM phusion/baseimage:focal-1.2.0 as baseimage +ENV DEBIAN_FRONTEND=noninteractive + + +RUN apt-get update && \ + apt-get dist-upgrade -y -o Dpkg::Options::="--force-confold" && \ + apt-get install -y cmake pkg-config libssl-dev git clang + +WORKDIR /subzero +COPY . /subzero + +RUN curl https://sh.rustup.rs -sSf | sh -s -- -y && \ + export PATH="$PATH:$HOME/.cargo/bin" && \ + rustup toolchain install nightly-2022-06-24 && \ + rustup target add wasm32-unknown-unknown --toolchain nightly-2022-06-24 && \ + rustup default nightly-2022-06-24 &&\ + rustup show + +# ===== STAGE 2 ====== + +FROM baseimage as builder +ARG PROFILE=release + +RUN export PATH="$PATH:$HOME/.cargo/bin" && \ +cargo build "--$PROFILE" + +# ===== STAGE 3 ====== + +FROM phusion/baseimage:focal-1.2.0 +LABEL maintainer="devops@zero.io" +LABEL description="This is the 2nd stage: a very small image where we copy the subzero binary." +ARG PROFILE=release + +RUN mv /usr/share/ca* /tmp && \ + rm -rf /usr/share/* && \ + mv /tmp/ca-certificates /usr/share/ && \ + useradd -m -u 1000 -U -s /bin/sh -d /subzero subzero && \ + mkdir -p /subzero/.local/share/subzero && \ + chown -R subzero:subzero /subzero/.local && \ + ln -s /subzero/.local/share/subzero /data + +COPY --from=builder /subzero/target/$PROFILE/subzero-dev /usr/local/bin +COPY --from=builder /subzero/.docker/chainspec /chainspec + +# checks +RUN ldd /usr/local/bin/subzero-dev && \ + /usr/local/bin/subzero-dev --version + +# Shrinking +# RUN rm -rf /usr/lib/python* && \ +# rm -rf /usr/bin /usr/sbin /usr/share/man + +USER subzero +EXPOSE 30333 9933 9944 9615 +VOLUME ["/data"] + +CMD ["/usr/local/bin/subzero-dev"] diff --git a/bin/alphaville/runtime/Cargo.toml b/bin/alphaville/runtime/Cargo.toml index ebed637fa9..61738af97c 100644 --- a/bin/alphaville/runtime/Cargo.toml +++ b/bin/alphaville/runtime/Cargo.toml @@ -130,6 +130,7 @@ gamedao-flow = { path = "../../../modules/gamedao-protocol/flow", default-featur gamedao-control = { path = "../../../modules/gamedao-protocol/control", default-features = false } gamedao-signal = { path = "../../../modules/gamedao-protocol/signal", default-features = false } gamedao-sense = { path = "../../../modules/gamedao-protocol/sense", default-features = false } +gamedao-battlepass = { path = "../../../modules/gamedao-protocol/battlepass", default-features = false } [build-dependencies] substrate-wasm-builder = { version = "5.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.28" } @@ -234,6 +235,7 @@ std = [ "gamedao-flow/std", "gamedao-control/std", "gamedao-signal/std", + "gamedao-battlepass/std", ] runtime-benchmarks = [ "frame-benchmarking/runtime-benchmarks", @@ -292,6 +294,7 @@ runtime-benchmarks = [ "gamedao-control/runtime-benchmarks", "gamedao-flow/runtime-benchmarks", "gamedao-signal/runtime-benchmarks", + "gamedao-battlepass/runtime-benchmarks", ] try-runtime = [ "frame-executive/try-runtime", diff --git a/bin/alphaville/runtime/src/lib.rs b/bin/alphaville/runtime/src/lib.rs index 27be70a170..a9ba16e3e1 100644 --- a/bin/alphaville/runtime/src/lib.rs +++ b/bin/alphaville/runtime/src/lib.rs @@ -1483,15 +1483,21 @@ impl pallet_gilt::Config for Runtime { type WeightInfo = pallet_gilt::weights::SubstrateWeight; } +parameter_types! { + pub const PartsLimit: u32 = 25; + pub const CollectionSymbolLimit: u32 = 100; + pub const MaxResourcesOnMint: u32 = 100; +} + impl pallet_rmrk_core::Config for Runtime { type Event = Event; type ProtocolOrigin = frame_system::EnsureRoot; type MaxRecursions = ConstU32<10>; type ResourceSymbolLimit = ConstU32<10>; - type PartsLimit = ConstU32<25>; + type PartsLimit = PartsLimit; type MaxPriorities = ConstU32<25>; - type CollectionSymbolLimit = ConstU32<100>; - type MaxResourcesOnMint = ConstU32<100>; + type CollectionSymbolLimit = CollectionSymbolLimit; + type MaxResourcesOnMint = MaxResourcesOnMint; } parameter_types! { @@ -1799,6 +1805,16 @@ impl gamedao_sense::Config for Runtime { type StringLimit = StringLimit; } +impl gamedao_battlepass::Config for Runtime { + type Event = Event; + type Control = Control; + type Rmrk = RmrkCore; + type StringLimit = StringLimit; + type SymbolLimit = CollectionSymbolLimit; + type PartsLimit = PartsLimit; + type MaxResourcesOnMint = MaxResourcesOnMint; +} + construct_runtime!( pub enum Runtime where Block = Block, @@ -1877,6 +1893,7 @@ construct_runtime!( Sense: gamedao_sense, Control: gamedao_control, Signal: gamedao_signal, + Battlepass: gamedao_battlepass, // Zero pallets: // Migration: module_migration, @@ -1990,6 +2007,7 @@ mod benches { [gamedao_control, Control] [gamedao_flow, Flow] [gamedao_signal, Signal] + // [gamedao_battlepass, Battlepass] ); } diff --git a/bin/subzero-dev/node/Cargo.toml b/bin/subzero-dev/node/Cargo.toml index e22ad96a39..82da4abe7a 100644 --- a/bin/subzero-dev/node/Cargo.toml +++ b/bin/subzero-dev/node/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subzero-dev-node" -version = "3.2.63" +version = "3.2.66" authors = ["ZERO "] description = "A substrate node for video games and beyond." license = "GPL-3.0-or-later WITH Classpath-exception-2.0" diff --git a/bin/subzero-dev/runtime/Cargo.toml b/bin/subzero-dev/runtime/Cargo.toml index 2f84372d2e..f92c27e159 100644 --- a/bin/subzero-dev/runtime/Cargo.toml +++ b/bin/subzero-dev/runtime/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subzero-dev-runtime" -version = "3.2.63" +version = "3.2.66" authors = ["ZERO "] license = "GPL-3.0-or-later WITH Classpath-exception-2.0" homepage = "https://zero.io" @@ -109,6 +109,7 @@ gamedao-flow = { path = "../../../modules/gamedao-protocol/flow", default-featur gamedao-control = { path = "../../../modules/gamedao-protocol/control", default-features = false } gamedao-signal = { path = "../../../modules/gamedao-protocol/signal", default-features = false } gamedao-sense = { path = "../../../modules/gamedao-protocol/sense", default-features = false } +gamedao-battlepass = { path = "../../../modules/gamedao-protocol/battlepass", default-features = false } [features] default = [ @@ -197,6 +198,7 @@ std = [ "gamedao-flow/std", "gamedao-control/std", "gamedao-signal/std", + "gamedao-battlepass/std", ] runtime-benchmarks = [ @@ -214,6 +216,7 @@ runtime-benchmarks = [ "pallet-identity/runtime-benchmarks", "pallet-treasury/runtime-benchmarks", "pallet-timestamp/runtime-benchmarks", + "pallet-uniques/runtime-benchmarks", "pallet-xcm/runtime-benchmarks", "sp-runtime/runtime-benchmarks", "xcm-builder/runtime-benchmarks", diff --git a/bin/subzero-dev/runtime/src/lib.rs b/bin/subzero-dev/runtime/src/lib.rs index ecf9c35a8f..95b5e55822 100644 --- a/bin/subzero-dev/runtime/src/lib.rs +++ b/bin/subzero-dev/runtime/src/lib.rs @@ -160,7 +160,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("subzero"), impl_name: create_runtime_str!("dev"), authoring_version: 75, - spec_version: 63, + spec_version: 66, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 1, @@ -1075,6 +1075,16 @@ impl gamedao_sense::Config for Runtime { type StringLimit = StringLimit; } +impl gamedao_battlepass::Config for Runtime { + type Event = Event; + type Control = Control; + type Rmrk = RmrkCore; + type StringLimit = StringLimit; + type SymbolLimit = ConstU32<100>; + type PartsLimit = ConstU32<25>; + type MaxResourcesOnMint = ConstU32<100>; +} + // Create the runtime by composing the FRAME pallets that were previously configured. construct_runtime!( pub enum Runtime where @@ -1143,6 +1153,7 @@ construct_runtime!( Sense: gamedao_sense = 71, Control: gamedao_control = 72, Signal: gamedao_signal = 73, + Battlepass: gamedao_battlepass = 74, } ); diff --git a/bin/subzero/runtime/src/lib.rs b/bin/subzero/runtime/src/lib.rs index c49729ecce..9ac2d32d55 100644 --- a/bin/subzero/runtime/src/lib.rs +++ b/bin/subzero/runtime/src/lib.rs @@ -1065,10 +1065,6 @@ mod benches { [pallet_timestamp, Timestamp] [pallet_collator_selection, CollatorSelection] [cumulus_pallet_xcmp_queue, XcmpQueue] - [gamedao_flow, Flow] - [gamedao_sense, Sense] - [gamedao_control, Control] - [gamedao_signal, Signal] ); } diff --git a/modules/gamedao-protocol b/modules/gamedao-protocol index 764f40ce77..03fcd977da 160000 --- a/modules/gamedao-protocol +++ b/modules/gamedao-protocol @@ -1 +1 @@ -Subproject commit 764f40ce77299f7c3a0c817f35d95f64d5d3fa70 +Subproject commit 03fcd977da35851671090805fa577d3299bb0419