Compare commits
3 Commits
fake-mev-e
...
dependabot
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fbeefe9b36 | ||
|
|
5bc562e810 | ||
|
|
72f0d30b52 |
@@ -59,6 +59,6 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"eslint-plugin-prettier": "^3.1.3",
|
||||
"node-fetch": "^2.6.1"
|
||||
"node-fetch": "^2.6.7"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
"@mycrypto/gas-estimation": "^1.1.0",
|
||||
"gas-price-oracle": "^0.1.5",
|
||||
"web3-utils": "^1.3.0",
|
||||
"node-fetch": "^2.1.2"
|
||||
"node-fetch": "^2.6.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
"bn-chai": "^1.0.1",
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
"cors": "^2.8.5",
|
||||
"dotenv": "^5.0.1",
|
||||
"express": "^4.16.3",
|
||||
"node-fetch": "^2.1.2",
|
||||
"node-fetch": "^2.6.7",
|
||||
"web3": "^1.3.0"
|
||||
},
|
||||
"engines": {
|
||||
|
||||
@@ -57,8 +57,5 @@ services:
|
||||
ORACLE_MEV_FOREIGN_FLASHBOTS_AUTH_SIGNING_KEY: 82db7175932f4e6c8e45283b78b54fd5f195149378ec90d95b8fd0ec8bdadf1d
|
||||
ORACLE_MEV_FOREIGN_BUNDLES_BLOCK_RANGE: '5'
|
||||
ORACLE_FOREIGN_RPC_POLLING_INTERVAL: '70000' # time between sending different batches of MEV bundles (~= 5 blocks * 14 seconds)
|
||||
FAKE_MEV_RELAY_TX_SENDING: 'true'
|
||||
FAKE_MEV_RELAY_NO_EIP1559: 'true'
|
||||
COMMON_FOREIGN_GAS_PRICE_FALLBACK: 100000000000 # will essentially replace block base fee
|
||||
restart: unless-stopped
|
||||
entrypoint: yarn mev:sender:foreign
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
"dotenv": "^5.0.1",
|
||||
"ethers": "^5.5.3",
|
||||
"ioredis": "^3.2.2",
|
||||
"node-fetch": "^2.1.2",
|
||||
"node-fetch": "^2.6.7",
|
||||
"pino": "^4.17.3",
|
||||
"pino-pretty": "^2.0.1",
|
||||
"promise-limit": "^2.7.0",
|
||||
|
||||
@@ -15,13 +15,9 @@ if (process.argv.length < 3) {
|
||||
}
|
||||
|
||||
const config = require(path.join('../config/', process.argv[2]))
|
||||
const GasPrice = require('./services/gasPrice')
|
||||
|
||||
const { web3, mevForeign, validatorAddress } = config
|
||||
|
||||
const FAKE_MEV_RELAY_TX_SENDING = process.env.FAKE_MEV_RELAY_TX_SENDING === 'true'
|
||||
const FAKE_MEV_RELAY_NO_EIP1559 = process.env.FAKE_MEV_RELAY_NO_EIP1559 === 'true'
|
||||
|
||||
let chainId = 0
|
||||
let flashbotsProvider
|
||||
|
||||
@@ -32,9 +28,7 @@ async function initialize() {
|
||||
web3.currentProvider.urls.forEach(checkHttps(config.id))
|
||||
|
||||
chainId = await getChainId(web3)
|
||||
if (!FAKE_MEV_RELAY_TX_SENDING) {
|
||||
flashbotsProvider = await mevForeign.getFlashbotsProvider(chainId)
|
||||
}
|
||||
flashbotsProvider = await mevForeign.getFlashbotsProvider(chainId)
|
||||
return runMain()
|
||||
} catch (e) {
|
||||
logger.error(e.message)
|
||||
@@ -71,13 +65,7 @@ async function main() {
|
||||
return
|
||||
}
|
||||
|
||||
const { baseFeePerGas, number: pendingBlockNumber } = await getBlock(web3, 'pending')
|
||||
let pendingBaseFee = baseFeePerGas
|
||||
if (FAKE_MEV_RELAY_TX_SENDING && FAKE_MEV_RELAY_NO_EIP1559) {
|
||||
// emulate baseFee with the current gasPrice
|
||||
await GasPrice.start('foreign', web3, true)
|
||||
pendingBaseFee = GasPrice.gasPriceOptions().gasPrice
|
||||
}
|
||||
const { baseFeePerGas: pendingBaseFee, number: pendingBlockNumber } = await getBlock(web3, 'pending')
|
||||
const bestJob = pickBestJob(jobs, pendingBaseFee)
|
||||
|
||||
if (!bestJob) {
|
||||
@@ -127,7 +115,7 @@ async function main() {
|
||||
{ nonce, fromBlock: pendingBlockNumber, toBlock: pendingBlockNumber + mevForeign.bundlesPerIteration - 1 },
|
||||
'Sending MEV bundles'
|
||||
)
|
||||
const opts = {
|
||||
const txHash = await sendTx({
|
||||
data: bestJob.data,
|
||||
nonce,
|
||||
value: bestJob.value,
|
||||
@@ -146,14 +134,7 @@ async function main() {
|
||||
toBlock: pendingBlockNumber + mevForeign.bundlesPerIteration - 1,
|
||||
logger
|
||||
}
|
||||
}
|
||||
if (FAKE_MEV_RELAY_TX_SENDING) {
|
||||
if (FAKE_MEV_RELAY_NO_EIP1559) {
|
||||
opts.gasPriceOptions = { gasPrice: pendingBaseFee }
|
||||
}
|
||||
delete opts.mevOptions
|
||||
}
|
||||
const txHash = await sendTx(opts)
|
||||
})
|
||||
|
||||
jobLogger.info({ txHash }, `Tx generated ${txHash} for event Tx ${bestJob.transactionReference}`)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user