From 1cb94091360572cae1aa0cecf7364973fe1005a1 Mon Sep 17 00:00:00 2001 From: Rachit Sonthalia Date: Tue, 6 Aug 2024 15:07:25 +0530 Subject: [PATCH 1/2] wip --- aggoracle/config.go | 7 +++---- config/default.go | 4 ++-- l1infotreesync/l1infotreesync.go | 9 ++++----- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/aggoracle/config.go b/aggoracle/config.go index 2dd39403..0d6025d0 100644 --- a/aggoracle/config.go +++ b/aggoracle/config.go @@ -16,10 +16,9 @@ var ( ) type Config struct { - TargetChainType TargetChainType `mapstructure:"TargetChainType"` - URLRPCL1 string `mapstructure:"URLRPCL1"` - // TODO: BlockFinality doesnt work as per the jsonschema - BlockFinality string `jsonschema:"enum=latest,enum=safe, enum=pending, enum=finalized" mapstructure:"BlockFinality"` + TargetChainType TargetChainType `mapstructure:"TargetChainType"` + URLRPCL1 string `mapstructure:"URLRPCL1"` + BlockFinality string `jsonschema:"enum=LatestBlock, enum=SafeBlock, enum=PendingBlock, enum=FinalizedBlock, enum=EarliestBlock" mapstructure:"BlockFinality"` WaitPeriodNextGER types.Duration `mapstructure:"WaitPeriodNextGER"` EVMSender chaingersender.EVMConfig `mapstructure:"EVMSender"` } diff --git a/config/default.go b/config/default.go index 85dbd1cd..54d224ad 100644 --- a/config/default.go +++ b/config/default.go @@ -126,7 +126,7 @@ DBPath = "/tmp/reorgdetector" DBPath = "/tmp/L1InfoTreeSync" GlobalExitRootAddr="0x8464135c8F25Da09e49BC8782676a84730C318bC" SyncBlockChunkSize=10 -BlockFinality="latest" +BlockFinality="LatestBlock" URLRPCL1="http://test-aggoracle-l1:8545" WaitForNewBlocksPeriod="100ms" InitialBlock=0 @@ -134,7 +134,7 @@ InitialBlock=0 [AggOracle] TargetChainType="EVM" URLRPCL1="http://test-aggoracle-l1:8545" -BlockFinality="latest" +BlockFinality="LatestBlock" WaitPeriodNextGER="100ms" [EVMSender] GlobalExitRootL2="0x8464135c8F25Da09e49BC8782676a84730C318bC" diff --git a/l1infotreesync/l1infotreesync.go b/l1infotreesync/l1infotreesync.go index 7b3be753..1fa06473 100644 --- a/l1infotreesync/l1infotreesync.go +++ b/l1infotreesync/l1infotreesync.go @@ -16,11 +16,10 @@ const ( ) type Config struct { - DBPath string `mapstructure:"DBPath"` - GlobalExitRootAddr common.Address `mapstructure:"GlobalExitRootAddr"` - SyncBlockChunkSize uint64 `mapstructure:"SyncBlockChunkSize"` - // TODO: BlockFinality doesnt work as per the jsonschema - BlockFinality string `jsonschema:"enum=latest,enum=safe, enum=pending, enum=finalized" mapstructure:"BlockFinality"` + DBPath string `mapstructure:"DBPath"` + GlobalExitRootAddr common.Address `mapstructure:"GlobalExitRootAddr"` + SyncBlockChunkSize uint64 `mapstructure:"SyncBlockChunkSize"` + BlockFinality string `jsonschema:"enum=LatestBlock, enum=SafeBlock, enum=PendingBlock, enum=FinalizedBlock, enum=EarliestBlock" mapstructure:"BlockFinality"` URLRPCL1 string `mapstructure:"URLRPCL1"` WaitForNewBlocksPeriod types.Duration `mapstructure:"WaitForNewBlocksPeriod"` InitialBlock uint64 `mapstructure:"InitialBlock"` From b80dd2fbc4b402c2e6e54f3feb125ff749e9a24f Mon Sep 17 00:00:00 2001 From: Rachit Sonthalia Date: Fri, 9 Aug 2024 11:10:53 +0530 Subject: [PATCH 2/2] wip --- config/default.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config/default.go b/config/default.go index 54d224ad..b66ae1b4 100644 --- a/config/default.go +++ b/config/default.go @@ -136,14 +136,14 @@ TargetChainType="EVM" URLRPCL1="http://test-aggoracle-l1:8545" BlockFinality="LatestBlock" WaitPeriodNextGER="100ms" - [EVMSender] + [AggOracle.EVMSender] GlobalExitRootL2="0x8464135c8F25Da09e49BC8782676a84730C318bC" URLRPCL2="http://test-aggoracle-l2:8545" ChainIDL2=1337 GasOffset=0 WaitPeriodMonitorTx="100ms" SenderAddr="0x70997970c51812dc3a010c7d01b50e0d17dc79c8" - [SequenceSender.EthTxManager] + [AggOracle.EVMSender.EthTxManager] FrequencyToMonitorTxs = "1s" WaitTxToBeMined = "2s" GetReceiptMaxTime = "250ms" @@ -158,7 +158,7 @@ WaitPeriodNextGER="100ms" ReadPendingL1Txs = false SafeStatusL1NumberOfBlocks = 5 FinalizedStatusL1NumberOfBlocks = 10 - [SequenceSender.EthTxManager.Etherman] + [AggOracle.EVMSender.EthTxManager.Etherman] URL = "http://test-aggoracle-l2" MultiGasProvider = false L1ChainID = 1337