Skip to content

Conversation

@zeroprooff
Copy link
Contributor

Fixed a bug where multiple transactions with refund_percent in a bundle were getting incorrect refund amounts.

The problem was that each transaction calculated its refund from the already-reduced refundable_value instead of the original amount. This caused later transactions to receive progressively smaller payouts.

For example, with two txs requesting 50% refund each from 1000 wei:

  • First tx: got 500 wei (correct)
  • Second tx: got 250 wei (50% of remaining 500, wrong - should be 500)

The fix stores the original refundable_value before the loop and uses that for all calculations. This matches the validation logic that ensures the sum of all refund percentages doesn't exceed 100%.

Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

ah I see, this would always decrease the paylout value

@github-project-automation github-project-automation bot moved this from Backlog to In Progress in Reth Tracker Nov 28, 2025
@mattsse mattsse added this pull request to the merge queue Nov 28, 2025
@mattsse mattsse added C-bug An unexpected or incorrect behavior A-rpc Related to the RPC implementation labels Nov 28, 2025
Merged via the queue into paradigmxyz:main with commit 36c6280 Nov 28, 2025
44 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in Reth Tracker Nov 28, 2025
@zeroprooff zeroprooff deleted the fix-sim-bundle-refund branch November 28, 2025 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-rpc Related to the RPC implementation C-bug An unexpected or incorrect behavior

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants