File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -849,8 +849,7 @@ export class PXE {
849849 // storing the tags here prevents linkage of txs sent from the same PXE.
850850 const taggingIndexRangesUsedInTheTx = privateExecutionResult . entrypoint . taggingIndexRanges ;
851851 if ( taggingIndexRangesUsedInTheTx . length > 0 ) {
852- // TODO(benesjan): The following is an expensive operation. Figure out a way to avoid it.
853- const txHash = ( await txProvingResult . toTx ( ) ) . txHash ;
852+ const txHash = await txProvingResult . getTxHash ( ) ;
854853
855854 await this . senderTaggingStore . storePendingIndexes ( taggingIndexRangesUsedInTheTx , txHash , jobId ) ;
856855 this . log . debug ( `Stored used tagging index ranges as sender for the tx` , {
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import {
1313} from './private_execution_result.js' ;
1414import { type ProvingStats , ProvingTimingsSchema } from './profiling.js' ;
1515import { Tx } from './tx.js' ;
16+ import type { TxHash } from './tx_hash.js' ;
1617
1718export class TxProvingResult {
1819 constructor (
@@ -22,6 +23,11 @@ export class TxProvingResult {
2223 public stats ?: ProvingStats ,
2324 ) { }
2425
26+ getTxHash ( ) : Promise < TxHash > {
27+ // Equivalent to `(await this.toTx()).txHash` but skips walking the execution result tree to collect logs.
28+ return Tx . computeTxHash ( { data : this . publicInputs } ) ;
29+ }
30+
2531 async toTx ( ) : Promise < Tx > {
2632 const contractClassLogs = collectSortedContractClassLogs ( this . privateExecutionResult ) ;
2733
You can’t perform that action at this time.
0 commit comments