Skip to content

Comments

fix(txe): committing after txs#20714

Merged
benesjan merged 2 commits intomerge-train/fairiesfrom
02-20-fix_txe_committing_after_txs
Feb 23, 2026
Merged

fix(txe): committing after txs#20714
benesjan merged 2 commits intomerge-train/fairiesfrom
02-20-fix_txe_committing_after_txs

Conversation

@benesjan
Copy link
Contributor

@benesjan benesjan commented Feb 20, 2026

Job handling in TXE was broken and it has been working until now because everything we have been querying was obtainable within one job. This is not the case with private events because those are obtainable only after being committed.

I described here TXE is in a need of a large refactor but Nico said on slack that we are not yet confident enough in the current design for it to be worth it to invest time in it. For this reason I have created this ugly PR that makes it all work but results in the abstractions being thoroughly broken. I think it's an ok interim solution.

The main problems fixed here:

  1. We didn't commit jobs after a call has been performed,
  2. we didn't sync contract private state before txeGetPrivateEvents get executed,
  3. the jobId in TXEOracleTopLevelContext was set to just the initial jobId and was not correctly updated.

Issue 3. was handled by me passing the jobId down to individual functions that needed it.

Copy link
Contributor Author

benesjan commented Feb 20, 2026

This stack of pull requests is managed by Graphite. Learn more about stacking.

): Promise<Fr[]>;
// TODO(F-335): Drop this from here as it's not a real oracle handler - it's only called from
// RPCTranslator::txeGetPrivateEvents and never from Noir.
syncContractNonOracleMethod(contractAddress: AztecAddress, scope: AztecAddress, jobId: string): Promise<void>;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I needed this to be able to trigger contract sync from txeGetPrivateEvents in RPCTranslator. It was not possible to do it from txeGetPrivateEvents in TXEOracleTopLevelContext because there we don't have access to the stateMachine and hence it's impossible to commit there after the sync is done.


async syncContractNonOracleMethod(contractAddress: AztecAddress, scope: AztecAddress, jobId: string) {
if (contractAddress.equals(DEFAULT_ADDRESS)) {
this.logger.debug(`Skipping sync in txeGetPrivateEvents because the events correspond to the default address.`);
Copy link
Contributor

Choose a reason for hiding this comment

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

why is this exception needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is because these tests work in top level context and have there address set to DEFAULT_ADDRESS. DEFAULT_ADDRESS is some kind of fake address and is set to the number of 42.

This is pretty messy but a lot of TXE is pretty messy so would not bother with this now (and until we are sure that the current TXE model makes sense).

Copy link
Contributor

@mverzilli mverzilli left a comment

Choose a reason for hiding this comment

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

Thanks for the fix!

@benesjan benesjan merged commit a711149 into merge-train/fairies Feb 23, 2026
23 of 28 checks passed
@benesjan benesjan deleted the 02-20-fix_txe_committing_after_txs branch February 23, 2026 10:19
github-merge-queue bot pushed a commit that referenced this pull request Feb 23, 2026
BEGIN_COMMIT_OVERRIDE
refactor: aztec new and init creating 2 crates (#20681)
fix: hodgepodge of small things (#20720)
test: aztec new scaffold works (#20711)
feat: add `aztec profile` command with gate count profiling (#20695)
fix(txe): committing after txs (#20714)
feat: add aztec profile flamegraph command (#20741)
feat: printing out public contract function debug logs in a tx (#20749)
END_COMMIT_OVERRIDE
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.

2 participants