Skip to content

BR-4: providers must be different operators; rand-guardian --check-providers - #11

Merged
dendisuhubdy merged 4 commits into
mainfrom
feat/i3-provider-independence
Nov 18, 2026
Merged

dendisuhubdy merged 4 commits into
mainfrom
feat/i3-provider-independence

Conversation

@dendisuhubdy

Copy link
Copy Markdown
Member

Tracks randprotocol/monorepo#3

What main already has

Multi-RPC quorum reads: each chain is read through rpc + rpcs, and a message is signed and a cursor moved only on what rpc_quorum providers report identically.

What was missing

Nothing checked that the providers are different parties on the same chain.

  • Config validation. With rpc_quorum of two or more, a config in which one operator's URLs are enough to meet the quorum does not load. The operator is the URL's host reduced to its last two labels (publicnode.com), or host and port for an IP address or single-label host.
  • A live check. rand-guardian --config <file> --check-providers makes one read-only identity call per provider and exits 0 only when, on every watched chain, a quorum of providers from at least two operators name the same chain, and the Rand nodes name the configured chain id and genesis hash. No key, no data directory.

Files

  • daemons/src/providers.rs (new), daemons/src/config.rs, daemons/src/bin/guardian.rs, daemons/src/lib.rs
  • daemons/tests/providers.rs (new, 9 tests)
  • daemons/README.md, daemons/config.example.toml, docs/guardian-hosts.md

Tests

cargo test --release in daemons/: all test binaries pass, no failures.

Upgrade

  • A config at rpc_quorum 1 (what the live guardians run) loads and behaves as before.
  • A config at rpc_quorum >= 2 whose quorum one operator's URLs can meet stops loading. The repository's mainnet configs, and those in guardian: fail closed on mainnet without redundant RPCs, peers and limits #8, do not have that shape. Run --check-providers on a new config before it goes live.
  • The operator rule is by host name, not the public-suffix list, and cannot see a shared upstream behind two names.

Left for the owner

🤖 Generated with Claude Code

…ders asks each provider its chain

Main reads each chain through several providers and signs only what a
quorum report identically. Nothing checked that the providers are
different parties: two URLs of one operator at rpc_quorum 2 loaded and
gave the protection of one.

With an rpc_quorum of two or more, a config in which one operator's URLs
are enough to meet the quorum is now refused at load. The operator is the
URL's host reduced to its last two labels, or host:port for an IP address
or a single-label host. A quorum of one is not judged (it still warns at
startup), so the configs the live guardians run load as before.

rand-guardian --check-providers makes one read-only identity call per
provider (eth_chainId, getGenesisHash, rand_chainId + rand_getGenesisHash)
and exits 0 only when, on every watched chain, a quorum of providers from
at least two operators name the same chain, and the Rand nodes name the
configured chain id and genesis hash. It needs no key and opens no data
directory.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YGaYNQ4cvFtg2UmokVgrAN
@codecov

codecov Bot commented Nov 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

dendisuhubdy and others added 3 commits November 18, 2026 13:46
--check-providers and --check-config both stay; the README and the hosts
runbook keep the guard's text and the independence check's.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YGaYNQ4cvFtg2UmokVgrAN
…ependence

docs/guardian-hosts.md keeps both the provider independence section and
the quorum headroom section.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YGaYNQ4cvFtg2UmokVgrAN
@dendisuhubdy
dendisuhubdy merged commit 0b5c502 into main Nov 18, 2026
1 check passed
@dendisuhubdy
dendisuhubdy deleted the feat/i3-provider-independence branch November 18, 2026 09:15
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.

1 participant