fix(balancer_v2): skip adding zero address rate_provider entrypoints (#224)

This commit is contained in:
Louise Poole
2025-06-25 17:52:49 +02:00
committed by GitHub
parent 1c6c2c53c7
commit dfa87f662d
4 changed files with 35 additions and 13 deletions

36
substreams/Cargo.lock generated
View File

@@ -235,12 +235,12 @@ dependencies = [
"substreams",
"substreams-ethereum",
"tiny-keccak",
"tycho-substreams 0.2.1 (git+https://github.com/propeller-heads/tycho-protocol-sdk.git?rev=52d5021)",
"tycho-substreams 0.2.1",
]
[[package]]
name = "ethereum-balancer-v2"
version = "0.3.1"
version = "0.3.2"
dependencies = [
"anyhow",
"ethabi 18.0.0",
@@ -250,7 +250,7 @@ dependencies = [
"num-bigint",
"substreams",
"substreams-ethereum",
"tycho-substreams 0.2.1 (git+https://github.com/propeller-heads/tycho-protocol-sdk.git?rev=51995f9)",
"tycho-substreams 0.2.2",
]
[[package]]
@@ -271,7 +271,7 @@ dependencies = [
"serde_qs",
"substreams",
"substreams-ethereum",
"tycho-substreams 0.2.1 (git+https://github.com/propeller-heads/tycho-protocol-sdk.git?rev=52d5021)",
"tycho-substreams 0.2.1",
]
[[package]]
@@ -308,7 +308,7 @@ dependencies = [
"substreams",
"substreams-ethereum",
"substreams-helper 0.0.2 (git+https://github.com/propeller-heads/tycho-protocol-sdk.git?rev=52d5021)",
"tycho-substreams 0.2.1 (git+https://github.com/propeller-heads/tycho-protocol-sdk.git?rev=52d5021)",
"tycho-substreams 0.2.1",
]
[[package]]
@@ -348,7 +348,7 @@ dependencies = [
"regex",
"substreams",
"substreams-ethereum",
"tycho-substreams 0.2.1 (git+https://github.com/propeller-heads/tycho-protocol-sdk.git?rev=52d5021)",
"tycho-substreams 0.2.1",
]
[[package]]
@@ -368,7 +368,7 @@ dependencies = [
"regex",
"substreams",
"substreams-ethereum",
"tycho-substreams 0.2.1 (git+https://github.com/propeller-heads/tycho-protocol-sdk.git?rev=52d5021)",
"tycho-substreams 0.2.1",
]
[[package]]
@@ -385,7 +385,7 @@ dependencies = [
"serde-sibor",
"substreams",
"substreams-ethereum",
"tycho-substreams 0.2.1 (git+https://github.com/propeller-heads/tycho-protocol-sdk.git?rev=52d5021)",
"tycho-substreams 0.2.1",
]
[[package]]
@@ -403,7 +403,7 @@ dependencies = [
"serde_qs",
"substreams",
"substreams-ethereum",
"tycho-substreams 0.2.1 (git+https://github.com/propeller-heads/tycho-protocol-sdk.git?rev=52d5021)",
"tycho-substreams 0.2.1",
]
[[package]]
@@ -1669,7 +1669,23 @@ dependencies = [
[[package]]
name = "tycho-substreams"
version = "0.2.1"
source = "git+https://github.com/propeller-heads/tycho-protocol-sdk.git?rev=51995f9#51995f9731ecf549a5ae68c281906c90efe9909a"
source = "git+https://github.com/propeller-heads/tycho-protocol-sdk.git?rev=52d5021#52d502198e9aa964814ef5f139df0886c3eb7bb0"
dependencies = [
"ethabi 18.0.0",
"hex",
"itertools 0.12.1",
"num-bigint",
"prost 0.11.9",
"serde",
"serde_json",
"substreams",
"substreams-ethereum",
]
[[package]]
name = "tycho-substreams"
version = "0.2.2"
source = "git+https://github.com/propeller-heads/tycho-protocol-sdk.git?tag=0.4.0#cfbf6812bdc9503ff51debcf5e171cd680b4d694"
dependencies = [
"ethabi 18.0.0",
"hex",

View File

@@ -1,6 +1,6 @@
[package]
name = "ethereum-balancer-v2"
version = "0.3.1"
version = "0.3.2"
edition = "2021"
[lib]
@@ -15,7 +15,7 @@ hex = "0.4.3"
anyhow = "1.0.75"
num-bigint = "0.4.4"
itertools = "0.12.0"
tycho-substreams = { git = "https://github.com/propeller-heads/tycho-protocol-sdk.git", rev = "51995f9" }
tycho-substreams = { git = "https://github.com/propeller-heads/tycho-protocol-sdk.git", tag = "0.4.0" }
[build-dependencies]
anyhow = "1"

View File

@@ -15,6 +15,7 @@ use tycho_substreams::{
};
pub const VAULT_ADDRESS: &[u8] = &hex!("BA12222222228d8Ba445958a75a0704d566BF2C8");
pub const ZERO_ADDRESS: &[u8] = &[0u8; 20];
#[substreams::handlers::map]
pub fn map_components(block: eth::v2::Block) -> Result<BlockTransactionProtocolComponents> {
@@ -214,6 +215,11 @@ pub fn map_protocol_changes(
if let Some(rate_providers) = rate_providers {
for rate_provider in rate_providers {
if rate_provider == ZERO_ADDRESS {
// Skipped: is not a rate provider
continue;
}
let trace_data = TraceData::Rpc(RpcTraceData {
caller: None,
calldata: hex::decode("679aefce").unwrap(), // getRate()

View File

@@ -1,7 +1,7 @@
specVersion: v0.1.0
package:
name: "ethereum_balancer_v2"
version: v0.3.1
version: v0.3.2
url: "https://github.com/propeller-heads/tycho-protocol-sdk/tree/main/substreams/ethereum-balancer-v2"
protobuf: