Support for widers scope of providers
- we need to read full block in case transactions is empty OR totalDifficulty is null - we need to log errors in upstream validation process
This commit is contained in:
@@ -81,6 +81,9 @@ open class EthereumUpstreamValidator(
|
||||
}
|
||||
}
|
||||
}
|
||||
.doOnError {
|
||||
log.warn("Error validating ${upstream.getId()}", it)
|
||||
}
|
||||
.onErrorReturn(UpstreamAvailability.UNAVAILABLE)
|
||||
}
|
||||
|
||||
|
||||
@@ -71,8 +71,11 @@ class EthereumWsHead(
|
||||
.flatMap { block ->
|
||||
// newHeads returns incomplete blocks, i.e. without some fields and without transaction hashes,
|
||||
// so we need to fetch the full block data
|
||||
if (block.difficulty == null || block.transactions == null) {
|
||||
// TODO do we really need this ?
|
||||
if (block.difficulty == null ||
|
||||
block.transactions == null ||
|
||||
block.transactions.isEmpty() ||
|
||||
block.totalDifficulty == null
|
||||
) {
|
||||
enhanceRealBlock(block)
|
||||
} else {
|
||||
Mono.just(BlockContainer.from(block))
|
||||
|
||||
Reference in New Issue
Block a user