Skip to content

Conversation

@tvinagre
Copy link
Contributor

No description provided.

@tvinagre tvinagre changed the title feat: Adapt UniV4 Substreams to emmit storage changes feat: UniswapV4 Hooks support Aug 21, 2025
@tvinagre tvinagre force-pushed the tl/hooks/ENG-4582/adapt-univ4-substream-for-dci branch from a1fa8ce to e4a1f00 Compare September 11, 2025 18:10
@louise-poole louise-poole force-pushed the tl/hooks/ENG-4582/adapt-univ4-substream-for-dci branch from 4668fff to f3970a4 Compare October 27, 2025 08:33
@louise-poole louise-poole force-pushed the tl/hooks/ENG-4582/adapt-univ4-substream-for-dci branch from 9f4ea02 to e3f1624 Compare October 28, 2025 08:27
and skip checking for changes in non-substream submodules
@louise-poole louise-poole force-pushed the tl/hooks/ENG-4582/adapt-univ4-substream-for-dci branch from 9ad7e0b to a88bcc2 Compare October 28, 2025 09:02
use tycho_substreams::{block_storage::get_block_storage_changes, prelude::*};

#[substreams::handlers::map]
pub fn map_dci_protocol_changes(
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not a big fan of this. I think we should not share the same map_protocol_changes instead. We can have a function that is used by both but the map itself should be adapted directly imo.

The main reason is because this adds an additional sequential map, so it most likely comes with perf overhead.

Copy link
Contributor Author

@tvinagre tvinagre Oct 28, 2025

Choose a reason for hiding this comment

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

I'm fine with it - I don't think this adds much performance overhead, do u? It's on a separate module so it will be paralellized

Otherwise I'd prefer to modify map_protocol_changes to take a flag and conditionally add storage_changes instead of having two map_protocol_changes

Copy link
Collaborator

Choose a reason for hiding this comment

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

It's hard to quantify the perf overhead here, for historical state it'll be handled in parallel probably but not for real time data. Not sure how this works on the Substreams side and if it's fine to add maps or not.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think I'll instead make a helper fn that collects the non-block storage changes to reduce repeated code. Then use it in separate map_protocol_changes.

use tycho_substreams::{block_storage::get_block_storage_changes, prelude::*};

#[substreams::handlers::map]
pub fn map_dci_protocol_changes(
Copy link
Contributor Author

@tvinagre tvinagre Oct 28, 2025

Choose a reason for hiding this comment

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

I'm fine with it - I don't think this adds much performance overhead, do u? It's on a separate module so it will be paralellized

Otherwise I'd prefer to modify map_protocol_changes to take a flag and conditionally add storage_changes instead of having two map_protocol_changes

This allows us to centralise repeated code between the hooks and no hooks implementations.
@louise-poole louise-poole force-pushed the tl/hooks/ENG-4582/adapt-univ4-substream-for-dci branch from a1c5d24 to bf702b0 Compare October 29, 2025 10:46
@louise-poole louise-poole merged commit 682c960 into main Oct 30, 2025
6 checks passed
@louise-poole louise-poole deleted the tl/hooks/ENG-4582/adapt-univ4-substream-for-dci branch October 30, 2025 09:05
zach030 pushed a commit that referenced this pull request Nov 14, 2025
* feat: Adapt UniV4 Substreams to emmit storage changes

* feat: Split UniswapV4 into hooks and no-hooks

* feat: Add yaml config file for UniV4 with no Hooks

* feat: Identify Euler pools on initialization, pause Uninstalled pools

* fix: Bump Substreams version

* refactor: rust fmt

* refactor: optimize store, remove unused params and code

* refactor: improve `store_pool_per_euler_hook`

This commit reduces the `store_pool_per_euler_hook` store size to the minimum required. We only use it for euler pools and only store one pool per hook.

* refactor: cargo fmt

* refactor: update `euler_pools_per_hook_store` lookup

* fix: Attach pausing attribute to the correct transaction

* fix: Attach pausing attribute to the correct transaction

* chore: cargo fmt

* feat: bump version to 0.5.0 to use new Tycho-substreams interface with previous slot value

* chore: use crate.io for `tycho-substreams` dependency

* fix: update tycho-substreams version

This new version has a bugfix for block storage extraction.

* fix: update tycho-substreams version to include native balances

* feat: remove full `block_storage_changes` from core usv4

* refactor: apply clippy suggestions

* ci: include all workspace packages on workspace change

and skip checking for changes in non-substream submodules

* feat: create usv4 helper fn to collect block changes

This allows us to centralise repeated code between the hooks and no hooks implementations.

---------

Co-authored-by: zizou <[email protected]>
Co-authored-by: Louise Poole <[email protected]>
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.

4 participants