feat: add configurable flashbots simulation endpoint#225
Open
init4samwise wants to merge 1 commit intomainfrom
Open
feat: add configurable flashbots simulation endpoint#225init4samwise wants to merge 1 commit intomainfrom
init4samwise wants to merge 1 commit intomainfrom
Conversation
Add FLASHBOTS_SIMULATION_ENDPOINT config option for alternative bundle simulation. When configured, bundles are simulated against this endpoint instead of the default FLASHBOTS_ENDPOINT. Falls back to default when not set. Changes: - Add flashbots_simulation_endpoint field to BuilderConfig (config.rs) - Add connect_flashbots_simulation() method to create provider - Add flashbots_simulation field to FlashbotsTask (flashbots.rs) - Add simulate_bundle() method using eth_callBundle API - Simulation failures are logged but don't block submission - Add metrics: simulation_attempts, simulation_success, simulation_failures - Update README with new environment variable documentation Closes ENG-1437
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add configuration option for an alternative Flashbots simulation endpoint. When
FLASHBOTS_SIMULATION_ENDPOINTis configured, bundles are simulated against that endpoint before submission. Otherwise, it defaults to using the standardFLASHBOTS_ENDPOINT.Changes
config.rs
flashbots_simulation_endpointoptional field toBuilderConfigconnect_flashbots_simulation()method to create an optional dedicated simulation providerflashbots.rs
flashbots_simulation: Option<FlashbotsProvider>field toFlashbotsTasknew()to load the simulation endpoint configurationsimulate_bundle()method that:flashbotsprovider when not configuredeth_callBundleAPI for simulationtask_future()to call simulation before submissionsignet.builder.flashbots.simulation_attemptssignet.builder.flashbots.simulation_successsignet.builder.flashbots.simulation_failuresREADME.md
FLASHBOTS_SIMULATION_ENDPOINTenvironment variableTesting
cargo fmt✅Notes
This enables using a dedicated simulation endpoint (e.g., for testing or using a faster simulation service) while keeping the submission endpoint separate.
Closes ENG-1437