Skip to content

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

Merged
kkovaacs merged 5 commits into
nextfrom
krisztian/allow-network-transactions
May 27, 2026
Merged

feat: gate RPC network tx submission behind internal auth header#2141
kkovaacs merged 5 commits into
nextfrom
krisztian/allow-network-transactions

Conversation

@kkovaacs
Copy link
Copy Markdown
Contributor

@kkovaacs kkovaacs commented May 26, 2026

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 option to miden-node full and miden-node sequencer:

RPC configuration:
      --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 option:

      --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 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
Comment on lines +21 to +28
/// Optional metadata header value for internal network-transaction RPC authentication.
#[arg(
long = "rpc.network-tx-auth-header-value",
env = "MIDEN_NODE_RPC_NETWORK_TX_AUTH_HEADER_VALUE",
value_name = "VALUE",
help_heading = super::section::RPC_CONFIGURATION_HELP_HEADING
)]
pub network_tx_auth_header_value: Option<String>,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The idea is that this would be a secret value that internal RPC nodes would be initialized with, but external RPC nodes wouldn't know - right?

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.

Correct yes

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.

Or in the simplest case, only the sequencer so long as one ensures that the ntx builder is connected to it and not a random internal full node

kkovaacs added 2 commits May 27, 2026 09:00
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 46dd83f to 452915a Compare May 27, 2026 07:06
@kkovaacs kkovaacs merged commit 3f721b3 into next May 27, 2026
44 of 46 checks passed
@kkovaacs kkovaacs deleted the krisztian/allow-network-transactions branch May 27, 2026 12:34
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

3 participants