-
Notifications
You must be signed in to change notification settings - Fork 476
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
README on mainnet script evaluation tests #4868
Merged
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# Plutus On-Chain Script Evaluation Tests | ||
|
||
This test suite evaluates Plutus scripts that ran on the Cardano mainnet. | ||
It verifies the preservation of behavior: existing scripts that succeeded (resp. failed) on-chain on a given input should always continue to succeed (resp. fail) when evaluated on plutus master given the same input. | ||
|
||
The test suite currently runs nightly. | ||
|
||
## Generating Script Dumps | ||
|
||
The executable for generating script dumps is in the [plutus-apps](https://github.com/input-output-hk/plutus-apps) repo, since it depends on the node API. | ||
It is currently in the "plutus-script-dump" branch and will eventually be merged into the main branch. | ||
|
||
To run it, check out the "plutus-script-dump" branch, and run the following in the nix shell of plutus-apps: | ||
|
||
``` | ||
AWS_ACCESS_KEY_ID=<replace_with_aws_key> \ | ||
AWS_SECRET_ACCESS_KEY=<replace_with_aws_secret_secret> \ | ||
AWS_DEFAULT_REGION=us-east-1 \ | ||
AWS_ENDPOINT_URL=https://s3.devx.iog.io \ | ||
S3_DUMP_DIR=s3://plutus/mainnet-script-dump/ \ | ||
cabal run plutus-script-evaluation-test:dump-script-events -- \ | ||
--socket-path $HOME/mainnet/db/node.socket \ | ||
--config $HOME/mainnet/mainnet-config.json \ | ||
--mainnet \ | ||
--blocks-per-file 50000 \ | ||
--events-per-file 50000 \ | ||
--dir $HOME/cardano-dump | ||
``` | ||
|
||
Adjust the `socket-path`, `config` and `dir` arguments as appropriate. | ||
The `dir` argument is the local working directory, which will contain the checkpoint files and the dump files. | ||
|
||
With the above arguments, it creates one checkpoint file and one dump file per 50000 blocks or 50000 script evaluation events, whichever comes sooner. | ||
When the executable starts, if there are checkpoint files in the working directory, it will resume from the latest checkpoint file. | ||
It keeps the latest 3 checkpoint files and deletes the older ones, since checkpoint files are large. | ||
Upon creating a dump file, it uploads the dump file to `S3_DUMP_DIR` before deleting the local copy. | ||
|
||
To ensure that no script evaluation event is lost, it creates and uploads the dump file before writing the checkpoint file. | ||
This means if the job is killed after uploading a dump file but before writing the checkpoint file, it may lead to duplicate events being uploaded. | ||
However, this will only happen if the job is re-started with a different `blocks-per-file` or `events-per-file`. | ||
If both arguments are the same, it will generate the same dump file again, and uploading it will overwrite the previously uploaded one. | ||
This also means that as long as `blocks-per-file` and `events-per-file` remain the same, it is safe to re-run the job from an older checkpoint or the beginning, without producing duplicate dumps on S3. | ||
|
||
## Running the Tests | ||
|
||
To run the tests, first download the dump files from S3 to a local directory. Then run the following in the nix shell of plutus: | ||
zliu41 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
``` | ||
EVENT_DUMP_DIR=$HOME/mainnet-script-dump-downloaded cabal run plutus-ledger-api:evaluation-test -- --num-threads=1 | ||
``` | ||
|
||
Adjust `EVENT_DUMP_DIR` as appropriate. | ||
|
||
The purpose of `--num-threads=1` is to run the tests on one dump file at a time. | ||
Currently, incremental deserialization is not implemented, and each dump file has to be entirely loaded in memory, and this ensures we don't consume too much memory by loading multiple dump files simultaneously. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
What's stopping it from going into
next-node
?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.
It currently depends on unmerged changes of node and ledger:
LedgerState
cardano-node#3993Also,
next-node
currently depends on plutus release/1.0.0, but this needs a newer plutus version.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'll bring up IntersectMBO/cardano-ledger#3052 next week when we plan who is working on what, so that someone can spend some time thinking about a proper fix.
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.
@JaredCorduan thanks!