From f2313d281542c765d5ef0a6fc2a2c6d372309363 Mon Sep 17 00:00:00 2001 From: Iulian Pascalau Date: Mon, 15 Nov 2021 13:16:01 +0200 Subject: [PATCH 1/3] - new config files --- cmd/bridge/config/config.toml | 4 +- cmd/bridge/config/config_binance.toml | 91 ++++++++++++++++++++++++++ cmd/bridge/config/config_ethereum.toml | 91 ++++++++++++++++++++++++++ 3 files changed, 184 insertions(+), 2 deletions(-) create mode 100644 cmd/bridge/config/config_binance.toml create mode 100644 cmd/bridge/config/config_ethereum.toml diff --git a/cmd/bridge/config/config.toml b/cmd/bridge/config/config.toml index 2378f67a..1c23c019 100644 --- a/cmd/bridge/config/config.toml +++ b/cmd/bridge/config/config.toml @@ -23,13 +23,13 @@ Sign = 8000000 ProposeTransferBase = 11000000 ProposeTransferForEach = 3000000 - ProposeStatus = 30000000 # TODO check this + ProposeStatus = 30000000 PerformActionBase = 25000000 PerformActionForEach = 2000000 [P2P] Port = "10010" - Seed = "seed-elrond-eth-bridge-0" + Seed = "" InitialPeerList = [] ProtocolID = "/erd/relay/1.0.0" diff --git a/cmd/bridge/config/config_binance.toml b/cmd/bridge/config/config_binance.toml new file mode 100644 index 00000000..8d56aad1 --- /dev/null +++ b/cmd/bridge/config/config_binance.toml @@ -0,0 +1,91 @@ +[Eth] + NetworkAddress = "http://127.0.0.1:8545" # a network address + BridgeAddress = "3009d97FfeD62E57d444e552A9eDF9Ee6Bc8644c" # the eth address for the bridge contract + SafeContractAddress = "A6504Cc508889bbDBd4B748aFf6EA6b5D0d2684c" + PrivateKeyFile = "config/ethereum.sk" # the path to the file containing the relayer eth private key + GasLimit = 500000 + ERC20Contracts = ["d1135C0307CEB01FD4728db8e5B8D38fbf984F9a"] + [Eth.GasStation] + Enabled = false + URL = "https://ethgasstation.info/api/ethgasAPI.json?" # gas station URL. Suggestion to provide the api-key here + PollingIntervalInSeconds = 60 # number of seconds between gas price polling + RequestTimeInSeconds = 2 # maximum timeout (in seconds) for the gas price request + MaximumAllowedGasPrice = 3000 # maximum value allowed for the fetched gas price value + # GasPriceSelector available options: "fast", "fastest", "safeLow", "average" + GasPriceSelector = "safeLow" # selector used to provide the gas price + +[Elrond] + NetworkAddress = "https://devnet-gateway.elrond.com" # the network address + BridgeAddress = "erd1qqqqqqqqqqqqqpgqzyuaqg3dl7rqlkudrsnm5ek0j3a97qevd8sszj0glf" # the elrond address for the bridge contract + PrivateKeyFile = "config/elrond.pem" # the path to the pem file containing the relayer elrond wallet + IntervalToResendTxsInSeconds = 60 # the time in seconds between nonce reads + [Elrond.GasMap] + Sign = 8000000 + ProposeTransferBase = 11000000 + ProposeTransferForEach = 3000000 + ProposeStatus = 30000000 + PerformActionBase = 25000000 + PerformActionForEach = 2000000 + +[P2P] + Port = "10010" + Seed = "" + InitialPeerList = [] + ProtocolID = "/erd/relay/2.0.0" + +[Relayer] + [Relayer.Marshalizer] + Type = "gogo protobuf" + SizeCheckDelta = 10 + [Relayer.RoleProvider] + UsePolling = true + PollingIntervalInMillis = 60000 # 1 minute + [Relayer.StatusMetricsStorage] + [Relayer.StatusMetricsStorage.Cache] + Name = "StatusMetricsStorage" + Capacity = 1000 + Type = "LRU" + [Relayer.StatusMetricsStorage.DB] + FilePath = "StatusMetricsStorageDB" + Type = "LvlDBSerial" + BatchDelaySeconds = 2 + MaxBatchSize = 100 + MaxOpenFiles = 10 + +[StateMachine] + [StateMachine.EthToElrond] + StepDurationInMillis = 6000 + Steps = [ + { Name = "getting the pending transactions", DurationInMillis = 12000 }, + { Name = "proposing transfer", DurationInMillis = 12000 }, + { Name = "waiting signatures for propose transfer", DurationInMillis = 12000 }, + { Name = "executing transfer", DurationInMillis = 12000 }, + { Name = "proposing set status", DurationInMillis = 600000 }, # 10 minutes + { Name = "waiting signatures for propose set status", DurationInMillis = 12000 }, + { Name = "executing set status", DurationInMillis = 12000 } + ] + [StateMachine.ElrondToEth] + StepDurationInMillis = 6000 + Steps = [ + { Name = "getting the pending transactions", DurationInMillis = 12000 }, + { Name = "proposing transfer", DurationInMillis = 12000 }, + { Name = "waiting signatures for propose transfer", DurationInMillis = 12000 }, + { Name = "executing transfer", DurationInMillis = 600000 }, # 10 minutes + { Name = "proposing set status", DurationInMillis = 12000 }, + { Name = "waiting signatures for propose set status", DurationInMillis = 12000 }, + { Name = "executing set status", DurationInMillis = 12000 } + ] +[Logs] + LogFileLifeSpanInSec = 86400 # 24h + +[Antiflood] + Enabled = true + [Antiflood.WebServer] + # SimultaneousRequests represents the number of concurrent requests accepted by the web server + # this is a global throttler that acts on all http connections regardless of the originating source + SimultaneousRequests = 100 + # SameSourceRequests defines how many requests are allowed from the same source in the specified + # time frame (SameSourceResetIntervalInSec) + SameSourceRequests = 10000 + # SameSourceResetIntervalInSec time frame between counter reset, in seconds + SameSourceResetIntervalInSec = 1 diff --git a/cmd/bridge/config/config_ethereum.toml b/cmd/bridge/config/config_ethereum.toml new file mode 100644 index 00000000..1c23c019 --- /dev/null +++ b/cmd/bridge/config/config_ethereum.toml @@ -0,0 +1,91 @@ +[Eth] + NetworkAddress = "http://127.0.0.1:8545" # a network address + BridgeAddress = "3009d97FfeD62E57d444e552A9eDF9Ee6Bc8644c" # the eth address for the bridge contract + SafeContractAddress = "A6504Cc508889bbDBd4B748aFf6EA6b5D0d2684c" + PrivateKeyFile = "config/ethereum.sk" # the path to the file containing the relayer eth private key + GasLimit = 500000 + ERC20Contracts = ["d1135C0307CEB01FD4728db8e5B8D38fbf984F9a"] + [Eth.GasStation] + Enabled = true + URL = "https://ethgasstation.info/api/ethgasAPI.json?" # gas station URL. Suggestion to provide the api-key here + PollingIntervalInSeconds = 60 # number of seconds between gas price polling + RequestTimeInSeconds = 2 # maximum timeout (in seconds) for the gas price request + MaximumAllowedGasPrice = 3000 # maximum value allowed for the fetched gas price value + # GasPriceSelector available options: "fast", "fastest", "safeLow", "average" + GasPriceSelector = "safeLow" # selector used to provide the gas price + +[Elrond] + NetworkAddress = "https://devnet-gateway.elrond.com" # the network address + BridgeAddress = "erd1qqqqqqqqqqqqqpgqzyuaqg3dl7rqlkudrsnm5ek0j3a97qevd8sszj0glf" # the elrond address for the bridge contract + PrivateKeyFile = "config/elrond.pem" # the path to the pem file containing the relayer elrond wallet + IntervalToResendTxsInSeconds = 60 # the time in seconds between nonce reads + [Elrond.GasMap] + Sign = 8000000 + ProposeTransferBase = 11000000 + ProposeTransferForEach = 3000000 + ProposeStatus = 30000000 + PerformActionBase = 25000000 + PerformActionForEach = 2000000 + +[P2P] + Port = "10010" + Seed = "" + InitialPeerList = [] + ProtocolID = "/erd/relay/1.0.0" + +[Relayer] + [Relayer.Marshalizer] + Type = "gogo protobuf" + SizeCheckDelta = 10 + [Relayer.RoleProvider] + UsePolling = true + PollingIntervalInMillis = 60000 # 1 minute + [Relayer.StatusMetricsStorage] + [Relayer.StatusMetricsStorage.Cache] + Name = "StatusMetricsStorage" + Capacity = 1000 + Type = "LRU" + [Relayer.StatusMetricsStorage.DB] + FilePath = "StatusMetricsStorageDB" + Type = "LvlDBSerial" + BatchDelaySeconds = 2 + MaxBatchSize = 100 + MaxOpenFiles = 10 + +[StateMachine] + [StateMachine.EthToElrond] + StepDurationInMillis = 6000 + Steps = [ + { Name = "getting the pending transactions", DurationInMillis = 12000 }, + { Name = "proposing transfer", DurationInMillis = 12000 }, + { Name = "waiting signatures for propose transfer", DurationInMillis = 12000 }, + { Name = "executing transfer", DurationInMillis = 12000 }, + { Name = "proposing set status", DurationInMillis = 600000 }, # 10 minutes + { Name = "waiting signatures for propose set status", DurationInMillis = 12000 }, + { Name = "executing set status", DurationInMillis = 12000 } + ] + [StateMachine.ElrondToEth] + StepDurationInMillis = 6000 + Steps = [ + { Name = "getting the pending transactions", DurationInMillis = 12000 }, + { Name = "proposing transfer", DurationInMillis = 12000 }, + { Name = "waiting signatures for propose transfer", DurationInMillis = 12000 }, + { Name = "executing transfer", DurationInMillis = 600000 }, # 10 minutes + { Name = "proposing set status", DurationInMillis = 12000 }, + { Name = "waiting signatures for propose set status", DurationInMillis = 12000 }, + { Name = "executing set status", DurationInMillis = 12000 } + ] +[Logs] + LogFileLifeSpanInSec = 86400 # 24h + +[Antiflood] + Enabled = true + [Antiflood.WebServer] + # SimultaneousRequests represents the number of concurrent requests accepted by the web server + # this is a global throttler that acts on all http connections regardless of the originating source + SimultaneousRequests = 100 + # SameSourceRequests defines how many requests are allowed from the same source in the specified + # time frame (SameSourceResetIntervalInSec) + SameSourceRequests = 10000 + # SameSourceResetIntervalInSec time frame between counter reset, in seconds + SameSourceResetIntervalInSec = 1 From 7e3df13f9dcb62039686da9b75ca623346c53391 Mon Sep 17 00:00:00 2001 From: Iulian Pascalau Date: Mon, 15 Nov 2021 13:24:58 +0200 Subject: [PATCH 2/3] - adjustments for bsc --- cmd/bridge/config/config_binance.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/bridge/config/config_binance.toml b/cmd/bridge/config/config_binance.toml index 8d56aad1..89260728 100644 --- a/cmd/bridge/config/config_binance.toml +++ b/cmd/bridge/config/config_binance.toml @@ -60,7 +60,7 @@ { Name = "proposing transfer", DurationInMillis = 12000 }, { Name = "waiting signatures for propose transfer", DurationInMillis = 12000 }, { Name = "executing transfer", DurationInMillis = 12000 }, - { Name = "proposing set status", DurationInMillis = 600000 }, # 10 minutes + { Name = "proposing set status", DurationInMillis = 120000 }, # 2 minutes { Name = "waiting signatures for propose set status", DurationInMillis = 12000 }, { Name = "executing set status", DurationInMillis = 12000 } ] @@ -70,7 +70,7 @@ { Name = "getting the pending transactions", DurationInMillis = 12000 }, { Name = "proposing transfer", DurationInMillis = 12000 }, { Name = "waiting signatures for propose transfer", DurationInMillis = 12000 }, - { Name = "executing transfer", DurationInMillis = 600000 }, # 10 minutes + { Name = "executing transfer", DurationInMillis = 120000 }, # 2 minutes { Name = "proposing set status", DurationInMillis = 12000 }, { Name = "waiting signatures for propose set status", DurationInMillis = 12000 }, { Name = "executing set status", DurationInMillis = 12000 } From b6c44c8bca33d6df1c12bb0f39a8664d85fca64e Mon Sep 17 00:00:00 2001 From: Iulian Pascalau Date: Mon, 15 Nov 2021 22:38:38 +0200 Subject: [PATCH 3/3] - new ERC20 contract --- cmd/bridge/config/config_ethereum.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/bridge/config/config_ethereum.toml b/cmd/bridge/config/config_ethereum.toml index 1c23c019..058ae511 100644 --- a/cmd/bridge/config/config_ethereum.toml +++ b/cmd/bridge/config/config_ethereum.toml @@ -4,7 +4,7 @@ SafeContractAddress = "A6504Cc508889bbDBd4B748aFf6EA6b5D0d2684c" PrivateKeyFile = "config/ethereum.sk" # the path to the file containing the relayer eth private key GasLimit = 500000 - ERC20Contracts = ["d1135C0307CEB01FD4728db8e5B8D38fbf984F9a"] + ERC20Contracts = ["d1135C0307CEB01FD4728db8e5B8D38fbf984F9a", "214E935c87454e70B415510fBDf8528c1A1363D5"] [Eth.GasStation] Enabled = true URL = "https://ethgasstation.info/api/ethgasAPI.json?" # gas station URL. Suggestion to provide the api-key here