Skip to content

Commit

Permalink
Merge branch 'master' into adr-0001
Browse files Browse the repository at this point in the history
  • Loading branch information
eljobe committed Jan 13, 2025
2 parents 92e2789 + b6577a1 commit 3297ae2
Show file tree
Hide file tree
Showing 29 changed files with 381 additions and 164 deletions.
16 changes: 9 additions & 7 deletions .github/workflows/arbitrator-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,20 +66,22 @@ jobs:
cache: 'yarn'
cache-dependency-path: '**/yarn.lock'

- name: Install rust stable
uses: dtolnay/rust-toolchain@stable
with:
toolchain: 'stable'
components: 'llvm-tools-preview, rustfmt, clippy'

- name: Install rust nightly
uses: dtolnay/rust-toolchain@nightly
id: install-rust-nightly
with:
toolchain: 'nightly-2024-08-06'
toolchain: 'nightly-2024-10-06'
targets: 'wasm32-wasi, wasm32-unknown-unknown'
components: 'rust-src, rustfmt, clippy'

- name: Install rust stable
id: install-rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: '1.80.1'
targets: 'wasm32-wasi, wasm32-unknown-unknown'
components: 'llvm-tools-preview, rustfmt, clippy'

- name: Set STYLUS_NIGHTLY_VER environment variable
run: echo "STYLUS_NIGHTLY_VER=+$(rustup toolchain list | grep '^nightly' | head -n1 | cut -d' ' -f1)" >> "$GITHUB_ENV"

Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,17 @@ jobs:
- name: Install rust stable
uses: dtolnay/rust-toolchain@stable
id: install-rust
with:
toolchain: 'stable'
toolchain: '1.80.1'
targets: 'wasm32-wasi, wasm32-unknown-unknown'
components: 'llvm-tools-preview, rustfmt, clippy'

- name: Install rust nightly
uses: dtolnay/rust-toolchain@nightly
id: install-rust-nightly
with:
toolchain: 'nightly-2024-08-06'
toolchain: 'nightly-2024-10-06'
targets: 'wasm32-wasi, wasm32-unknown-unknown'
components: 'rust-src, rustfmt, clippy'

Expand Down
26 changes: 26 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -440,54 +440,80 @@ $(stylus_test_dir)/%.wasm: $(stylus_test_dir)/%.b $(stylus_lang_bf)

$(stylus_test_keccak_wasm): $(stylus_test_keccak_src)
$(cargo_nightly) --manifest-path $< --release --config $(stylus_cargo)
wasm2wat $@ > $@.wat #removing reference types
wat2wasm $@.wat -o $@
@touch -c $@ # cargo might decide to not rebuild the binary

$(stylus_test_keccak-100_wasm): $(stylus_test_keccak-100_src)
$(cargo_nightly) --manifest-path $< --release --config $(stylus_cargo)
wasm2wat $@ > $@.wat #removing reference types
wat2wasm $@.wat -o $@
@touch -c $@ # cargo might decide to not rebuild the binary

$(stylus_test_fallible_wasm): $(stylus_test_fallible_src)
$(cargo_nightly) --manifest-path $< --release --config $(stylus_cargo)
wasm2wat $@ > $@.wat #removing reference types
wat2wasm $@.wat -o $@
@touch -c $@ # cargo might decide to not rebuild the binary

$(stylus_test_storage_wasm): $(stylus_test_storage_src)
$(cargo_nightly) --manifest-path $< --release --config $(stylus_cargo)
wasm2wat $@ > $@.wat #removing reference types
wat2wasm $@.wat -o $@
@touch -c $@ # cargo might decide to not rebuild the binary

$(stylus_test_multicall_wasm): $(stylus_test_multicall_src)
$(cargo_nightly) --manifest-path $< --release --config $(stylus_cargo)
wasm2wat $@ > $@.wat #removing reference types
wat2wasm $@.wat -o $@
@touch -c $@ # cargo might decide to not rebuild the binary

$(stylus_test_log_wasm): $(stylus_test_log_src)
$(cargo_nightly) --manifest-path $< --release --config $(stylus_cargo)
wasm2wat $@ > $@.wat #removing reference types
wat2wasm $@.wat -o $@
@touch -c $@ # cargo might decide to not rebuild the binary

$(stylus_test_create_wasm): $(stylus_test_create_src)
$(cargo_nightly) --manifest-path $< --release --config $(stylus_cargo)
wasm2wat $@ > $@.wat #removing reference types
wat2wasm $@.wat -o $@
@touch -c $@ # cargo might decide to not rebuild the binary

$(stylus_test_math_wasm): $(stylus_test_math_src)
$(cargo_nightly) --manifest-path $< --release --config $(stylus_cargo)
wasm2wat $@ > $@.wat #removing reference types
wat2wasm $@.wat -o $@
@touch -c $@ # cargo might decide to not rebuild the binary

$(stylus_test_evm-data_wasm): $(stylus_test_evm-data_src)
$(cargo_nightly) --manifest-path $< --release --config $(stylus_cargo)
wasm2wat $@ > $@.wat #removing reference types
wat2wasm $@.wat -o $@
@touch -c $@ # cargo might decide to not rebuild the binary

$(stylus_test_read-return-data_wasm): $(stylus_test_read-return-data_src)
$(cargo_nightly) --manifest-path $< --release --config $(stylus_cargo)
wasm2wat $@ > $@.wat #removing reference types
wat2wasm $@.wat -o $@
@touch -c $@ # cargo might decide to not rebuild the binary

$(stylus_test_sdk-storage_wasm): $(stylus_test_sdk-storage_src)
$(cargo_nightly) --manifest-path $< --release --config $(stylus_cargo)
wasm2wat $@ > $@.wat #removing reference types
wat2wasm $@.wat -o $@
@touch -c $@ # cargo might decide to not rebuild the binary

$(stylus_test_erc20_wasm): $(stylus_test_erc20_src)
$(cargo_nightly) --manifest-path $< --release --config $(stylus_cargo)
wasm2wat $@ > $@.wat #removing reference types
wat2wasm $@.wat -o $@
@touch -c $@ # cargo might decide to not rebuild the binary

$(stylus_test_hostio-test_wasm): $(stylus_test_hostio-test_src)
$(cargo_nightly) --manifest-path $< --release --config $(stylus_cargo)
wasm2wat $@ > $@.wat #removing reference types
wat2wasm $@.wat -o $@
@touch -c $@ # cargo might decide to not rebuild the binary

contracts/test/prover/proofs/float%.json: $(arbitrator_cases)/float%.wasm $(prover_bin) $(output_latest)/soft-float.wasm
Expand Down
61 changes: 38 additions & 23 deletions arbitrator/Cargo.lock

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

4 changes: 2 additions & 2 deletions arbitrator/arbutil/src/operator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -595,13 +595,13 @@ impl Display for OperatorCode {
}
}

impl<'a> From<Operator<'a>> for OperatorCode {
impl From<Operator<'_>> for OperatorCode {
fn from(op: Operator) -> Self {
OperatorCode::from(&op)
}
}

impl<'a> From<&Operator<'a>> for OperatorCode {
impl From<&Operator<'_>> for OperatorCode {
fn from(op: &Operator) -> Self {
use Operator as O;

Expand Down
2 changes: 1 addition & 1 deletion arbitrator/jit/src/caller_env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ impl<'a> JitEnv<'a> for WasmEnvMut<'a> {
}
}

impl<'s> JitMemAccess<'s> {
impl JitMemAccess<'_> {
fn view(&self) -> MemoryView {
self.memory.view(&self.store)
}
Expand Down
2 changes: 1 addition & 1 deletion arbitrator/prover/src/binary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ pub fn parse<'a>(input: &'a [u8], path: &'_ Path) -> Result<WasmBinary<'a>> {
Ok(binary)
}

impl<'a> Debug for WasmBinary<'a> {
impl Debug for WasmBinary<'_> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("WasmBinary")
.field("types", &self.types)
Expand Down
2 changes: 1 addition & 1 deletion arbitrator/prover/src/programs/counter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ pub struct FuncCounter<'a> {
block: Vec<Operator<'a>>,
}

impl<'a> FuncCounter<'a> {
impl FuncCounter<'_> {
fn new(counters: Arc<Mutex<Vec<GlobalIndex>>>) -> Self {
let block = vec![];
Self { counters, block }
Expand Down
4 changes: 2 additions & 2 deletions arbitrator/prover/src/programs/depth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ pub struct FuncDepthChecker<'a> {
done: bool,
}

impl<'a> FuncDepthChecker<'a> {
impl FuncDepthChecker<'_> {
fn new(
global: GlobalIndex,
funcs: Arc<HashMap<FunctionIndex, FunctionType>>,
Expand Down Expand Up @@ -227,7 +227,7 @@ impl<'a> FuncMiddleware<'a> for FuncDepthChecker<'a> {
}
}

impl<'a> FuncDepthChecker<'a> {
impl FuncDepthChecker<'_> {
fn worst_case_depth(&self) -> Result<u32> {
use Operator::*;

Expand Down
3 changes: 2 additions & 1 deletion arbitrator/prover/src/programs/meter.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Copyright 2022-2023, Offchain Labs, Inc.
// For license information, see https://github.com/nitro/blob/master/LICENSE
#![allow(clippy::needless_lifetimes)]

use crate::{
programs::{
Expand Down Expand Up @@ -122,7 +123,7 @@ pub struct FuncMeter<'a, F: OpcodePricer> {
sigs: Arc<SigMap>,
}

impl<'a, F: OpcodePricer> FuncMeter<'a, F> {
impl<F: OpcodePricer> FuncMeter<'_, F> {
fn new(
ink_global: GlobalIndex,
status_global: GlobalIndex,
Expand Down
Loading

0 comments on commit 3297ae2

Please sign in to comment.