Skip to content

Commit

Permalink
Perform the protobuf encoding and decoding manually (#2326)
Browse files Browse the repository at this point in the history
* Perform the protobuf encoding and decoding manually

* Link to noise protobuf

* Remove unused function to fix warning

* Restore libc6-dev-i386 on 32bits target CI

* Restore cmake in wasm-node-size-diff step

* Remove more traces of cmake

* Forgot a protobuf file

* Add values for with_capacity

* Rustfmt

* Add tests

* Rustfmt
  • Loading branch information
tomaka authored May 30, 2022
1 parent 5fd1f65 commit 69b11f5
Show file tree
Hide file tree
Showing 26 changed files with 1,009 additions and 933 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ jobs:
container:
image: rust:1.60
steps:
- run: apt-get update && apt install -y cmake # For the `prost-build` library
- uses: actions/checkout@v3
- uses: Swatinem/rust-cache@v1
- run: RUSTFLAGS=-Dwarnings cargo test --locked --workspace --all-features
Expand All @@ -39,7 +38,7 @@ jobs:
container:
image: rust:1.60
steps:
- run: apt-get update && apt install -y libc6-dev-i386 && apt install -y cmake # For the `prost-build` library
- run: apt-get update && apt install -y libc6-dev-i386
- uses: actions/checkout@v3
- uses: Swatinem/rust-cache@v1
- run: rustup target add i686-unknown-linux-gnu
Expand All @@ -50,7 +49,7 @@ jobs:
container:
image: rust:1.60
steps:
- run: apt-get update && apt install -y binaryen && apt install -y cmake # For `wasm-opt` and the `prost-build` library
- run: apt-get update && apt install -y binaryen # For `wasm-opt`
- uses: actions/checkout@v3
- uses: Swatinem/rust-cache@v1
- uses: actions/[email protected]
Expand All @@ -63,7 +62,7 @@ jobs:
container:
image: rust:1.60
steps:
- run: apt-get update && apt install -y cmake # For the `prost-build` library
- run: apt-get update && apt install -y cmake # TODO: remove; temporarily needed to build the `prost-build` library in the "before" comparison
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Necessary to fetch pull request base below
Expand Down Expand Up @@ -98,7 +97,6 @@ jobs:
container:
image: rust:1.60
steps:
- run: apt-get update && apt install -y cmake # For the `prost-build` library
- uses: actions/checkout@v3
- uses: Swatinem/rust-cache@v1
- run: RUSTFLAGS=-Dwarnings cargo check --package smoldot --locked --no-default-features
Expand All @@ -111,7 +109,6 @@ jobs:
container:
image: rust:1.60
steps:
- run: apt-get update && apt install -y cmake # For the `prost-build` library
- uses: actions/checkout@v3
- uses: Swatinem/rust-cache@v1
- run: cargo doc --verbose --workspace --all-features --no-deps --document-private-items
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
- uses: actions/[email protected]
with:
node-version: 14
- run: apt-get update && apt install -y binaryen && apt install -y cmake # For `wasm-opt` and the `prost-build` library
- run: apt-get update && apt install -y binaryen # For `wasm-opt`
- uses: actions-rs/toolchain@v1
with:
# Ideally we don't want to install any toolchain, but the GH action doesn't support this.
Expand Down
122 changes: 0 additions & 122 deletions Cargo.lock

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

4 changes: 0 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ num-bigint = { version = "0.4.3", default-features = false }
num-rational = { version = "0.4.0", default-features = false, features = ["num-bigint"] }
num-traits = { version = "0.2.15", default-features = false }
pbkdf2 = { version = "0.11.0", default-features = false }
prost = { version = "0.10.4", default-features = false, features = ["prost-derive"] }
rand = { version = "0.8.5", default-features = false, features = ["std", "std_rng"] } # TODO: rand is used in hack-y ways at the moment ; these features should be removed
rand_chacha = { version = "0.3.1", default-features = false }
ruzstd = { version = "0.2.4" } # TODO: doesn't support no_std :-/
Expand Down Expand Up @@ -101,9 +100,6 @@ parity-scale-codec = { version = "3.1.2", features = ["derive"], default-feature
# `std` feature
wasmtime = { version = "0.36.0", default-features = false, features = ["async", "cranelift"], optional = true }

[build-dependencies]
prost-build = "0.10.4"

[dev-dependencies]
async-std = "1.11.0"
criterion = "0.3.5"
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ The following list is a best-effort list of packages that must be available on t
- `clang` or `gcc`
- `pkg-config`
- `sqlite`
- `cmake`

The full client is currently a work in progress and doesn't support many features that the official client supports.

Expand Down
2 changes: 1 addition & 1 deletion bin/full-node/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ LABEL maintainer "Pierre Krieger <[email protected]>"
COPY ./../.. /build
WORKDIR /build

RUN apt-get update && apt-get install -y musl-tools cmake
RUN apt-get update && apt-get install -y musl-tools
RUN rustup target add x86_64-unknown-linux-musl
RUN cargo build --target x86_64-unknown-linux-musl --package smoldot-full-node --release --verbose

Expand Down
1 change: 1 addition & 0 deletions bin/wasm-node/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
### Fixed

- Fix a panic in case of a Noise message with an invalid length. ([#2321](https://github.com/paritytech/smoldot/pull/2321))
- Fix a panic in case of a carefully-crafted LEB128 length. ([#2326](https://github.com/paritytech/smoldot/pull/2326))

## 0.6.16 - 2022-05-16

Expand Down
31 changes: 0 additions & 31 deletions build.rs

This file was deleted.

Loading

0 comments on commit 69b11f5

Please sign in to comment.