Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Component/batch executor #14

Merged
merged 9 commits into from
Feb 20, 2025
Merged

Component/batch executor #14

merged 9 commits into from
Feb 20, 2025

Conversation

0xSero
Copy link
Collaborator

@0xSero 0xSero commented Feb 18, 2025

Add Executor Component for Transaction Management

Overview

This PR introduces a new Executor component that manages the execution of profitable bump transactions. It provides a robust, configurable system for handling wallet operations, transaction queueing, and tip collection.

Key Features

  • Transaction queue management with FIFO processing
  • Wallet balance monitoring and automatic tip collection
  • Concurrent transaction execution with configurable limits
  • Gas price optimization with boost percentage
  • Comprehensive error handling and retry mechanism
  • Detailed transaction status tracking and statistics

Technical Details

  • Implements a modular architecture with strategy pattern
  • Uses TypeScript for type safety
  • Includes comprehensive test suite
  • Configurable via environment variables and runtime options
  • Follows existing logging patterns

Configuration Options

  • Queue size and concurrency limits
  • Gas price boost percentage
  • Minimum wallet balance
  • Transaction confirmation requirements
  • Tip transfer thresholds

Testing

Added test-executor.ts that verifies:

  • Queue management functionality
  • Transaction execution flow
  • Status monitoring
  • Error handling scenarios
  • Tip transfer mechanism

Usage Example

const executor = new ExecutorWrapper(stakerContract, provider, {
wallet: {
privateKey: process.env.PRIVATE_KEY,
minBalance: ethers.parseEther('0.1'),
},
gasBoostPercentage: 10,
concurrentTransactions: 3,
});
await executor.start();
const tx = await executor.queueTransaction(depositId, profitabilityCheck);

Related

  • Integrates with existing profitability engine
  • Uses shared logging system
  • Follows project architecture patterns

Notes

  • Requires TEST_PRIVATE_KEY in .env for testing
  • Gas boost percentage is configurable per environment
  • Includes detailed README with usage examples

closes: #6

@0xSero 0xSero marked this pull request as draft February 18, 2025 17:52
@0xSero 0xSero marked this pull request as ready for review February 20, 2025 16:49
@0xSero 0xSero merged commit 07f5bf3 into main Feb 20, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement Batch Execution System
1 participant