Skip to content

feat: Update SubmitProvenTransaction RPC with tx replay data#1278

Merged
sergerad merged 10 commits intonextfrom
sergerad-guardrails
Oct 23, 2025
Merged

feat: Update SubmitProvenTransaction RPC with tx replay data#1278
sergerad merged 10 commits intonextfrom
sergerad-guardrails

Conversation

@sergerad
Copy link
Collaborator

@sergerad sergerad commented Oct 8, 2025

Context

As part of the guardrails we are adding to the overall network, we want to be able to perform re-execution of proven transactions when they are submitted to the RPC via the SubmitProvenTransaction endpoint.

Relates to #613.

Changes

  • Update SubmitProvenTransaction endpoint to take an optional binary encoded TransactionInputs.
  • Update the RPC server's submit_proven_transaction() function to perform re-execution of transactions when the optional TransactionInputs is provided.
  • Update ntx builder to submit proven transactions via RPC rather than block producer to allow for validation.

@sergerad sergerad marked this pull request as draft October 8, 2025 02:41
@bobbinth
Copy link
Contributor

bobbinth commented Oct 8, 2025

Before we start the implementation, would be good to describe the overall architecture. For example, it is not clear to me yet at which point it is best to do the verification and whether it will be done inside our current components or delegated to some new component. At the high level, I can see 3 separate approaches to this:

  1. Everything happens in the RPC component. That is, the RPC component decodes the reply data, re-executes the transaction, stores the reply data somewhere (e.g., a separate database or my in our existing store), and from the point on, everything else works as it does now.
  2. The replay data travels through our existing "pipeline" - i.e., the RPC component re-executes the transaction, but then passes the data to the block producer, which includes it with the block that gets submitted to the store.
  3. There is a new component that the RPC sends the transaction to. This component re-executes the transaction, signs it, and send the signed transaction back to the RPC. The RPC then send the transaction with the signatures to the block producer.

We should think through pros/cons of the above as they will result in different implementation complexity but also will allows to provide different "features".

@sergerad sergerad force-pushed the sergerad-guardrails branch 3 times, most recently from 994b008 to 73dd58b Compare October 12, 2025 23:39
@sergerad sergerad force-pushed the sergerad-guardrails branch 5 times, most recently from 13a16da to ae097a6 Compare October 14, 2025 01:55
);
},
}
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@bobbinth

  1. Do we want this to be blocking as it is now?
  2. Do we want this to return an error if it fails? Or just log like it does now?

Copy link
Contributor

Choose a reason for hiding this comment

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

Since this is opt in for debugging only, we probably want to create bounded queue but do the re-execution async. This implies it's not going to block by default, but will eventually if we're under high load, mostly to avoid OOM as it would occur in the unbounded channel scenario. This would hint at 2. being logging only.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This re-execution logic will move to the validator component and this RPC stack will talk to that via gRPC.

Having said that, I think the bounded queue and async processing logic would be the same for this PR and the followup work. Its just a question of what we want to put into this PR for now.

@sergerad
Copy link
Collaborator Author

I will need 0xMiden/miden-client#1382 to be completed before I can update client and integration tests to validate the changes in this PR.

But in the meantime I will prepare this for merge because the new codepath cannot be triggered without the client changes anyway.

@sergerad sergerad force-pushed the sergerad-guardrails branch from 4695a14 to b464f9d Compare October 19, 2025 18:59
@sergerad sergerad marked this pull request as ready for review October 19, 2025 19:00
@sergerad sergerad requested review from bobbinth and drahnr October 19, 2025 19:00
@sergerad
Copy link
Collaborator Author

I have run integration tests to validate the new codepath and it seems innocuous 👍

Copy link
Contributor

@bobbinth bobbinth 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! Thank you! I left some comments inline - but most of them are for the future.

@sergerad sergerad force-pushed the sergerad-guardrails branch from 64b3e2e to 3ca4707 Compare October 23, 2025 21:47
@sergerad sergerad merged commit 0078236 into next Oct 23, 2025
6 checks passed
@sergerad sergerad deleted the sergerad-guardrails branch October 23, 2025 22:18
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.

3 participants