-
Notifications
You must be signed in to change notification settings - Fork 18
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
Simulation framework for multi-client server testing #358
Conversation
This PR introduces a simulation framework designed to test the server by simulating multiple clients performing various actions over several rounds. The framework reads simulation configurations from YAML files, validates them against a predefined schema, and executes the simulation accordingly. Here's a summary of the key changes made: 1. **New `simulation` Module**: - Added a new Go module `simulation` with its own `go.mod` and `go.sum`. - Introduced a main application for running simulations based on a YAML configuration. - Included functions for setting up clients, performing actions like onboarding, sending transactions, and claiming funds. - Added validation of simulation configuration against a schema using `gojsonschema`. 2. **Simulation Configuration**: - Added `simulation1.yaml` as an example configuration file for running simulations. - Defined a `schema.yaml` for validating simulation configurations. 3. **`.gitignore` Updates**: - Added `.idea` to ignore IntelliJ IDEA project files. 4. **`Dockerfile` Update**: - Updated the base image version of Golang from `1.23.1` to `1.23.2`. 5. **`go.work` Update**: - Updated the Go version from `1.23.1` to `1.23.2`. - Added a new directory `./simulation` to the workspace. 6. **`go.work.sum` Update**: - Added new dependencies `github.com/coreos/go-systemd` and `github.com/go-task/slim-sprig`. 7. **`e2e_test.go` Modifications**: - Removed the `setupAspWallet` function and replaced its usage with `utils.SetupAspWalletCovenantless`. 8. **`test_utils.go` Modifications**: - Added a new function `SetupAspWalletCovenantless` to handle wallet setup with optional initial funding.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would not bump version in this PR, best to make one to go in master in a dedicated commit before this if is needed. Want to square out potential bugs/replication issues coming from different go versions.
Also please add a README documentation on how to run the simulation
Reverted |
simulation/schema.yaml
Outdated
- number: int(min=1) | ||
actions: | ||
regex('^client_\d+$'): | ||
- type: enum('Onboard', 'SendAsync', 'SendOffchain', 'SendOnchain', 'Claim', 'CollaborativeExit', 'UnilateralExit') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In order to maintain coherence with method's names, I think "CollaborativeExit" should be renamed to "CollaborativeRedeem"
- type: enum('Onboard', 'SendAsync', 'SendOffchain', 'SendOnchain', 'Claim', 'CollaborativeExit', 'UnilateralExit') | |
- type: enum('Onboard', 'SendAsync', 'SendOffchain', 'SendOnchain', 'Claim', 'CollaborativeRedeem', 'UnilateralExit') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but redeem can be confused with Redeem Tx for oor?
@@ -31,9 +31,7 @@ services: | |||
- ARK_ROUND_INTERVAL=10 | |||
- ARK_NETWORK=liquidregtest | |||
- ARK_LOG_LEVEL=5 | |||
- ARK_ESPLORA_URL=http://chopsticks-liquid:3000 | |||
- ARK_ROUND_LIFETIME=20 | |||
- ARK_SCHEDULER_TYPE=block |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing ARK_ROUND_LIFETIME
& ARK_SCHEDULER_TYPE
will make the coveanant "TestSweep" test fails
* rework nonces encoding * add a check in Musig2Nonce decode function * musig2_test: increase number of signers to 20 * musig2.json: add a test case with a 35 leaves tree
Remember to squash the history locally in a single meaningful commit after the work is done. |
This introduces a simulation framework designed to test the server by simulating multiple clients performing various actions over several rounds. The framework reads simulation configurations from YAML files, validates them against a predefined schema, and executes the simulation accordingly.
simulation1.yaml is configured as per this requirement, but this was created with idea that any scenario can be configured.
@tiero @altafan @louisinger @bordalix please review.