-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* rename to linea-finalized-tag-plugin --------- Co-authored-by: jonesho <[email protected]> Co-authored-by: jonesho <[email protected]>
- Loading branch information
1 parent
6a81227
commit 2f5dd49
Showing
17 changed files
with
90 additions
and
79 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
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
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
5 changes: 0 additions & 5 deletions
5
finalized-tag-updater/src/main/java/net/consensys/linea/consensus/EngineBlockTagUpdater.java
This file was deleted.
Oops, something went wrong.
47 changes: 0 additions & 47 deletions
47
...g-updater/src/main/java/net/consensys/linea/consensus/L1FinalizationTagUpdaterPlugin.java
This file was deleted.
Oops, something went wrong.
5 changes: 5 additions & 0 deletions
5
finalized-tag-updater/src/main/kotlin/linea/consensus/EngineBlockTagUpdater.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,5 @@ | ||
package linea.consensus | ||
|
||
interface EngineBlockTagUpdater { | ||
fun lineaUpdateFinalizedBlockV1(finalizedBlockNumber: Long) | ||
} |
47 changes: 47 additions & 0 deletions
47
finalized-tag-updater/src/main/kotlin/linea/consensus/LineaL1FinalizationTagUpdaterPlugin.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,47 @@ | ||
package linea.consensus | ||
|
||
import io.vertx.core.Vertx | ||
import net.consensys.linea.LineaBesuEngineBlockTagUpdater | ||
import net.consensys.linea.LineaL1FinalizationUpdaterService | ||
import net.consensys.linea.PluginCliOptions | ||
import net.consensys.linea.async.toSafeFuture | ||
import org.hyperledger.besu.plugin.BesuPlugin | ||
import org.hyperledger.besu.plugin.ServiceManager | ||
import org.hyperledger.besu.plugin.services.BlockchainService | ||
import org.hyperledger.besu.plugin.services.PicoCLIOptions | ||
|
||
class LineaL1FinalizationTagUpdaterPlugin : BesuPlugin { | ||
private val cliOptions = PluginCliOptions() | ||
private val vertx: Vertx = Vertx.vertx() | ||
private lateinit var service: LineaL1FinalizationUpdaterService | ||
private lateinit var blockchainService: BlockchainService | ||
|
||
override fun register(serviceManager: ServiceManager) { | ||
val cmdlineOptions = serviceManager.getService(PicoCLIOptions::class.java) | ||
.orElseThrow { IllegalStateException("Failed to obtain PicoCLI options from the BesuContext") } | ||
cmdlineOptions.addPicoCLIOptions(CLI_OPTIONS_PREFIX, cliOptions) | ||
|
||
blockchainService = serviceManager.getService(BlockchainService::class.java) | ||
.orElseThrow { RuntimeException("Failed to obtain BlockchainService from the BesuContext.") } | ||
} | ||
|
||
override fun start() { | ||
service = LineaL1FinalizationUpdaterService( | ||
vertx, | ||
cliOptions.getConfig(), | ||
LineaBesuEngineBlockTagUpdater(blockchainService) | ||
) | ||
service.start() | ||
} | ||
|
||
override fun stop() { | ||
service.stop() | ||
.thenCompose { | ||
vertx.close().toSafeFuture() | ||
}.get() | ||
} | ||
|
||
companion object { | ||
private const val CLI_OPTIONS_PREFIX = "linea" | ||
} | ||
} |
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
1 change: 1 addition & 0 deletions
1
...d-tag-updater/src/main/resources/META-INF/services/org.hyperledger.besu.plugin.BesuPlugin
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 @@ | ||
linea.consensus.LineaL1FinalizationTagUpdaterPlugin |
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