Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(kl-factory): base token ether tests #1746

Merged
merged 594 commits into from
Apr 24, 2024

Conversation

juan518munoz
Copy link
Contributor

@juan518munoz juan518munoz commented Apr 19, 2024

What ❔

Adapt ethers tests so they work when usyng any token as base (using kl-factory base token implementation).

Why ❔

Improve test coverage.

Fixes: EVM-555

Checklist

  • PR title corresponds to the body of PR (we generate changelog entries from PRs).
  • Tests for the changes have been added / updated.
  • Documentation comments have been added / updated.
  • Code has been formatted via zk fmt and zk lint.

@juan518munoz
Copy link
Contributor Author

@mm-zk external node integration tests should now be working.

@mm-zk
Copy link
Collaborator

mm-zk commented Apr 23, 2024

@juan518munoz - it is still failing:

  ● ERC20 contract checks › Should claim failed deposit

    expect(received).toBeAccepted(expected)

    Transaction was expected to pass, but it failed. Details:
     [Error: invalid address (argument="address", value="0x87fa08e257bdc0f1f8bd6504467ce5c0df9bc1", code=INVALID_ARGUMENT, version=address/5.7.0)]

      197 |         await waitUntilBlockFinalized(alice, l2TxReceipt.blockNumber);
      198 |         // Claim failed deposit.
    > 199 |         await expect(alice.claimFailedDeposit(l2Hash)).toBeAccepted();
          |                                                        ^
      200 |         await expect(alice.getBalanceL1(tokenDetails.l1Address)).resolves.bnToBeEq(initialBalance);
      201 |     });
      202 |

      at Object.<anonymous> (tests/erc20.test.ts:199:56)
      ```

StanislavBreadless and others added 3 commits April 23, 2024 12:36
## What ❔

<!-- What are the changes this PR brings about? -->
<!-- Example: This PR adds a PR template to the repo. -->
<!-- (For bigger PRs adding more context is appreciated) -->

## Why ❔

<!-- Why are these changes done? What goal do they contribute to? What
are the principles behind them? -->
<!-- Example: PR templates ensure PR reviewers, observers, and future
iterators are in context about the evolution of repos. -->

## Checklist

<!-- Check your PR fulfills the following items. -->
<!-- For draft PRs check the boxes as you complete them. -->

- [ ] PR title corresponds to the body of PR (we generate changelog
entries from PRs).
- [ ] Tests for the changes have been added / updated.
- [ ] Documentation comments have been added / updated.
- [ ] Code has been formatted via `zk fmt` and `zk lint`.
- [ ] Spellcheck has been run via `zk spellcheck`.
- [ ] Linkcheck has been run via `zk linkcheck`.
## What ❔

<!-- What are the changes this PR brings about? -->
<!-- Example: This PR adds a PR template to the repo. -->
<!-- (For bigger PRs adding more context is appreciated) -->

## Why ❔

<!-- Why are these changes done? What goal do they contribute to? What
are the principles behind them? -->
<!-- Example: PR templates ensure PR reviewers, observers, and future
iterators are in context about the evolution of repos. -->

## Checklist

<!-- Check your PR fulfills the following items. -->
<!-- For draft PRs check the boxes as you complete them. -->

- [ ] PR title corresponds to the body of PR (we generate changelog
entries from PRs).
- [ ] Tests for the changes have been added / updated.
- [ ] Documentation comments have been added / updated.
- [ ] Code has been formatted via `zk fmt` and `zk lint`.
- [ ] Spellcheck has been run via `zk spellcheck`.
- [ ] Linkcheck has been run via `zk linkcheck`.
## What ❔

<!-- What are the changes this PR brings about? -->
<!-- Example: This PR adds a PR template to the repo. -->
<!-- (For bigger PRs adding more context is appreciated) -->

## Why ❔

<!-- Why are these changes done? What goal do they contribute to? What
are the principles behind them? -->
<!-- Example: PR templates ensure PR reviewers, observers, and future
iterators are in context about the evolution of repos. -->

## Checklist

<!-- Check your PR fulfills the following items. -->
<!-- For draft PRs check the boxes as you complete them. -->

- [ ] PR title corresponds to the body of PR (we generate changelog
entries from PRs).
- [ ] Tests for the changes have been added / updated.
- [ ] Documentation comments have been added / updated.
- [ ] Code has been formatted via `zk fmt` and `zk lint`.
- [ ] Spellcheck has been run via `zk spellcheck`.
- [ ] Linkcheck has been run via `zk linkcheck`.
@juan518munoz
Copy link
Contributor Author

juan518munoz commented Apr 23, 2024

@mm-zk what are the steps to reproduce? I didn't find anything specific about running tests using the extenarl node on the README, so I'm currently testing this way:

Terminal 1
Start base token implementation and server:

rm -rf volumes && zk && zk clean --all && zk env dev && zk config compile dev --diff 0 && zk init --base-token-name BAT && zk server

Terminal 2
Start external node:

zk env ext-node && ZKSYNC_ENV=ext-node zk db reset && zk external-node

Terminal 3
Run tests with ext-node environment:

zk env ext-node && zk test i server

output:

 PASS  tests/base-token.test.ts
 PASS  tests/erc20.test.ts
 PASS  tests/system.test.ts
 PASS  tests/l1.test.ts
 PASS  tests/self-unit.test.ts
 PASS  tests/api/debug.test.ts
 PASS  tests/api/contract-verification.test.ts
 PASS  tests/paymaster.test.ts
 PASS  tests/contracts.test.ts
 PASS  tests/mempool.test.ts
 PASS  tests/api/web3.test.ts
 PASS  tests/custom-account.test.ts

Test Suites: 1 skipped, 13 passed, 13 of 14 total
Tests:       3 skipped, 132 passed, 135 total

StanislavBreadless and others added 2 commits April 23, 2024 15:00
## What ❔

<!-- What are the changes this PR brings about? -->
<!-- Example: This PR adds a PR template to the repo. -->
<!-- (For bigger PRs adding more context is appreciated) -->

## Why ❔

<!-- Why are these changes done? What goal do they contribute to? What
are the principles behind them? -->
<!-- Example: PR templates ensure PR reviewers, observers, and future
iterators are in context about the evolution of repos. -->

## Checklist

<!-- Check your PR fulfills the following items. -->
<!-- For draft PRs check the boxes as you complete them. -->

- [ ] PR title corresponds to the body of PR (we generate changelog
entries from PRs).
- [ ] Tests for the changes have been added / updated.
- [ ] Documentation comments have been added / updated.
- [ ] Code has been formatted via `zk fmt` and `zk lint`.
- [ ] Spellcheck has been run via `zk spellcheck`.
- [ ] Linkcheck has been run via `zk linkcheck`.
@mm-zk mm-zk requested a review from benceharomi April 23, 2024 15:56
@mationorato mationorato changed the base branch from kl-factory to main April 23, 2024 16:02
@mationorato mationorato requested a review from a team as a code owner April 23, 2024 16:02
@mm-zk mm-zk enabled auto-merge April 24, 2024 09:48
@mm-zk mm-zk disabled auto-merge April 24, 2024 09:49
@mm-zk mm-zk added this pull request to the merge queue Apr 24, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 24, 2024
@mm-zk mm-zk added this pull request to the merge queue Apr 24, 2024
Merged via the queue into matter-labs:main with commit 6cf14a0 Apr 24, 2024
35 checks passed
RomanBrodetski pushed a commit that referenced this pull request Apr 30, 2024
🤖 I have created a release *beep* *boop*
---


##
[24.0.0](core-v23.1.0...core-v24.0.0)
(2024-04-30)


### ⚠ BREAKING CHANGES

* **prover:** Protocol Upgrade 1.5.0
([#1699](#1699))
* shared bridge
([#298](#298))

### Features

* **api:** Allow granular max response size config
([#1642](#1642))
([83c4034](83c4034))
* **api:** Improve logging for API server
([#1792](#1792))
([50fbda5](50fbda5))
* **api:** Track params for RPC methods
([#1673](#1673))
([1a34c8b](1a34c8b))
* **configs:** move ecosystem contracts to contracts
([#1606](#1606))
([9d52180](9d52180))
* EcPairing precompile as system contract
([#1761](#1761))
([3071622](3071622))
* Include create2 factory in genesis
([#1775](#1775))
([597280b](597280b))
* **prover:** Protocol Upgrade 1.5.0
([#1699](#1699))
([6a557f7](6a557f7))
* **prover:** remove redundant config fields
([#1787](#1787))
([a784ea6](a784ea6))
* shared bridge
([#298](#298))
([8c3478a](8c3478a))
* **tree:** Improved tree pruning
([#1532](#1532))
([bcb192c](bcb192c))
* **vm-runner:** implement VM runner storage layer
([#1651](#1651))
([543f9e9](543f9e9))
* **vm:** Extend bootloader memory in the new version
([#1807](#1807))
([f461b28](f461b28))


### Bug Fixes

* **api:** Fix extra DB connection acquisition during tx submission
([#1793](#1793))
([9c6ed83](9c6ed83))
* **en:** correct en config vars
([#1809](#1809))
([d340fbc](d340fbc))
* **en:** Remove duplicate reorg detector
([#1783](#1783))
([3417941](3417941))
* **kl-factory:** base token ether tests
([#1746](#1746))
([6cf14a0](6cf14a0))
* **prover:** Fix panics if prover's config is not ready
([#1822](#1822))
([21d90d7](21d90d7))
* **snapshots_creator:** Remove snapshots during reverts
([#1757](#1757))
([8d587fd](8d587fd))
* **types:** Add LegacyMixedCall
([#1773](#1773))
([2b236fe](2b236fe))
* v23 api typo
([#1821](#1821))
([a11fa86](a11fa86))
* Weaker assert for protocol version for operations
([#1800](#1800))
([11898c2](11898c2))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: perekopskiy <mikeson.dp@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.