Skip to content

Optimize espresso-dev-node startup #281

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
wants to merge 4 commits into
base: prerelease/v2-alpha
Choose a base branch
from

Conversation

tuler
Copy link
Member

@tuler tuler commented May 22, 2025

This PR tries to speed up espresso-dev-node startup time by using a new option called ESPRESSO_DEV_NODE_L1_DEPLOYMENT=skip only currently available at the main unreleased version of espresso-dev-node. It expects the smart contract to already be deployed to the L1 provider (anvil).

For that to work we first created a cannon package for the espresso network smart contracts.
That is available at https://github.com/cartesi/espresso-network/tree/cartesi
So the first step to test this PR is to clone that repo, switch to branch cartesi and run cannon build (assuming cannon is installed).

Then we integrated the cannon package into our devnet, which can be built using

pnpm run build --filter @cartesi/devnet

That assumes the cannon package espresso-network:0.0.1@main was built locally.
ps: when a stable version exists, we can publish to cannon registry.

Then we changed the binary used by the SDK to a main unreleased version.
Copy the unreleased devnet into SDK and build it.

cp -R packages/devnet/deployments packages/sdk
cp packages/devnet/anvil_state.json packages/sdk
pnpm run build --filter @cartesi/sdk

Then run the CLI with a devel image:

tsx apps/cli/src/index.ts start --services espresso --runtime-version devel

@tuler tuler requested a review from endersonmaia May 22, 2025 18:31
Copy link

changeset-bot bot commented May 22, 2025

⚠️ No Changeset found

Latest commit: ff69f85

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

github-actions bot commented May 22, 2025

Coverage Report for ./apps/cli

Status Category Percentage Covered / Total
🔵 Lines 26.41% 295 / 1117
🔵 Statements 26.33% 300 / 1139
🔵 Functions 25.5% 51 / 200
🔵 Branches 24.44% 121 / 495
File CoverageNo changed files found.
Generated in workflow #532 for commit ff69f85 by the Vitest Coverage Report Action

@tuler
Copy link
Member Author

tuler commented May 22, 2025

CI will keep failing while cannon package is not published to registry

@tuler tuler force-pushed the feature/espresso-startup branch from 6a60701 to 0ddb6c9 Compare May 22, 2025 19:42
@tuler tuler linked an issue May 22, 2025 that may be closed by this pull request
@tuler tuler force-pushed the feature/espresso-startup branch from 6601b6a to ff69f85 Compare May 23, 2025 23:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Long espresso-dev-node startup time
1 participant