feat: make the REST API and Vault opt-in, and keep volumes on stop - #46
Merged
Conversation
pallet-revive's eth-rpc surfaces native Substrate extrinsics as pseudo-Ethereum transactions: SCALE-encoded input, a `modl*` pallet account as `to`, and zero gas. They carry no EVM call frames, so debug_traceTransaction answers "No Ethereum extrinsic found" and the internal transaction fetcher retries those blocks forever, flooding the logs. Nothing is lost by turning it off, since debug_traceBlockByNumber returns [] regardless. Exposed as POLYMESH_BLOCKSCOUT_DISABLE_INTERNAL_TX_FETCHER (default true) so it can be re-enabled if a future eth-rpc image supports tracing.
The frontend's Contract Read/Write tabs and its "Add to wallet" network config are driven by wagmi/viem in the browser, so the RPC endpoint has to resolve from the host rather than from inside the Docker network. Without NEXT_PUBLIC_NETWORK_RPC_URL those calls have no endpoint to use. Defaults to http://localhost:<POLYMESH_ETH_RPC_PORT> and is overridable via POLYMESH_BLOCKSCOUT_NETWORK_RPC_URL for setups that publish the eth-rpc port elsewhere or run the browser on another host.
Starting everything meant five containers for the REST APIs and Vault even when a workflow never signs through them, which is a real cost on a constrained machine. They are now opt-in via `--profile rest-api`, leaving the node, Postgres and the Subquery indexer as the default set. `environment-ready` waited on a marker written by the REST API account init, which no longer runs in the default set, so it would have hung forever. It now gates that wait on POLYMESH_WAIT_FOR_REST_API and otherwise reports ready once the core services are healthy, which its new depends_on guarantees. `start-env.sh` sets the variable to match the profiles it was given; running `docker compose` directly needs it set by hand. `--profile evm` no longer implies Vault and the REST APIs, so working on contracts no longer pays for them. `--profile rest-api,evm` restores the previous behaviour. `stop-env.sh` force-enables both optional profiles on teardown so nothing is left running, and the test scripts enable `rest-api` themselves since the suite signs with Vault.
`stop-env.sh` removed chain data, Vault keys and the Blockscout database on every stop, so resuming from existing state meant remembering `--keep-volumes` and forgetting it meant re-syncing from genesis. Losing that data by accident is a lot more expensive than typing a flag when you actually want a clean slate, so the default is inverted: `--volumes` now opts into removal. `--keep-volumes` is still accepted as a no-op so existing invocations keep working. The full `yarn test` cycle owns the environment it creates and leaves identities and assets on chain that a rerun would trip over, so it now passes `--volumes` explicitly, as does CI via a new `test:stop:clean`.
prashantasdeveloper
approved these changes
Sep 1, 2026
Contributor
Author
|
/fast-forward |
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.
Description
Makes the dev environment cheaper to run and safer to stop.
The REST API and Vault now sit behind a
rest-apicompose profile instead of starting unconditionally, so a run that never signs through them does not pay for five extra containers.--profile evmno longer drags them in either;--profile rest-api,evmrestores the old everything-on behaviour.environment-readygates onPOLYMESH_WAIT_FOR_REST_APIso it reports ready on core services when the profile is off, rather than waiting forever for a marker that is never written.stop-env.shnow keeps named volumes by default. Losing chain data by accident costs a full re-sync, so removal is opt-in via--volumes(-v).yarn testand CI pass it explicitly, since the suite leaves on-chain state a rerun trips over.Two Blockscout fixes found along the way:
NEXT_PUBLIC_NETWORK_RPC_URLdefaults to the published eth-rpc port, which the browser needs for Contract Read/Write and "Add to wallet".Docs updated across
README.md,tests/README.mdand all env files.test:stop:evmremoved —stop-env.shforce-enables both profiles, so it was a duplicate oftest:stop.Validated with
docker compose configacross all profile combinations, with resolved values spot-checked. The integration suite has not been run end-to-end against these commits.Breaking Changes
docker compose up -dno longer starts the REST API or Vault. Add--profile rest-api, plusPOLYMESH_WAIT_FOR_REST_API=truewhen driving compose directly.--profile evmalone no longer starts Vault and the REST APIs. Use--profile rest-api,evmfor the previous behaviour.stop-env.shno longer removes named volumes by default. Pass--volumes(or-v).--keep-volumesstill accepted as a no-op.yarn test:stop:evmremoved; useyarn test:stop.JIRA Link
Checklist