Skip to content

Conversation

@benesjan
Copy link
Contributor

@benesjan benesjan commented Dec 19, 2025

Fixes #14555

New PR Description

As mentioned in the old PR description I originally planned to just type the arg of getLogsByTags but while addressing this PR's feedback I realized that I made a mistake: the getLogsByTags endpoint was used for both private and public logs and the issue is that for public logs we use "unsiloed" tag and for private logs we use siloed tag.

Having these 2 endpoints merged was just a tech debt: there is not a place where we would call this endpoint expecting only 1 type of logs. This led to us having ugly utilities that filtered out one kind of logs after retrieval.

We didn't split this before because we didn't want to introduce a breaking change to the API.

Given that I am already breaking backwards compatibility and given the error I made it made sense to fix this by splitting the two endpoints.

Now we have getPrivateLogsByTag and getPublicLogsByTagsFromContract endpoints.

Old PR Description

In this PR I used the SiloedTag type for the param in getLogsByTags. This allowed me to drop some ugly type conversions. This was just a tech debt.

The diff turned out to be quite large because I needed to move the type from pxe to stdlib.

As mentioned in a PR down the stack this is second of 3 PRs in which I clean up the getLogsByTags endpoint:

  1. First PR - including block timestamp in return value,
  2. This is the second PR - I type the tag arg of the function to be SiloedTag,
  3. in the last PR I will drop pagination from this endpoint.

@benesjan benesjan force-pushed the 12-19-refactor_typing_tag_arg_in_getlogsbytags branch 2 times, most recently from a36eb2f to 1a47f83 Compare December 19, 2025 18:47
@benesjan benesjan changed the title refactor: typing tag arg in getLogsByTags refactor!: typing tag arg in getLogsByTags Dec 19, 2025
@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 19, 2025
@benesjan benesjan marked this pull request as ready for review December 19, 2025 19:07
@benesjan benesjan changed the base branch from 12-19-feat_optimizing_aztecnode_getlogsbytags_for_new_log_sync_algo to graphite-base/19158 December 22, 2025 17:39
@benesjan benesjan force-pushed the 12-19-refactor_typing_tag_arg_in_getlogsbytags branch from 7f81d21 to e225434 Compare December 22, 2025 19:24
@benesjan benesjan force-pushed the graphite-base/19158 branch from 528b8ae to 19b00c9 Compare December 22, 2025 19:24
@benesjan benesjan changed the base branch from graphite-base/19158 to next December 22, 2025 19:24
@benesjan benesjan marked this pull request as draft December 22, 2025 19:32
@benesjan benesjan force-pushed the 12-19-refactor_typing_tag_arg_in_getlogsbytags branch from e225434 to 8b2772a Compare December 22, 2025 21:56
@benesjan benesjan changed the title refactor!: typing tag arg in getLogsByTags refactor!: separating getLogsByTags to private and public versions Dec 22, 2025
@benesjan benesjan changed the title refactor!: separating getLogsByTags to private and public versions refactor!: splitting getLogsByTags to private and public versions Dec 22, 2025
@benesjan benesjan force-pushed the 12-19-refactor_typing_tag_arg_in_getlogsbytags branch from 8b2772a to cd892e9 Compare December 22, 2025 22:13
@benesjan benesjan marked this pull request as ready for review December 22, 2025 22:24
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.

Approving because it's overall good and I won't be around to approve later, but we probably should also add migration notes, shouldn't we?

const txEffect = await TxEffect.random();
txEffect.privateLogs = mockPrivateLogs(blockNumber, txIndex);
txEffect.publicLogs = mockPublicLogs(blockNumber, txIndex);
txEffect.publicLogs = []; // No public logs needed for private log tests
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't we test some cases with public logs? Even when we know the implementation handles it well now, we probably want to spec that, especially consider the LogStore processes and reduces logs of both types at the same time

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is a new block of tests for getPublicLogsByTagsFromContract. Or do you think they are insufficient.

Copy link
Contributor

@spalladino spalladino left a comment

Choose a reason for hiding this comment

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

Archiver changes look good to me, and agree with @mverzilli on extracting some helpers to make it easier to follow. I also agree with him in that you are a really nice person.

@benesjan benesjan marked this pull request as draft December 23, 2025 14:08
@benesjan benesjan force-pushed the 12-19-refactor_typing_tag_arg_in_getlogsbytags branch from 6da68b6 to 0d69348 Compare December 23, 2025 15:03
@benesjan benesjan marked this pull request as ready for review December 23, 2025 15:19
@benesjan
Copy link
Contributor Author

we probably should also add migration notes

Indeed, I have some more changes to this endpoint in the pipeline and I plan on writing them once I am done with those. But thanks for reminding me

@benesjan benesjan added ci-squash-and-merge and removed ci-no-fail-fast Sets NO_FAIL_FAST in the CI so the run is not aborted on the first failure labels Dec 23, 2025
@benesjan benesjan force-pushed the 12-19-refactor_typing_tag_arg_in_getlogsbytags branch 2 times, most recently from 859acfe to f88fa5c Compare December 23, 2025 16:55
@benesjan benesjan enabled auto-merge December 23, 2025 17:13
Fixes #14555

## New PR Description

As mentioned in the old PR description I originally planned to just type the arg of `getLogsByTags` but while addressing this PR's feedback I realized that I made a mistake: the `getLogsByTags` endpoint was used for both private and public logs and the issue is that for public logs we use "unsiloed" tag and for private logs we use siloed tag.

Having these 2 endpoints merged was just a tech debt: there is not a place where we would call this endpoint expecting only 1 type of logs. This led to us having ugly utilities that filtered out one kind of logs after retrieval.

We didn't split this before because we didn't want to introduce a breaking change to the API.

Given that I am already breaking backwards compatibility and given the error I made it made sense to fix this by splitting the two endpoints.

Now we have `getPrivateLogsByTag` and `getPublicLogsByTagsFromContract` endpoints.

## Old PR Description
In this PR I used the `SiloedTag` type for the param in `getLogsByTags`. This allowed me to drop some ugly type conversions. This was just a tech debt.

The diff turned out to be quite large because I needed to move the type from `pxe` to `stdlib`.

As mentioned in a PR down the stack this is second of 3 PRs in which I clean up the `getLogsByTags` endpoint:
1. First PR - including block timestamp in return value,
2. This is the second PR - I type the tag arg of the function to be `SiloedTag`,
3. in the last PR I will drop pagination from this endpoint.

Co-authored-by: Jan Beneš <janbenes1234@gmail.com>
@AztecBot AztecBot force-pushed the 12-19-refactor_typing_tag_arg_in_getlogsbytags branch from f88fa5c to e8de31f Compare December 23, 2025 17:15
@benesjan benesjan added this pull request to the merge queue Dec 23, 2025
Merged via the queue into next with commit 318e3f3 Dec 23, 2025
18 checks passed
@benesjan benesjan deleted the 12-19-refactor_typing_tag_arg_in_getlogsbytags branch December 23, 2025 17:49
github-actions bot pushed a commit that referenced this pull request Dec 23, 2025
…19158)

Fixes #14555

## New PR Description

As mentioned in the old PR description I originally planned to just type
the arg of `getLogsByTags` but while addressing this PR's feedback I
realized that I made a mistake: the `getLogsByTags` endpoint was used
for both private and public logs and the issue is that for public logs
we use "unsiloed" tag and for private logs we use siloed tag.

Having these 2 endpoints merged was just a tech debt: there is not a
place where we would call this endpoint expecting only 1 type of logs.
This led to us having ugly utilities that filtered out one kind of logs
after retrieval.

We didn't split this before because we didn't want to introduce a
breaking change to the API.

Given that I am already breaking backwards compatibility and given the
error I made it made sense to fix this by splitting the two endpoints.

Now we have `getPrivateLogsByTag` and `getPublicLogsByTagsFromContract`
endpoints.

## Old PR Description
In this PR I used the `SiloedTag` type for the param in `getLogsByTags`.
This allowed me to drop some ugly type conversions. This was just a tech
debt.

The diff turned out to be quite large because I needed to move the type
from `pxe` to `stdlib`.

As mentioned in a PR down the stack this is second of 3 PRs in which I
clean up the `getLogsByTags` endpoint:
1. First PR - including block timestamp in return value,
2. This is the second PR - I type the tag arg of the function to be
`SiloedTag`,
3. in the last PR I will drop pagination from this endpoint.
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.

Split AztecNode::getLogsByTags to private and public versions

5 participants