-
Notifications
You must be signed in to change notification settings - Fork 1
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
[DRAFT] Update clarinet-sdk
and clarinet-sdk-wasm
to support repl.remote_data
#115
base: master
Are you sure you want to change the base?
Conversation
0503de7
to
a80f973
Compare
Closing this, as per #116. |
This commit refactors a trait reference processing test that proved to be erratic after upgrading to the latest version of clarinet-sdk. Failed CI job that caused this commit: https://github.com/stacks-network/rendezvous/actions/runs/13400901964/job/37431400758?pr=115.
PR reopened. Thanks to @hugocaillard for quickly releasing a new Clarinet version with a fix for Node < 22. At this point, the previous Rendezvous functionality should be preserved. Remote simnet data is left to be tested before taking this PR out of draft. |
citizen.ts
Outdated
await simnet.initEmptySession(); | ||
await simnet.initEmptySession({ | ||
enabled: false, | ||
initial_height: 5, |
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 5 means?
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 is a random hardcoded value. It can easily be 1.
citizen.ts
Outdated
enabled: false, | ||
initial_height: 5, | ||
api_url: "", | ||
}); |
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.
An idea would be to read the session params from rv-config.json (it can be a section there with three key/values) and then:
- If any of them is malformed or missing we throw an error and exit.
- If all of them are valid, we pass them to the empty session.
- If none of them is specified we pass dummy/empty values.
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.
So we could rename path
to conf
or just keep path
for now and re-purpose it for rv-config.json
. Then since it's a JSON, we can deserialize it to a type.
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.
Great plan! This way, we don't have to increase the already fairly sized number of command-line args, and we'll kick off the user configurations.
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.
Yes we can keep it as path
for now. And if it works we can right after rename to conf
.
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.
Theses new settings are in the Clarinet.toml
https://www.hiro.so/blog/test-your-code-with-mainnet-data-in-clarinet-simnet
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.
Thanks for the update and the resources, @hugocaillard. So, to initialize an empty simnet session, can we stick to what's inside the user's Clarinet.toml
? And override a hardcoded remote data object if there's nothing? Also, what will happen in the scenario used in Rendezvous (empty session initialization, redeployment of all contracts by epoch, overwriting the target contract source with the concatenation)?
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.
You can pass null
if there's nothing in the clarinet.toml (of if it's not enabled).
Also, what will happen in the scenario used in Rendezvous (empty session initialization, redeployment of all contracts by epoch, overwriting the target contract source with the concatenation)?
It should just work as usual. But I do encourage you to give it a try
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.
Some updates after trying initEmptySession
with different remote_data_settings
:
- For
null
, the Rendezvous example project won't be successfully initialized. The error is the following (probably because there is an issue resolving the dependency tree for traits):
UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "Contract deployment runtime error: ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM.rendezvous-token -> use of undeclared trait <sip-010-trait>".
- For previously working
{ enabled: false, api_url: "", initial_height: 5 }
, same error as fornull
. - For remote data (see Clarinet.toml), it seems to be working properly. The CI fails because of the API rate limit.
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.
🚀
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.
This commit adds support for public network contracts fuzzing. If the user correctly sets up the remote data in Clarinet.toml, an empty session configured with those settings will be set up in the `issueFirstClassCitizenship` method.
64ded9f
to
054f022
Compare
clarinet-sdk
and clarinet-sdk-wasm
to the latest versionclarinet-sdk
and clarinet-sdk-wasm
to support repl.remote_data
This PR updates
clarinet-sdk
andclarinet-sdk-wasm
to the latest stable version. Before merging the PR, Rendezvous compatibility with the remote data feature introduced in@hirosystems/clarinet-sdk v2.13.0
has to be checked. For this reason, this PR is still a draft.