Skip to content

Commit

Permalink
move start block num from cfg to node
Browse files Browse the repository at this point in the history
  • Loading branch information
Intizar-T committed Dec 26, 2024
1 parent 27003aa commit 40f73cb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 19 deletions.
2 changes: 0 additions & 2 deletions sequencer/cfg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions sequencer/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down
18 changes: 3 additions & 15 deletions sequencer/node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 40f73cb

Please sign in to comment.