Skip to content

feat: gate RPC network tx submission behind internal auth header#2141

Open
kkovaacs wants to merge 6 commits into
nextfrom
krisztian/allow-network-transactions
Open

feat: gate RPC network tx submission behind internal auth header#2141
kkovaacs wants to merge 6 commits into
nextfrom
krisztian/allow-network-transactions

Conversation

@kkovaacs
Copy link
Copy Markdown
Contributor

Adds optional internal auth-header support to the shared gRPC client builder, enforces that header in RPC for network-account deployment submissions, and wires ntx-builder to send it when configured. The default name of the header is x-miden-network-tx-auth.

Covers single-tx and batch submission paths, validates operator-supplied auth config cleanly at startup, and adds the future node CLI surface for RPC network-tx auth settings.

Adds the following CLI options to miden-node full and miden-node sequencer:

RPC configuration:
      --rpc.network-tx-auth-header-name <NAME>
          Optional metadata header name for internal network-transaction RPC authentication.

          This only has an effect when `rpc.network-tx-auth-header-value` is also set.

          [env: MIDEN_NODE_RPC_NETWORK_TX_AUTH_HEADER_NAME=]
          [default: x-miden-network-tx-auth]

      --rpc.network-tx-auth-header-value <VALUE>
          Optional metadata header value for internal network-transaction RPC authentication

          [env: MIDEN_NODE_RPC_NETWORK_TX_AUTH_HEADER_VALUE=]

And miden-ntx-builder gets added the following new CLI options:

      --rpc.auth-header-name <NAME>
          Optional metadata header name for authenticating internal RPC requests

          [env: MIDEN_NODE_NTX_BUILDER_RPC_AUTH_HEADER_NAME=]
          [default: x-miden-network-tx-auth]

      --rpc.auth-header-value <VALUE>
          Optional metadata header value for authenticating internal RPC requests

          [env: MIDEN_NODE_NTX_BUILDER_RPC_AUTH_HEADER_VALUE=]

Closes #2131

@kkovaacs kkovaacs marked this pull request as ready for review May 26, 2026 12:41
Comment thread bin/node/src/commands/rpc.rs Outdated
kkovaacs added 4 commits May 26, 2026 16:12
Adds optional internal auth-header support to the shared gRPC client
builder, enforces that header in RPC for network-account deployment
submissions, and wires `ntx-builder` to send it when configured.

Covers single-tx and batch submission paths, validates operator-supplied
auth config cleanly at startup, and adds the future node CLI surface for
RPC network-tx auth settings.
@kkovaacs kkovaacs force-pushed the krisztian/allow-network-transactions branch from 58f2f59 to 1257284 Compare May 26, 2026 14:18
Copy link
Copy Markdown
Collaborator

@Mirko-von-Leipzig Mirko-von-Leipzig left a comment

Choose a reason for hiding this comment

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

LGTM modulo removing the header name config

Comment thread bin/ntx-builder/src/clients/rpc.rs Outdated
AsciiMetadataValue::from_str(value)
.with_context(|| format!("invalid RPC auth header value for `{name}`"))?;
fn validate_auth_header_value(value: &str) -> anyhow::Result<()> {
AsciiMetadataValue::from_str(value).with_context(|| {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

You may be able to embed this directly into the clap type since it impls from_str

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done in 46dd83f

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.

Support network transaction submission in RPC

2 participants