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

Adjust 1.4.1 tests for zkSync #625

Open
wants to merge 37 commits into
base: main
Choose a base branch
from

Conversation

ElvisKrop
Copy link

@ElvisKrop ElvisKrop commented Jul 25, 2023

As agreed previously #588 (comment)

@github-actions
Copy link

github-actions bot commented Jul 25, 2023

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@ElvisKrop ElvisKrop marked this pull request as draft July 25, 2023 12:59
@ElvisKrop
Copy link
Author

I have read the CLA Document and I hereby sign the CLA

github-actions bot added a commit that referenced this pull request Jul 25, 2023
@nick8319
Copy link

I have read the CLA Document and I hereby sign the CLA

github-actions bot added a commit that referenced this pull request Jul 27, 2023
@ElvisKrop ElvisKrop marked this pull request as ready for review August 22, 2023 17:22
{ gasLimit: 1000000 },
);

// Reverted reason seems not properly returned by zkSync local node, though it is in fact GS010 when using debug_traceTransaction
Copy link
Member

@mmv08 mmv08 Aug 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can this be extracted into a utility function? e.g., assertZksyncRevertWithMessage that would do this under the hood?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I didn't get your point. Do you wanna to show this comment during tests execution?

Copy link
Member

@mmv08 mmv08 Aug 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test only checks that the transaction is reverted and doesn't check the revert message. However, a comment says that you can use debug_traceTransaction to verify that it is in GS010. Is there a way to write a utility function that would call debug_traceTransaction under the hood and verify the error message?

});

it("simulate selfdestruct", async () => {
it("simulate selfdestruct", async function () {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All other tests uses arrow function expressions, please adjust this test and make sure it's consistent across the updated code (I was some other test files where this was changed)

Copy link
Author

@ElvisKrop ElvisKrop Aug 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Arrow function has no own context. Function expression was changed to enable such features as inclusive tests on some condition.

Copy link
Member

@mmv08 mmv08 Aug 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I see. But it seems there are some places where it was changed not to enable anything? Like https://github.com/safe-global/safe-contracts/pull/625/files#diff-291a4add941d879c99b79d09eed2c4206c6f23edd4f5edbc93d2bdd18e1c91deR110-R153

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops, indeed
I will revert them back 😉

Some details:
There are some places where we skipped the tests because of .send function usage, it was not properly supported by zksync. However, you have already changed it .call. Therefore, we removed the conditional skipping. But this is a leftover...

@ElvisKrop
Copy link
Author

Hello @mmv08! I hope you are doing well 😌
I was able to rebase this branch onto the main with latest changes. However, we cannot merge zksync related changes as zksync packages use ethers-v5, while main branch has some deps that rely on ethers-v6. Please take a look at this issue (matter-labs/hardhat-zksync#311) created by @NomicFoundation in June. It's sad...

I can see only two options here:

  1. If zksync changes must get in the main branch before the next release - we have to downgrade all dependencies back in the repository to use ethers-v5. After @matter-labs migrates all their packages to the ethers-v6 we can migrate too.
  2. Otherwise, we have to wait until @matter-labs will migrate to the ethers-v6. Only then we can come back to this PR and try to make it work.

Both options are not so good from dev perspective. If you have anything in mind, please let us know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants