From 474825d856d951e025724838dd521b102f48e012 Mon Sep 17 00:00:00 2001 From: KillariDev Date: Mon, 29 Jan 2024 08:43:17 +0200 Subject: [PATCH 1/2] =?UTF-8?q?change=20to=20=F0=9F=A6=AB=20and=20fix=20te?= =?UTF-8?q?xt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/ts/components/Settings.tsx | 2 +- app/ts/constants.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/ts/components/Settings.tsx b/app/ts/components/Settings.tsx index 174a39f..0970a9e 100644 --- a/app/ts/components/Settings.tsx +++ b/app/ts/components/Settings.tsx @@ -115,7 +115,7 @@ export const SettingsModal = ({ display, appSettings }: { display: Signal) => validateSimulationRelayEndpointInput(e.currentTarget.value)} value={simulationRelayEndpointInput.value.value} type='text' className='bg-transparent outline-none placeholder:text-gray-600' placeholder='https://' />
- Bundle Submit Relay URL + Bundle Submission Relay URL ) => validateAndSetSubmissionRelayEndpointInput(e.currentTarget.value)} value={submissionRelayEndpointInput.value.value} type='text' className='bg-transparent outline-none placeholder:text-gray-600' placeholder='https://' />
diff --git a/app/ts/constants.ts b/app/ts/constants.ts index ca3b083..1795dc2 100644 --- a/app/ts/constants.ts +++ b/app/ts/constants.ts @@ -1,4 +1,4 @@ export const NETWORKS: { [chainId: string]: { simulationRelay: string, submissionRelay: string, blockExplorer: string, rpcUrl: string }} = { - '1': { simulationRelay: 'https://relay.dark.florist', submissionRelay: 'https://rpc.titanbuilder.xyz', blockExplorer: 'https://etherscan.io/', rpcUrl: 'https://rpc.dark.florist/flipcardtrustone' }, + '1': { simulationRelay: 'https://relay.dark.florist', submissionRelay: 'https://beaver-cors-proxy.dark-florist.workers.dev', blockExplorer: 'https://etherscan.io/', rpcUrl: 'https://rpc.dark.florist/flipcardtrustone' }, '5': { simulationRelay: 'https://relay-goerli.dark.florist', submissionRelay: 'https://relay-goerli.dark.florist', blockExplorer: 'https://goerli.etherscan.io/', rpcUrl: 'https://rpc-goerli.dark.florist/flipcardtrustone' } } From 694746ac1bb095307bc29e0fca901038ab65bdea Mon Sep 17 00:00:00 2001 From: KillariDev Date: Mon, 29 Jan 2024 17:30:23 +0200 Subject: [PATCH 2/2] add id --- app/ts/constants.ts | 2 +- app/ts/library/flashbots.ts | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/ts/constants.ts b/app/ts/constants.ts index 1795dc2..ca3b083 100644 --- a/app/ts/constants.ts +++ b/app/ts/constants.ts @@ -1,4 +1,4 @@ export const NETWORKS: { [chainId: string]: { simulationRelay: string, submissionRelay: string, blockExplorer: string, rpcUrl: string }} = { - '1': { simulationRelay: 'https://relay.dark.florist', submissionRelay: 'https://beaver-cors-proxy.dark-florist.workers.dev', blockExplorer: 'https://etherscan.io/', rpcUrl: 'https://rpc.dark.florist/flipcardtrustone' }, + '1': { simulationRelay: 'https://relay.dark.florist', submissionRelay: 'https://rpc.titanbuilder.xyz', blockExplorer: 'https://etherscan.io/', rpcUrl: 'https://rpc.dark.florist/flipcardtrustone' }, '5': { simulationRelay: 'https://relay-goerli.dark.florist', submissionRelay: 'https://relay-goerli.dark.florist', blockExplorer: 'https://goerli.etherscan.io/', rpcUrl: 'https://rpc-goerli.dark.florist/flipcardtrustone' } } diff --git a/app/ts/library/flashbots.ts b/app/ts/library/flashbots.ts index 141d19f..b27d0ff 100644 --- a/app/ts/library/flashbots.ts +++ b/app/ts/library/flashbots.ts @@ -94,6 +94,7 @@ export async function simulateBundle( } } +let bundleId = 1 export async function sendBundle(bundle: Bundle, targetBlock: bigint, fundingAmountMin: bigint, provider: ProviderStore, signers: Signers, blockInfo: BlockInfo, appSettings: AppSettings) { if (appSettings.blocksInFuture <= 0n) throw new Error('Blocks in future is negative or zero') @@ -105,7 +106,12 @@ export async function sendBundle(bundle: Bundle, targetBlock: bigint, fundingAmo maxBaseFee, ) - const payload = JSON.stringify({ jsonrpc: '2.0', method: 'eth_sendBundle', params: [{ txs, blockNumber: `0x${targetBlock.toString(16)}`, revertingTxHashes: [] }] }) + const payload = JSON.stringify({ + jsonrpc: '2.0', + method: 'eth_sendBundle', + id: bundleId++, + params: [{ txs, blockNumber: `0x${targetBlock.toString(16)}`, revertingTxHashes: [] }] + }) const flashbotsSig = `${await provider.authSigner.getAddress()}:${await provider.authSigner.signMessage(id(payload))}` const request = await fetch(appSettings.submissionRelayEndpoint, { method: 'POST', body: payload, headers: { 'Content-Type': 'application/json', 'X-Flashbots-Signature': flashbotsSig } }