Log index validator (#699)

* log index validator - wip

* fix: Handle edge cases in LogIndexValidator and fix GitHub Actions

gix critical edge case: when first transaction has no logs, second transaction starting at logIndex=0 is VALID behavior
 null handling
fix  'repo_token' parameter

* - Use Mono.empty() instead of Mono.just(null)
- Use defaultIfEmpty for handling empty results

* wip : add tests for LogIndexValidator

* test fixes

* fix: Fix ktlint issues in LogIndexValidatorTest

- Remove wildcard import
- Fix trailing spaces
- Add missing trailing commas
- Fix import order
- Add newline at end of file

* add disable option

* add logs for error case

* save prevState on doOnNext

* also check for first tx log index order

* add not continius indexes test

* make code thread safe

* use upstream.getHead

* search CHECK_TX_COUNT instead of 0 and 1 indexes

* refactor double rpc call
This commit is contained in:
EugeneDrpc
2025-08-08 18:03:10 +02:00
committed by GitHub
parent 5eb8f78d68
commit a34f2186cc
7 changed files with 762 additions and 3 deletions

View File

@@ -19,6 +19,7 @@ class ChainOptions {
val disableLivenessSubscriptionValidation: Boolean,
val disableBoundValidation: Boolean = false,
val valdateErigonBug: Boolean,
val disableLogIndexValidation: Boolean = false,
)
data class DefaultOptions(
@@ -41,7 +42,8 @@ class ChainOptions {
var callLimitSize: Int? = null,
var disableLivenessSubscriptionValidation: Boolean? = null,
var disableBoundValidation: Boolean? = null,
var validateErigonBug: Boolean? = null
var validateErigonBug: Boolean? = null,
var disableLogIndexValidation: Boolean? = null
) {
companion object {
@JvmStatic
@@ -73,6 +75,7 @@ class ChainOptions {
copy.disableLivenessSubscriptionValidation = overwrites.disableLivenessSubscriptionValidation ?: this.disableLivenessSubscriptionValidation
copy.disableBoundValidation = overwrites.disableBoundValidation ?: this.disableBoundValidation
copy.validateErigonBug = overwrites.validateErigonBug ?: this.validateErigonBug
copy.disableLogIndexValidation = overwrites.disableLogIndexValidation ?: this.disableLogIndexValidation
return copy
}
@@ -93,6 +96,7 @@ class ChainOptions {
this.disableLivenessSubscriptionValidation ?: false,
this.disableBoundValidation ?: false,
this.validateErigonBug ?: true,
this.disableLogIndexValidation ?: false,
)
}
}

View File

@@ -58,6 +58,9 @@ class ChainOptionsReader : YamlConfigReader<ChainOptions.PartialOptions>() {
getValueAsBool(values, "disable-bound-validation")?.let {
options.disableBoundValidation = it
}
getValueAsBool(values, "disable-log-index-validation")?.let {
options.disableLogIndexValidation = it
}
return options
}
}