Repository navigation
Conversation
…-json `cartesi status --json` failed with "Do not know how to serialize a BigInt" as soon as a deployed application had a withdrawal config, whose drive fields are bigints. Write them as decimal strings, as formatValue already does for TOML values. Co-Authored-By: Claude Opus 5.5 <[email protected]>
🦋 Changeset detectedLatest commit: 9064850 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 |
Contributor
Coverage Report
📁 File Coverage (20 files)
|
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
cartesi status --jsonexits 1 withDo not know how to serialize a BigIntas soon as a deployed application has a withdrawal config (found on 2.0.0-alpha.42; the code is unchanged in 2.0.0-alpha.43).getDeploymentsparseswithdrawal_configintoNodeWithdrawalConfig, whose drive fields (accountsDriveStartIndex,log2LeavesPerAccount,log2MaxNumOfAccounts) are bigints, and the command passed the deployments straight toJSON.stringify. Plaincartesi status(the table) is not affected.Fix
formatStatusJson, which writes bigints as decimal strings with the same replacerformatValue(config/errors.ts) already uses.Tests
tests/unit/commands/status.test.ts: one case without a withdrawal config, one with it. The second case failed before the fix withJSON.stringify cannot serialize BigInt.bun test tests/unit: 558 pass.biome checkandtscare clean.cartesi runenvironment.The docs removed their mention of
cartesi status --jsonin cartesi/docs#359 because of this bug; it can come back once this is released.🤖 Generated with Claude Code