Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Process arbitrum nitro eth_syncing message #508

Merged
merged 4 commits into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions foundation/src/main/resources/chains.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,6 @@ chain-settings:
settings:
expected-block-time: 2.7s
allow-pruning-requirement: true
options:
disable-validation: true
lags:
syncing: 40
lagging: 20
Expand All @@ -240,8 +238,6 @@ chain-settings:
settings:
expected-block-time: 260ms
allow-pruning-requirement: true
options:
disable-validation: true
lags:
syncing: 40
lagging: 20
Expand Down Expand Up @@ -358,7 +354,6 @@ chain-settings:
allow-pruning-requirement: true
options:
validate-peers: false
validate-syncing: false
lags:
syncing: 10
lagging: 5
Expand Down Expand Up @@ -1271,7 +1266,6 @@ chain-settings:
settings:
options:
validate-peers: false
validate-syncing: false
fork-choice: quorum
expected-block-time: 300ms
lags:
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import io.emeraldpay.dshackle.upstream.UpstreamAvailability
import io.emeraldpay.dshackle.upstream.ValidateUpstreamSettingsResult
import io.emeraldpay.dshackle.upstream.ethereum.domain.Address
import io.emeraldpay.dshackle.upstream.ethereum.hex.HexData
import io.emeraldpay.dshackle.upstream.ethereum.json.SyncingJson
import io.emeraldpay.dshackle.upstream.ethereum.json.TransactionCallJson
import io.emeraldpay.dshackle.upstream.rpcclient.ListParams
import org.springframework.scheduling.concurrent.CustomizableThreadFactory
Expand Down Expand Up @@ -58,7 +57,15 @@ open class EthereumUpstreamValidator @JvmOverloads constructor(
override fun validateSyncingRequest(): ValidateSyncingRequest {
return ValidateSyncingRequest(
ChainRequest("eth_syncing", ListParams()),
) { bytes -> objectMapper.readValue(bytes, SyncingJson::class.java).isSyncing }
) { bytes ->
val raw = Global.objectMapper.readTree(bytes)
if (raw.isBoolean) {
raw.asBoolean()
} else {
log.warn("Received syncing object ${raw.toPrettyString()} for upstream ${upstream.getId()}")
true
}
}
}

override fun validatePeersRequest(): ValidatePeersRequest {
Expand Down
Loading