This repository was archived by the owner on Feb 17, 2025. It is now read-only.
Replies: 2 comments 2 replies
-
|
About the proposal:
|
Beta Was this translation helpful? Give feedback.
2 replies
-
|
Mostly, we are using unit test, integrated test and e2e tests right now. There would be no problem in unit tests. The only problem is a e2e test. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
The current
zkEVM-Nodearchitecture allows different types ofSynchronizersdepending on thenode typewhich is running, basically, we can have aTrusted Sequencer Node, aPermissionless Sequencer Node, and aRead-only Node. We want to make sure all the types ofSynchronizersare tested properly since the synchronization processes are different for each type.Background
Before we start discussing how to test the different
Synchronizers, and even though we understand theforced batchis a very important feature that affects directly theSynchronizers, we decided to not take this topic(forced batch) into consideration now to make it easier to create the test strategy focusing in theSynchronizersbased on theTrusted Sequencer Nodebeing the only one in the networks affecting the state.Firstly let's recap the known node types we have, so we can understand more about them and properly think about a solution for the synchronization tests.
When a
zkEVM-Nodeis set up as aTrusted Sequencer Node, this is the node responsible for managing theTrusted State, also this node is the one thatdecideswhen theTrusted Stateshould beVirtualizedin order to allow anAggregatortoConsolidatethe state further. TheSynchronizationprocess of this type of node requires reading the alreadyVirtualized StatefromL1and checking it against theTrusted Statein order to handlereorgsandforced batchesproperly.When a
zkEVM-Nodeis set up as aPermissionless Sequencer NodeorRead-only Node, they will synchronize information from bothL1and theTrusted Sequencer Node - Broadcast Service, which is the component responsible for providing information about theTrusted State. So, when the node is behind theVirtualized Stateit synchronizes the information from theL1, when theVirtualized Stateis fully synchronized, it starts to synchronize information from theTrusted Sequencer Nodevia the `Broadcast Service.Well, now that the node types and how they synchronize were clarified, I want to explain what are the things we want to test related to these types of
Synchronizers, so we must make sure that:L1has priority in order to the data stored as theTrusted State.Trusted Statein theTrusted Sequencer Nodeshould reflect in all nodesNow we need to talk about the types of tests we think we can use to solve the problem
Smoke testsgenerally are handled manually and have a focus to test the core functionalities of a system, just to make sure the very happy paths are still working and the system has the minimum capacity to work with the new version being released. A basic use case is a tester person running the system in a controlled environment and using it as a regular system user, trying to perform the most important operations in the system.Unit Testsare meant to test a single layer and instead of integrating with a real dependency component, it use mocks to fake the integration layer. A basic use case is a component depending on an external API, where a fake HTTP response ir returned.Integrated Testsgenerally tend to validate an integration point even though the whole process can be a bigger chain of events. A basic use case is a component depending on a database, with integration tests you can also test the SQL commands running it against a real SQL database.E2E TestsThese tests tend to validate a workflow from the beginning until the end, making sure all the real components required by the workflow are called, but generally the call is made in a fully controlled environment and a proposed scenario is prepared before running the expected call to get the expected response. A basic use case for it is testing a system that needs to call an external API and also save data to a database and after that send an e-mail with confirmation to the user.Continuity Teststry to guarantee the system will continue to run over time, no matter what happens to the data inserted into it, it tries to explore failures due to the accumulation of data, resource usage, and limitations and checks against date and time. A basic use case is testing the sequencer of blocks in a blockchain that has the relation between blocks and each block on the chain depending on the previous one, testing the block reorgs, different sizes of blocks, and the behavior of the blockchain as it grows in size of blocks.Proposal
We can have different tests for all the different types of
Synchronizers, but IMO opinion theContinuity Testsin this case are the ones we want to have because the synchronization process is something that we need to check growing the blockchain with different use cases along the journey to make sure the state is synchronized properly on all types ofSynchronizersThe idea is to create a
robotthat will keep executing actions periodically on the L2 blockchain, performing user operations like sending multiple transactions, getting information from the blockchain, and also checking it against the information in the blockchain from the point of view of each different node.Theoretically, we should have all the types of the
Synchronizersrunning in isolated environments to mimic a realistic scenario about different blockchain consumers in different places and make sure they are all available to be consumed by the robot in order to check the data.In other words, we should run some nodes on AWS to be the different types of nodes we want to run, they must not know about each other unless is it strictly necessary, theoretically, the protocol is the one that will handle the passive communication between them via the
Synchronizers.Beta Was this translation helpful? Give feedback.
All reactions