From 40f73cb0e14f4e0cb06c09d4937d03d434c5cd8f Mon Sep 17 00:00:00 2001 From: Intizar Date: Thu, 26 Dec 2024 19:57:24 +0900 Subject: [PATCH] move start block num from cfg to node --- sequencer/cfg.toml | 2 -- sequencer/config/config.go | 3 +-- sequencer/node/node.go | 18 +++--------------- 3 files changed, 4 insertions(+), 19 deletions(-) diff --git a/sequencer/cfg.toml b/sequencer/cfg.toml index ecebb55..6f47fdc 100644 --- a/sequencer/cfg.toml +++ b/sequencer/cfg.toml @@ -73,8 +73,6 @@ StatsUpdateFrequencyDivider = 100 [SmartContracts] ## Smart contract address of the rollup contract Rollup = "0xd2Fcf423780E5D4e6F8fD4F3c7aa931454DFB9c4" -## block number of the Smart contract to sync from -StartBlockNum = 379608 [Coordinator] ## Ethereum address that the coordinator is using to forge batches diff --git a/sequencer/config/config.go b/sequencer/config/config.go index b05f294..a1df97b 100644 --- a/sequencer/config/config.go +++ b/sequencer/config/config.go @@ -302,8 +302,7 @@ type Node struct { } `validate:"required"` SmartContracts struct { // Rollup is the address of the Hermez.sol smart contract - Rollup ethCommon.Address `validate:"required" env:"TONNODE_SMARTCONTRACTS_ROLLUP"` - StartBlockNum int64 `validate:"required"` + Rollup ethCommon.Address `validate:"required" env:"TONNODE_SMARTCONTRACTS_ROLLUP"` } `validate:"required"` API APIConfigParameters `validate:"required"` RecommendedFeePolicy stateapiupdater.RecommendedFeePolicy `validate:"required"` diff --git a/sequencer/node/node.go b/sequencer/node/node.go index bc71453..cbb27f3 100644 --- a/sequencer/node/node.go +++ b/sequencer/node/node.go @@ -42,20 +42,8 @@ import ( const SyncTime = 24 * 60 * time.Minute -// Mode sets the working mode of the node (synchronizer or coordinator) -// type Mode string - -// const ( -// // ModeCoordinator defines the mode of the HermezNode as Coordinator, which -// // means that the node is set to forge (which also will be synchronizing with -// // the L1 blockchain state) -// ModeCoordinator Mode = "coordinator" - -// // ModeSynchronizer defines the mode of the HermezNode as Synchronizer, which -// // means that the node is set to only synchronize with the L1 blockchain state -// // and will not forge -// ModeSynchronizer Mode = "synchronizer" -// ) +// block number of the Smart contract to sync from +const RollupStartBlockNum = 379608 // Node is the Hermez Node type Node struct { @@ -266,7 +254,7 @@ func NewNode(cfg *config.Node, version string) (*Node, error) { StatsUpdateBlockNumDiffThreshold: cfg.Synchronizer.StatsUpdateBlockNumDiffThreshold, StatsUpdateFrequencyDivider: cfg.Synchronizer.StatsUpdateFrequencyDivider, ChainID: chainIDU64, - StartBlockNum: cfg.SmartContracts.StartBlockNum, + StartBlockNum: RollupStartBlockNum, }) if err != nil { return nil, common.Wrap(err)