feat: changes to support node alpha.12#489
Conversation
🦋 Changeset detectedLatest commit: a9dc071 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
0499c68 to
c063bb0
Compare
…si/rollups 2.2.0.
…devnet-contracts [address-book] * Replaced Fungible and Non Fungible token addresses to use the new ones exported by Devnet package. * Refactor deposit ERC-20 and ERC-721 to the new addresses as defaults.
…me and bump required-version for cartesi-machine tests.
2969b12 to
6cb5268
Compare
Coverage Report
📁 File Coverage (19 files)
|
f494f64 to
3ac391f
Compare
|
I am making that ready to review, but a release will also need to have an explorer ready The PR is here: cartesi/rollups-explorer#464. Once we have a tag and release for the explorer, I will just update the image tag for the service. |
endersonmaia
left a comment
There was a problem hiding this comment.
I see there's --prt that enables prt mode and default is Authority, what about Quorum, will it be possible to use Quorum in dev mode?
Not for this release. |
|
I did one extra commit to include a fix to the following bug |
c3d1b2a to
791b9c7
Compare
* Add parse function related to the configuration * Add a few type check parsers for address and number.
…when using RUN command. - Add --claim-staging-period flag. default to 0 - Add --config flag. default to cartesi.toml
… property. - The application status and enabled has separate meanings. It can be in a FAILED state but still enabled.
… allow external access. - Allow specific methods, headers with max-age control of 24 hours and a vary-header to avoid intermittent CORS bug when tightening the domain list.
…CHAIN_WS_ENDPOINT.
- Fix "unable to open a TTY: No such device or address" error returned by cartesi-machine.
…ESI and pass it down to rollups-node. * There is a list of allowed environment variable configured for rollups-node. Only these are picked on from the big bag of possible variables.
…pported environment variables by service.
…he cartesi-machine.
* Solve lint blocker problems.
791b9c7 to
afe3049
Compare
| * A number of environment variables are rule out to avoid confusion e.g. CORS, FEATURE Enablement, etc. | ||
| */ | ||
| export const nodeAllowedEnvironmentVariables = [ | ||
| "CARTESI_AUTH_MNEMONIC", |
There was a problem hiding this comment.
is it really worth the burden of maintaining this list over time?
There was a problem hiding this comment.
I did curate that because there are a dozen more; I just did not add them all because, looking at the node source code, it looks like they set reasonable defaults. I am not sure about going free and just plugging any CARTESI_* in the compose environment section of the rollups-node service declaration.
There was a problem hiding this comment.
I think only advanced users will set CARTESI_ variables. And for those it's a minor issue if they break the behavior of the dev execution because they set some variable to some value that changes the behavior in an unpredictable way to the CLI.
IMO it's a big downside for maintenance to keep this list. The rollups node may change variables, as it happened several times in the past, and the CLI will always need to keep up.
I'd just iterate over all variables, filter all prefixed with CARTESI_ and forward all. It's simple, it works, and low-maintenance.
| export const getMachineHash = (): Hash | undefined => { | ||
| // read hash of the cartesi machine snapshot, if one exists | ||
| const hashPath = getContextPath("image", "hash"); | ||
| const hashPath = getContextPath("image", "hash_tree.sht"); |
There was a problem hiding this comment.
I wouldn't read this file. Instead I'd rather call the cartesi-machine-stored-hash utility
There was a problem hiding this comment.
Push the change here: 053f405
The change in the YAML was small, just the QEMU + Docker Buildx setup. But for some reason, Biome was formatting the whole document.
d709be7 to
053f405
Compare
* Add integration test cases. * Add test utility to create and build a cartesi-application on demand using CLI binary. A temporary folder is generated and a cleanup is applied after-all tests had finished
053f405 to
a9dc071
Compare
📝 Summary
This PR improves the CLI run flow, node compose generation, and configuration parsing, alongside dependency upgrades, test suite expansions, and comprehensive validation for fork mode configurations.
🚀 Key Changes
CLI & run Command Enhancements
--no-rollupflag passed to thecartesi-machinebinary, ensuring compatibility with newer versions.run.tsbefore initiating a run session in fork mode.Config System & Validation
validations.tswithassertForkConfigto execute pre-flight assertions. This ensures required contracts are deployed on the target chain/block and validates that on-chain calls likegetInputBoxorgetDeploymentBlockNumbersucceed.getForkChainIdwith a more completegetForkConfigfunction insiderollups.tsto query the current Anvil service details and return a completeForkConfig(containingchainId,url, andblockNumber).base.tsto verify the deployment and contract state withingetAddressBook().withdrawalConfigparsing and validation (including address and numeric validation).InvalidAddressValueError,ForkChainValidationError, andUnsupportedForkChainErrorto improve error context.hash_tree.sht(root hash offset).Rollups-Node Env Management & Proxy Updates
CARTESI_BLOCKCHAIN_WS_ENDPOINTfrom default node compose environments.Dependencies & SDK
0.12.0-alpha.41.rollups-explorerimage integration version from2.0.0-alpha.2to2.0.0-alpha.3inrollups.ts.TestUsdWithdrawalOutputBuilder.Migration risk is low, but note the following behavioral changes:
hash_tree.sht. (Don't forget to executecartesi buildon existing dapps)--no-rollupflag has been removed as it is not available as an option incartesi-machineversions0.20and previous0.19. This ensures the CLI works correctly with newer CM versions.getInputBox) fail.🧪 Testing & Validation
validations.tsthat dynamically derive contract baseline call indices (avoiding fragile, hardcoded call-count assumptions) and explicitly assert contract checks.