Skip to content

Commit 0d1ac83

Browse files
committed
skipping validation of log_cache
1 parent ac36caf commit 0d1ac83

File tree

2 files changed

+90
-82
lines changed

2 files changed

+90
-82
lines changed

src/bindings.rs

Lines changed: 32 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1017,38 +1017,41 @@ impl Bindings {
10171017
let request_from_block_val = from_block.unwrap_or(0);
10181018

10191019
for log_cache in log_caches {
1020-
match self.validate_log_cache(&log_cache) {
1021-
Ok(true) => {
1022-
for log in log_cache.logs {
1023-
if let Some(log_block_number) = log.block_number {
1024-
if log_block_number >= request_from_block_val {
1025-
all_valid_logs.push(log);
1026-
}
1027-
} else {
1028-
if from_block.is_none() {
1029-
all_valid_logs.push(log);
1030-
}
1031-
}
1020+
// VALIDATION TEMPORARILY SKIPPED - For external reasons, validation is disabled
1021+
// and all logs are processed as if validation succeeded (Ok(true) case)
1022+
1023+
// match self.validate_log_cache(&log_cache) {
1024+
// Ok(true) => {
1025+
for log in log_cache.logs {
1026+
if let Some(log_block_number) = log.block_number {
1027+
if log_block_number >= request_from_block_val {
1028+
all_valid_logs.push(log);
1029+
}
1030+
} else {
1031+
if from_block.is_none() {
1032+
all_valid_logs.push(log);
10321033
}
1033-
}
1034-
Ok(false) => {
1035-
print_to_terminal(
1036-
1,
1037-
&format!("LogCache validation failed for cache created by {}. Discarding {} logs.",
1038-
log_cache.metadata.created_by,
1039-
log_cache.logs.len())
1040-
);
1041-
}
1042-
Err(e) => {
1043-
print_to_terminal(
1044-
1,
1045-
&format!(
1046-
"Error validating LogCache from {}: {:?}. Discarding.",
1047-
log_cache.metadata.created_by, e,
1048-
),
1049-
);
10501034
}
10511035
}
1036+
// }
1037+
// Ok(false) => {
1038+
// print_to_terminal(
1039+
// 1,
1040+
// &format!("LogCache validation failed for cache created by {}. Discarding {} logs.",
1041+
// log_cache.metadata.created_by,
1042+
// log_cache.logs.len())
1043+
// );
1044+
// }
1045+
// Err(e) => {
1046+
// print_to_terminal(
1047+
// 1,
1048+
// &format!(
1049+
// "Error validating LogCache from {}: {:?}. Discarding.",
1050+
// log_cache.metadata.created_by, e,
1051+
// ),
1052+
// );
1053+
// }
1054+
// }
10521055
}
10531056

10541057
all_valid_logs.sort_by(|a, b| {

src/hypermap.rs

Lines changed: 58 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1144,40 +1144,42 @@ impl Hypermap {
11441144
let request_from_block_val = from_block.unwrap_or(0);
11451145

11461146
for log_cache in log_caches {
1147-
match self.validate_log_cache(&log_cache) {
1148-
Ok(true) => {
1149-
for log in log_cache.logs {
1150-
if let Some(log_block_number) = log.block_number {
1151-
if log_block_number >= request_from_block_val {
1152-
all_valid_logs.push(log);
1153-
}
1154-
} else {
1155-
if from_block.is_none() {
1156-
all_valid_logs.push(log);
1157-
}
1158-
}
1147+
// VALIDATION TEMPORARILY SKIPPED - For external reasons, validation is disabled
1148+
// and all logs are processed as if validation succeeded (Ok(true) case)
1149+
1150+
// match self.validate_log_cache(&log_cache) {
1151+
// Ok(true) => {
1152+
for log in log_cache.logs {
1153+
if let Some(log_block_number) = log.block_number {
1154+
if log_block_number >= request_from_block_val {
1155+
all_valid_logs.push(log);
1156+
}
1157+
} else {
1158+
if from_block.is_none() {
1159+
all_valid_logs.push(log);
11591160
}
1160-
}
1161-
Ok(false) => {
1162-
print_to_terminal(
1163-
1,
1164-
&format!("LogCache validation failed for cache created by {}. Discarding {} logs.",
1165-
log_cache.metadata.created_by,
1166-
log_cache.logs.len())
1167-
);
1168-
}
1169-
Err(e) => {
1170-
print_to_terminal(
1171-
1,
1172-
&format!(
1173-
"Error validating LogCache from {}: {:?}. Discarding.",
1174-
log_cache.metadata.created_by, e,
1175-
),
1176-
);
11771161
}
11781162
}
1163+
// }
1164+
// Ok(false) => {
1165+
// print_to_terminal(
1166+
// 1,
1167+
// &format!("LogCache validation failed for cache created by {}. Discarding {} logs.",
1168+
// log_cache.metadata.created_by,
1169+
// log_cache.logs.len())
1170+
// );
1171+
// }
1172+
// Err(e) => {
1173+
// print_to_terminal(
1174+
// 1,
1175+
// &format!(
1176+
// "Error validating LogCache from {}: {:?}. Discarding.",
1177+
// log_cache.metadata.created_by, e,
1178+
// ),
1179+
// );
1180+
// }
1181+
// }
11791182
}
1180-
11811183
all_valid_logs.sort_by(|a, b| {
11821184
let block_cmp = a.block_number.cmp(&b.block_number);
11831185
if block_cmp == std::cmp::Ordering::Equal {
@@ -1224,8 +1226,11 @@ impl Hypermap {
12241226
let request_from_block_val = from_block.unwrap_or(0);
12251227

12261228
for log_cache in log_caches {
1227-
match self.validate_log_cache(&log_cache).await {
1228-
Ok(true) => {
1229+
// VALIDATION TEMPORARILY SKIPPED - For external reasons, validation is disabled
1230+
// and all logs are processed as if validation succeeded (Ok(true) case)
1231+
1232+
//match self.validate_log_cache(&log_cache).await {
1233+
//Ok(true) => {
12291234
for log in log_cache.logs {
12301235
if let Some(log_block_number) = log.block_number {
12311236
if log_block_number >= request_from_block_val {
@@ -1237,27 +1242,27 @@ impl Hypermap {
12371242
}
12381243
}
12391244
}
1240-
}
1241-
Ok(false) => {
1242-
print_to_terminal(
1243-
1,
1244-
&format!("LogCache validation failed for cache created by {}. Discarding {} logs.",
1245-
log_cache.metadata.created_by,
1246-
log_cache.logs.len())
1247-
);
1248-
}
1249-
Err(e) => {
1250-
print_to_terminal(
1251-
1,
1252-
&format!(
1253-
"Error validating LogCache from {}: {:?}. Discarding {} logs.",
1254-
log_cache.metadata.created_by,
1255-
e,
1256-
log_cache.logs.len()
1257-
),
1258-
);
1259-
}
1260-
}
1245+
//}
1246+
//Ok(false) => {
1247+
// print_to_terminal(
1248+
// 1,
1249+
// &format!("LogCache validation failed for cache created by {}. Discarding {} logs.",
1250+
// log_cache.metadata.created_by,
1251+
// log_cache.logs.len())
1252+
// );
1253+
//}
1254+
//Err(e) => {
1255+
// print_to_terminal(
1256+
// 1,
1257+
// &format!(
1258+
// "Error validating LogCache from {}: {:?}. Discarding {} logs.",
1259+
// log_cache.metadata.created_by,
1260+
// e,
1261+
// log_cache.logs.len()
1262+
// ),
1263+
// );
1264+
//}
1265+
//}
12611266
}
12621267

12631268
all_valid_logs.sort_by(|a, b| {

0 commit comments

Comments
 (0)