feat(preconf): add TLS support to sequencer server and validator client#3115
Open
fridrik01 wants to merge 3 commits into
Open
feat(preconf): add TLS support to sequencer server and validator client#3115fridrik01 wants to merge 3 commits into
fridrik01 wants to merge 3 commits into
Conversation
999c6ff to
31b1929
Compare
Copilot stopped reviewing on behalf of
fridrik01 due to an error
May 28, 2026 18:39
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## preconf-dev #3115 +/- ##
===============================================
+ Coverage 59.72% 60.01% +0.29%
===============================================
Files 384 384
Lines 19929 20055 +126
===============================================
+ Hits 11902 12036 +134
+ Misses 7047 7028 -19
- Partials 980 991 +11
🚀 New features to boost your workflow:
|
calbera
reviewed
May 28, 2026
calbera
reviewed
May 28, 2026
calbera
reviewed
May 28, 2026
calbera
reviewed
May 28, 2026
Contributor
calbera
left a comment
There was a problem hiding this comment.
generally lgtm, left some nits + will review again.
Some potential followups from claude:
- No mTLS / client certificates. The client is authenticated at the app layer via JWT; TLS only authenticates the server. For this threat model that's adequate; mTLS would be defense-in-depth, a fine follow-up.
- No rate-limiting / the JWT check is O(n) HMAC over all validator secrets before the whitelist/proposer checks. Pre-existing, but this PR's whole premise is internet exposure, which makes an unauthenticated-request amplification slightly more relevant. Follow-up, not a blocker.
Contributor
Author
mTLS is not required imo, but the others are part of https://berachain.clickup.com/t/9014124274/86b9exmww and https://berachain.clickup.com/t/9014124274/86b9exmz9 |
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 preconf sequencer and validators exchange JWT auth tokens and execution payloads over plain HTTP. For a sequencer reachable over the public internet, this leaks credentials and MEV-sensitive transaction ordering in cleartext. This PR adds opt-in TLS to the sequencer server and validator client along with the tooling to run and rotate it.
More specifically, the main changes are:
Server TLS (
beacon/preconf/server.go)tls-cert-path+tls-key-pathswitch the API to HTTPS, served viaServeTLSwith aGetCertificatehook.Start(), so a bad cert/key or an in-use port fails node startup loudly instead of being logged in a goroutine behind a dead endpoint.Client pinning (
beacon/preconf/client.go)sequencer-ca-cert-pathpins the sequencer to a single CA and rejects certificates from any other CA, guarding against CA mis-issuance and BGP-hijack attacks. When unset, it falls back to the system trust store.Config and operations
Config.Validate()rejects half-configured TLS (cert without key, or pinning without anhttps://URL).SIGHUP(next to the existing whitelist reload), so rotation needs no restart and a bad cert file leaves the old one serving.config.tomltemplate entries cover all three paths.Devnet (
kurtosis/)preconf.tls: true). At plan time it generates an internal CA and a CA-signed server cert (SAN matching the sequencer service name), serves the leaf on the sequencer, and pins the CA on the validators. This mirrors the production trust topology rather than a self-signed shortcut. TLS stays a toggle, so the devnet can still run plaintext withtls: false.Documentation (
beacon/preconf/README.md)Test plan
SIGHUPcert reload, bind-failure handling, and config validation.make start-devnet-preconf). Confirmed validators fetch payloads from the sequencer over HTTPS with CA pinning and no certificate verification failures.