Skip to content

Commit 5bc562e

Browse files
authored
Merge the develop branch to the master branch, preparation to v3.4.0
This merge contains the following set of changes: * [Oracle, Improvement] Refetch old logs ranges to see if there are missed events (#627) * [Oracle, Improvement] Add support for EIP1559 gas price oracle (#631) * [Oracle, Improvement] CollectedSignatures AMB watcher for MEV bundling (#634) * [Oracle, Fix] Fix eip1559 transaction sending problems (#632)
2 parents b17fff2 + 72f0d30 commit 5bc562e

37 files changed

+1850
-120
lines changed

CONFIGURATION.md

+8-2
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ COMMON_HOME_RPC_URL | The HTTPS URL(s) used to communicate to the RPC nodes in t
88
COMMON_FOREIGN_RPC_URL | The HTTPS URL(s) used to communicate to the RPC nodes in the Foreign network. Several URLs can be specified, delimited by spaces. If the connection to one of these nodes is lost the next URL is used for connection. | URL(s)
99
COMMON_HOME_BRIDGE_ADDRESS | The address of the bridge contract address in the Home network. It is used to listen to events from and send validators' transactions to the Home network. | hexidecimal beginning with "0x"
1010
COMMON_FOREIGN_BRIDGE_ADDRESS | The address of the bridge contract address in the Foreign network. It is used to listen to events from and send validators' transactions to the Foreign network. | hexidecimal beginning with "0x"
11-
COMMON_HOME_GAS_PRICE_SUPPLIER_URL | The URL used to get a JSON response from the gas price prediction oracle for the Home network. The gas price provided by the oracle is used to send the validator's transactions to the RPC node. Since it is assumed that the Home network has a predefined gas price (e.g. the gas price in the Core of POA.Network is `1 GWei`), the gas price oracle parameter can be omitted for such networks. | URL
11+
COMMON_HOME_GAS_PRICE_SUPPLIER_URL | The URL used to get a JSON response from the gas price prediction oracle for the Home network. The gas price provided by the oracle is used to send the validator's transactions to the RPC node. Since it is assumed that the Home network has a predefined gas price (e.g. the gas price in the Core of POA.Network is `1 GWei`), the gas price oracle parameter can be omitted for such networks. Set to `eip1559-gas-estimation` if you want to use EIP1559 RPC-based gas estimation. | URL
1212
COMMON_HOME_GAS_PRICE_SPEED_TYPE | Assuming the gas price oracle responds with the following JSON structure: `{"fast": 20.0, "block_time": 12.834, "health": true, "standard": 6.0, "block_number": 6470469, "instant": 71.0, "slow": 1.889}`, this parameter specifies the desirable transaction speed. The speed type can be omitted when `COMMON_HOME_GAS_PRICE_SUPPLIER_URL` is not used. | `instant` / `fast` / `standard` / `slow`
1313
COMMON_HOME_GAS_PRICE_FALLBACK | The gas price (in Wei) that is used if both the oracle and the fall back gas price specified in the Home Bridge contract are not available. | integer
1414
COMMON_HOME_GAS_PRICE_FACTOR | A value that will multiply the gas price of the oracle to convert it to gwei. If the oracle API returns gas prices in gwei then this can be set to `1`. Also, it could be used to intentionally pay more gas than suggested by the oracle to guarantee the transaction verification. E.g. `1.25` or `1.5`. | integer
15-
COMMON_FOREIGN_GAS_PRICE_SUPPLIER_URL | The URL used to get a JSON response from the gas price prediction oracle for the Foreign network. The provided gas price is used to send the validator's transactions to the RPC node. If the Foreign network is Ethereum Foundation mainnet, the oracle URL can be: https://gasprice.poa.network. Otherwise this parameter can be omitted. Set to `gas-price-oracle` if you want to use npm `gas-price-oracle` package for retrieving gas price from multiple sources. | URL
15+
COMMON_FOREIGN_GAS_PRICE_SUPPLIER_URL | The URL used to get a JSON response from the gas price prediction oracle for the Foreign network. The provided gas price is used to send the validator's transactions to the RPC node. If the Foreign network is Ethereum Foundation mainnet, the oracle URL can be: https://gasprice.poa.network. Otherwise this parameter can be omitted. Set to `gas-price-oracle` if you want to use npm `gas-price-oracle` package for retrieving gas price from multiple sources. Set to `eip1559-gas-estimation` if you want to use EIP1559 RPC-based gas estimation. | URL
1616
COMMON_FOREIGN_GAS_PRICE_SPEED_TYPE | Assuming the gas price oracle responds with the following JSON structure: `{"fast": 20.0, "block_time": 12.834, "health": true, "standard": 6.0, "block_number": 6470469, "instant": 71.0, "slow": 1.889}`, this parameter specifies the desirable transaction speed. The speed type can be omitted when `COMMON_FOREIGN_GAS_PRICE_SUPPLIER_URL`is not used. | `instant` / `fast` / `standard` / `slow`
1717
COMMON_FOREIGN_GAS_PRICE_FALLBACK | The gas price (in Wei) used if both the oracle and fall back gas price specified in the Foreign Bridge contract are not available. | integer
1818
COMMON_FOREIGN_GAS_PRICE_FACTOR | A value that will multiply the gas price of the oracle to convert it to gwei. If the oracle API returns gas prices in gwei then this can be set to `1`. Also, it could be used to intentionally pay more gas than suggested by the oracle to guarantee the transaction verification. E.g. `1.25` or `1.5`. | integer
@@ -53,6 +53,12 @@ ORACLE_SHUTDOWN_CONTRACT_METHOD | Method signature to be used in the side chain
5353
ORACLE_FOREIGN_RPC_BLOCK_POLLING_LIMIT | Max length for the block range used in `eth_getLogs` requests for polling contract events for the Foreign chain. Infinite, if not provided. | `integer`
5454
ORACLE_HOME_RPC_BLOCK_POLLING_LIMIT | Max length for the block range used in `eth_getLogs` requests for polling contract events for the Home chain. Infinite, if not provided. | `integer`
5555
ORACLE_JSONRPC_ERROR_CODES | Override default JSON rpc error codes that can trigger RPC fallback to the next URL from the list (or a retry in case of a single RPC URL). Default is `-32603,-32002,-32005`. Should be a comma-separated list of negative integers. | `string`
56+
ORACLE_HOME_EVENTS_REPROCESSING | If set to `true`, home events happened in the past will be refetched and processed once again, to ensure that nothing was missed on the first pass. | `bool`
57+
ORACLE_HOME_EVENTS_REPROCESSING_BATCH_SIZE | Batch size for one `eth_getLogs` request when reprocessing old logs in the home chain. Defaults to `1000` | `integer`
58+
ORACLE_HOME_EVENTS_REPROCESSING_BLOCK_DELAY | Block confirmations number, after which old logs are being reprocessed in the home chain. Defaults to `500` | `integer`
59+
ORACLE_FOREIGN_EVENTS_REPROCESSING | If set to `true`, foreign events happened in the past will be refetched and processed once again, to ensure that nothing was missed on the first pass. | `bool`
60+
ORACLE_FOREIGN_EVENTS_REPROCESSING_BATCH_SIZE | Batch size for one `eth_getLogs` request when reprocessing old logs in the foreign chain. Defaults to `500` | `integer`
61+
ORACLE_FOREIGN_EVENTS_REPROCESSING_BLOCK_DELAY | Block confirmations number, after which old logs are being reprocessed in the foreign chain. Defaults to `250` | `integer`
5662

5763

5864
## Monitor configuration

commons/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"test": "NODE_ENV=test mocha"
99
},
1010
"dependencies": {
11+
"@mycrypto/gas-estimation": "^1.1.0",
1112
"gas-price-oracle": "^0.1.5",
1213
"web3-utils": "^1.3.0",
1314
"node-fetch": "^2.1.2"

commons/utils.js

+14-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const { toWei, toBN, BN } = require('web3-utils')
22
const { GasPriceOracle } = require('gas-price-oracle')
3+
const { estimateFees } = require('@mycrypto/gas-estimation')
34
const fetch = require('node-fetch')
45
const { BRIDGE_MODES } = require('./constants')
56
const { REWARDABLE_VALIDATORS_ABI } = require('./abis')
@@ -176,12 +177,20 @@ const gasPriceWithinLimits = (gasPrice, limits) => {
176177
const normalizeGasPrice = (oracleGasPrice, factor, limits = null) => {
177178
let gasPrice = oracleGasPrice * factor
178179
gasPrice = gasPriceWithinLimits(gasPrice, limits)
179-
return toBN(toWei(gasPrice.toFixed(2).toString(), 'gwei'))
180+
return toWei(gasPrice.toFixed(2).toString(), 'gwei')
180181
}
181182

182-
const gasPriceFromSupplier = async (url, options = {}) => {
183+
const gasPriceFromSupplier = async (web3, url, options = {}) => {
183184
try {
184185
let json
186+
if (url === 'eip1559-gas-estimation') {
187+
const { maxFeePerGas, maxPriorityFeePerGas } = await estimateFees(web3)
188+
const res = { maxFeePerGas: maxFeePerGas.toString(10), maxPriorityFeePerGas: maxPriorityFeePerGas.toString(10) }
189+
options.logger &&
190+
options.logger.debug &&
191+
options.logger.debug(res, 'Gas price updated using eip1559-gas-estimation')
192+
return res
193+
}
185194
if (url === 'gas-price-oracle') {
186195
json = await gasPriceOracle.fetchGasPricesOffChain()
187196
} else if (url) {
@@ -205,7 +214,7 @@ const gasPriceFromSupplier = async (url, options = {}) => {
205214
options.logger.debug &&
206215
options.logger.debug({ oracleGasPrice, normalizedGasPrice }, 'Gas price updated using the API')
207216

208-
return normalizedGasPrice
217+
return { gasPrice: normalizedGasPrice }
209218
} catch (e) {
210219
options.logger && options.logger.error && options.logger.error(`Gas Price API is not available. ${e.message}`)
211220
}
@@ -214,11 +223,11 @@ const gasPriceFromSupplier = async (url, options = {}) => {
214223

215224
const gasPriceFromContract = async (bridgeContract, options = {}) => {
216225
try {
217-
const gasPrice = await bridgeContract.methods.gasPrice().call()
226+
const gasPrice = (await bridgeContract.methods.gasPrice().call()).toString()
218227
options.logger &&
219228
options.logger.debug &&
220229
options.logger.debug({ gasPrice }, 'Gas price updated using the contracts')
221-
return gasPrice
230+
return { gasPrice }
222231
} catch (e) {
223232
options.logger &&
224233
options.logger.error &&

e2e-commons/components-envs/oracle-amb.env

+6
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,9 @@ ORACLE_HOME_START_BLOCK=1
2323
ORACLE_FOREIGN_START_BLOCK=1
2424
ORACLE_HOME_TO_FOREIGN_BLOCK_LIST=/mono/oracle/access-lists/block_list.txt
2525
ORACLE_FOREIGN_ARCHIVE_RPC_URL=http://parity2:8545
26+
ORACLE_HOME_EVENTS_REPROCESSING=false
27+
ORACLE_HOME_EVENTS_REPROCESSING_BATCH_SIZE=10
28+
ORACLE_HOME_EVENTS_REPROCESSING_BLOCK_DELAY=10
29+
ORACLE_FOREIGN_EVENTS_REPROCESSING=true
30+
ORACLE_FOREIGN_EVENTS_REPROCESSING_BATCH_SIZE=10
31+
ORACLE_FOREIGN_EVENTS_REPROCESSING_BLOCK_DELAY=10

e2e-commons/components-envs/oracle-erc20-native.env

+6
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,9 @@ ORACLE_ALLOW_HTTP_FOR_RPC=yes
2222
ORACLE_HOME_START_BLOCK=1
2323
ORACLE_FOREIGN_START_BLOCK=1
2424
ORACLE_HOME_TO_FOREIGN_BLOCK_LIST=/mono/oracle/access-lists/block_list.txt
25+
ORACLE_HOME_EVENTS_REPROCESSING=true
26+
ORACLE_HOME_EVENTS_REPROCESSING_BATCH_SIZE=10
27+
ORACLE_HOME_EVENTS_REPROCESSING_BLOCK_DELAY=10
28+
ORACLE_FOREIGN_EVENTS_REPROCESSING=true
29+
ORACLE_FOREIGN_EVENTS_REPROCESSING_BATCH_SIZE=10
30+
ORACLE_FOREIGN_EVENTS_REPROCESSING_BLOCK_DELAY=10

oracle/config/base.config.js

+19-3
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,13 @@ const {
2323
ORACLE_HOME_START_BLOCK,
2424
ORACLE_FOREIGN_START_BLOCK,
2525
ORACLE_HOME_RPC_BLOCK_POLLING_LIMIT,
26-
ORACLE_FOREIGN_RPC_BLOCK_POLLING_LIMIT
26+
ORACLE_FOREIGN_RPC_BLOCK_POLLING_LIMIT,
27+
ORACLE_HOME_EVENTS_REPROCESSING,
28+
ORACLE_HOME_EVENTS_REPROCESSING_BATCH_SIZE,
29+
ORACLE_HOME_EVENTS_REPROCESSING_BLOCK_DELAY,
30+
ORACLE_FOREIGN_EVENTS_REPROCESSING,
31+
ORACLE_FOREIGN_EVENTS_REPROCESSING_BATCH_SIZE,
32+
ORACLE_FOREIGN_EVENTS_REPROCESSING_BLOCK_DELAY
2733
} = process.env
2834

2935
let homeAbi
@@ -61,7 +67,12 @@ const homeConfig = {
6167
blockPollingLimit: parseInt(ORACLE_HOME_RPC_BLOCK_POLLING_LIMIT, 10),
6268
web3: web3Home,
6369
bridgeContract: homeContract,
64-
eventContract: homeContract
70+
eventContract: homeContract,
71+
reprocessingOptions: {
72+
enabled: ORACLE_HOME_EVENTS_REPROCESSING === 'true',
73+
batchSize: parseInt(ORACLE_HOME_EVENTS_REPROCESSING_BATCH_SIZE, 10) || 1000,
74+
blockDelay: parseInt(ORACLE_HOME_EVENTS_REPROCESSING_BLOCK_DELAY, 10) || 500
75+
}
6576
}
6677

6778
const foreignContract = new web3Foreign.eth.Contract(foreignAbi, COMMON_FOREIGN_BRIDGE_ADDRESS)
@@ -74,7 +85,12 @@ const foreignConfig = {
7485
blockPollingLimit: parseInt(ORACLE_FOREIGN_RPC_BLOCK_POLLING_LIMIT, 10),
7586
web3: web3Foreign,
7687
bridgeContract: foreignContract,
77-
eventContract: foreignContract
88+
eventContract: foreignContract,
89+
reprocessingOptions: {
90+
enabled: ORACLE_FOREIGN_EVENTS_REPROCESSING === 'true',
91+
batchSize: parseInt(ORACLE_FOREIGN_EVENTS_REPROCESSING_BATCH_SIZE, 10) || 500,
92+
blockDelay: parseInt(ORACLE_FOREIGN_EVENTS_REPROCESSING_BLOCK_DELAY, 10) || 250
93+
}
7894
}
7995

8096
const maxProcessingTime =
+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
const baseConfig = require('./base.config')
2+
3+
const { DEFAULT_TRANSACTION_RESEND_INTERVAL } = require('../src/utils/constants')
4+
const { MEV_HELPER_ABI } = require('../src/utils/mev')
5+
const { web3Foreign, getFlashbotsProvider } = require('../src/services/web3')
6+
7+
const {
8+
ORACLE_FOREIGN_TX_RESEND_INTERVAL,
9+
ORACLE_MEV_FOREIGN_HELPER_CONTRACT_ADDRESS,
10+
ORACLE_MEV_FOREIGN_MIN_GAS_PRICE,
11+
ORACLE_MEV_FOREIGN_FLAT_MINER_FEE,
12+
ORACLE_MEV_FOREIGN_MAX_PRIORITY_FEE_PER_GAS,
13+
ORACLE_MEV_FOREIGN_MAX_FEE_PER_GAS,
14+
ORACLE_MEV_FOREIGN_BUNDLES_BLOCK_RANGE
15+
} = process.env
16+
17+
const contract = new baseConfig.foreign.web3.eth.Contract(MEV_HELPER_ABI, ORACLE_MEV_FOREIGN_HELPER_CONTRACT_ADDRESS)
18+
19+
module.exports = {
20+
...baseConfig,
21+
pollingInterval: baseConfig.foreign.pollingInterval,
22+
mevForeign: {
23+
contractAddress: ORACLE_MEV_FOREIGN_HELPER_CONTRACT_ADDRESS,
24+
contract,
25+
minGasPrice: ORACLE_MEV_FOREIGN_MIN_GAS_PRICE,
26+
flatMinerFee: ORACLE_MEV_FOREIGN_FLAT_MINER_FEE,
27+
maxPriorityFeePerGas: ORACLE_MEV_FOREIGN_MAX_PRIORITY_FEE_PER_GAS,
28+
maxFeePerGas: ORACLE_MEV_FOREIGN_MAX_FEE_PER_GAS,
29+
bundlesPerIteration: Math.max(parseInt(ORACLE_MEV_FOREIGN_BUNDLES_BLOCK_RANGE, 10) || 5, 1),
30+
getFlashbotsProvider
31+
},
32+
mevJobsRedisKey: `${baseConfig.id}-collected-signatures-mev:mevJobs`,
33+
id: 'mev-sender-foreign',
34+
name: 'mev-sender-foreign',
35+
web3: web3Foreign,
36+
resendInterval: parseInt(ORACLE_FOREIGN_TX_RESEND_INTERVAL, 10) || DEFAULT_TRANSACTION_RESEND_INTERVAL
37+
}

oracle/config/foreign-sender.config.js

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ const { ORACLE_FOREIGN_TX_RESEND_INTERVAL } = process.env
88
module.exports = {
99
...baseConfig,
1010
queue: 'foreign-prioritized',
11-
oldQueue: 'foreign',
1211
id: 'foreign',
1312
name: 'sender-foreign',
1413
web3: web3Foreign,

oracle/config/home-sender.config.js

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ const { ORACLE_HOME_TX_RESEND_INTERVAL } = process.env
88
module.exports = {
99
...baseConfig,
1010
queue: 'home-prioritized',
11-
oldQueue: 'home',
1211
id: 'home',
1312
name: 'sender-home',
1413
web3: web3Home,
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
const baseConfig = require('./base.config')
2+
const { MEV_HELPER_ABI } = require('../src/utils/mev')
3+
4+
const {
5+
ORACLE_MEV_FOREIGN_HELPER_CONTRACT_ADDRESS,
6+
ORACLE_MEV_FOREIGN_MIN_GAS_PRICE,
7+
ORACLE_MEV_FOREIGN_FLAT_MINER_FEE,
8+
ORACLE_MEV_FOREIGN_MAX_PRIORITY_FEE_PER_GAS,
9+
ORACLE_MEV_FOREIGN_MAX_FEE_PER_GAS
10+
} = process.env
11+
12+
const id = `${baseConfig.id}-collected-signatures-mev`
13+
14+
const contract = new baseConfig.foreign.web3.eth.Contract(MEV_HELPER_ABI, ORACLE_MEV_FOREIGN_HELPER_CONTRACT_ADDRESS)
15+
16+
module.exports = {
17+
...baseConfig,
18+
mevForeign: {
19+
contractAddress: ORACLE_MEV_FOREIGN_HELPER_CONTRACT_ADDRESS,
20+
contract,
21+
minGasPrice: ORACLE_MEV_FOREIGN_MIN_GAS_PRICE,
22+
flatMinerFee: ORACLE_MEV_FOREIGN_FLAT_MINER_FEE,
23+
maxPriorityFeePerGas: ORACLE_MEV_FOREIGN_MAX_PRIORITY_FEE_PER_GAS,
24+
maxFeePerGas: ORACLE_MEV_FOREIGN_MAX_FEE_PER_GAS
25+
},
26+
main: baseConfig.home,
27+
event: 'CollectedSignatures',
28+
name: `watcher-${id}`,
29+
id
30+
}

oracle/docker-compose-helpers.yml

+46
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
---
22
version: '2.4'
33
services:
4+
redis:
5+
cpus: 0.1
6+
mem_limit: 500m
7+
command: [ redis-server, --appendonly, 'yes' ]
8+
hostname: redis
9+
image: redis:4
10+
restart: unless-stopped
11+
volumes: [ '~/bridge_data/helpers/redis:/data' ]
412
interestFetcher:
513
cpus: 0.1
614
mem_limit: 500m
@@ -13,3 +21,41 @@ services:
1321
INTERVAL: 300000
1422
restart: unless-stopped
1523
entrypoint: yarn helper:interestFether
24+
mevWatcher:
25+
cpus: 0.1
26+
mem_limit: 500m
27+
image: poanetwork/tokenbridge-oracle:latest
28+
env_file: ./.env
29+
environment:
30+
NODE_ENV: production
31+
ORACLE_VALIDATOR_ADDRESS: ${ORACLE_VALIDATOR_ADDRESS}
32+
ORACLE_MEV_FOREIGN_HELPER_CONTRACT_ADDRESS: 'TBD'
33+
ORACLE_MEV_FOREIGN_MIN_GAS_PRICE: '50000000000' # 50 gwei
34+
ORACLE_MEV_FOREIGN_FLAT_MINER_FEE: '1500000000000000' # 0.0015 eth = 300k gas * 5 gwei
35+
ORACLE_MEV_FOREIGN_MAX_PRIORITY_FEE_PER_GAS: '0' # 0 gwei
36+
ORACLE_MEV_FOREIGN_MAX_FEE_PER_GAS: '1000000000000' # 1000 gwei
37+
ORACLE_FOREIGN_RPC_POLLING_INTERVAL: '15000' # CollectedSignatures event polling interval
38+
ORACLE_HOME_START_BLOCK: 'TBD'
39+
ORACLE_HOME_SKIP_MANUAL_LANE: 'true'
40+
restart: unless-stopped
41+
entrypoint: yarn mev:watcher:collected-signatures
42+
mevSender:
43+
cpus: 0.1
44+
mem_limit: 500m
45+
image: poanetwork/tokenbridge-oracle:latest
46+
env_file: ./.env
47+
environment:
48+
NODE_ENV: production
49+
ORACLE_VALIDATOR_ADDRESS: ${ORACLE_VALIDATOR_ADDRESS}
50+
ORACLE_VALIDATOR_ADDRESS_PRIVATE_KEY: ${ORACLE_VALIDATOR_ADDRESS_PRIVATE_KEY}
51+
ORACLE_MEV_FOREIGN_HELPER_CONTRACT_ADDRESS: 'TBD'
52+
ORACLE_MEV_FOREIGN_MIN_GAS_PRICE: '50000000000' # 50 gwei
53+
ORACLE_MEV_FOREIGN_FLAT_MINER_FEE: '1500000000000000' # 0.0015 eth = 300k gas * 5 gwei
54+
ORACLE_MEV_FOREIGN_MAX_PRIORITY_FEE_PER_GAS: '0' # 0 gwei
55+
ORACLE_MEV_FOREIGN_MAX_FEE_PER_GAS: '1000000000000' # 1000 gwei
56+
ORACLE_MEV_FOREIGN_FLASHBOTS_RPC_URL: 'https://relay-goerli.flashbots.net'
57+
ORACLE_MEV_FOREIGN_FLASHBOTS_AUTH_SIGNING_KEY: 82db7175932f4e6c8e45283b78b54fd5f195149378ec90d95b8fd0ec8bdadf1d
58+
ORACLE_MEV_FOREIGN_BUNDLES_BLOCK_RANGE: '5'
59+
ORACLE_FOREIGN_RPC_POLLING_INTERVAL: '70000' # time between sending different batches of MEV bundles (~= 5 blocks * 14 seconds)
60+
restart: unless-stopped
61+
entrypoint: yarn mev:sender:foreign

oracle/package.json

+5-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
"confirm:information-request": "./scripts/start-worker.sh confirmRelay information-request-watcher",
2020
"manager:shutdown": "./scripts/start-worker.sh shutdownManager shutdown-manager",
2121
"helper:interestFether": "node ./scripts/interestFetcher.js",
22+
"mev:watcher:collected-signatures": "./scripts/start-worker.sh mevWatcher mev-collected-signatures-watcher",
23+
"mev:sender:foreign": "./scripts/start-worker.sh mevSender foreign-mev-sender",
2224
"dev": "concurrently -n 'watcher:signature-request,watcher:collected-signatures,watcher:affirmation-request,watcher:transfer, sender:home,sender:foreign' -c 'red,green,yellow,blue,magenta,cyan' 'yarn watcher:signature-request' 'yarn watcher:collected-signatures' 'yarn watcher:affirmation-request' 'yarn watcher:transfer' 'yarn sender:home' 'yarn sender:foreign'",
2325
"test": "NODE_ENV=test mocha",
2426
"test:watch": "NODE_ENV=test mocha --watch --reporter=min",
@@ -28,17 +30,19 @@
2830
"author": "",
2931
"license": "ISC",
3032
"dependencies": {
33+
"@flashbots/ethers-provider-bundle": "^0.4.3",
3134
"amqp-connection-manager": "^2.0.0",
3235
"amqplib": "^0.5.2",
3336
"bignumber.js": "^7.2.1",
3437
"dotenv": "^5.0.1",
38+
"ethers": "^5.5.3",
3539
"ioredis": "^3.2.2",
3640
"node-fetch": "^2.1.2",
3741
"pino": "^4.17.3",
3842
"pino-pretty": "^2.0.1",
3943
"promise-limit": "^2.7.0",
4044
"promise-retry": "^1.1.1",
41-
"web3": "^1.3.0"
45+
"web3": "^1.6.0"
4246
},
4347
"devDependencies": {
4448
"bn-chai": "^1.0.1",

oracle/scripts/erc20_to_native/sendForeign.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ async function main() {
3636
data,
3737
nonce,
3838
gasPrice: FOREIGN_TEST_TX_GAS_PRICE,
39-
amount: '0',
39+
value: '0',
4040
gasLimit,
4141
to: bridgeableTokenAddress,
4242
web3: web3Foreign,

oracle/scripts/erc20_to_native/sendHome.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ async function main() {
2929
data: '0x',
3030
nonce,
3131
gasPrice: HOME_TEST_TX_GAS_PRICE,
32-
amount: HOME_MIN_AMOUNT_PER_TX,
32+
value: web3Home.utils.toWei(HOME_MIN_AMOUNT_PER_TX),
3333
gasLimit: 100000,
3434
to: COMMON_HOME_BRIDGE_ADDRESS,
3535
web3: web3Home,

oracle/scripts/interestFetcher.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ async function main() {
5454
nonce,
5555
gasPrice,
5656
gasLimit: Math.round(gasLimit * 1.5),
57-
amount: '0',
57+
value: '0',
5858
chainId,
5959
web3: web3Home
6060
})

0 commit comments

Comments
 (0)