A high-performance, lightweight TEE-based secure block builder for Ethereum.
FlashBlock is a lightweight block builder that uses a TEE to securely build blocks. It is designed to be used in conjunction with an existing Ethereum client to build blocks at a configurable interval.
- Ultra-fast Blocks: Generate blocks at configurable millisecond intervals (default: 250ms)
- JSON-RPC API: Compatible interface for submitting transactions and querying blocks
- WebSocket Support: Real-time block notifications
- Mempool Management: Efficient transaction queuing and processing
- Metrics: Built-in performance tracking
- Low Latency: Minimize transaction confirmation times for testing
- Configurable: Adjust block intervals and other parameters to suit testing needs
- Go 1.24 or higher
Clone the repository:
git clone https://github.com/yourusername/flashblock.git
cd flashblockBuild the server and client:
make buildmake runWith custom configuration:
make run-customOr directly:
./build/flashblock --rpc-addr=:8888 --block-interval=500msmake run-clientFlashBlock can be configured via command line flags:
--rpc-addr: JSON-RPC server address (default::8080)--block-interval: Block creation interval (default:250ms)--log-blocks: Enable block creation event logging (default:true)--log-file: Log file path (default:flashblock.log)
A sample configuration file (config.yaml) is also available for client workload testing:
# Number of concurrent clients
num_clients: 5
# Requests per second per client
requests_per_second: 10
# Total duration of the test in seconds
duration_seconds: 60
# Server URL
server_url: "http://localhost:8080"Check the examples/ directory for sample code showing how to interact with FlashBlock:
- Basic client for submitting transactions
- WebSocket client for real-time block notifications
cmd/: Application entry pointsserver/: FlashBlock serverclient/: Test client implementation
internal/: Internal packagesmempool/: Transaction queue managementprocessor/: Block creation and transaction processingrpc/: JSON-RPC API implementationmodel/: Data structuresmetrics/: Performance measurementeth/: Ethereum compatibility
make testWith coverage:
make test-coverageRun benchmarks:
make benchContributions are welcome! Please feel free to submit a Pull Request.