Repository navigation
BR-4: providers must be different operators; rand-guardian --check-providers - #11
Merged
Merged
Conversation
…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 Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
--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
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.
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 whatrpc_quorumproviders report identically.What was missing
Nothing checked that the providers are different parties on the same chain.
rpc_quorumof 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.rand-guardian --config <file> --check-providersmakes 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.rsdaemons/tests/providers.rs(new, 9 tests)daemons/README.md,daemons/config.example.toml,docs/guardian-hosts.mdTests
cargo test --releaseindaemons/: all test binaries pass, no failures.Upgrade
rpc_quorum1 (what the live guardians run) loads and behaves as before.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-providerson a new config before it goes live.Left for the owner
🤖 Generated with Claude Code