Skip to content

Commit

Permalink
default to V6 and remove V5 references
Browse files Browse the repository at this point in the history
  • Loading branch information
thedarkjester committed Jan 28, 2025
1 parent bbf5d02 commit ea0ee73
Show file tree
Hide file tree
Showing 14 changed files with 33 additions and 161 deletions.
4 changes: 2 additions & 2 deletions config/coordinator/coordinator-docker.config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,11 @@ finalized-block-tag="latest"
# reset this once we know what to do on dev/UAT
earliest-block=0
genesis-state-root-hash="0x072ead6777750dc20232d1cee8dc9a395c2d350df4bbaa5096c6f59b214dcecd"
# shnarf for contract V5
# shnarf for contract V6
# Keccak256(parentShnarf="0x00...00", snarkHash="0x00...00",
# parentStateRootHash="0x072ead6777750dc20232d1cee8dc9a395c2d350df4bbaa5096c6f59b214dcecd",
# evaludationClaim="0x00...00", evaludationPoint="0x00...00")
genesis-shnarf-v5="0x47452a1b9ebadfe02bdd02f580fa1eba17680d57eec968a591644d05d78ee84f"
genesis-shnarf-v6="0x47452a1b9ebadfe02bdd02f580fa1eba17680d57eec968a591644d05d78ee84f"

[l2]
rpc-endpoint="http://sequencer:8545"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package net.consensys.linea.contract

import build.linea.contract.LineaRollupV5
import build.linea.contract.LineaRollupV6
import net.consensys.linea.web3j.AtomicContractEIP1559GasProvider
import net.consensys.linea.web3j.EIP1559GasFees
import net.consensys.linea.web3j.SmartContractErrors
Expand Down Expand Up @@ -28,7 +28,7 @@ class LineaRollupAsyncFriendly(
private val asyncTransactionManager: AsyncFriendlyTransactionManager,
contractGasProvider: ContractGasProvider,
private val smartContractErrors: SmartContractErrors
) : LineaRollupV5(
) : LineaRollupV6(
contractAddress,
web3j,
asyncTransactionManager,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package net.consensys.linea.contract.l1

import build.linea.contract.LineaRollupV5
import build.linea.contract.LineaRollupV6
import net.consensys.linea.contract.AsyncFriendlyTransactionManager
import net.consensys.linea.contract.Web3JContractAsyncHelper
import org.web3j.abi.datatypes.Function
Expand All @@ -16,7 +16,7 @@ internal class LineaRollupEnhancedWrapper(
asyncTransactionManager: AsyncFriendlyTransactionManager,
contractGasProvider: ContractGasProvider,
val helper: Web3JContractAsyncHelper
) : LineaRollupV5(
) : LineaRollupV6(
contractAddress,
web3j,
asyncTransactionManager,
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ internal fun buildSubmitBlobsFunction(
blobs: List<BlobRecord>
): Function {
return when (version) {
LineaContractVersion.V5 -> buildSubmitBlobsFunction(blobs)
LineaContractVersion.V6 -> buildSubmitBlobsFunctionV6(blobs)
}
}
Expand Down Expand Up @@ -63,21 +62,10 @@ fun buildFinalizeBlocksFunction(
version: LineaContractVersion,
aggregationProof: ProofToFinalize,
aggregationLastBlob: BlobRecord,
parentShnarf: ByteArray,
parentL1RollingHash: ByteArray,
parentL1RollingHashMessageNumber: Long
): Function {
when (version) {
LineaContractVersion.V5 -> {
return buildFinalizeBlobsFunction(
aggregationProof,
aggregationLastBlob,
parentShnarf,
parentL1RollingHash,
parentL1RollingHashMessageNumber
)
}

LineaContractVersion.V6 -> {
return buildFinalizeBlockFunctionV6(
aggregationProof,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package net.consensys.linea.contract.l1

import build.linea.contract.LineaRollupV5
import build.linea.contract.LineaRollupV6
import build.linea.contract.l1.Web3JLineaRollupSmartContractClientReadOnly
import net.consensys.linea.contract.AsyncFriendlyTransactionManager
import net.consensys.linea.contract.Web3JContractAsyncHelper
Expand Down Expand Up @@ -37,7 +37,7 @@ class Web3JLineaRollupSmartContractClient internal constructor(
contractGasProvider,
smartContractErrors
),
private val web3jLineaClient: LineaRollupV5 = LineaRollupEnhancedWrapper(
private val web3jLineaClient: LineaRollupV6 = LineaRollupEnhancedWrapper(
contractAddress,
web3j,
asyncTransactionManager,
Expand Down Expand Up @@ -155,7 +155,6 @@ class Web3JLineaRollupSmartContractClient internal constructor(
version,
aggregation,
aggregationLastBlob,
parentShnarf,
parentL1RollingHash,
parentL1RollingHashMessageNumber
)
Expand All @@ -180,7 +179,6 @@ class Web3JLineaRollupSmartContractClient internal constructor(
version,
aggregation,
aggregationLastBlob,
parentShnarf,
parentL1RollingHash,
parentL1RollingHashMessageNumber
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class BlobAndAggregationFinalizationIntTest : CleanDbTestSuiteParallel() {
vertx: Vertx,
smartContractVersion: LineaContractVersion
) {
if (listOf(LineaContractVersion.V5, LineaContractVersion.V6).contains(smartContractVersion).not()) {
if (listOf(LineaContractVersion.V6).contains(smartContractVersion).not()) {
// V6 with prover V3 is soon comming, so we will need to update/extend this test setup
throw IllegalArgumentException("unsupported contract version=$smartContractVersion!")
}
Expand Down Expand Up @@ -99,13 +99,13 @@ class BlobAndAggregationFinalizationIntTest : CleanDbTestSuiteParallel() {
)
aggregationsRepository = AggregationsRepositoryImpl(PostgresAggregationsDao(sqlClient, fakeClock))

val lineaRollupContractForDataSubmissionV5 = rollupDeploymentResult.rollupOperatorClient
val lineaRollupContractForDataSubmissionV6 = rollupDeploymentResult.rollupOperatorClient

val acceptedBlobEndBlockNumberConsumer = Consumer<ULong> { acceptedBlob = it }

@Suppress("DEPRECATION")
val alreadySubmittedBlobFilter = L1ShnarfBasedAlreadySubmittedBlobsFilter(
lineaRollup = lineaRollupContractForDataSubmissionV5,
lineaRollup = lineaRollupContractForDataSubmissionV6,
acceptedBlobEndBlockNumberConsumer = acceptedBlobEndBlockNumberConsumer
)
val blobSubmittedEventConsumers = mapOf(
Expand All @@ -123,7 +123,7 @@ class BlobAndAggregationFinalizationIntTest : CleanDbTestSuiteParallel() {
),
blobsRepository = blobsRepository,
aggregationsRepository = aggregationsRepository,
lineaSmartContractClient = lineaRollupContractForDataSubmissionV5,
lineaSmartContractClient = lineaRollupContractForDataSubmissionV6,
alreadySubmittedBlobsFilter = alreadySubmittedBlobFilter,
gasPriceCapProvider = FakeGasPriceCapProvider(),
blobSubmittedEventDispatcher = EventDispatcher(blobSubmittedEventConsumers),
Expand Down Expand Up @@ -208,15 +208,6 @@ class BlobAndAggregationFinalizationIntTest : CleanDbTestSuiteParallel() {
}.whenException(testContext::failNow)
}

@Test
@Timeout(3, timeUnit = TimeUnit.MINUTES)
fun `submission works with contract V5`(
vertx: Vertx,
testContext: VertxTestContext
) {
testSubmission(vertx, testContext, LineaContractVersion.V5)
}

@Test
@Timeout(3, timeUnit = TimeUnit.MINUTES)
fun `submission works with contract V6`(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package net.consensys.zkevm.ethereum.coordination.messageanchoring

import build.linea.contract.LineaRollupV5
import build.linea.contract.LineaRollupV6
import build.linea.contract.l1.LineaContractVersion
import io.vertx.core.Vertx
import io.vertx.junit5.Timeout
Expand Down Expand Up @@ -37,7 +37,7 @@ class L1EventQuerierIntegrationTest {
@BeforeEach
fun beforeEach() {
val deploymentResult = ContractsManager.get()
.deployLineaRollup(contractVersion = LineaContractVersion.V5)
.deployLineaRollup(contractVersion = LineaContractVersion.V6)
.get()
testLineaRollupContractAddress = deploymentResult.contractAddress
web3Client = Web3jClientManager.l1Client
Expand Down Expand Up @@ -82,9 +82,9 @@ class L1EventQuerierIntegrationTest {
contract.sendMessage(it.recipient, it.fee, it.calldata, it.value).sendAsync()
.thenApply { receipt ->
Pair(
LineaRollupV5.getMessageSentEventFromLog(
LineaRollupV6.getMessageSentEventFromLog(
receipt.logs.first { log ->
log.topics.contains(EventEncoder.encode(LineaRollupV5.MESSAGESENT_EVENT))
log.topics.contains(EventEncoder.encode(LineaRollupV6.MESSAGESENT_EVENT))
}
),
receipt
Expand All @@ -103,9 +103,9 @@ class L1EventQuerierIntegrationTest {
contract.sendMessage(it.recipient, it.fee, it.calldata, it.value).sendAsync()
.thenApply { receipt ->
Pair(
LineaRollupV5.getMessageSentEventFromLog(
LineaRollupV6.getMessageSentEventFromLog(
receipt.logs.first { log ->
log.topics.contains(EventEncoder.encode(LineaRollupV5.MESSAGESENT_EVENT))
log.topics.contains(EventEncoder.encode(LineaRollupV6.MESSAGESENT_EVENT))
}
),
receipt
Expand Down Expand Up @@ -159,10 +159,10 @@ class L1EventQuerierIntegrationTest {
contract.sendMessage(it.recipient, it.fee, it.calldata, it.value).sendAsync()
.thenApply { receipt ->
Pair(
LineaRollupV5.staticExtractEventParameters(
LineaRollupV5.MESSAGESENT_EVENT,
LineaRollupV6.staticExtractEventParameters(
LineaRollupV6.MESSAGESENT_EVENT,
receipt.logs.first { log ->
log.topics.contains(EventEncoder.encode(LineaRollupV5.MESSAGESENT_EVENT))
log.topics.contains(EventEncoder.encode(LineaRollupV6.MESSAGESENT_EVENT))
}
),
receipt
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package net.consensys.zkevm.ethereum.coordination.messageanchoring

import build.linea.contract.LineaRollupV5
import build.linea.contract.LineaRollupV6
import build.linea.contract.l1.LineaContractVersion
import io.vertx.core.Vertx
import io.vertx.junit5.Timeout
Expand Down Expand Up @@ -49,7 +49,7 @@ class MessageServiceIntegrationTest {

private fun deployContracts() {
val l1RollupDeploymentResult = ContractsManager.get()
.deployLineaRollup(contractVersion = LineaContractVersion.V5)
.deployLineaRollup(contractVersion = LineaContractVersion.V6)
.get()
@Suppress("DEPRECATION")
l1ContractLegacyClient = l1RollupDeploymentResult.rollupOperatorClientLegacy
Expand Down Expand Up @@ -202,10 +202,10 @@ class MessageServiceIntegrationTest {
.toSafeFuture()
.thenApply { transactionReceipt ->
log.debug("Message has been sent in block {}", transactionReceipt.blockNumber)
val eventValues = LineaRollupV5.staticExtractEventParameters(
LineaRollupV5.MESSAGESENT_EVENT,
val eventValues = LineaRollupV6.staticExtractEventParameters(
LineaRollupV6.MESSAGESENT_EVENT,
transactionReceipt.logs.first { log ->
log.topics.contains(EventEncoder.encode(LineaRollupV5.MESSAGESENT_EVENT))
log.topics.contains(EventEncoder.encode(LineaRollupV6.MESSAGESENT_EVENT))
}
)
MessageSentResult(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package net.consensys.zkevm.ethereum.coordination.messageanchoring

import build.linea.contract.LineaRollupV5
import build.linea.contract.LineaRollupV6
import io.vertx.core.Vertx
import net.consensys.linea.async.toSafeFuture
import net.consensys.toULong
Expand All @@ -24,10 +24,10 @@ class L1EventQuerierImpl(
private val l1Web3jClient: Web3j
) : L1EventQuerier {
companion object {
val encodedMessageSentEvent: String = EventEncoder.encode(LineaRollupV5.MESSAGESENT_EVENT)
val encodedMessageSentEvent: String = EventEncoder.encode(LineaRollupV6.MESSAGESENT_EVENT)

fun parseMessageSentEventLogs(log: Log): SendMessageEvent {
val messageSentEvent = LineaRollupV5.getMessageSentEventFromLog(log)
val messageSentEvent = LineaRollupV6.getMessageSentEventFromLog(log)
return SendMessageEvent(
Bytes32.wrap(messageSentEvent._messageHash),
messageSentEvent._nonce.toULong(),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package net.consensys.zkevm.ethereum.coordination.messageanchoring

import build.linea.contract.LineaRollupV5
import build.linea.contract.LineaRollupV6
import io.vertx.core.Vertx
import io.vertx.junit5.Timeout
import io.vertx.junit5.VertxExtension
Expand Down Expand Up @@ -603,7 +603,7 @@ class L1EventQuerierImplTest {

private fun createRandomSendEvent(blockNumber: String, logIndex: String): LogResult<Log> {
val log = Log()
val eventSignature: String = EventEncoder.encode(LineaRollupV5.MESSAGESENT_EVENT)
val eventSignature: String = EventEncoder.encode(LineaRollupV6.MESSAGESENT_EVENT)
val messageHashValue = Bytes32.random()
val messageHash = org.web3j.abi.datatypes.generated.Bytes32(messageHashValue.toArray())

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ interface ContractsManager {
fun deployRollupAndL2MessageService(
dataCompressionAndProofAggregationMigrationBlock: ULong = 1000UL,
numberOfOperators: Int = 1,
l1ContractVersion: LineaContractVersion = LineaContractVersion.V5
l1ContractVersion: LineaContractVersion = LineaContractVersion.V6
): SafeFuture<ContactsDeploymentResult>

fun connectToLineaRollupContract(
Expand Down
Loading

0 comments on commit ea0ee73

Please sign in to comment.