Skip to content

Add smoketest to e2e tests#261

Merged
piersy merged 29 commits intocelo10from
piersy/smoketest
Nov 26, 2024
Merged

Add smoketest to e2e tests#261
piersy merged 29 commits intocelo10from
piersy/smoketest

Conversation

@piersy
Copy link
Copy Markdown

@piersy piersy commented Oct 18, 2024

Adds an e2e smoketest that sends value transfer, contract interaction
and contract creation transactions for all of the valid transaction types.

It also verifies that deprecated transactions (celo legacy & cip42) are
not supported.

@piersy piersy requested review from ezdac and karlb October 18, 2024 18:19
Comment on lines +116 to +121
// This test is failing because the produced transaction is of type cip64.
// I guess this is a problem with the viem internals.
it.skip("cip42 not supported", async () => {
const type = "cip42";
await verifyTypedTransactions(type);
}).timeout(10_000);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Interesting and I think your explanation is correct. We could try running the same test against Celo L1 to make sure it's not a change in the chain behaviour that is causing this.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@piersy just to get the explanation right - viem with the new l2 alfajores definitions does not seem to know about "cip42" types and instead produces a cip64 transaction, that then fails the assertion?

I would classify this as a viem bug, since it shouldn't even allow the deprecated `cip42' type and fail early on unknown types (at least in my expectation).

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

yeah, I'd classify it as a viem bug, i will raise it with the dev tooling team

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

However viem still needs to be able to send cip42 txs to the celo l1, so it does still need that functionality.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Does it? It could just send CIP-64 without missing any features.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Unless people really want to set the gatewayFee and gatewayFeeRecipient! I'll check with the devtooling team to see what the expected approach for viem is.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

You can't set those to non-zero values anymore (celo-blockchain will reject the tx otherwise), so nothing is lost.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Ok, was unaware!

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

@karlb @ezdac I've moved this test into the smoketest_unsupported_txs golang test. Where we can be sure that we are sending an invalid transaction, and therefore ensure that the server correctly rejects it.

assert.fail("Managed to send unsupported legacy tx with fee currency");
}).timeout(10_000);

it.only("legacy create tx with fee currency not supported", async () => {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I'm not sure if it's worth having this test in addition to the previous one. Chances that tx types behave totally differently between send and create are low and we already test plenty of both in other tests with having to repeat them.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Hey @karlb I've removed these tests from the viem test and added them in golang since its easier to construct known unsupported transactions in golang, in the golang version I only test send transactions.

Base automatically changed from piersy/run-e2e-tests-on-alfajores to celo10 October 21, 2024 10:58
Copy link
Copy Markdown

@ezdac ezdac left a comment

Choose a reason for hiding this comment

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

Looks good so far! I added some suggestions and questions regarding unsupported tx types.
This branch requires a rebase against celo10.

Comment on lines +116 to +121
// This test is failing because the produced transaction is of type cip64.
// I guess this is a problem with the viem internals.
it.skip("cip42 not supported", async () => {
const type = "cip42";
await verifyTypedTransactions(type);
}).timeout(10_000);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@piersy just to get the explanation right - viem with the new l2 alfajores definitions does not seem to know about "cip42" types and instead produces a cip64 transaction, that then fails the assertion?

I would classify this as a viem bug, since it shouldn't even allow the deprecated `cip42' type and fail early on unknown types (at least in my expectation).

@karlb
Copy link
Copy Markdown

karlb commented Oct 22, 2024

Why is the CI workflow with the tests not run for the last commits? The workflow file looks fine to me.

@piersy
Copy link
Copy Markdown
Author

piersy commented Oct 22, 2024

Why is the CI workflow with the tests not run for the last commits? The workflow file looks fine to me.

Hey @karlb, no idea I only made one change to CI which was to run these tests on alfajores. Maybe because the automatic base change or the conflicts it now has?

Update: The workflow seemed to get run again after rebasing this on celo10, perhaps it was the existence of conflicts between this and celo10 that caused the workflow to not get run.

piersy added 13 commits October 22, 2024 15:06
The smoketest tries all types of transaction for both sends and creates.
Chose a timeout of 16 seconds since the first two tests were taking 8
seconds on Alfajores.
Note that in many cases we were able to remove explicit use of account
in transaction creattion because it is "hoisted" in the walletClient.

Also removed chain-id and ACC_PRIVKEY as arguments from send_tx.mjs
because they are controlled by env vars, which are picked up by the mjs
file.
piersy and others added 3 commits October 23, 2024 13:11
Co-authored-by: Karl Bartel <karl.bartel@clabs.co>
Due to the way that viem is structured it is a bad idea for us to block
transactions based on the supplied tx attributes, since they may be supported by
downstream components such as optimism's custom viem functionality.

So rather than trying to test unsupported txs via viem, we now test via
golang which allows us full control of the sent transaction, thereby
ensuring that rejection is happening at the node level.

This commit also extends the error message for deprecated transactions
to distinguish between celo legacy and plain legacy transactions.
piersy added a commit that referenced this pull request Apr 23, 2025
Adds an e2e smoketest that sends value transfer, contract interaction
and contract creation transactions for all of the valid transaction types.

It also verifies that deprecated transactions (celo legacy & cip42) are
not supported.

Co-authored-by: Karl Bartel <karl.bartel@clabs.co>
piersy added a commit that referenced this pull request Apr 24, 2025
Adds an e2e smoketest that sends value transfer, contract interaction
and contract creation transactions for all of the valid transaction types.

It also verifies that deprecated transactions (celo legacy & cip42) are
not supported.

Co-authored-by: Karl Bartel <karl.bartel@clabs.co>
piersy added a commit that referenced this pull request Apr 24, 2025
Adds an e2e smoketest that sends value transfer, contract interaction
and contract creation transactions for all of the valid transaction types.

It also verifies that deprecated transactions (celo legacy & cip42) are
not supported.

Co-authored-by: Karl Bartel <karl.bartel@clabs.co>
piersy added a commit that referenced this pull request Apr 29, 2025
Adds an e2e smoketest that sends value transfer, contract interaction
and contract creation transactions for all of the valid transaction types.

It also verifies that deprecated transactions (celo legacy & cip42) are
not supported.

Co-authored-by: Karl Bartel <karl.bartel@clabs.co>
piersy added a commit that referenced this pull request Apr 29, 2025
Adds an e2e smoketest that sends value transfer, contract interaction
and contract creation transactions for all of the valid transaction types.

It also verifies that deprecated transactions (celo legacy & cip42) are
not supported.

Co-authored-by: Karl Bartel <karl.bartel@clabs.co>
piersy added a commit that referenced this pull request Apr 29, 2025
Adds an e2e smoketest that sends value transfer, contract interaction
and contract creation transactions for all of the valid transaction types.

It also verifies that deprecated transactions (celo legacy & cip42) are
not supported.

Co-authored-by: Karl Bartel <karl.bartel@clabs.co>
ezdac pushed a commit that referenced this pull request Apr 30, 2025
Adds an e2e smoketest that sends value transfer, contract interaction
and contract creation transactions for all of the valid transaction types.

It also verifies that deprecated transactions (celo legacy & cip42) are
not supported.

Co-authored-by: Karl Bartel <karl.bartel@clabs.co>
piersy added a commit that referenced this pull request May 1, 2025
Adds an e2e smoketest that sends value transfer, contract interaction
and contract creation transactions for all of the valid transaction types.

It also verifies that deprecated transactions (celo legacy & cip42) are
not supported.

Co-authored-by: Karl Bartel <karl.bartel@clabs.co>
piersy added a commit that referenced this pull request May 1, 2025
Adds an e2e smoketest that sends value transfer, contract interaction
and contract creation transactions for all of the valid transaction types.

It also verifies that deprecated transactions (celo legacy & cip42) are
not supported.

Co-authored-by: Karl Bartel <karl.bartel@clabs.co>
piersy added a commit that referenced this pull request May 1, 2025
Adds an e2e smoketest that sends value transfer, contract interaction
and contract creation transactions for all of the valid transaction types.

It also verifies that deprecated transactions (celo legacy & cip42) are
not supported.

Co-authored-by: Karl Bartel <karl.bartel@clabs.co>
piersy added a commit that referenced this pull request May 2, 2025
Adds an e2e smoketest that sends value transfer, contract interaction
and contract creation transactions for all of the valid transaction types.

It also verifies that deprecated transactions (celo legacy & cip42) are
not supported.

Co-authored-by: Karl Bartel <karl.bartel@clabs.co>
piersy added a commit that referenced this pull request May 6, 2025
Adds an e2e smoketest that sends value transfer, contract interaction
and contract creation transactions for all of the valid transaction types.

It also verifies that deprecated transactions (celo legacy & cip42) are
not supported.

Co-authored-by: Karl Bartel <karl.bartel@clabs.co>
piersy added a commit that referenced this pull request May 6, 2025
Adds an e2e smoketest that sends value transfer, contract interaction
and contract creation transactions for all of the valid transaction types.

It also verifies that deprecated transactions (celo legacy & cip42) are
not supported.

Co-authored-by: Karl Bartel <karl.bartel@clabs.co>
piersy added a commit that referenced this pull request May 8, 2025
Adds an e2e smoketest that sends value transfer, contract interaction
and contract creation transactions for all of the valid transaction types.

It also verifies that deprecated transactions (celo legacy & cip42) are
not supported.

Co-authored-by: Karl Bartel <karl.bartel@clabs.co>
piersy added a commit that referenced this pull request May 12, 2025
Adds an e2e smoketest that sends value transfer, contract interaction
and contract creation transactions for all of the valid transaction types.

It also verifies that deprecated transactions (celo legacy & cip42) are
not supported.

Co-authored-by: Karl Bartel <karl.bartel@clabs.co>
piersy added a commit that referenced this pull request May 22, 2025
Adds an e2e smoketest that sends value transfer, contract interaction
and contract creation transactions for all of the valid transaction types.

It also verifies that deprecated transactions (celo legacy & cip42) are
not supported.

Co-authored-by: Karl Bartel <karl.bartel@clabs.co>
piersy added a commit that referenced this pull request May 22, 2025
Adds an e2e smoketest that sends value transfer, contract interaction
and contract creation transactions for all of the valid transaction types.

It also verifies that deprecated transactions (celo legacy & cip42) are
not supported.

Co-authored-by: Karl Bartel <karl.bartel@clabs.co>
Kourin1996 pushed a commit that referenced this pull request Jul 20, 2025
Adds an e2e smoketest that sends value transfer, contract interaction
and contract creation transactions for all of the valid transaction types.

It also verifies that deprecated transactions (celo legacy & cip42) are
not supported.

Co-authored-by: Karl Bartel <karl.bartel@clabs.co>
Kourin1996 pushed a commit that referenced this pull request Jul 21, 2025
Adds an e2e smoketest that sends value transfer, contract interaction
and contract creation transactions for all of the valid transaction types.

It also verifies that deprecated transactions (celo legacy & cip42) are
not supported.

Co-authored-by: Karl Bartel <karl.bartel@clabs.co>
Kourin1996 pushed a commit that referenced this pull request Jul 26, 2025
Adds an e2e smoketest that sends value transfer, contract interaction
and contract creation transactions for all of the valid transaction types.

It also verifies that deprecated transactions (celo legacy & cip42) are
not supported.

Co-authored-by: Karl Bartel <karl.bartel@clabs.co>
Kourin1996 pushed a commit that referenced this pull request Jul 28, 2025
Adds an e2e smoketest that sends value transfer, contract interaction
and contract creation transactions for all of the valid transaction types.

It also verifies that deprecated transactions (celo legacy & cip42) are
not supported.

Co-authored-by: Karl Bartel <karl.bartel@clabs.co>
Kourin1996 pushed a commit that referenced this pull request Jul 30, 2025
Adds an e2e smoketest that sends value transfer, contract interaction
and contract creation transactions for all of the valid transaction types.

It also verifies that deprecated transactions (celo legacy & cip42) are
not supported.

Co-authored-by: Karl Bartel <karl.bartel@clabs.co>
Kourin1996 pushed a commit that referenced this pull request Jul 30, 2025
Adds an e2e smoketest that sends value transfer, contract interaction
and contract creation transactions for all of the valid transaction types.

It also verifies that deprecated transactions (celo legacy & cip42) are
not supported.

Co-authored-by: Karl Bartel <karl.bartel@clabs.co>
Kourin1996 pushed a commit that referenced this pull request Jul 30, 2025
Adds an e2e smoketest that sends value transfer, contract interaction
and contract creation transactions for all of the valid transaction types.

Co-authored-by: Karl Bartel <karl.bartel@clabs.co>
Kourin1996 pushed a commit that referenced this pull request Jul 31, 2025
Adds an e2e smoketest that sends value transfer, contract interaction
and contract creation transactions for all of the valid transaction types.

It also verifies that deprecated transactions (celo legacy & cip42) are
not supported.

Co-authored-by: Karl Bartel <karl.bartel@clabs.co>
Kourin1996 pushed a commit that referenced this pull request Jul 31, 2025
Adds an e2e smoketest that sends value transfer, contract interaction
and contract creation transactions for all of the valid transaction types.

It also verifies that deprecated transactions (celo legacy & cip42) are
not supported.

Co-authored-by: Karl Bartel <karl.bartel@clabs.co>
Kourin1996 pushed a commit that referenced this pull request Jul 31, 2025
Adds an e2e smoketest that sends value transfer, contract interaction
and contract creation transactions for all of the valid transaction types.

It also verifies that deprecated transactions (celo legacy & cip42) are
not supported.

Co-authored-by: Karl Bartel <karl.bartel@clabs.co>
Kourin1996 pushed a commit that referenced this pull request Aug 1, 2025
…d_tx.mjs (#261)

Co-authored-by: Karl Bartel <karl.bartel@clabs.co>
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.

4 participants