Skip to content

Commit d24563c

Browse files
committed
Merge remote-tracking branch 'origin/master' into laz/ethexe/3-blocks/network-announce
# Conflicts: # ethexe/common/src/injected.rs # ethexe/consensus/src/tx_validation.rs # ethexe/consensus/src/validator/producer.rs # ethexe/consensus/src/validator/tx_pool.rs # ethexe/network/src/validator/topic.rs # ethexe/service/src/tests/mod.rs
2 parents 9f995fc + 44dec28 commit d24563c

File tree

382 files changed

+10164
-7475
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

382 files changed

+10164
-7475
lines changed

.cargo/config.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,8 @@ GEAR_WORKSPACE_DIR = { value = "", relative = true }
33

44
[alias]
55
gbuild = "run -p cargo-gbuild --"
6+
7+
[registries]
8+
# crates.io registry to hack `substrate-wasm-builder` patch section
9+
# so runtimes do not use `gear-workspace-hack`
10+
crates-io-patch-hack = { index = "sparse+https://index.crates.io/" }

.config/hakari.toml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# This file contains settings for `cargo hakari`.
2+
# See https://docs.rs/cargo-hakari/latest/cargo_hakari/config for a full list of options.
3+
4+
hakari-package = "gear-workspace-hack"
5+
6+
# Format version for hakari's output. Version 4 requires cargo-hakari 0.9.22 or above.
7+
dep-format-version = "4"
8+
9+
# Setting workspace.resolver = "2" or higher in the root Cargo.toml is HIGHLY recommended.
10+
# Hakari works much better with the v2 resolver. (The v2 and v3 resolvers are identical from
11+
# hakari's perspective, so you're welcome to set either.)
12+
#
13+
# For more about the new feature resolver, see:
14+
# https://blog.rust-lang.org/2021/03/25/Rust-1.51.0.html#cargos-new-feature-resolver
15+
resolver = "3"
16+
17+
# Add triples corresponding to platforms commonly used by developers here.
18+
# https://doc.rust-lang.org/rustc/platform-support.html
19+
platforms = [
20+
"x86_64-unknown-linux-gnu",
21+
"aarch64-unknown-linux-gnu",
22+
"aarch64-apple-darwin"
23+
]
24+
25+
# Write out exact versions rather than a semver range. (Defaults to false.)
26+
# exact-versions = true
27+
28+
workspace-hack-line-style = "workspace-dotted"
29+
30+
[final-excludes]
31+
third-party = [
32+
# we have to exclude these deps because of their `try-runtime` and `runtime-benchmarks` features,
33+
# because we cannot, for example, run `cargo build --package gear-cli` without `--all-features` flag
34+
{ name = "frame-benchmarking", git = "https://github.com/gear-tech/polkadot-sdk.git", branch = "gear-polkadot-stable2409-wasm32v1-none" },
35+
{ name = "frame-benchmarking-cli", git = "https://github.com/gear-tech/polkadot-sdk.git", branch = "gear-polkadot-stable2409-wasm32v1-none" },
36+
{ name = "frame-election-provider-support", git = "https://github.com/gear-tech/polkadot-sdk.git", branch = "gear-polkadot-stable2409-wasm32v1-none" },
37+
{ name = "frame-executive", git = "https://github.com/gear-tech/polkadot-sdk.git", branch = "gear-polkadot-stable2409-wasm32v1-none" },
38+
{ name = "frame-support", git = "https://github.com/gear-tech/polkadot-sdk.git", branch = "gear-polkadot-stable2409-wasm32v1-none" },
39+
{ name = "frame-system", git = "https://github.com/gear-tech/polkadot-sdk.git", branch = "gear-polkadot-stable2409-wasm32v1-none" },
40+
{ name = "frame-try-runtime", git = "https://github.com/gear-tech/polkadot-sdk.git", branch = "gear-polkadot-stable2409-wasm32v1-none" },
41+
{ name = "pallet-authority-discovery", git = "https://github.com/gear-tech/polkadot-sdk.git", branch = "gear-polkadot-stable2409-wasm32v1-none" },
42+
{ name = "pallet-authorship", git = "https://github.com/gear-tech/polkadot-sdk.git", branch = "gear-polkadot-stable2409-wasm32v1-none" },
43+
{ name = "pallet-babe", git = "https://github.com/gear-tech/polkadot-sdk.git", branch = "gear-polkadot-stable2409-wasm32v1-none" },
44+
{ name = "pallet-bags-list", git = "https://github.com/gear-tech/polkadot-sdk.git", branch = "gear-polkadot-stable2409-wasm32v1-none" },
45+
{ name = "pallet-balances", git = "https://github.com/gear-tech/polkadot-sdk.git", branch = "gear-polkadot-stable2409-wasm32v1-none" },
46+
{ name = "pallet-bounties", git = "https://github.com/gear-tech/polkadot-sdk.git", branch = "gear-polkadot-stable2409-wasm32v1-none" },
47+
{ name = "pallet-child-bounties", git = "https://github.com/gear-tech/polkadot-sdk.git", branch = "gear-polkadot-stable2409-wasm32v1-none" },
48+
{ name = "pallet-conviction-voting", git = "https://github.com/gear-tech/polkadot-sdk.git", branch = "gear-polkadot-stable2409-wasm32v1-none" },
49+
{ name = "pallet-election-provider-multi-phase", git = "https://github.com/gear-tech/polkadot-sdk.git", branch = "gear-polkadot-stable2409-wasm32v1-none" },
50+
{ name = "pallet-grandpa", git = "https://github.com/gear-tech/polkadot-sdk.git", branch = "gear-polkadot-stable2409-wasm32v1-none" },
51+
{ name = "pallet-identity", git = "https://github.com/gear-tech/polkadot-sdk.git", branch = "gear-polkadot-stable2409-wasm32v1-none" },
52+
{ name = "pallet-im-online", git = "https://github.com/gear-tech/polkadot-sdk.git", branch = "gear-polkadot-stable2409-wasm32v1-none" },
53+
{ name = "pallet-multisig", git = "https://github.com/gear-tech/polkadot-sdk.git", branch = "gear-polkadot-stable2409-wasm32v1-none" },
54+
{ name = "pallet-nomination-pools", git = "https://github.com/gear-tech/polkadot-sdk.git", branch = "gear-polkadot-stable2409-wasm32v1-none" },
55+
{ name = "pallet-offences", git = "https://github.com/gear-tech/polkadot-sdk.git", branch = "gear-polkadot-stable2409-wasm32v1-none" },
56+
{ name = "pallet-preimage", git = "https://github.com/gear-tech/polkadot-sdk.git", branch = "gear-polkadot-stable2409-wasm32v1-none" },
57+
{ name = "pallet-proxy", git = "https://github.com/gear-tech/polkadot-sdk.git", branch = "gear-polkadot-stable2409-wasm32v1-none" },
58+
{ name = "pallet-ranked-collective", git = "https://github.com/gear-tech/polkadot-sdk.git", branch = "gear-polkadot-stable2409-wasm32v1-none" },
59+
{ name = "pallet-referenda", git = "https://github.com/gear-tech/polkadot-sdk.git", branch = "gear-polkadot-stable2409-wasm32v1-none" },
60+
{ name = "pallet-scheduler", git = "https://github.com/gear-tech/polkadot-sdk.git", branch = "gear-polkadot-stable2409-wasm32v1-none" },
61+
{ name = "pallet-session", git = "https://github.com/gear-tech/polkadot-sdk.git", branch = "gear-polkadot-stable2409-wasm32v1-none" },
62+
{ name = "pallet-staking", git = "https://github.com/gear-tech/polkadot-sdk.git", branch = "gear-polkadot-stable2409-wasm32v1-none" },
63+
{ name = "pallet-sudo", git = "https://github.com/gear-tech/polkadot-sdk.git", branch = "gear-polkadot-stable2409-wasm32v1-none" },
64+
{ name = "pallet-timestamp", git = "https://github.com/gear-tech/polkadot-sdk.git", branch = "gear-polkadot-stable2409-wasm32v1-none" },
65+
{ name = "pallet-transaction-payment", git = "https://github.com/gear-tech/polkadot-sdk.git", branch = "gear-polkadot-stable2409-wasm32v1-none" },
66+
{ name = "pallet-treasury", git = "https://github.com/gear-tech/polkadot-sdk.git", branch = "gear-polkadot-stable2409-wasm32v1-none" },
67+
{ name = "pallet-utility", git = "https://github.com/gear-tech/polkadot-sdk.git", branch = "gear-polkadot-stable2409-wasm32v1-none" },
68+
{ name = "pallet-vesting", git = "https://github.com/gear-tech/polkadot-sdk.git", branch = "gear-polkadot-stable2409-wasm32v1-none" },
69+
{ name = "pallet-whitelist", git = "https://github.com/gear-tech/polkadot-sdk.git", branch = "gear-polkadot-stable2409-wasm32v1-none" },
70+
{ name = "sc-client-db", git = "https://github.com/gear-tech/polkadot-sdk.git", branch = "gear-polkadot-stable2409-wasm32v1-none" },
71+
{ name = "sc-service", git = "https://github.com/gear-tech/polkadot-sdk.git", branch = "gear-polkadot-stable2409-wasm32v1-none" },
72+
{ name = "sp-runtime", git = "https://github.com/gear-tech/polkadot-sdk.git", branch = "gear-polkadot-stable2409-wasm32v1-none" },
73+
{ name = "sp-staking", git = "https://github.com/gear-tech/polkadot-sdk.git", branch = "gear-polkadot-stable2409-wasm32v1-none" },
74+
]

.config/nextest.toml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,24 @@ chmod +x target/release/gear
1010
leak-timeout = { period = "5s", result = "fail" }
1111
slow-timeout = { period = "1m", terminate-after = 5 }
1212

13+
[profile.default.junit]
14+
path = "junit.xml"
15+
store-success-output = false
16+
store-failure-output = true
17+
1318
[profile.ci]
1419
fail-fast = false
1520
archive.include = [
1621
{ path = "wasm32-gear", relative-to = "target", on-missing = "warn" },
1722
]
1823

19-
[profile.ci.junit]
20-
path = "junit.xml"
21-
2224
# sdk
2325
[[profile.ci.overrides]]
24-
filter = 'package(gclient) or package(gsdk) or package(gcli)'
26+
filter = 'package(gsdk) or package(gcli)'
2527
retries = 5
2628

2729
[[profile.ci.scripts]]
28-
filter = 'package(gclient) or package(gsdk) or package(gcli)'
30+
filter = 'package(gsdk) or package(gcli)'
2931
platform = "cfg(unix)"
3032
setup = "replace-node-and-runtime"
3133

.ethexe.example.local.toml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
# (optional, default: false).
1212
# tmp = false
1313

14+
# Flag to run node in development mode.
15+
# (optional, default: false).
16+
# dev = false
17+
1418
# Public key of the validator, if node should act as one.
1519
# Provided in the format of 33-byte hex string:
1620
# - `yParityCompressed`, compressed `publicKeyY`,
@@ -83,11 +87,11 @@ canonical-quarantine = 0
8387

8488
# Maximum allowed deepness of the chain for validating commitments.
8589
# (optional, must be non-zero u32, default: 10_000).
86-
validate-chain-deepness-limit = 10_000
90+
# validate-chain-deepness-limit = 10_000
8791

8892
# Threshold for producer to submit commitment despite of no transitions.
8993
# (optional, must be non-zero u32, default: 500).
90-
chain-deepness-threshold = 500
94+
# chain-deepness-threshold = 500
9195

9296
##########################################################################################
9397

@@ -98,7 +102,7 @@ chain-deepness-threshold = 500
98102
rpc = "ws://localhost:8545"
99103

100104
# Ethereum Beacon RPC endpoint.
101-
# (optional, default: http://localhost:5052).
105+
# (optional, default: http://localhost:8545).
102106
beacon-rpc = "http://localhost:8545"
103107

104108
# Ethereum router contract address.
@@ -107,7 +111,7 @@ router = "0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9"
107111

108112
# Ethereum block time in seconds.
109113
# (optional, default: 12).
110-
# block-time = 12
114+
block-time = 1
111115

112116
##########################################################################################
113117

.ethexe.example.toml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
# (optional, default: false).
1212
# tmp = false
1313

14+
# Flag to run node in development mode.
15+
# (optional, default: false).
16+
# dev = false
17+
1418
# Public key of the validator, if node should act as one.
1519
# Provided in the format of 33-byte hex string:
1620
# - `yParityCompressed`, compressed `publicKeyY`,
@@ -98,8 +102,8 @@
98102
# rpc = "ws://localhost:8545"
99103

100104
# Ethereum Beacon RPC endpoint.
101-
# (optional, default: http://localhost:5052).
102-
# beacon-rpc = "http://localhost:5052"
105+
# (optional, default: http://localhost:8545).
106+
# beacon-rpc = "http://localhost:8545"
103107

104108
# Ethereum router contract address.
105109
# (optional).
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: cargo-hakari
2+
author: ark0f
3+
description: Run `cargo hakari`
4+
5+
inputs:
6+
args:
7+
required: true
8+
description: Arguments for `cargo hakari`
9+
10+
runs:
11+
using: composite
12+
steps:
13+
- id: host-target
14+
run: "echo value=$(rustc -vV | grep host: | cut -d ' ' -f 2) >> $GITHUB_OUTPUT"
15+
shell: bash
16+
17+
- id: already-installed
18+
run: |
19+
if cargo hakari --version; then
20+
echo "value=true" >> $GITHUB_OUTPUT
21+
else
22+
echo "value=false" >> $GITHUB_OUTPUT
23+
fi
24+
shell: bash
25+
26+
- uses: taiki-e/install-action@v2
27+
if: ${{ steps.already-installed.outputs.value == 'false' }}
28+
with:
29+
tool: cargo-hakari
30+
env:
31+
CARGO_BUILD_TARGET: ${{ steps.host-target.outputs.value }}
32+
CARGO_ENCODED_RUSTFLAGS: ""
33+
34+
- run: cargo hakari ${{ inputs.args }}
35+
shell: bash
36+
env:
37+
CARGO_ENCODED_RUSTFLAGS: ""

.github/actions/rust-cache/action.yml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,26 @@ inputs:
1919
cache-all-crates:
2020
required: false
2121
description: Whether to cache every crate
22+
keep-workspace-hack:
23+
required: false
24+
description: Whether to keep workspace hack enabled
25+
default: 'false'
2226

2327
runs:
2428
using: composite
2529
steps:
30+
# disable workspace hack because we cache only specific build commands and don't want the cache to blow up
31+
- uses: ./.github/actions/cargo-hakari
32+
if: ${{ inputs.keep-workspace-hack == 'false' }}
33+
with:
34+
args: disable
35+
36+
# we have manually written deps in our hack so we also should remove the hack as dependency
37+
- uses: ./.github/actions/cargo-hakari
38+
if: ${{ inputs.keep-workspace-hack == 'false' }}
39+
with:
40+
args: remove-deps --yes
41+
2642
- run: |
2743
if [[ "${{ runner.environment }}" == "github-hosted" ]]; then
2844
echo "AWS_ACCESS_KEY_ID=${{ inputs.us-access-key-id }}" >> $GITHUB_ENV
@@ -59,7 +75,7 @@ runs:
5975

6076
- uses: gear-tech/rust-cache@wasm
6177
with:
62-
prefix-key: 'rust-cache/date-${{ steps.date.outputs.value }}'
78+
prefix-key: 'rust-cache/date-${{ steps.date.outputs.value }}-workspace-hack'
6379
key: ${{ inputs.key }}
6480
workspaces: |
6581
. -> target

.github/actions/setup-compilation-env/action.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,11 @@ runs:
8484
8585
wget -qO - https://raw.githubusercontent.com/ScoopInstaller/Main/refs/heads/master/bucket/openssl.json | jq -r '.architecture."64bit".url' | xargs wget -qO openssl_installer.exe
8686
innoextract -d ${{ runner.temp }}/openssl_extracted -I app/include -I app/lib/VC/x64/MT openssl_installer.exe
87-
88-
echo "OPENSSL_NO_VENDOR=1" >> $GITHUB_ENV
89-
echo "OPENSSL_INCLUDE_DIR=${{ runner.temp }}/openssl_extracted/app/include" >> $GITHUB_ENV
90-
echo "OPENSSL_LIB_DIR=${{ runner.temp }}/openssl_extracted/app/lib/VC/x64/MT" >> $GITHUB_ENV
91-
87+
rm openssl_installer.exe
88+
89+
echo "X86_64_PC_WINDOWS_MSVC_OPENSSL_NO_VENDOR=1" >> $GITHUB_ENV
90+
echo "X86_64_PC_WINDOWS_MSVC_OPENSSL_INCLUDE_DIR=${{ runner.temp }}/openssl_extracted/app/include" >> $GITHUB_ENV
91+
echo "X86_64_PC_WINDOWS_MSVC_OPENSSL_LIB_DIR=${{ runner.temp }}/openssl_extracted/app/lib/VC/x64/MT" >> $GITHUB_ENV
9292
cargo xwin env | sed -e 's/^export //' -e 's/;$//' -e 's/="\(.*\)"$/=\1/' >> $GITHUB_ENV
9393
shell: bash
9494

.github/workflows/build-windows.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ jobs:
5858
run: >-
5959
cargo nextest archive --archive-file=workspace.tar.zst
6060
-p gsdk
61-
-p gclient
6261
-p "pallet-*" -p gear-lazy-pages -p gear-runtime-interface
6362
--zstd-level=6
6463
--target=x86_64-pc-windows-msvc
@@ -118,9 +117,3 @@ jobs:
118117
cargo nextest run --archive-file=workspace.tar.zst
119118
-E 'platform(target) and package(gsdk)'
120119
--workspace-remap=${{ github.workspace }}
121-
122-
- name: "Test: Client tests"
123-
run: >-
124-
cargo nextest run --archive-file=workspace.tar.zst
125-
-E 'platform(target) and package(gclient)'
126-
--workspace-remap=${{ github.workspace }}

.github/workflows/build.yml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ jobs:
294294
- name: "Install: Foundry"
295295
uses: foundry-rs/foundry-toolchain@v1
296296
with:
297-
version: v1.5.0-rc1
297+
version: v1.5.0
298298

299299
- name: "Show: Versioning"
300300
run: |
@@ -382,25 +382,25 @@ jobs:
382382
# check that perf benchmarks works. `--steps=5` need to test, that benchmarks works for different input number.
383383
run: >-
384384
./target/release/gear benchmark pallet
385-
--chain=dev --steps=5 --repeat=0 --heap-pages=4096
385+
--chain=dev --steps=5 --repeat=0 --heap-pages=16384
386386
--pallet="*" --extrinsic="*"
387387
388388
- name: "Test: Extra `read_big_state` benchmark"
389389
run: >-
390390
./target/release/gear benchmark pallet
391-
--chain=dev --repeat=0 --heap-pages=4096
391+
--chain=dev --repeat=0 --heap-pages=16384
392392
--pallet=pallet_gear --extrinsic="read_big_state" --extra
393393
394394
- name: "Test: Extra `signal_stack_limit_exceeded_works` benchmark"
395395
run: >-
396396
./target/release/gear benchmark pallet
397-
--chain=dev --repeat=0 --heap-pages=4096
397+
--chain=dev --repeat=0 --heap-pages=16384
398398
--pallet=pallet_gear --extrinsic="signal_stack_limit_exceeded_works" --extra
399399
400400
- name: "Test: Extra `check_all` benchmark"
401401
run: >-
402402
./target/release/gear benchmark pallet
403-
--chain=dev --repeat=0 --heap-pages=4096
403+
--chain=dev --repeat=0 --heap-pages=16384
404404
--pallet=pallet_gear --extrinsic="check_all" --extra
405405
406406
try-runtime:
@@ -552,6 +552,18 @@ jobs:
552552
name: examples-release-wasm32-gear
553553
path: examples-artifact
554554

555+
- name: "ACTIONS: Disable workspace hack"
556+
uses: ./.github/actions/cargo-hakari
557+
with:
558+
# production binaries should not have additional features enabled for deps, too
559+
args: disable
560+
561+
- name: "ACTIONS: Disable workspace hack"
562+
uses: ./.github/actions/cargo-hakari
563+
with:
564+
# also don't compile manually written deps in the hack
565+
args: remove-deps --yes
566+
555567
- name: "Build: Production binaries"
556568
run: cargo build -p wasm-proc -p gear-cli -F cli --profile production
557569

0 commit comments

Comments
 (0)