Skip to content

Commit 56b82ef

Browse files
committed
fix: remove irrelevant fields from deployment queries
We may need to add these back later for other purposes, but indexer-service does not need these fields; the only reason it queries allocations is to create attestation signers for them. There might be even more fields that we could remove. However, signalled_tokens in particular is necessary at the moment because there is buggy data in the real-world network subgraph where the field is negative sometimes. That breaks U256 parsing. Since we don't need this and the other fields, I thought it best to remove them.
1 parent c0b5ecd commit 56b82ef

File tree

6 files changed

+4
-52
lines changed

6 files changed

+4
-52
lines changed

common/src/allocations/mod.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,6 @@ pub struct SubgraphDeployment {
3939
pub id: DeploymentId,
4040
#[serde(rename = "deniedAt")]
4141
pub denied_at: Option<u64>,
42-
#[serde(rename = "stakedTokens")]
43-
pub staked_tokens: U256,
44-
#[serde(rename = "signalledTokens")]
45-
pub signalled_tokens: U256,
46-
#[serde(rename = "queryFeesAmount")]
47-
pub query_fees_amount: U256,
4842
}
4943

5044
impl<'d> Deserialize<'d> for Allocation {

common/src/allocations/monitor.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,6 @@ pub fn indexer_allocations(
100100
subgraphDeployment {
101101
id
102102
deniedAt
103-
stakedTokens
104-
signalledTokens
105-
queryFeesAmount
106103
}
107104
}
108105
recentlyClosedAllocations: totalAllocations(
@@ -121,9 +118,6 @@ pub fn indexer_allocations(
121118
subgraphDeployment {
122119
id
123120
deniedAt
124-
stakedTokens
125-
signalledTokens
126-
queryFeesAmount
127121
}
128122
}
129123
}

common/src/attestations/signer.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,6 @@ mod tests {
187187
)
188188
.unwrap(),
189189
denied_at: None,
190-
staked_tokens: U256::zero(),
191-
signalled_tokens: U256::zero(),
192-
query_fees_amount: U256::zero(),
193190
},
194191
indexer: Address::ZERO,
195192
allocated_tokens: U256::zero(),
@@ -236,9 +233,6 @@ mod tests {
236233
)
237234
.unwrap(),
238235
denied_at: None,
239-
staked_tokens: U256::zero(),
240-
signalled_tokens: U256::zero(),
241-
query_fees_amount: U256::zero(),
242236
},
243237
indexer: Address::ZERO,
244238
allocated_tokens: U256::zero(),

common/src/test_vectors.rs

Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,7 @@ pub const ALLOCATIONS_QUERY_RESPONSE: &str = r#"
3636
"closedAtEpoch": null,
3737
"subgraphDeployment": {
3838
"id": "0xbbde25a2c85f55b53b7698b9476610c3d1202d88870e66502ab0076b7218f98a",
39-
"deniedAt": 0,
40-
"stakedTokens": "96183284152000000014901161",
41-
"signalledTokens": "182832939554154667498047",
42-
"queryFeesAmount": "19861336072168874330350"
39+
"deniedAt": 0
4340
}
4441
},
4542
{
@@ -53,10 +50,7 @@ pub const ALLOCATIONS_QUERY_RESPONSE: &str = r#"
5350
"closedAtEpoch": null,
5451
"subgraphDeployment": {
5552
"id": "0xcda7fa0405d6fd10721ed13d18823d24b535060d8ff661f862b26c23334f13bf",
56-
"deniedAt": 0,
57-
"stakedTokens": "53885041676589999979510903",
58-
"signalledTokens": "104257136417832003117925",
59-
"queryFeesAmount": "2229358609434396563687"
53+
"deniedAt": 0
6054
}
6155
}
6256
],
@@ -72,10 +66,7 @@ pub const ALLOCATIONS_QUERY_RESPONSE: &str = r#"
7266
"closedAtEpoch": 953,
7367
"subgraphDeployment": {
7468
"id": "0xbbde25a2c85f55b53b7698b9476610c3d1202d88870e66502ab0076b7218f98a",
75-
"deniedAt": 0,
76-
"stakedTokens": "96183284152000000014901161",
77-
"signalledTokens": "182832939554154667498047",
78-
"queryFeesAmount": "19861336072168874330350"
69+
"deniedAt": 0
7970
}
8071
},
8172
{
@@ -89,10 +80,7 @@ pub const ALLOCATIONS_QUERY_RESPONSE: &str = r#"
8980
"closedAtEpoch": 953,
9081
"subgraphDeployment": {
9182
"id": "0xc064c354bc21dd958b1d41b67b8ef161b75d2246b425f68ed4c74964ae705cbd",
92-
"deniedAt": 0,
93-
"stakedTokens": "85450761241000000055879354",
94-
"signalledTokens": "154944508746646550301048",
95-
"queryFeesAmount": "4293718622418791971020"
83+
"deniedAt": 0
9684
}
9785
}
9886
]
@@ -134,9 +122,6 @@ lazy_static! {
134122
.unwrap(),
135123
),
136124
denied_at: Some(0),
137-
staked_tokens: U256::from_str("96183284152000000014901161").unwrap(),
138-
signalled_tokens: U256::from_str("182832939554154667498047").unwrap(),
139-
query_fees_amount: U256::from_str("19861336072168874330350").unwrap(),
140125
},
141126
status: AllocationStatus::Null,
142127
closed_at_epoch_start_block_hash: None,
@@ -163,9 +148,6 @@ lazy_static! {
163148
.unwrap(),
164149
),
165150
denied_at: Some(0),
166-
staked_tokens: U256::from_str("53885041676589999979510903").unwrap(),
167-
signalled_tokens: U256::from_str("104257136417832003117925").unwrap(),
168-
query_fees_amount: U256::from_str("2229358609434396563687").unwrap(),
169151
},
170152
status: AllocationStatus::Null,
171153
closed_at_epoch_start_block_hash: None,
@@ -192,9 +174,6 @@ lazy_static! {
192174
.unwrap(),
193175
),
194176
denied_at: Some(0),
195-
staked_tokens: U256::from_str("96183284152000000014901161").unwrap(),
196-
signalled_tokens: U256::from_str("182832939554154667498047").unwrap(),
197-
query_fees_amount: U256::from_str("19861336072168874330350").unwrap(),
198177
},
199178
status: AllocationStatus::Null,
200179
closed_at_epoch_start_block_hash: None,
@@ -221,9 +200,6 @@ lazy_static! {
221200
.unwrap(),
222201
),
223202
denied_at: Some(0),
224-
staked_tokens: U256::from_str("85450761241000000055879354").unwrap(),
225-
signalled_tokens: U256::from_str("154944508746646550301048").unwrap(),
226-
query_fees_amount: U256::from_str("4293718622418791971020").unwrap(),
227203
},
228204
status: AllocationStatus::Null,
229205
closed_at_epoch_start_block_hash: None,

service/src/query_processor.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,6 @@ mod tests {
186186
let subgraph_deployment = SubgraphDeployment {
187187
id: *DEPLOYMENT_ID,
188188
denied_at: None,
189-
staked_tokens: U256::from(0),
190-
signalled_tokens: U256::from(0),
191-
query_fees_amount: U256::from(0),
192189
};
193190

194191
let indexer = Address::from_str(INDEXER_ADDRESS).unwrap();

service/src/tap_manager.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,6 @@ mod test {
180180
subgraph_deployment: SubgraphDeployment {
181181
id: DeploymentId::from_str("QmAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA").unwrap(),
182182
denied_at: None,
183-
query_fees_amount: U256::zero(),
184-
signalled_tokens: U256::zero(),
185-
staked_tokens: U256::zero(),
186183
},
187184
status: AllocationStatus::Active,
188185
allocated_tokens: U256::zero(),

0 commit comments

Comments
 (0)