feat(l1): opt-in for plaintext RPC to trusted private hosts#21
Merged
Conversation
The provider rejected any non-HTTPS RPC whose host wasn't literal loopback, which broke reaching a node over a private container network (Docker/K8s service name, host.docker.internal, private-VPC IP) — e.g. `http://anvil:8545`. Plaintext there is normal and safe; anvil doesn't speak TLS at all. Add `--allow-insecure-rpc` / `CARTESI_SEQUENCER_ALLOW_INSECURE_RPC` (default false) on setup/run/flush-mempool. The default stays secure — remote plaintext is refused — but an operator can explicitly opt in for a trusted private network. The opt-in is loud (warn!) and auditable (shows up in args/env), and is threaded through every provider constructor so no path can silently downgrade. Also harden the loopback check: classify the parsed `url::Host` with `Ipv4Addr/Ipv6Addr::is_loopback()` instead of matching literal strings. This drops the `[::1]` bracket hack and fixes a latent bug where the whole 127.0.0.0/8 block except 127.0.0.1 was wrongly rejected.
Address PR review feedback: spell out that `CARTESI_SEQUENCER_ALLOW_INSECURE_RPC` is not pinned into the DB at `setup` — it must be set on every L1-dialing subcommand (`setup`, `run`, `flush-mempool`), and omitting it on `run` after a successful `setup` fails loud (`remote RPC must use https`) by design, not a bug. Add a Docker Compose snippet showing it in the shared environment.
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.
The provider rejected any non-HTTPS RPC whose host wasn't literal loopback, which broke reaching a node over a private container network (Docker/K8s service name, host.docker.internal, private-VPC IP) — e.g.
http://anvil:8545. Plaintext there is normal and safe; anvil doesn't speak TLS at all.Add
--allow-insecure-rpc/CARTESI_SEQUENCER_ALLOW_INSECURE_RPC(default false) on setup/run/flush-mempool. The default stays secure — remote plaintext is refused — but an operator can explicitly opt in for a trusted private network. The opt-in is loud (warn!) and auditable (shows up in args/env), and is threaded through every provider constructor so no path can silently downgrade.Also harden the loopback check: classify the parsed
url::HostwithIpv4Addr/Ipv6Addr::is_loopback()instead of matching literal strings. This drops the[::1]bracket hack and fixes a latent bug where the whole 127.0.0.0/8 block except 127.0.0.1 was wrongly rejected.