Skip to content

Commit

Permalink
Node: Linea supports finalized
Browse files Browse the repository at this point in the history
  • Loading branch information
bruce-riley committed Sep 6, 2024
1 parent ff9c4b1 commit a15f17d
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 5,557 deletions.
27 changes: 8 additions & 19 deletions node/cmd/guardiand/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,8 @@ var (
xlayerRPC *string
xlayerContract *string

lineaRPC *string
lineaContract *string
lineaRollUpUrl *string
lineaRollUpContract *string
lineaRPC *string
lineaContract *string

berachainRPC *string
berachainContract *string
Expand Down Expand Up @@ -389,8 +387,6 @@ func init() {

lineaRPC = node.RegisterFlagWithValidationOrFail(NodeCmd, "lineaRPC", "Linea RPC URL", "ws://eth-devnet:8545", []string{"ws", "wss"})
lineaContract = NodeCmd.Flags().String("lineaContract", "", "Linea contract address")
lineaRollUpUrl = NodeCmd.Flags().String("lineaRollUpUrl", "", "Linea roll up URL")
lineaRollUpContract = NodeCmd.Flags().String("lineaRollUpContract", "", "Linea roll up contract address")

berachainRPC = node.RegisterFlagWithValidationOrFail(NodeCmd, "berachainRPC", "Berachain RPC URL", "ws://eth-devnet:8545", []string{"ws", "wss"})
berachainContract = NodeCmd.Flags().String("berachainContract", "", "Berachain contract address")
Expand Down Expand Up @@ -759,6 +755,7 @@ func runNode(cmd *cobra.Command, args []string) {
*mantleContract = checkEvmArgs(logger, *mantleRPC, *mantleContract, "mantle", true)
*blastContract = checkEvmArgs(logger, *blastRPC, *blastContract, "blast", true)
*xlayerContract = checkEvmArgs(logger, *xlayerRPC, *xlayerContract, "xlayer", true)
*lineaContract = checkEvmArgs(logger, *lineaRPC, *lineaContract, "linea", true)
*berachainContract = checkEvmArgs(logger, *berachainRPC, *berachainContract, "berachain", false)
*snaxchainContract = checkEvmArgs(logger, *snaxchainRPC, *snaxchainContract, "snaxchain", true)

Expand All @@ -770,12 +767,6 @@ func runNode(cmd *cobra.Command, args []string) {
*holeskyContract = checkEvmArgs(logger, *holeskyRPC, *holeskyContract, "holesky", false)
*polygonSepoliaContract = checkEvmArgs(logger, *polygonSepoliaRPC, *polygonSepoliaContract, "polygonSepolia", false)

// Linea requires a couple of additional parameters.
*lineaContract = checkEvmArgs(logger, *lineaRPC, *lineaContract, "linea", false)
if (*lineaRPC != "") && (*lineaRollUpUrl == "" || *lineaRollUpContract == "") && env != common.UnsafeDevNet {
logger.Fatal("If --lineaRPC is specified, --lineaRollUpUrl and --lineaRollUpContract must also be specified")
}

if !argsConsistent([]string{*solanaContract, *solanaRPC}) {
logger.Fatal("Both --solanaContract and --solanaRPC must be set or both unset")
}
Expand Down Expand Up @@ -1309,13 +1300,11 @@ func runNode(cmd *cobra.Command, args []string) {

if shouldStart(lineaRPC) {
wc := &evm.WatcherConfig{
NetworkID: "linea",
ChainID: vaa.ChainIDLinea,
Rpc: *lineaRPC,
Contract: *lineaContract,
CcqBackfillCache: *ccqBackfillCache,
LineaRollUpUrl: *lineaRollUpUrl,
LineaRollUpContract: *lineaRollUpContract,
NetworkID: "linea",
ChainID: vaa.ChainIDLinea,
Rpc: *lineaRPC,
Contract: *lineaContract,
CcqBackfillCache: *ccqBackfillCache,
}

watcherConfigs = append(watcherConfigs, wc)
Expand Down
13 changes: 0 additions & 13 deletions node/pkg/watchers/evm/config.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package evm

import (
"errors"

"github.com/certusone/wormhole/node/pkg/common"
gossipv1 "github.com/certusone/wormhole/node/pkg/proto/gossip/v1"
"github.com/certusone/wormhole/node/pkg/query"
Expand All @@ -22,10 +20,6 @@ type WatcherConfig struct {
L1FinalizerRequired watchers.NetworkID // (optional)
l1Finalizer interfaces.L1Finalizer
CcqBackfillCache bool

// These parameters are currently only used for Linea and should be set via SetLineaParams()
LineaRollUpUrl string
LineaRollUpContract string
}

func (wc *WatcherConfig) GetNetworkID() watchers.NetworkID {
Expand Down Expand Up @@ -63,12 +57,5 @@ func (wc *WatcherConfig) Create(

watcher := NewEthWatcher(wc.Rpc, eth_common.HexToAddress(wc.Contract), string(wc.NetworkID), wc.ChainID, msgC, setWriteC, obsvReqC, queryReqC, queryResponseC, devMode, wc.CcqBackfillCache)
watcher.SetL1Finalizer(wc.l1Finalizer)
if wc.ChainID == vaa.ChainIDLinea {
if err := watcher.SetLineaParams(wc.LineaRollUpUrl, wc.LineaRollUpContract); err != nil {
return nil, nil, err
}
} else if wc.LineaRollUpUrl != "" || wc.LineaRollUpContract != "" {
return nil, nil, errors.New("LineaRollUpUrl and LineaRollUpContract may only be specified for Linea")
}
return watcher, watcher.Run, nil
}
218 changes: 0 additions & 218 deletions node/pkg/watchers/evm/connectors/linea_poller.go

This file was deleted.

5,268 changes: 0 additions & 5,268 deletions node/pkg/watchers/evm/connectors/lineaabi/LineaRollup.go

This file was deleted.

Loading

0 comments on commit a15f17d

Please sign in to comment.