-
Notifications
You must be signed in to change notification settings - Fork 575
refactor!: expanding return value of getLogsByTags #19233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 12-18-feat_integrating_new_log_sync
Are you sure you want to change the base?
refactor!: expanding return value of getLogsByTags #19233
Conversation
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
47bce0f to
6e01080
Compare
371a484 to
1ecae46
Compare
1ecae46 to
ec04be9
Compare
6a3088c to
7912feb
Compare
ec04be9 to
6b89008
Compare
| ### [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. | ||
|
|
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cute, no? 🥰
| }); | ||
| }); | ||
|
|
||
| describe('getPublicLogByTag', () => { |
There was a problem hiding this comment.
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> { |
There was a problem hiding this comment.
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)); |
There was a problem hiding this comment.
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.

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.