Repository navigation
guardian: fail closed on mainnet without redundant RPCs, peers and limits - #8
Merged
Merged
Conversation
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment Thanks for integrating Codecov - We've got you covered ☂️ |
…s quorum, peers and caps
On a Rand chain id of 14 or higher (the public chains as classified for BRG-901), or with no
chain id configured, rand-guardian now stops at startup unless every watched chain is read
through at least two distinct providers at an rpc_quorum of at least two (BR-4),
guardian.peers is non-empty (BR-502) and [guardian.limits] is present (BRG-1). The error lists
each missing control. Devnet ids below 14 keep the old warnings.
- --check-config runs the same check and exits, without a key.
- --unsafe-skip-mainnet-guards / RAND_GUARDIAN_UNSAFE_SKIP_MAINNET_GUARDS=1 overrides it for an
emergency or a dev run, logging every gap at error level.
- --pause-signing, --resume-signing and --list-held are not gated.
- RPC URLs and peers accept ${NAME} placeholders filled from the environment at load
(Config::load_with), so provider API keys stay out of config files. An unfilled one counts
as a gap and does not count toward a quorum.
- JSON-RPC transport errors drop the URL, naming the host only.
Tests: tests/mainnet_guard.rs (classification, each gap, placeholders) and five binary tests
in tests/daemons.rs (each refusal, the override by flag and env, devnet exemption,
--check-config, operator commands). Removing the guard turns them red.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… and caps; roll runbook
daemons/mainnet/guardian-1..8.toml now pass the mainnet guard once their environment is set:
- rpc_quorum = 2 on every chain, over keyless providers that served the needed calls on
2026-11-04, plus one ${GUARDIAN_RPC_*} placeholder per chain for a keyed provider (Rand,
Ethereum, BSC, Tron, Solana).
- guardian.peers: the other guardians through loopback forwards at 127.0.0.1:717<j>.
- The existing published caps.
tests/mainnet_guard.rs loads all eight. With the variables set they have no gaps; without,
they name exactly the five variables. run-guardians-set1.sh passes GUARDIAN_RPC_* from
~/.rand-bridge/mainnet-set1/rpc.env.
docs/guardian-hosts.md describes the guard, the providers, the peer forwards (and that a peer
serves only its own signatures) and the roll to the live guardians. Binary and config roll
together, one host at a time. While guardians 7 and 8 are offline, each restart stops signing,
so the preferred order brings 7 and 8 up first (BR-402).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ter the rebase on audit v14 main now refuses a guardian without rand.genesis_hash (BR-1005), so the two guard tests that expect a start past the guard stopped at that check instead of at the Rand node. The test config names a genesis hash whenever it names a chain. The roll runbook says the host file needs the line too. Three guard messages lose a run of spaces left by a line break inside the literal. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
dendisuhubdy
force-pushed
the
fix/audit-v12-br601
branch
from
November 18, 2026 04:17
ceaccc6 to
3742829
Compare
This was referenced Nov 18, 2026
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.
Two changes:
[guardian.limits]section.--unsafe-skip-mainnet-guards(orRAND_GUARDIAN_UNSAFE_SKIP_MAINNET_GUARDS) overrides this.--check-config, plus${ENV}substitution for secrets.The eight mainnet tomls are updated, and docs/guardian-hosts.md has the runbook. Locally, 263 tests pass.
Do not roll before each droplet has its provider URLs and peer tunnels: a guardian with the old config will refuse to start.
🤖 Generated with Claude Code