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
-
The current
zkEVM-Node
architecture allows different types ofSynchronizers
depending on thenode type
which is running, basically, we can have aTrusted Sequencer Node
, aPermissionless Sequencer Node
, and aRead-only Node
. We want to make sure all the types ofSynchronizers
are 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 batch
is 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 theSynchronizers
based on theTrusted Sequencer Node
being 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-Node
is set up as aTrusted Sequencer Node
, this is the node responsible for managing theTrusted State
, also this node is the one thatdecides
when theTrusted State
should beVirtualized
in order to allow anAggregator
toConsolidate
the state further. TheSynchronization
process of this type of node requires reading the alreadyVirtualized State
fromL1
and checking it against theTrusted State
in order to handlereorgs
andforced batches
properly.When a
zkEVM-Node
is set up as aPermissionless Sequencer Node
orRead-only Node
, they will synchronize information from bothL1
and theTrusted Sequencer Node - Broadcast Service
, which is the component responsible for providing information about theTrusted State
. So, when the node is behind theVirtualized State
it synchronizes the information from theL1
, when theVirtualized State
is fully synchronized, it starts to synchronize information from theTrusted Sequencer Node
via 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:L1
has priority in order to the data stored as theTrusted State
.Trusted State
in theTrusted Sequencer Node
should reflect in all nodesNow we need to talk about the types of tests we think we can use to solve the problem
Smoke tests
generally 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 Tests
are 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 Tests
generally 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 Tests
These 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 Tests
try 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 Tests
in 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 ofSynchronizers
The idea is to create a
robot
that 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
Synchronizers
running 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