-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Staterecovery part 13 blockhash fixes (#675)
staterecovery: fix blockHash opcode and improve performance of blob fetching from L1 --------- Signed-off-by: Pedro Novais <1478752+jpnovais@users.noreply.github.com> Co-authored-by: Roman Vaseev <4833306+Filter94@users.noreply.github.com>
- Loading branch information
Showing
238 changed files
with
2,245 additions
and
1,156 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
contracts/local-deployments-artifacts/static-artifacts/OpcodeTester.json
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
jvm-libs/generic/extensions/kotlin/src/main/kotlin/linea/kotlin/ULongExtensions.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package linea.kotlin | ||
|
||
fun List<ULong>.hasSequentialElements(): Boolean { | ||
if (this.size < 2) return true // A list with less than 2 elements is trivially continuous | ||
|
||
for (i in 1 until this.size) { | ||
if (this[i] != this[i - 1] + 1UL) { | ||
return false | ||
} | ||
} | ||
return true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
jvm-libs/generic/extensions/kotlin/src/test/kotlin/linea/kotlin/ULongExtensionsTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package linea.kotlin | ||
import org.assertj.core.api.Assertions.assertThat | ||
import org.junit.jupiter.api.Test | ||
|
||
class ULongExtensionsTest { | ||
@Test | ||
fun `hasSequentialElements should return true for an empty list`() { | ||
val list = emptyList<ULong>() | ||
assertThat(list.hasSequentialElements()).isTrue() | ||
} | ||
|
||
@Test | ||
fun `hasSequentialElements should return true for a list with one element`() { | ||
val list = listOf(1UL) | ||
assertThat(list.hasSequentialElements()).isTrue() | ||
} | ||
|
||
@Test | ||
fun `hasSequentialElements should return true for a list with sequential elements`() { | ||
val list = listOf(1UL, 2UL, 3UL, 4UL, 5UL) | ||
assertThat(list.hasSequentialElements()).isTrue() | ||
} | ||
|
||
@Test | ||
fun `hasSequentialElements should return false for a list with non-sequential elements`() { | ||
val list = listOf(1UL, 3UL, 2UL, 5UL, 4UL) | ||
assertThat(list.hasSequentialElements()).isFalse() | ||
} | ||
|
||
@Test | ||
fun `hasSequentialElements should return false for a list with gaps`() { | ||
val list = listOf(1UL, 2UL, 4UL, 5UL) | ||
assertThat(list.hasSequentialElements()).isFalse() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
jvm-libs/generic/vertx-helper/src/main/kotlin/net/consensys/linea/vertx/VertxFactory.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
package net.consensys.linea.vertx | ||
|
||
import io.vertx.core.Vertx | ||
import io.vertx.core.VertxOptions | ||
import io.vertx.core.json.JsonObject | ||
import kotlin.time.Duration | ||
import kotlin.time.Duration.Companion.seconds | ||
|
||
object VertxFactory { | ||
fun createVertxWithJsonConfigs(configs: JsonObject): Vertx { | ||
return Vertx.vertx(VertxOptions(configs)) | ||
} | ||
|
||
fun createVertx( | ||
maxEventLoopExecuteTime: Duration? = 5.seconds, | ||
maxWorkerExecuteTime: Duration? = 30.seconds, | ||
blockedThreadCheckInterval: Duration? = 5.seconds, | ||
warningExceptionTime: Duration? = 60.seconds, | ||
jvmMetricsEnabled: Boolean = true, | ||
prometheusMetricsEnabled: Boolean = true, | ||
preferNativeTransport: Boolean = true | ||
): Vertx { | ||
val configs = JsonObject() | ||
maxEventLoopExecuteTime?.let { | ||
configs.put("maxEventLoopExecuteTime", it.inWholeMilliseconds) | ||
configs.put("maxEventLoopExecuteTimeUnit", "MILLISECONDS") | ||
} | ||
maxWorkerExecuteTime?.let { | ||
configs.put("maxWorkerExecuteTime", it.inWholeMilliseconds) | ||
configs.put("maxWorkerExecuteTimeTimeUnit", "MILLISECONDS") | ||
} | ||
blockedThreadCheckInterval?.let { | ||
configs.put("blockedThreadCheckInterval", it.inWholeMilliseconds) | ||
configs.put("blockedThreadCheckIntervalUnit", "MILLISECONDS") | ||
} | ||
warningExceptionTime?.let { | ||
configs.put("warningExceptionTime", it.inWholeMilliseconds) | ||
configs.put("warningExceptionTimeUnit", "MILLISECONDS") | ||
} | ||
configs.put("preferNativeTransport", preferNativeTransport) | ||
|
||
if (jvmMetricsEnabled || prometheusMetricsEnabled) { | ||
val metricsOptions = JsonObject() | ||
metricsOptions.put("enabled", true) | ||
metricsOptions.put("jvmMetricsEnabled", jvmMetricsEnabled) | ||
if (prometheusMetricsEnabled) { | ||
val prometheusOptions = JsonObject() | ||
prometheusOptions.put("enabled", true) | ||
prometheusOptions.put("publishQuantiles", true) | ||
metricsOptions.put("prometheusOptions", prometheusOptions) | ||
} | ||
configs.put("metricsOptions", metricsOptions) | ||
} | ||
println(configs) | ||
return createVertxWithJsonConfigs(configs) | ||
} | ||
} |
Oops, something went wrong.