Skip to content

Conversation

@dobertRowneySr
Copy link
Collaborator

Scope

Integrates Renzo protocol using proposed adapter and substream.

Notes

  • Every component has been modelled as a pair (COLLATERAL_TOKEN, ezETH). In case the COLLATERAL_TOKEN == ETH we have used the restake manager renzo contract asset as the integration tests where failing when using component_id = "0x0000000000000000000000000000000000000000"

@zizou0x zizou0x force-pushed the fix/renzo-relative-balances branch from d046c4e to da4d6ef Compare February 13, 2025 14:21
@zizou0x zizou0x changed the title SDK integration Renzo protocol Renzo integration Feb 13, 2025
@@ -0,0 +1,11 @@
# substreams auth file
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't understand why you added this because these things are already ignored by the root .gitignore

But for sure we don't want to have a module scoped gitignore

continue
states[pool_id]["state"] = state

print("🚨 states", states)
Copy link
Collaborator

Choose a reason for hiding this comment

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

SDK improvements are welcomed but this is out of scope for this branch.

If you want to improve SDK related logic, please do this in another branch

@@ -0,0 +1,35 @@
# ethereum_renzo Substreams modules
Copy link
Collaborator

Choose a reason for hiding this comment

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

This whole readme looks not accurate with what we actually have

@@ -0,0 +1,40 @@
#![allow(clippy::all)]
Copy link
Collaborator

Choose a reason for hiding this comment

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

We have a generic build.rs file that should work for any packages (you can for example find it in balancer_v2).

We're trying to stick with this one as much as possible to avoid having too much protocol specific logic. Please try it there and see if it works as expected

@@ -0,0 +1,566 @@
syntax = "proto3";
Copy link
Collaborator

Choose a reason for hiding this comment

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

What is this file?

)
.with_contracts(&[RESTAKE_MANAGER_ADDRESS.as_slice()])
.with_tokens(&[ETH_ADDRESS.as_slice(), EZETH_ADDRESS.as_slice()])
.as_swap_type("restake_manager", ImplementationType::Vm),
Copy link
Collaborator

Choose a reason for hiding this comment

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

We want to know the protocol it belongs to in the ProtocolType.name, you can check others modules to see how we do it. Maybe "renzo_collateral"

.filter_map(|(log, _)| {
if log.address != RESTAKE_MANAGER_ADDRESS {
None
} else if let Some(ev) = restake_manager_contract::events::CollateralTokenAdded::match_and_decode(log) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

One question, can a collateral be removed?

Comment on lines +43 to +46
ProtocolComponent::new(
// according to the general logic used in other components this should be ETH_ADDRESS,
// however using RESTAKE_MANAGER_ADDRESS to make integration tests pass
&format!("0x{}", hex::encode(RESTAKE_MANAGER_ADDRESS))
Copy link
Collaborator

Choose a reason for hiding this comment

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

The name should be unique, I'm opened for suggestions but it could be "renzo-eth"?

Comment on lines +262 to +266
Attribute {
name: "update_marker".to_string(),
value: vec![1u8],
change: ChangeType::Creation.into(),
},
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 you miss understood the usage of this marker. It's not needed if the components aren't marked with the "manual_update" static attributes


# A list of tests.
tests:
- name: test_restake_manager_creation
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you add more tests with more collaterals please?

@zizou0x
Copy link
Collaborator

zizou0x commented Feb 13, 2025

Please fix foundry CI

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.

5 participants