x23.ai

alpha

#137: [TESTING] Script for benchmarking builders locally

11 files changed

4366 additions

1 deletions

78 commits

github.com

TL;DR:

The pull request introduces significant updates to the builder repository by Flashbots, including the addition of new files, functions, and structs, and updates to existing ones. Key changes include the addition of emulate_network.go file, introduction of new functions like parseUserServices, getBlockNumber, build, update_config, and error handling improvements.

The pull request introduces several changes to the builder repository owned by Flashbots. The main point of these changes is to enhance the functionality of the repository by adding new files, functions, and structs, and updating existing ones.

A new file emulate_network.go has been added to the scripts directory. This file contains the main package and imports several packages. Two new structs, PortInfo and ServiceInfo, have been defined in this file.

Several new functions have been introduced:

  • parseUserServices function takes a string as input and returns a slice of ServiceInfo and an error. It splits the input text into lines, iterates over each line, and uses regular expressions to match and extract service information.
  • getBlockNumber function takes a URL string as input and returns the current block number and an error. It sends a JSON-RPC request to the specified URL.
  • build function builds a Docker image using a given image tag, build directory, and Dockerfile path.
  • update_config function updates the configuration of a network. It reads a JSON file, updates the "seconds_per_slot" value, and updates the participant with "el_client_type" set to "REPLACE_WITH_BUILDER" to use "geth" and the provided image tag.
  • A new function has been added to marshal a map back to JSON format. The resulting JSON string is printed to the console and the modified content is saved back to a file named network_params_tmp.json in the kurtosisNetworkScriptFolder directory.
  • run function has been introduced with several parameters. The body of this function is not shown in the diff.

The pull request also includes error handling for request creation, sending the request, reading the response body, unmarshalling the JSON response, and converting the hexadecimal result to an integer. It also includes error handling for file reading, JSON unmarshalling, and type assertions.

Last updated 5 hours ago

Last updated 04/12 00:17