Lower data timestamp (#404)
This commit is contained in:
Submodule emerald-grpc updated: 474627a53b...0fff78d64b
@@ -57,6 +57,7 @@ class StreamHead(
|
||||
.setSlot(block.slot)
|
||||
.setCurrentLowerBlock(ms.getLowerBlock().blockNumber)
|
||||
.setCurrentLowerSlot(ms.getLowerBlock().slot ?: 0)
|
||||
.setCurrentLowerDataTimestamp(ms.getLowerBlock().timestamp)
|
||||
.setTimestamp(block.timestamp.toEpochMilli())
|
||||
.setWeight(ByteString.copyFrom(block.difficulty.toByteArray()))
|
||||
.setBlockId(block.hash.toHex())
|
||||
|
||||
@@ -5,6 +5,7 @@ import org.slf4j.LoggerFactory
|
||||
import reactor.core.publisher.Flux
|
||||
import reactor.core.publisher.Mono
|
||||
import java.time.Duration
|
||||
import java.time.Instant
|
||||
import java.util.concurrent.atomic.AtomicReference
|
||||
|
||||
typealias LowerBoundBlockDetectorBuilder = (Chain, Upstream) -> LowerBoundBlockDetector
|
||||
@@ -41,11 +42,14 @@ abstract class LowerBoundBlockDetector(
|
||||
data class LowerBlockData(
|
||||
val blockNumber: Long,
|
||||
val slot: Long?,
|
||||
val timestamp: Long,
|
||||
) : Comparable<LowerBlockData> {
|
||||
constructor(blockNumber: Long) : this(blockNumber, null)
|
||||
constructor(blockNumber: Long) : this(blockNumber, null, Instant.now().epochSecond)
|
||||
|
||||
constructor(blockNumber: Long, slot: Long) : this(blockNumber, slot, Instant.now().epochSecond)
|
||||
|
||||
companion object {
|
||||
fun default() = LowerBlockData(0, 0)
|
||||
fun default() = LowerBlockData(0, 0, 0)
|
||||
}
|
||||
|
||||
override fun compareTo(other: LowerBlockData): Int {
|
||||
|
||||
@@ -33,6 +33,7 @@ class EthereumLowerBoundBlockDetector(
|
||||
"header for hash not found",
|
||||
"after last accepted block",
|
||||
"Version has either been pruned, or is for a future block", // cronos
|
||||
"no historical RPC is available for this historical", // optimism
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user