Skip to content

feat: Pre-authenticated transaction submission#2262

Open
sergerad wants to merge 18 commits into
nextfrom
sergerad-trusted-auth
Open

feat: Pre-authenticated transaction submission#2262
sergerad wants to merge 18 commits into
nextfrom
sergerad-trusted-auth

Conversation

@sergerad

Copy link
Copy Markdown
Collaborator

Summary

Closes #2242.

Changelog

[[entry]]
scope       = "node"
impact      = "added"
description = "Added trusted transaction submission from full node to sequencer"

@sergerad sergerad changed the title Sergerad trusted auth feat: Trusted transaction submission Jun 17, 2026
@sergerad sergerad marked this pull request as ready for review June 17, 2026 02:41

@kkovaacs kkovaacs left a comment

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.

Looks good to me, thanks!

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

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.

I'm not sure we should be emphasizing trust everywhere. This is just another internal service. We could envisage extending this with mempool stats or introspection etc in the future so I would not hyperfixate on submission/trust.

Its already an internal proto service. The docs should be mainly in the CLI/markdown files.

Comment thread proto/proto/internal/trusted.proto Outdated
Comment thread proto/proto/internal/trusted.proto Outdated
Comment thread proto/proto/internal/pre_authenticated.proto
Comment thread bin/node/src/commands/modes.rs Outdated
Comment thread crates/block-producer/src/server/mod.rs Outdated
Comment thread crates/block-producer/src/server/mod.rs Outdated
Comment thread crates/rpc/src/server/api/submit_proven_tx.rs Outdated
Comment thread crates/rpc/src/server/api.rs Outdated
Comment thread crates/rpc/src/server/pre_authenticated.rs Outdated
sergerad and others added 6 commits June 19, 2026 10:20
Co-authored-by: Mirko <48352201+Mirko-von-Leipzig@users.noreply.github.com>
Co-authored-by: Mirko <48352201+Mirko-von-Leipzig@users.noreply.github.com>
Co-authored-by: Mirko <48352201+Mirko-von-Leipzig@users.noreply.github.com>
@sergerad sergerad changed the title feat: Trusted transaction submission feat: Pre-authenticated transaction submission Jun 19, 2026
/// forwards the authenticated result to the sequencer's pre-authenticated submission API, rather
/// than forwarding the raw transaction upstream. Both must be provided together.
#[derive(clap::Args, Clone, Debug)]
pub struct PreAuthenticatedNodeOptions {

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@Mirko-von-Leipzig I renamed trusted->pre-authenticated. You might still prefer to call this SequencerOptions etc instead?

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.

I think so, especially if we add other options down the line.


// The chain height at which authentication took place.
fixed32 authentication_height = 4;
}

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@Mirko-von-Leipzig we could just do single field of bytes (AuthenticatedTransaction::to_bytes) instead of these fields.

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.

At the moment it doesn't much matter; but it depends where we land with #1882.

I would keep this as is.


// The chain height at which authentication took place.
fixed32 authentication_height = 4;
}

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.

At the moment it doesn't much matter; but it depends where we land with #1882.

I would keep this as is.

// sequencer trusts that the caller has already performed basic checks, proof verification,
// validator re-execution and authentication. It must therefore never be exposed publicly.
syntax = "proto3";
package pre_authenticated;

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.

I would still prefer we call this sequencer. This contains the sequencer's internal gRPC services.

If anything, you could change service Api to service Preauthenticated, but I also wouldn't do that.

There are other future methods we may want or need to add here, so forcing this name just because it happens to be the current two methods isn't a good idea imo. We already have the method names to indicate this.

Comment on lines +228 to +232
/// Submits each transaction in the batch to the validator for re-execution.
///
/// The caller must ensure `transaction_inputs` matches the batch's transactions in length and
/// order.
async fn submit_batch_to_validator(

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.

I feel like this could be a method on ValidatorClient instead of free floating.

/// forwards the authenticated result to the sequencer's pre-authenticated submission API, rather
/// than forwarding the raw transaction upstream. Both must be provided together.
#[derive(clap::Args, Clone, Debug)]
pub struct PreAuthenticatedNodeOptions {

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.

I think so, especially if we add other options down the line.

Comment on lines +31 to +37
if batch.transactions().len() != inputs.len() {
return Err(Status::invalid_argument(format!(
"Number of inputs {} does not match number of transactions {} in batch",
inputs.len(),
batch.transactions().len()
)));
}

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.

Nit: this is a cheap check and should go above the auth_inputs decoding.

Comment on lines +377 to +381
debug_assert_eq!(
batch.transactions().len(),
inputs.len(),
"transaction inputs must match the batch's transactions"
);

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.

This should probably be a hard assert?

/// When unset the pre-authenticated submission service is not exposed. This interface accepts
/// already-authenticated transactions from full nodes *without* re-verification.
#[arg(
long = "pre-authenticated.listen",

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.

I would either call this sequencer.listen or if we want to emphasize that this is an internal api sequencer.internal.listen or internal.listen.

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.

Perform transaction authentication in trusted full nodes

3 participants