Skip to content

Conversation

@benesjan
Copy link
Contributor

@benesjan benesjan commented Dec 23, 2025

Fixes F-231
Fixes #9789

In this PR I modify the the return value of our "get logs by tags" endpoints such that we don't need to perform another request for tx hash in PXE's log service. Since I was already modifying it I also dropped unused values from the type and made it a bit less messy.

I added here migration notes for all the changes I did to the endpoint not only in this PR but also in PRs down the stack.

@benesjan benesjan force-pushed the 12-18-feat_integrating_new_log_sync branch from 47bce0f to 6e01080 Compare December 23, 2025 21:42
@benesjan benesjan force-pushed the 12-23-feat_expanding_return_value_of_getlogsbytags branch from 371a484 to 1ecae46 Compare December 23, 2025 21:42
@benesjan benesjan changed the base branch from 12-18-feat_integrating_new_log_sync to graphite-base/19233 December 23, 2025 22:03
@benesjan benesjan force-pushed the 12-23-feat_expanding_return_value_of_getlogsbytags branch from 1ecae46 to ec04be9 Compare December 23, 2025 22:03
@benesjan benesjan changed the base branch from graphite-base/19233 to 12-18-feat_integrating_new_log_sync December 23, 2025 22:03
@benesjan benesjan added the ci-no-fail-fast Sets NO_FAIL_FAST in the CI so the run is not aborted on the first failure label Dec 23, 2025
@benesjan benesjan marked this pull request as ready for review December 23, 2025 22:08
@benesjan benesjan force-pushed the 12-18-feat_integrating_new_log_sync branch from 6a3088c to 7912feb Compare December 24, 2025 01:10
@benesjan benesjan force-pushed the 12-23-feat_expanding_return_value_of_getlogsbytags branch from ec04be9 to 6b89008 Compare December 24, 2025 01:10
@benesjan benesjan changed the title feat: expanding return value of getLogsByTags refactor!: expanding return value of getLogsByTags Dec 24, 2025
### [AVM] Gas cost multipliers for public execution to reach simulation/proving parity

Gas costs for several AVM opcodes have been adjusted with multipliers to better align public simulation costs with actual proving costs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just run formatting below.

* @param block - The L2 block to extract logs from.
* @returns An object containing the private and public tagged logs for the block.
*/
async #extractTaggedLogsFromBlock(block: L2BlockNew) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

blockHash was dropped from TxScopedL2Log which results in this no longer needing to be async.

txEffect.data.noteHashes,
txEffect.data.nullifiers[0],
scopedLog.noteHashes,
scopedLog.firstNullifier,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Cute, no? 🥰

@benesjan benesjan marked this pull request as draft December 24, 2025 01:21
});
});

describe('getPublicLogByTag', () => {
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 made the getPublicLogByTag function private in the log service and it got greatly simplified by this PR that I don't think we need these tests anymore.


// TODO(F-231): delete this function and implement this behavior in the node instead
public async getPublicLogByTag(tag: Tag, contractAddress: AztecAddress): Promise<PublicLogWithTxData | null> {
async #getPublicLogByTag(tag: Tag, contractAddress: AztecAddress): Promise<PublicLogWithTxData | null> {
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 function getPrivateLogByTag were not used out of the LogService so I made them private.

I think eventually we might want to drop these functions but kept them around for no due to the linked issue #11627 below.

} = {}): Promise<TxEffect> {
const count = (max: number, num?: number) => num ?? Math.min(maxEffects ?? randomInt(max), max);
// Every tx effect must have at least 1 nullifier (the first nullifier is used for log indexing)
const countNullifiers = (max: number, num?: number) => Math.max(1, count(max, num));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Needed to update this to make archiver tests pass. It's correct to have min be 1 here because all the tx always have at least 1 nullifier.

@benesjan benesjan marked this pull request as ready for review December 24, 2025 01:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-no-fail-fast Sets NO_FAIL_FAST in the CI so the run is not aborted on the first failure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants