Skip to content

Add ipc support in --execution-endpoint - #8802

Open
simonmichal wants to merge 5 commits into
sigp:unstablefrom
simonmichal:issue-7336
Open

Add ipc support in --execution-endpoint#8802
simonmichal wants to merge 5 commits into
sigp:unstablefrom
simonmichal:issue-7336

Conversation

@simonmichal

Copy link
Copy Markdown

Issue Addressed

This PR aims to address #7336

Proposed Changes

This PR adds IPC transport.

Additional Info

I run following test to valided it:

$ reth node   --dev   --authrpc.jwtsecret /tmp/jwt.hex   --auth-ipc   --auth-ipc.path /tmp/reth_auth.ipc

2026-02-11T14:28:16.034991Z  INFO Initialized tracing, debug log directory: /home/msimon/.cache/reth/logs/dev
2026-02-11T14:28:16.038027Z  INFO Starting Reth version="1.10.2 (e0a0a0d)"
2026-02-11T14:28:16.038158Z  INFO Opening database path="/home/msimon/.local/share/reth/dev/db"
2026-02-11T14:28:16.060618Z  INFO Launching node
2026-02-11T14:28:16.065503Z  INFO Configuration loaded path="/home/msimon/.local/share/reth/dev/reth.toml"
2026-02-11T14:28:16.072104Z  INFO Healing static file inconsistencies.
2026-02-11T14:28:16.124622Z  INFO Verifying storage consistency.
2026-02-11T14:28:16.124992Z  INFO Database opened
2026-02-11T14:28:16.125773Z  INFO
Pre-merge hard forks (block based):
- Frontier                         @0
- Homestead                        @0
- Dao                              @0
- Tangerine                        @0
- SpuriousDragon                   @0
- Byzantium                        @0
- Constantinople                   @0
- Petersburg                       @0
- Istanbul                         @0
- Berlin                           @0
- London                           @0
Merge hard forks:
- Paris                            @0 (network is known to be merged)
Post-merge hard forks (timestamp based):
- Shanghai                         @0          blob: (target: 6, max: 9, fraction: 5007716)
- Cancun                           @0          blob: (target: 6, max: 9, fraction: 5007716)
- Prague                           @0          blob: (target: 6, max: 9, fraction: 5007716)
2026-02-11T14:28:16.125892Z  INFO Loaded storage settings settings=StorageSettings { receipts_in_static_files: false, transaction_senders_in_static_files: false, storages_history_in_rocksdb: false, transaction_hash_numbers_in_rocksdb: false, account_history_in_rocksdb: false, account_changesets_in_static_files: false, storage_changesets_in_static_files: false }
2026-02-11T14:28:16.128570Z  INFO Transaction pool initialized
2026-02-11T14:28:16.128953Z  INFO Loading saved peers file=/home/msimon/.local/share/reth/dev/known-peers.json
2026-02-11T14:28:16.284598Z  INFO P2P networking initialized enode=enode://cb39a4c5803fe7f2518f9836adf6f88043771ed87c18cd0ce0bc90270fd69d13bf19055f6ab670801b52ae3a11299105c1e648f6011b0d86eb3b285713e50bbd@127.0.0.1:30303
2026-02-11T14:28:16.285488Z  INFO StaticFileProducer initialized
2026-02-11T14:28:16.287837Z  INFO Pruner initialized prune_config=PruneConfig { block_interval: 5, segments: PruneModes { sender_recovery: None, transaction_lookup: None, receipts: None, account_history: None, storage_history: None, bodies_history: None, receipts_log_filter: ReceiptsLogPruneConfig({}) } }
2026-02-11T14:28:16.293459Z  INFO Consensus engine initialized
2026-02-11T14:28:16.294725Z  INFO Engine API handler initialized
2026-02-11T14:28:17.161843Z  INFO RPC IPC server started path=/tmp/reth.ipc
2026-02-11T14:28:17.161963Z  INFO RPC HTTP server started url=127.0.0.1:8545
2026-02-11T14:28:17.162031Z  INFO RPC auth server started url=127.0.0.1:8551 ipc_endpoint=/tmp/reth_auth.ipc
2026-02-11T14:28:17.166785Z  INFO Starting consensus engine
2026-02-11T14:28:17.167120Z  INFO Using local payload attributes builder for dev mode
2026-02-11T14:28:17.175942Z  INFO Forkchoice updated head_block_hash=0x683713729fcb72be6f3d8b88c8cda3e10569d73b9640d3bf6f5184d94bd97616 safe_block_hash=0x683713729fcb72be6f3d8b88c8cda3e10569d73b9640d3bf6f5184d94bd97616 finalized_block_hash=0x683713729fcb72be6f3d8b88c8cda3e10569d73b9640d3bf6f5184d94bd97616
2026-02-11T14:28:19.294468Z  INFO Status connected_peers=0 latest_block=0
2026-02-11T14:29:34.294588Z  INFO Status connected_peers=0 latest_block=0
2026-02-11T14:30:49.295235Z  INFO Status connected_peers=0 latest_block=0
2026-02-11T14:31:15.930576Z  INFO Received forkchoice updated message when syncing head_block_hash=0xd9d2ef9856fae9d10306db72069231d6d0429f157584a82dd90c2ca8298d0a34 safe_block_hash=0x2fc937743aeb5cb593aa36616d85a0d256d4e825bca299e40df034bfbb4f88a0 finalized_block_hash=0xe27cf2491bc46a9b73cd0e97d219a1faf468a41dc3a863ef6b278a0abcacd17b
2026-02-11T14:31:16.174137Z  INFO Forkchoice updated head_block_hash=0x683713729fcb72be6f3d8b88c8cda3e10569d73b9640d3bf6f5184d94bd97616 safe_block_hash=0x683713729fcb72be6f3d8b88c8cda3e10569d73b9640d3bf6f5184d94bd97616 finalized_block_hash=0x683713729fcb72be6f3d8b88c8cda3e10569d73b9640d3bf6f5184d94bd97616
2026-02-11T14:32:04.295059Z  INFO Status connected_peers=0 latest_block=0
2026-02-11T14:32:13.988141Z  INFO Received forkchoice updated message when syncing head_block_hash=0x28c1604d96dfacb2e2035dbefa69997638a9373991171a982934f4320a3ec121 safe_block_hash=0x2fc937743aeb5cb593aa36616d85a0d256d4e825bca299e40df034bfbb4f88a0 finalized_block_hash=0xe27cf2491bc46a9b73cd0e97d219a1faf468a41dc3a863ef6b278a0abcacd17b
2026-02-11T14:32:14.174929Z  INFO Forkchoice updated head_block_hash=0x683713729fcb72be6f3d8b88c8cda3e10569d73b9640d3bf6f5184d94bd97616 safe_block_hash=0x683713729fcb72be6f3d8b88c8cda3e10569d73b9640d3bf6f5184d94bd97616 finalized_block_hash=0x683713729fcb72be6f3d8b88c8cda3e10569d73b9640d3bf6f5184d94bd97616
$ lighthouse beacon_node   --network mainnet   --execution-endpoint ipc:///tmp/reth_auth.ipc   --execution-jwt /tmp/jwt.hex   --checkpoint-sync-url https://mainnet.checkpoint.sigp.io/

Feb 11 15:28:29.497 INFO  Lighthouse started                            version: "Lighthouse/v8.0.1-1e692da+"
Feb 11 15:28:29.504 INFO  Configured network                            network_name: "mainnet"
Feb 11 15:28:29.512 INFO  Data directory initialised                    datadir: /home/msimon/.lighthouse/mainnet
Feb 11 15:28:29.521 INFO  Deposit contract                              deploy_block: 11184524, address: 0x00000000219ab540356cbb839cbe05303d7705fa
Feb 11 15:28:29.636 INFO  Hot-Cold DB initialized                       split.slot: 13661632, split.state_root: 0x1bc1c1e5239e8ca4fdd8f9bb33c291b8edca4c1daefc612c4a483986f34d044d, split.block_root: 0x38d2080db5696a2ef2aba2a9b2dc0852e0587e592b41c8e17bbe3d3b7d5f5239
Feb 11 15:28:29.637 INFO  Blob DB initialized                           path: "/home/msimon/.lighthouse/mainnet/beacon/blobs_db", oldest_blob_slot: Some(Slot(13661408)), oldest_data_column_slot: Some(Slot(13661408))
Feb 11 15:28:35.212 INFO  Refusing to checkpoint sync                   msg: "database already exists, use --purge-db to force checkpoint sync"
Feb 11 15:28:35.213 INFO  Starting beacon chain                         method: "resume"
Feb 11 15:28:36.695 WARN  State cache missed                            state_root: 0x74fd2c90630d35169c7b5f3adba3617a65d0db1e3c602ad25c8fe8e1e6b34c2d
Feb 11 15:30:15.911 INFO  Block production enabled
Feb 11 15:30:16.035 WARN  State cache missed                            state_root: 0x7c3f7b5c419bcfef3533e14d1576626c4fbaae350edff4f8b702989cc168212d, block_root: 0x08f8a2d3d74eaaba8c55d887fd7f3d1cb15cc3429b0d78b7d08d6fc2d4e8fe8b
Feb 11 15:31:15.793 INFO  Beacon chain initialized                      head_state: 0x7c3f7b5c419bcfef3533e14d1576626c4fbaae350edff4f8b702989cc168212d, head_block: 0x08f8a2d3d74eaaba8c55d887fd7f3d1cb15cc3429b0d78b7d08d6fc2d4e8fe8b, head_slot: 13661689
Feb 11 15:31:15.799 INFO  Timer service started
Feb 11 15:31:15.802 INFO  UPnP Attempting to initialise routes
Feb 11 15:31:15.851 INFO  ENR Initialised                               enr: "enr:-Ny4QADnKeulBkr78kqVC-Ya92rhQKPP-WNz_l3viC_ne222Y4p3joN58-2eq7apa_jrekZzEotN51XcSlxAOZsC3RoQh2F0dG5ldHOIAAAAAAAAAACDY2djBIZjbGllbnTRikxpZ2h0aG91c2WFOC4wLjGEZXRoMpCMn2L-BgAAAP__________gmlkgnY0g25mZISMn2L-hHF1aWOCIymJc2VjcDI1NmsxoQJAp7YytwEZgIwEasi-Dz_2igQkCE77UssGZV_IKAoZ9YhzeW5jbmV0cwCDdGNwgiMo", seq: 16, id: 0xf438..5f47, ip4: None, udp4: None, tcp4: Some(9000), tcp6: None, udp6: None, quic4: Some(9001), quic6: None
Feb 11 15:31:15.893 INFO  Libp2p Starting                               peer_id: 16Uiu2HAkyn4Q2GbaKWNjhZs2gyrNNEZ49uRA8BcA6m9wdYiQUGSg, bandwidth_config: "3-Average"
Feb 11 15:31:15.896 INFO  Listening established                         address: /ip4/0.0.0.0/tcp/9000/p2p/16Uiu2HAkyn4Q2GbaKWNjhZs2gyrNNEZ49uRA8BcA6m9wdYiQUGSg
Feb 11 15:31:15.899 INFO  Listening established                         address: /ip4/0.0.0.0/udp/9001/quic-v1/p2p/16Uiu2HAkyn4Q2GbaKWNjhZs2gyrNNEZ49uRA8BcA6m9wdYiQUGSg
Feb 11 15:31:15.908 INFO  HTTP server is disabled
Feb 11 15:31:17.363 INFO  Address updated                               ip: 193.38.43.222, udp_port: 52062
Feb 11 15:31:25.862 INFO  Could not UPnP map Discovery port             error: Gateway does not support UPnP
Feb 11 15:31:25.900 INFO  UPnP not available
Feb 11 15:31:29.100 WARN  Low peer count                                peer_count: "0"
Feb 11 15:31:29.100 INFO  Searching for peers                           peers: "0", finalized_root: 0x38d2080db5696a2ef2aba2a9b2dc0852e0587e592b41c8e17bbe3d3b7d5f5239, finalized_epoch: 426926, head_slot: 13661689, current_slot: 13666355
Feb 11 15:31:34.377 INFO  Sync state updated                            old_state: Stalled, new_state: Syncing Finalized Chain
Feb 11 15:31:41.002 INFO  Syncing                                       peers: "9", distance: "4667 slots (15 hrs 33 mins)", est_time: "--"
Feb 11 15:31:53.002 INFO  Syncing                                       peers: "7", distance: "4668 slots (15 hrs 33 mins)", est_time: "--"
Feb 11 15:32:05.001 INFO  Syncing                                       peers: "9", distance: "4669 slots (15 hrs 33 mins)", est_time: "--"
Feb 11 15:32:17.002 INFO  Syncing                                       peers: "11", distance: "4664 slots (15 hrs 32 mins)", speed: "0.17 slots/sec", est_time: "7 hrs 46 mins"
Feb 11 15:32:17.799 INFO  Execution payloads are pruned
Feb 11 15:32:29.001 INFO  Syncing                                       peers: "22", distance: "4665 slots (15 hrs 33 mins)", speed: "0.12 slots/sec", est_time: "10 hrs 22 mins"
Feb 11 15:32:41.002 INFO  Syncing                                       peers: "21", distance: "4666 slots (15 hrs 33 mins)", speed: "0.12 slots/sec", est_time: "10 hrs 22 mins"
Feb 11 15:32:53.001 INFO  Syncing                                       peers: "21", distance: "4667 slots (15 hrs 33 mins)", speed: "0.12 slots/sec", est_time: "10 hrs 22 mins"
Feb 11 15:33:05.028 INFO  Syncing                                       peers: "26", distance: "4668 slots (15 hrs 33 mins)", est_time: "--"

@cla-assistant

cla-assistant Bot commented Feb 11, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@simonmichal

Copy link
Copy Markdown
Author

Hi team,

I took the liberty of opening this PR — we can use it as a starting point for discussion. I’m happy to add test cases for the IPC transport (similar to HTTP); I just wanted to get some feedback on the implementation first.

Please let me know your thoughts!

@michaelsproul for vis

@simonmichal

Copy link
Copy Markdown
Author

ummgh, seems SensitiveUrl is no longer part of the repo - I'll need to do some adjustments ...

@simonmichal

Copy link
Copy Markdown
Author

Since it is no longer possible to fix URL parsing inside SensitiveUrl, I am adding localhost to the IPC URL under the hood so that it passes SensitiveUrl parsing.

Buttom line is, it's working and it's ready for first review.

@michaelsproul

Copy link
Copy Markdown
Member

You could also upstream changes to sensitive_url here (and patch it in) if you prefer: https://github.com/sigp/sensitive_url

@michaelsproul michaelsproul added the enhancement New feature or request label Feb 11, 2026
@simonmichal

Copy link
Copy Markdown
Author

Thanks for pointing me to the sensitive_url repo, here's the PR:
sigp/sensitive_url#1

I am happy to accommodate any feedback you have regarding the PR.

@simonmichal

Copy link
Copy Markdown
Author

@michaelsproul : just a friendly ping

@michaelsproul

Copy link
Copy Markdown
Member

Hey @simonmichal we are all in on Gloas at the moment with little time to review. We'll try to find some time to review this in the coming weeks.

@macladson macladson left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the meantime, can you change the target branch to unstable and we'll get CI running

@michaelsproul
michaelsproul changed the base branch from stable to unstable March 2, 2026 01:02
@michaelsproul

Copy link
Copy Markdown
Member

Target branch check will fail until you push a new commit, but looks like there's a small conflict anyway. So should be fine once that's addressed

@michaelsproul michaelsproul added the waiting-on-author The reviewer has suggested changes and awaits thier implementation. label Mar 2, 2026
@simonmichal

Copy link
Copy Markdown
Author

@michaelsproul , @macladson : as requested, I've rebase on unstable

Comment thread beacon_node/src/cli.rs Outdated
@@ -544,8 +547,20 @@ impl<E: EthSpec> ExecutionLayer<E> {
let engine: Engine = {
let auth = Auth::new(jwt_key, jwt_id, jwt_version);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So here, we define the authentication to connect to the execution, yet the JWT isn't used at all during IPC. However --execution-jwt is still required for IPC connections. It would be nice to remove the requirement to pass in a jwt if you're connecting over IPC

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for pointing it out. Done!

Comment on lines +113 to +121
async fn ensure_connected(&self) -> Result<(), Error> {
let mut conn_guard = self.connection.lock().await;

if conn_guard.is_none() {
let connection = Self::create_connection(&self.path).await?;
*conn_guard = Some(connection);
}
Ok(())
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't actually tested this, but I believe since we are only checking for conn_guard.is_none(), once we have established a connection, conn_guard will then forever be Some. So if the connection ever drops (the EL goes down briefly or restarts) we will never be able to reconnect since the connection is closed at the kernel level.

We would need to add error detection and if there is an IO error we set conn_guard back to None so it grabs a fresh UnixStream

@simonmichal simonmichal Mar 13, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the feedback! I have added error handling logic that on connection erros will reset the connection to None - tested it by killing and then restarting reth, which now works. Let me know if it looks OK now?

@macladson macladson left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh one more thing, can you add a CLI test for the IPC version of the --execution-endpoint? It will need new_with_no_execution_endpoint so you can override the flag like we do for this test:

fn always_prepare_payload_override() {
let dir = TempDir::new().expect("Unable to create temporary directory");
CommandLineTest::new_with_no_execution_endpoint()

conn.writer.flush().await?;

let mut response = String::new();
conn.reader.read_line(&mut response).await?;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Related to the connection reset comment from earlier:

read_line will return Ok(0) if the UnixStream is closed. https://docs.rs/tokio/1.50.0/tokio/net/struct.UnixStream.html

So we should check the length of bytes read from read_line and if it is empty raise an error so that we can reset the connection.

Currently it will raise an error during deserialization at from_str but we don't necessarily want to reset the connection on those errors.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, thanks for pointing it out! This case is also included in the error handling logic - upone graceful shutdown will reset the connection to None - tested it by shuting down and then restarting reth, which now works.

@simonmichal
simonmichal force-pushed the issue-7336 branch 2 times, most recently from b444024 to 8e69030 Compare March 13, 2026 10:10
@simonmichal

Copy link
Copy Markdown
Author

Oh one more thing, can you add a CLI test for the IPC version of the --execution-endpoint? It will need new_with_no_execution_endpoint so you can override the flag like we do for this test:

fn always_prepare_payload_override() {
let dir = TempDir::new().expect("Unable to create temporary directory");
CommandLineTest::new_with_no_execution_endpoint()

@macladson : done, let me know if it looks OK?

@macladson macladson left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @simonmichal looks like the Cargo.lock file is stale, it should regenerate on its own if you run something like make lint. If you can get CI passing I'll give it another review

@simonmichal

simonmichal commented Mar 23, 2026

Copy link
Copy Markdown
Author

Hi @simonmichal looks like the Cargo.lock file is stale, it should regenerate on its own if you run something like make lint. If you can get CI passing I'll give it another review

@macladson Thanks for your reply and guidance - done!

@macladson macladson removed the waiting-on-author The reviewer has suggested changes and awaits thier implementation. label Mar 23, 2026
@mergify mergify Bot removed the ready-for-review The code is ready for review label Mar 30, 2026
@simonmichal

Copy link
Copy Markdown
Author

This pull request has merge conflicts. Could you please resolve them @simonmichal? 🙏

rebased on unstable

@simonmichal

Copy link
Copy Markdown
Author

@macladson : just a friendly ping.

@macladson macladson added ready-for-review The code is ready for review and removed waiting-on-author The reviewer has suggested changes and awaits thier implementation. labels Apr 13, 2026
@mergify

mergify Bot commented May 13, 2026

Copy link
Copy Markdown

This pull request has merge conflicts. Could you please resolve them @simonmichal? 🙏

@mergify mergify Bot added waiting-on-author The reviewer has suggested changes and awaits thier implementation. and removed ready-for-review The code is ready for review labels May 13, 2026
@simonmichal

Copy link
Copy Markdown
Author

This pull request has merge conflicts. Could you please resolve them @simonmichal? 🙏
Rebased on upstream.

@macladson , @michaelsproul please let me know if you have any change requests!

@mergify mergify Bot closed this Jun 17, 2026
@mergify

mergify Bot commented Jun 17, 2026

Copy link
Copy Markdown

Hi @simonmichal, this pull request has been closed automatically due to 30 days of inactivity. If you’d like to continue working on it, feel free to reopen at any time.

@mergify mergify Bot added the stale Stale PRs that have been inactive and is now outdated label Jun 17, 2026
@macladson macladson reopened this Jun 17, 2026
@macladson macladson removed the stale Stale PRs that have been inactive and is now outdated label Jun 17, 2026
@simonmichal

Copy link
Copy Markdown
Author

@macladson : I've just rebased on unstable, let me know if you have any comments!

@mergify mergify Bot closed this Jul 20, 2026
@mergify

mergify Bot commented Jul 20, 2026

Copy link
Copy Markdown

Hi @simonmichal, this pull request has been closed automatically due to 30 days of inactivity. If you’d like to continue working on it, feel free to reopen at any time.

@mergify mergify Bot added the stale Stale PRs that have been inactive and is now outdated label Jul 20, 2026
@macladson macladson reopened this Jul 20, 2026
@macladson macladson removed the stale Stale PRs that have been inactive and is now outdated label Jul 20, 2026

@ackintosh ackintosh left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working this! I left a couple of suggestions around the JWT handling for the IPC path.

Comment on lines 527 to 557
// Use the default jwt secret path if not provided via cli.
let secret_file = secret_file.unwrap_or_else(|| default_datadir.join(DEFAULT_JWT_FILE));

let jwt_key = if secret_file.exists() {
// Read secret from file if it already exists
std::fs::read_to_string(&secret_file)
.map_err(|e| format!("Failed to read JWT secret file. Error: {:?}", e))
.and_then(|ref s| {
let secret = JwtKey::from_slice(
&hex::decode(strip_prefix(s.trim_end()))
.map_err(|e| format!("Invalid hex string: {:?}", e))?,
)?;
Ok(secret)
})
.map_err(Error::InvalidJWTSecret)
} else {
// Create a new file and write a randomly generated secret to it if file does not exist
warn!(path = %secret_file.display(),"No JWT found on disk. Generating");
std::fs::File::options()
.write(true)
.create_new(true)
.open(&secret_file)
.map_err(|e| format!("Failed to open JWT secret file. Error: {:?}", e))
.and_then(|mut f| {
let secret = auth::JwtKey::random();
f.write_all(secret.hex_string().as_bytes())
.map_err(|e| format!("Failed to write to JWT secret file: {:?}", e))?;
Ok(secret)
})
.map_err(Error::InvalidJWTSecret)
}?;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These lines read (and create if missing) the JWT secret, but that's only needed for the http/https transport — IPC doesn't use JWT auth. The secret_file.unwrap_or_else(...) fallback also defeats the None we set for IPC in config.rs, so a JWT file still gets generated on disk even when using IPC.

I'd recommend moving this whole block into the http | https arm of the match.

Comment thread beacon_node/src/config.rs
Comment on lines 310 to 341
@@ -329,6 +333,9 @@ pub fn get_config<E: EthSpec>(
e
)
})?;
secret_file = Some(secret_file_buf);
} else if execution_endpoint.expose_full().scheme() == "ipc" {
secret_file = None;
} else {
return Err("Error! Please set either --execution-jwt file_path or --execution-jwt-secret-key directly via cli when using --execution-endpoint".to_string());
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that a user could supply an IPC endpoint via --execution-endpoint together with --execution-jwt / --execution-jwt-secret-key, it would be better to check the endpoint scheme first, to avoid the inconsistent state where the endpoint is IPC but secret_file is not None. Since IPC doesn't use JWT auth, we can also warn! when a JWT flag was supplied but has no effect:

if execution_endpoint.expose_full().scheme() == "ipc" {
    secret_file = None;

    // IPC transport doesn't use JWT authentication.
    if cli_args.get_one::<String>("execution-jwt").is_some()
        || cli_args.get_one::<String>("execution-jwt-secret-key").is_some()
    {
        warn!("--execution-jwt/--execution-jwt-secret-key is ignored when using an IPC execution endpoint");
    }
} else if let Some(secret_files) = cli_args.get_one::<String>("execution-jwt") {
    // set `secret_file` from --execution-jwt
    secret_file = Some(parse_only_one_value(...
} else if let Some(jwt_secret_key) = cli_args.get_one::<String>("execution-jwt-secret-key") {
    // generate the file from --execution-jwt-secret-key
    // ...
} else {
    return Err("Error! Please set either --execution-jwt ...".to_string());
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request waiting-on-author The reviewer has suggested changes and awaits thier implementation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants