Skip to content

Conversation

@odysseus0
Copy link
Collaborator

@odysseus0 odysseus0 commented Aug 30, 2025

Summary

  • Implements X-Flashbots-Origin header support for guaranteed refund collection
  • Adds preset configuration system to ensure partners receive fixed refund percentages
  • Maintains backward compatibility with existing URL parameter flows

Implementation Details

  • ConfigurationWatcher: Extended to support presets field with graceful error handling
  • Request Handler: New getEffectiveParameters() method checks header first, falls back to URL parsing
  • Configuration: Preset URLs are pre-parsed at startup for performance and early error detection

Key Behavior

When X-Flashbots-Origin header is present:

  1. Looks up preset configuration for the origin ID
  2. Uses preset parameters, completely ignoring URL parameters
  3. Falls back to normal URL parsing if no preset found

Testing

  • Unit tests cover preset parsing and header override logic
  • Tests graceful degradation for invalid preset configurations
  • Ready for testnet deployment and integration testing

Configuration Changes Required

For Testing (Sepolia testnet)

Add to devops/k8s/eth-l1-testnets/sepolia/protect/rpc/configs/customers.yaml:

urls:
  test1:
    - /fast?originId=test1
  test2:
    - /fast?originId=test2&auctionTimeout=500&maxBlockRange=7
presets:
  test-header: /fast?originId=test-header&refund=0xb60e8dd61c5d32be8058bb8eb970870f07233155:50

For Production (when QuickNode provides requirements)

Add to devops/k8s/eth-l1-prod/protect-old/rpc.yaml:

urls:
  # ... existing configs ...
  quicknode:
    - /fast?originId=quicknode
presets:
  quicknode: [QuickNode to provide: endpoint, refund address, percentage, other params]

Testing Plan

  1. Deploy testnet config changes
  2. Deploy code to testnet
  3. Test with header: X-Flashbots-Origin-ID: test-header
  4. Verify preset overrides URL parameters correctly
  5. Verify fallback works when no header present

🤖 Generated with Claude Code

Implements X-Flashbots-Origin-ID header support to enable guaranteed
refund collection for enterprise partners like QuickNode.

Changes:
- Add presets field to CustomersConfig for header-based enforcement
- Implement getEffectiveParameters() method with header override logic
- Add graceful degradation for invalid preset configurations
- Include unit tests for preset parsing and header override behavior

When X-Flashbots-Origin-ID header is present, preset configuration
takes precedence over URL parameters, ensuring partners receive
guaranteed refund percentages.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Copy link
Contributor

@jeyldii jeyldii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

@TymKh TymKh merged commit 26f9e82 into main Sep 4, 2025
2 checks passed
@TymKh TymKh deleted the feature/quicknode-header-config branch September 4, 2025 16:15
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.

3 participants