Skip to content

Commit

Permalink
fix: Track class registered count in tx stats (#5417)
Browse files Browse the repository at this point in the history
We were incorrectly deserializing log elements from txs, so the class
registered count was always zero. Thanks @alexghr for reporting.
  • Loading branch information
spalladino authored Mar 25, 2024
1 parent 9e05e9c commit ff8eafc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion yarn-project/circuit-types/src/tx/tx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
import { arrayNonEmptyLength } from '@aztec/foundation/collection';
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';

import { UnencryptedL2Log } from '../index.js';
import { GetUnencryptedLogsResponse } from '../logs/get_unencrypted_logs_response.js';
import { L2LogsSource } from '../logs/l2_logs_source.js';
import { TxL2Logs } from '../logs/tx_l2_logs.js';
Expand Down Expand Up @@ -166,7 +167,8 @@ export class Tx {
size: this.toBuffer().length,
classRegisteredCount: this.unencryptedLogs
.unrollLogs()
.filter(log => ContractClassRegisteredEvent.isContractClassRegisteredEvent(log)).length,
.map(log => UnencryptedL2Log.fromBuffer(log))
.filter(log => ContractClassRegisteredEvent.isContractClassRegisteredEvent(log.data)).length,
};
}

Expand Down

0 comments on commit ff8eafc

Please sign in to comment.