Skip to content

feat(rpc): forward tx and batches submissions in full node mode#2139

Merged
Mirko-von-Leipzig merged 6 commits into
nextfrom
mirko/forward-submissions
May 27, 2026
Merged

feat(rpc): forward tx and batches submissions in full node mode#2139
Mirko-von-Leipzig merged 6 commits into
nextfrom
mirko/forward-submissions

Conversation

@Mirko-von-Leipzig
Copy link
Copy Markdown
Collaborator

@Mirko-von-Leipzig Mirko-von-Leipzig commented May 26, 2026

This PR differentiates transaction and batch submissions in the RPC layer by the node's mode.

In sequencer mode, it processes as per normal and forwards to the block producer. In full-node mode, it no longer pushes to the validator and instead delegates that to the upstream sync url.

This allows external full node's to still handle submissions because they won't have access to the validator. In the future we will expand the full node to differentiate between internal (trusted) and external (untrusted) nodes but for now we only implement the untrusted variant (no validator).

This PR prepares us for removing the store and block-producer gRPC services by making the boundaries more clear.

Stacks on #2138.

Closes #2089

@Mirko-von-Leipzig Mirko-von-Leipzig added no changelog This PR does not require an entry in the `CHANGELOG.md` file rpc Related to the RPC component labels May 26, 2026
Copy link
Copy Markdown
Collaborator

@SantiagoPittella SantiagoPittella left a comment

Choose a reason for hiding this comment

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

Looks good, should the RpcMode be added to the status response?

Comment on lines +561 to +570
// In full node mode we forward the request to the source.
let (block_producer, validator) = match &self.mode {
RpcMode::Sequencer { block_producer, validator } => {
(block_producer.as_ref(), validator.as_ref())
},
RpcMode::FullNode { source_rpc } => {
return source_rpc.as_ref().clone().submit_proven_tx_batch(request).await;
},
};

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 guess it is ok, but in this method we are going to validate the proof twice

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.

Verification is (relatively) cheap.

In the future we can optimise this by having an internal trusted service which allows skipping these.

Copy link
Copy Markdown
Contributor

@kkovaacs kkovaacs left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@Mirko-von-Leipzig
Copy link
Copy Markdown
Collaborator Author

Looks good, should the RpcMode be added to the status response?

tbh I'm unsure what this should look like going forward. In the official networks we would hit a random full node, and never the sequencer.. so we may need to rethink what these are for.

@Mirko-von-Leipzig Mirko-von-Leipzig force-pushed the mirko/yank-mempool-subscription branch from 5c8de13 to e02d619 Compare May 27, 2026 08:23
@Mirko-von-Leipzig Mirko-von-Leipzig force-pushed the mirko/forward-submissions branch from 02a38b9 to eef31f9 Compare May 27, 2026 08:23
Base automatically changed from mirko/yank-mempool-subscription to next May 27, 2026 08:28
@Mirko-von-Leipzig Mirko-von-Leipzig enabled auto-merge (squash) May 27, 2026 08:29
@Mirko-von-Leipzig Mirko-von-Leipzig merged commit 97f6ef9 into next May 27, 2026
20 checks passed
@Mirko-von-Leipzig Mirko-von-Leipzig deleted the mirko/forward-submissions branch May 27, 2026 08:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no changelog This PR does not require an entry in the `CHANGELOG.md` file rpc Related to the RPC component

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replica should forward write requests to stream source

3 participants