From 8c69402cc9f11698df60c06436ea203e18f17b2b Mon Sep 17 00:00:00 2001 From: Bence Haromi Date: Mon, 16 Oct 2023 16:20:00 +0100 Subject: [PATCH 1/6] ci: using boojum branch of test node --- .github/workflows/ci.yaml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 100b1e08..9e362a46 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -66,8 +66,13 @@ jobs: node-version: 18.18.0 cache: yarn + - name: Install rust + uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + toolchain: nightly-2023-04-17 + - name: Use era-test-node for testing - uses: dutterbutter/era-test-node-action@latest + run: cargo +nightly install --git https://github.com/matter-labs/era-test-node.git --locked --branch boojum-integration - name: Install dependencies run: yarn @@ -85,6 +90,9 @@ jobs: contracts/precompiles/artifacts bootloader/build + - name: Starting test node + run: era_test_node run > /dev/null 2>&1 + - name: Run tests run: yarn test From 52ac077a100bd8cacb74dfa440a72233fd9a2b71 Mon Sep 17 00:00:00 2001 From: Bence Haromi Date: Mon, 16 Oct 2023 17:58:16 +0100 Subject: [PATCH 2/6] ci: nightly keyword removed --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 9e362a46..902238ef 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -72,7 +72,7 @@ jobs: toolchain: nightly-2023-04-17 - name: Use era-test-node for testing - run: cargo +nightly install --git https://github.com/matter-labs/era-test-node.git --locked --branch boojum-integration + run: cargo install --git https://github.com/matter-labs/era-test-node.git --locked --branch boojum-integration - name: Install dependencies run: yarn From ff8f0d3a89c14b18363600ec4debc6945c261c8a Mon Sep 17 00:00:00 2001 From: Bence Haromi Date: Mon, 16 Oct 2023 18:06:50 +0100 Subject: [PATCH 3/6] test: reenable temporarily disabled tests --- test/AccountCodeStorage.spec.ts | 22 +++++++++++----------- test/ComplexUpgrader.spec.ts | 2 +- test/Compressor.spec.ts | 2 +- test/ContractDeployer.spec.ts | 2 +- test/DefaultAccount.spec.ts | 2 +- test/EventWriter.spec.ts | 2 +- test/ImmutableSimulator.spec.ts | 2 +- test/KnownCodesStorage.spec.ts | 2 +- 8 files changed, 18 insertions(+), 18 deletions(-) diff --git a/test/AccountCodeStorage.spec.ts b/test/AccountCodeStorage.spec.ts index 1d0fef89..9bed917b 100644 --- a/test/AccountCodeStorage.spec.ts +++ b/test/AccountCodeStorage.spec.ts @@ -39,7 +39,7 @@ describe('AccountCodeStorage tests', function () { ).to.be.revertedWith('Callable only by the deployer system contract'); }); - xit('failed to set with constructed bytecode', async () => { + it('failed to set with constructed bytecode', async () => { await expect( accountCodeStorage .connect(deployerAccount) @@ -47,7 +47,7 @@ describe('AccountCodeStorage tests', function () { ).to.be.revertedWith('Code hash is not for a contract on constructor'); }); - xit('successfully stored', async () => { + it('successfully stored', async () => { await accountCodeStorage .connect(deployerAccount) .storeAccountConstructingCodeHash(RANDOM_ADDRESS, CONSTRUCTING_BYTECODE_HASH); @@ -67,7 +67,7 @@ describe('AccountCodeStorage tests', function () { ).to.be.revertedWith('Callable only by the deployer system contract'); }); - xit('failed to set with constructing bytecode', async () => { + it('failed to set with constructing bytecode', async () => { await expect( accountCodeStorage .connect(deployerAccount) @@ -75,7 +75,7 @@ describe('AccountCodeStorage tests', function () { ).to.be.revertedWith('Code hash is not for a constructed contract'); }); - xit('successfully stored', async () => { + it('successfully stored', async () => { await accountCodeStorage .connect(deployerAccount) .storeAccountConstructedCodeHash(RANDOM_ADDRESS, CONSTRUCTED_BYTECODE_HASH); @@ -95,7 +95,7 @@ describe('AccountCodeStorage tests', function () { ); }); - xit('failed to mark already constructed bytecode', async () => { + it('failed to mark already constructed bytecode', async () => { await accountCodeStorage .connect(deployerAccount) .storeAccountConstructedCodeHash(RANDOM_ADDRESS, CONSTRUCTED_BYTECODE_HASH); @@ -107,7 +107,7 @@ describe('AccountCodeStorage tests', function () { await unsetCodeHash(accountCodeStorage, RANDOM_ADDRESS); }); - xit('successfully marked', async () => { + it('successfully marked', async () => { await accountCodeStorage .connect(deployerAccount) .storeAccountConstructingCodeHash(RANDOM_ADDRESS, CONSTRUCTING_BYTECODE_HASH); @@ -127,7 +127,7 @@ describe('AccountCodeStorage tests', function () { expect(await accountCodeStorage.getRawCodeHash(RANDOM_ADDRESS)).to.be.eq(ethers.constants.HashZero); }); - xit('non-zero', async () => { + it('non-zero', async () => { await accountCodeStorage .connect(deployerAccount) .storeAccountConstructedCodeHash(RANDOM_ADDRESS, CONSTRUCTED_BYTECODE_HASH); @@ -152,7 +152,7 @@ describe('AccountCodeStorage tests', function () { expect(await accountCodeStorage.getCodeHash(wallet.address)).to.be.eq(EMPTY_STRING_KECCAK); }); - xit('address in the constructor', async () => { + it('address in the constructor', async () => { await accountCodeStorage .connect(deployerAccount) .storeAccountConstructingCodeHash(RANDOM_ADDRESS, CONSTRUCTING_BYTECODE_HASH); @@ -162,7 +162,7 @@ describe('AccountCodeStorage tests', function () { await unsetCodeHash(accountCodeStorage, RANDOM_ADDRESS); }); - xit('constructed code hash', async () => { + it('constructed code hash', async () => { await accountCodeStorage .connect(deployerAccount) .storeAccountConstructedCodeHash(RANDOM_ADDRESS, CONSTRUCTED_BYTECODE_HASH); @@ -188,7 +188,7 @@ describe('AccountCodeStorage tests', function () { expect(await accountCodeStorage.getCodeSize('0x0000000000000000000000000000000000000001')).to.be.eq(0); }); - xit('address in the constructor', async () => { + it('address in the constructor', async () => { await accountCodeStorage .connect(deployerAccount) .storeAccountConstructingCodeHash(RANDOM_ADDRESS, CONSTRUCTING_BYTECODE_HASH); @@ -198,7 +198,7 @@ describe('AccountCodeStorage tests', function () { await unsetCodeHash(accountCodeStorage, RANDOM_ADDRESS); }); - xit('non-zero size', async () => { + it('non-zero size', async () => { await accountCodeStorage .connect(deployerAccount) .storeAccountConstructedCodeHash(RANDOM_ADDRESS, CONSTRUCTED_BYTECODE_HASH); diff --git a/test/ComplexUpgrader.spec.ts b/test/ComplexUpgrader.spec.ts index 259ec527..ea92b57a 100644 --- a/test/ComplexUpgrader.spec.ts +++ b/test/ComplexUpgrader.spec.ts @@ -23,7 +23,7 @@ describe('ComplexUpgrader tests', function () { ).to.be.revertedWith('Can only be called by FORCE_DEPLOYER'); }); - xit('successfully upgraded', async () => { + it('successfully upgraded', async () => { await network.provider.request({ method: 'hardhat_impersonateAccount', params: [FORCE_DEPLOYER_ADDRESS] diff --git a/test/Compressor.spec.ts b/test/Compressor.spec.ts index b29fdee2..0e1ba314 100644 --- a/test/Compressor.spec.ts +++ b/test/Compressor.spec.ts @@ -12,7 +12,7 @@ import { } from './shared/constants'; import { deployContract, getCode, getWallets, loadArtifact, setCode } from './shared/utils'; -xdescribe('Compressor tests', function () { +describe('Compressor tests', function () { let wallet: Wallet; let compressor: Compressor; let bootloader: ethers.Signer; diff --git a/test/ContractDeployer.spec.ts b/test/ContractDeployer.spec.ts index 462053bc..d7ec83b5 100644 --- a/test/ContractDeployer.spec.ts +++ b/test/ContractDeployer.spec.ts @@ -16,7 +16,7 @@ import { } from './shared/constants'; import { deployContract, getCode, getWallets, loadArtifact, publishBytecode, setCode } from './shared/utils'; -xdescribe('ContractDeployer tests', function () { +describe('ContractDeployer tests', function () { let wallet: Wallet; let contractDeployer: ContractDeployer; let contractDeployerSystemCall: ContractDeployer; diff --git a/test/DefaultAccount.spec.ts b/test/DefaultAccount.spec.ts index 366d4fbe..a2460581 100644 --- a/test/DefaultAccount.spec.ts +++ b/test/DefaultAccount.spec.ts @@ -21,7 +21,7 @@ import { import { signedTxToTransactionData } from './shared/transactions'; import { deployContract, getWallets, loadArtifact, setCode } from './shared/utils'; -xdescribe('DefaultAccount tests', function () { +describe('DefaultAccount tests', function () { let wallet: Wallet; let account: Wallet; let defaultAccount: DefaultAccount; diff --git a/test/EventWriter.spec.ts b/test/EventWriter.spec.ts index 3d1b9c49..46a6fc56 100644 --- a/test/EventWriter.spec.ts +++ b/test/EventWriter.spec.ts @@ -6,7 +6,7 @@ import { EventWriterTest } from '../typechain-types'; import { EVENT_WRITER_CONTRACT_ADDRESS } from './shared/constants'; import { deployContract, getCode, getWallets, setCode } from './shared/utils'; -xdescribe('EventWriter tests', function () { +describe('EventWriter tests', function () { let wallet: Wallet; let eventWriter: Contract; let eventWriterTest: EventWriterTest; diff --git a/test/ImmutableSimulator.spec.ts b/test/ImmutableSimulator.spec.ts index d88a2d86..64ca735c 100644 --- a/test/ImmutableSimulator.spec.ts +++ b/test/ImmutableSimulator.spec.ts @@ -30,7 +30,7 @@ describe('ImmutableSimulator tests', function () { ); }); - xit('successfully set', async () => { + it('successfully set', async () => { await network.provider.request({ method: 'hardhat_impersonateAccount', params: [DEPLOYER_SYSTEM_CONTRACT_ADDRESS] diff --git a/test/KnownCodesStorage.spec.ts b/test/KnownCodesStorage.spec.ts index 7f700159..49d4b374 100644 --- a/test/KnownCodesStorage.spec.ts +++ b/test/KnownCodesStorage.spec.ts @@ -9,7 +9,7 @@ import { } from './shared/constants'; import { deployContract, getCode, getWallets, loadArtifact, setCode } from './shared/utils'; -xdescribe('KnownCodesStorage tests', function () { +describe('KnownCodesStorage tests', function () { let wallet: Wallet; let knownCodesStorage: KnownCodesStorage; let mockL1Messenger: MockL1Messenger; From bb716d095c72943388638a0acd84570fc7ff6ba2 Mon Sep 17 00:00:00 2001 From: Bence Haromi Date: Mon, 16 Oct 2023 19:38:30 +0100 Subject: [PATCH 4/6] ci: test node in background --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 902238ef..1d8db17f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -91,7 +91,7 @@ jobs: bootloader/build - name: Starting test node - run: era_test_node run > /dev/null 2>&1 + run: era_test_node run > /dev/null 2>&1 & - name: Run tests run: yarn test From c0f88dfa1bb0256bf8a31e679fdc69a93e00b99f Mon Sep 17 00:00:00 2001 From: Bence Haromi Date: Tue, 17 Oct 2023 11:45:30 +0100 Subject: [PATCH 5/6] ci: caching for era-test-node --- .github/workflows/ci.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 1d8db17f..2b76ce4c 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -72,7 +72,11 @@ jobs: toolchain: nightly-2023-04-17 - name: Use era-test-node for testing - run: cargo install --git https://github.com/matter-labs/era-test-node.git --locked --branch boojum-integration + uses: baptiste0928/cargo-install@v2 + with: + crate: era_test_node + git: https://github.com/matter-labs/era-test-node.git + branch: boojum-integration - name: Install dependencies run: yarn From 6dccfe37f194df47ed28f0b9d4b98ae1ac41057d Mon Sep 17 00:00:00 2001 From: Bence Haromi Date: Tue, 17 Oct 2023 12:35:00 +0100 Subject: [PATCH 6/6] Revert "test: reenable temporarily disabled tests" This reverts commit ff8f0d3a89c14b18363600ec4debc6945c261c8a. --- test/AccountCodeStorage.spec.ts | 22 +++++++++++----------- test/ComplexUpgrader.spec.ts | 2 +- test/Compressor.spec.ts | 2 +- test/ContractDeployer.spec.ts | 2 +- test/DefaultAccount.spec.ts | 2 +- test/EventWriter.spec.ts | 2 +- test/ImmutableSimulator.spec.ts | 2 +- test/KnownCodesStorage.spec.ts | 2 +- 8 files changed, 18 insertions(+), 18 deletions(-) diff --git a/test/AccountCodeStorage.spec.ts b/test/AccountCodeStorage.spec.ts index 9bed917b..1d0fef89 100644 --- a/test/AccountCodeStorage.spec.ts +++ b/test/AccountCodeStorage.spec.ts @@ -39,7 +39,7 @@ describe('AccountCodeStorage tests', function () { ).to.be.revertedWith('Callable only by the deployer system contract'); }); - it('failed to set with constructed bytecode', async () => { + xit('failed to set with constructed bytecode', async () => { await expect( accountCodeStorage .connect(deployerAccount) @@ -47,7 +47,7 @@ describe('AccountCodeStorage tests', function () { ).to.be.revertedWith('Code hash is not for a contract on constructor'); }); - it('successfully stored', async () => { + xit('successfully stored', async () => { await accountCodeStorage .connect(deployerAccount) .storeAccountConstructingCodeHash(RANDOM_ADDRESS, CONSTRUCTING_BYTECODE_HASH); @@ -67,7 +67,7 @@ describe('AccountCodeStorage tests', function () { ).to.be.revertedWith('Callable only by the deployer system contract'); }); - it('failed to set with constructing bytecode', async () => { + xit('failed to set with constructing bytecode', async () => { await expect( accountCodeStorage .connect(deployerAccount) @@ -75,7 +75,7 @@ describe('AccountCodeStorage tests', function () { ).to.be.revertedWith('Code hash is not for a constructed contract'); }); - it('successfully stored', async () => { + xit('successfully stored', async () => { await accountCodeStorage .connect(deployerAccount) .storeAccountConstructedCodeHash(RANDOM_ADDRESS, CONSTRUCTED_BYTECODE_HASH); @@ -95,7 +95,7 @@ describe('AccountCodeStorage tests', function () { ); }); - it('failed to mark already constructed bytecode', async () => { + xit('failed to mark already constructed bytecode', async () => { await accountCodeStorage .connect(deployerAccount) .storeAccountConstructedCodeHash(RANDOM_ADDRESS, CONSTRUCTED_BYTECODE_HASH); @@ -107,7 +107,7 @@ describe('AccountCodeStorage tests', function () { await unsetCodeHash(accountCodeStorage, RANDOM_ADDRESS); }); - it('successfully marked', async () => { + xit('successfully marked', async () => { await accountCodeStorage .connect(deployerAccount) .storeAccountConstructingCodeHash(RANDOM_ADDRESS, CONSTRUCTING_BYTECODE_HASH); @@ -127,7 +127,7 @@ describe('AccountCodeStorage tests', function () { expect(await accountCodeStorage.getRawCodeHash(RANDOM_ADDRESS)).to.be.eq(ethers.constants.HashZero); }); - it('non-zero', async () => { + xit('non-zero', async () => { await accountCodeStorage .connect(deployerAccount) .storeAccountConstructedCodeHash(RANDOM_ADDRESS, CONSTRUCTED_BYTECODE_HASH); @@ -152,7 +152,7 @@ describe('AccountCodeStorage tests', function () { expect(await accountCodeStorage.getCodeHash(wallet.address)).to.be.eq(EMPTY_STRING_KECCAK); }); - it('address in the constructor', async () => { + xit('address in the constructor', async () => { await accountCodeStorage .connect(deployerAccount) .storeAccountConstructingCodeHash(RANDOM_ADDRESS, CONSTRUCTING_BYTECODE_HASH); @@ -162,7 +162,7 @@ describe('AccountCodeStorage tests', function () { await unsetCodeHash(accountCodeStorage, RANDOM_ADDRESS); }); - it('constructed code hash', async () => { + xit('constructed code hash', async () => { await accountCodeStorage .connect(deployerAccount) .storeAccountConstructedCodeHash(RANDOM_ADDRESS, CONSTRUCTED_BYTECODE_HASH); @@ -188,7 +188,7 @@ describe('AccountCodeStorage tests', function () { expect(await accountCodeStorage.getCodeSize('0x0000000000000000000000000000000000000001')).to.be.eq(0); }); - it('address in the constructor', async () => { + xit('address in the constructor', async () => { await accountCodeStorage .connect(deployerAccount) .storeAccountConstructingCodeHash(RANDOM_ADDRESS, CONSTRUCTING_BYTECODE_HASH); @@ -198,7 +198,7 @@ describe('AccountCodeStorage tests', function () { await unsetCodeHash(accountCodeStorage, RANDOM_ADDRESS); }); - it('non-zero size', async () => { + xit('non-zero size', async () => { await accountCodeStorage .connect(deployerAccount) .storeAccountConstructedCodeHash(RANDOM_ADDRESS, CONSTRUCTED_BYTECODE_HASH); diff --git a/test/ComplexUpgrader.spec.ts b/test/ComplexUpgrader.spec.ts index ea92b57a..259ec527 100644 --- a/test/ComplexUpgrader.spec.ts +++ b/test/ComplexUpgrader.spec.ts @@ -23,7 +23,7 @@ describe('ComplexUpgrader tests', function () { ).to.be.revertedWith('Can only be called by FORCE_DEPLOYER'); }); - it('successfully upgraded', async () => { + xit('successfully upgraded', async () => { await network.provider.request({ method: 'hardhat_impersonateAccount', params: [FORCE_DEPLOYER_ADDRESS] diff --git a/test/Compressor.spec.ts b/test/Compressor.spec.ts index 0e1ba314..b29fdee2 100644 --- a/test/Compressor.spec.ts +++ b/test/Compressor.spec.ts @@ -12,7 +12,7 @@ import { } from './shared/constants'; import { deployContract, getCode, getWallets, loadArtifact, setCode } from './shared/utils'; -describe('Compressor tests', function () { +xdescribe('Compressor tests', function () { let wallet: Wallet; let compressor: Compressor; let bootloader: ethers.Signer; diff --git a/test/ContractDeployer.spec.ts b/test/ContractDeployer.spec.ts index d7ec83b5..462053bc 100644 --- a/test/ContractDeployer.spec.ts +++ b/test/ContractDeployer.spec.ts @@ -16,7 +16,7 @@ import { } from './shared/constants'; import { deployContract, getCode, getWallets, loadArtifact, publishBytecode, setCode } from './shared/utils'; -describe('ContractDeployer tests', function () { +xdescribe('ContractDeployer tests', function () { let wallet: Wallet; let contractDeployer: ContractDeployer; let contractDeployerSystemCall: ContractDeployer; diff --git a/test/DefaultAccount.spec.ts b/test/DefaultAccount.spec.ts index a2460581..366d4fbe 100644 --- a/test/DefaultAccount.spec.ts +++ b/test/DefaultAccount.spec.ts @@ -21,7 +21,7 @@ import { import { signedTxToTransactionData } from './shared/transactions'; import { deployContract, getWallets, loadArtifact, setCode } from './shared/utils'; -describe('DefaultAccount tests', function () { +xdescribe('DefaultAccount tests', function () { let wallet: Wallet; let account: Wallet; let defaultAccount: DefaultAccount; diff --git a/test/EventWriter.spec.ts b/test/EventWriter.spec.ts index 46a6fc56..3d1b9c49 100644 --- a/test/EventWriter.spec.ts +++ b/test/EventWriter.spec.ts @@ -6,7 +6,7 @@ import { EventWriterTest } from '../typechain-types'; import { EVENT_WRITER_CONTRACT_ADDRESS } from './shared/constants'; import { deployContract, getCode, getWallets, setCode } from './shared/utils'; -describe('EventWriter tests', function () { +xdescribe('EventWriter tests', function () { let wallet: Wallet; let eventWriter: Contract; let eventWriterTest: EventWriterTest; diff --git a/test/ImmutableSimulator.spec.ts b/test/ImmutableSimulator.spec.ts index 64ca735c..d88a2d86 100644 --- a/test/ImmutableSimulator.spec.ts +++ b/test/ImmutableSimulator.spec.ts @@ -30,7 +30,7 @@ describe('ImmutableSimulator tests', function () { ); }); - it('successfully set', async () => { + xit('successfully set', async () => { await network.provider.request({ method: 'hardhat_impersonateAccount', params: [DEPLOYER_SYSTEM_CONTRACT_ADDRESS] diff --git a/test/KnownCodesStorage.spec.ts b/test/KnownCodesStorage.spec.ts index 49d4b374..7f700159 100644 --- a/test/KnownCodesStorage.spec.ts +++ b/test/KnownCodesStorage.spec.ts @@ -9,7 +9,7 @@ import { } from './shared/constants'; import { deployContract, getCode, getWallets, loadArtifact, setCode } from './shared/utils'; -describe('KnownCodesStorage tests', function () { +xdescribe('KnownCodesStorage tests', function () { let wallet: Wallet; let knownCodesStorage: KnownCodesStorage; let mockL1Messenger: MockL1Messenger;