From 1d1effa3ab77c6ca5a8681ea4194a21d8de0f46e Mon Sep 17 00:00:00 2001 From: AntonD3 <74021421+AntonD3@users.noreply.github.com> Date: Fri, 27 Oct 2023 00:35:15 +0400 Subject: [PATCH] fix: boojum integration nightly rust (#177) Co-authored-by: MexicanAce --- .github/workflows/checks.yaml | 20 +++++++------------- .github/workflows/release.yml | 4 ++-- .github/workflows/tests.yaml | 17 +++++++---------- e2e-tests/test/zks-apis.test.ts | 2 +- src/node.rs | 9 ++------- 5 files changed, 19 insertions(+), 33 deletions(-) diff --git a/.github/workflows/checks.yaml b/.github/workflows/checks.yaml index 5100a085..1c9c3125 100644 --- a/.github/workflows/checks.yaml +++ b/.github/workflows/checks.yaml @@ -6,7 +6,7 @@ on: tags: - 'v*' pull_request: - branches: [main] + branches: [boojum-integration] workflow_dispatch: jobs: @@ -16,15 +16,12 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - name: Install latest nightly - uses: dtolnay/rust-toolchain@stable + - name: Install rust + uses: actions-rust-lang/setup-rust-toolchain@v1 with: - toolchain: nightly + toolchain: nightly-2023-07-21 components: rustfmt, clippy - - name: Rust Cache - uses: Swatinem/rust-cache@v2 - - uses: actions/setup-node@v3 with: node-version: 18.x @@ -43,14 +40,11 @@ jobs: os: [ubuntu-latest, macos-latest] steps: - uses: actions/checkout@v3 - + - name: Install Rust - uses: dtolnay/rust-toolchain@stable + uses: actions-rust-lang/setup-rust-toolchain@v1 with: - toolchain: stable - - - name: Rust Cache - uses: Swatinem/rust-cache@v2 + toolchain: nightly-2023-07-21 - name: Build Code run: make all diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bdcadb5e..769804eb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -44,8 +44,8 @@ jobs: steps: - name: Checkout sources uses: actions/checkout@v3 - - name: Get latest version of stable Rust - run: rustup update stable + - name: Set version of nightly Rust + run: rustup default nightly-2023-07-21 - name: Install target run: rustup target add ${{ matrix.arch }} - uses: Swatinem/rust-cache@v2 diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index ad01072b..540d52f8 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -2,11 +2,11 @@ name: run on: push: - branches: [main] + branches: [boojum-integration] tags: - 'v*' pull_request: - branches: [main] + branches: [boojum-integration] workflow_dispatch: jobs: test: @@ -21,15 +21,12 @@ jobs: uses: actions/checkout@v3 - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - toolchain: stable + uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + toolchain: nightly-2023-07-21 - - name: Cache Rust Dependencies - uses: Swatinem/rust-cache@v2 - - name: Install cargo-nextest - run: cargo +stable install cargo-nextest - + run: cargo install cargo-nextest + - name: Run tests run: cargo nextest run diff --git a/e2e-tests/test/zks-apis.test.ts b/e2e-tests/test/zks-apis.test.ts index 35770486..dde269d5 100644 --- a/e2e-tests/test/zks-apis.test.ts +++ b/e2e-tests/test/zks-apis.test.ts @@ -31,7 +31,7 @@ describe("zks_estimateFee", function () { const response: Fee = await provider.send("zks_estimateFee", [transaction]); // Assert - expect(ethers.BigNumber.from(response.gas_limit)).to.eql(ethers.BigNumber.from("1230957"), "Unexpected gas_limit"); + expect(ethers.BigNumber.from(response.gas_limit)).to.eql(ethers.BigNumber.from("1231992"), "Unexpected gas_limit"); expect(ethers.BigNumber.from(response.gas_per_pubdata_limit)).to.eql( ethers.BigNumber.from("4080"), "Unexpected gas_per_pubdata_limit" diff --git a/src/node.rs b/src/node.rs index fd1bb449..fe13acbc 100644 --- a/src/node.rs +++ b/src/node.rs @@ -478,14 +478,9 @@ impl InMemoryNodeInner { let execution_mode = TxExecutionMode::EstimateFee; let (mut batch_env, _) = self.create_l1_batch_env(storage.clone()); batch_env.l1_gas_price = l1_gas_price; - let impersonating = if self + let impersonating = self .impersonated_accounts - .contains(&l2_tx.common_data.initiator_address) - { - true - } else { - false - }; + .contains(&l2_tx.common_data.initiator_address); let system_env = self.create_system_env( self.system_contracts .contracts_for_fee_estimate(impersonating)