Suppose I am a searcher who sends a bundle to a builder for arbitrage that requires sequential execution. Can the builder insert additional transactions in my bundle to attack me? How is the searcher protected in this scenario?
Block builders today have full control of the content in their blocks and have the ability to remove and/or insert transactions at any position. You can find some more details on how searchers and builders interact, and a some criteria to look for in a block builder, in our Documentation and in Searching Post-Merge.
We are working on reducing these trust assumptions, since March we’ve been running a block builder inside an SGX enclave, bringing us one step closer toward transaction confidentiality and decentralization of the block-building role.
Moving forward, with SUAVE, we seek to substitute these trust guarantees further with robust cryptographic and cryptoeconomic assurances for comprehensive programmable privacy.
How to send bundles to a block builder? I am running falshbots block builder and need to send bundles to block builder. I used the following code, used BUILDER_URL, does not work.
const flashbotsProvider = await FlashbotsBundleProvider.create(
RPC_PROVIDER, // ethers.js provider, to perform gas estimiations and nonce lookups
wallet, // ethers.js signer wallet
BUILDER_URL,
BLOCKCHAIN_NAME
);
for (var i = 1; i <= 10; i++) {
//bundle submission
const bundleSubmission = await flashbotsProvider.sendRawBundle(
signedTransactions,
blockNumber + i
)
const waitResponse = await bundleSubmission.wait()
//check bundle inclusion
if (
waitResponse === FlashbotsBundleResolution.BundleIncluded ||
waitResponse === FlashbotsBundleResolution.AccountNonceTooHigh
) {
console.log('Bundle included !!!')
process.exit(0)
} else {
console.log("bundle not included !!!" + i)
console.log({
bundleStats: await flashbotsProvider.getBundleStats(
simulation.bundleHash,
blockNumber + 1,
),
userStats: await flashbotsProvider.getUserStats(),
})
}
}