This is an automated email from the ASF dual-hosted git repository.
toulmean pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-tuweni.git
The following commit(s) were added to refs/heads/main by this push:
new 3f269e3a Add javadoc
new 21fb8adf Merge pull request #408 from atoulme/add_javadoc2
3f269e3a is described below
commit 3f269e3a357a738332d7cfe9f8f0868e47baa876
Author: Antoine Toulme <[email protected]>
AuthorDate: Sat May 28 23:48:11 2022 -0700
Add javadoc
---
.../org/apache/tuweni/ethclient/FromBestBlockHeaderSynchronizer.kt | 4 ++++
.../org/apache/tuweni/ethclient/FromUnknownParentSynchronizer.kt | 7 +++++++
2 files changed, 11 insertions(+)
diff --git
a/eth-client/src/main/kotlin/org/apache/tuweni/ethclient/FromBestBlockHeaderSynchronizer.kt
b/eth-client/src/main/kotlin/org/apache/tuweni/ethclient/FromBestBlockHeaderSynchronizer.kt
index d70a3bc3..382bf8e0 100644
---
a/eth-client/src/main/kotlin/org/apache/tuweni/ethclient/FromBestBlockHeaderSynchronizer.kt
+++
b/eth-client/src/main/kotlin/org/apache/tuweni/ethclient/FromBestBlockHeaderSynchronizer.kt
@@ -30,6 +30,10 @@ import kotlin.coroutines.CoroutineContext
const val BEST_PEER_DELAY: Long = 5000
const val HEADERS_RESPONSE_TIMEOUT: Long = 10000
+/**
+ * This synchronizer strategy will use the best known header, and keep asking
new block headers
+ * from there, until the response comes back with just one header.
+ */
class FromBestBlockHeaderSynchronizer(
executor: ExecutorService = Executors.newSingleThreadExecutor(),
coroutineContext: CoroutineContext = executor.asCoroutineDispatcher(),
diff --git
a/eth-client/src/main/kotlin/org/apache/tuweni/ethclient/FromUnknownParentSynchronizer.kt
b/eth-client/src/main/kotlin/org/apache/tuweni/ethclient/FromUnknownParentSynchronizer.kt
index 62226082..8e947ba7 100644
---
a/eth-client/src/main/kotlin/org/apache/tuweni/ethclient/FromUnknownParentSynchronizer.kt
+++
b/eth-client/src/main/kotlin/org/apache/tuweni/ethclient/FromUnknownParentSynchronizer.kt
@@ -30,6 +30,13 @@ import kotlin.coroutines.CoroutineContext
const val DELAY: Long = 1000
const val HEADER_PARENT_HEADER_REQUEST_SIZE: Long = 64
+/**
+ * This synchronizer is requesting the parent headers of an unknown block
header, until this is resolved.
+ *
+ * To maximize chances of getting new headers, the synchronizer will ask for
headers with different skip levels,
+ * triggering this synchronizer again and parallelizing requests.
+ *
+ */
class FromUnknownParentSynchronizer(
executor: ExecutorService = Executors.newSingleThreadExecutor(),
coroutineContext: CoroutineContext = executor.asCoroutineDispatcher(),
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]