Conversation
|
cc @bitwalker |
|
Could you add a description or link an issue where we can find information about what the goal of the PR is? It is hard to review the changes or judge alternatives without this information. |
|
@PhilippGackstatter @bobbinth This PR makes it possible for us to debug programs executed by the transaction kernel, which is a big improvement in DX. I'd like to try and get this released as part of the v0.22 release cycle/upcoming testnet - just let me know if you need anything on our end to make that go smoothly. |
|
@djolertrk Looks like a couple lint checks failed |
bobbinth
left a comment
There was a problem hiding this comment.
Thank you! Not a review yet - but a couple of high-level comments:
- It seems like this PR includes a lot of extraneous changes (e.g., from the AggLayer crate). Could we remove them? (these changes will land soon as a part of #2546)
- It would be great to provide a bit more detail about the goal here. After a brief look, my understanding is that we are trying to control how
FastProcessoris instantiated, but I don't yet have full understanding of how this will be used in the compiler. I'm mostly trying to understand if theTransactionProgramFactorypattern is really needed here or if we can do something simpler (e.g., maybe adding a generic type to theTransactionExecutorwould suffice).
Also, I wonder if there may be some overlap with #2293 (though, maybe not).
@bobbinth Thanks for the comments! Yes, it does overlap with the #2546 (the AggLayer changes for example), but I needed those so I can test the feature end to end. But yes, if the PR will land soon, I can just rebase on top of it -- so I am doing it. The immediate consumer here is the debugger, not the compiler. The goal is to let @PhilippGackstatter I've updated PR description as well. |
917ffe3 to
6a5bc19
Compare
|
note: Rebased on top of #2546. |
6a5bc19 to
27c1fea
Compare
|
note: now rebased on top of |
|
@djolertrk I think we've landed on our plan for how to proceed with this. If you can rebase on the latest changes in next, and make the switch to a single trait vs factory + executor traits, I believe this should be basically ready to merge. |
Yes. I agree. Let's do it that way (I was already on it -- doing some final testing). |
27c1fea to
d1e99cf
Compare
bobbinth
left a comment
There was a problem hiding this comment.
Looks good! Thank you. I left some comments inline.
|
@bobbinth Thank you for the comments! |
| .map_err(TransactionCheckerError::TransactionPreparation)?; | ||
|
|
||
| let processor = FastProcessor::new(stack_inputs).with_advice(advice_inputs); | ||
| let processor = EXEC::new(stack_inputs, advice_inputs, ExecutionOptions::default()); |
There was a problem hiding this comment.
Not related to this PR, but I wonder if the options should be configured somehow (i.e., we shouldn't be using just the default options). cc @PhilippGackstatter.
| let (mut host, stack_inputs, advice_inputs) = self.prepare_transaction(&tx_inputs).await?; | ||
|
|
||
| let processor = FastProcessor::new(stack_inputs).with_advice(advice_inputs); | ||
| let processor = EXEC::new(stack_inputs, advice_inputs, ExecutionOptions::default()); |
This PR adds a small hook to the transaction execution path so that the program runner used by
midentx::TransactionExecutorcan be swapped out while preserving the existing transaction preparation/execution pipeline.The motivation is debugger support and better developer tooling. We want to be able to debug programs executed under the transaction kernel, instead of only debugging standalone VM programs. In practice, this lets downstream tooling swap in a custom executor that:
while still reusing the existing
TransactionExecutorlogic for transaction preparation, host setup, note handling, foreign account loading, etc.The default behavior is unchanged:
TransactionExecutorstill usesFastProcessorby default.