Skip to content

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

Open
Mirko-von-Leipzig wants to merge 2 commits into
mirko/yank-mempool-subscriptionfrom
mirko/forward-submissions
Open

feat(rpc): forward tx and batches submissions in full node mode#2139
Mirko-von-Leipzig wants to merge 2 commits into
mirko/yank-mempool-subscriptionfrom
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.

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.

3 participants