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

Change use of block deadlines #381

Merged
merged 2 commits into from
Aug 15, 2024
Merged

Change use of block deadlines #381

merged 2 commits into from
Aug 15, 2024

Conversation

fhenneke
Copy link
Collaborator

@fhenneke fhenneke commented Aug 14, 2024

This PR adds a grace period of one block to the deadline for settling on chain. It also removes the use of block deadlines in computing fees and other quantities.

The PR changes two things:

  • Settlements are still rewarded if solvers settle one block after the deadline. This change is implemented to not punish solvers for slightly suboptimal transaction canceling in the driver. The alternative would be to implement very cautios canceling which might negatively impact revert rates.
  • The use of block deadlines for setting surplus, fee, and execution_cost to zero was removed. For every successful settlemen, even if after the deadline by many blocks, those values will just be copies of the respective values in the settlement_observations table. The change to surplusand execution_costdoes not have any effect on solver payments. Those values are only used for analytics. The change to fee has an effect since it enters the computation of network_fee_eth. Before the change, the network fee was computed to be negative and essentially equal to -protocol_fee_eth. On the one hand, network fees were already removed from slippage using per order data. On the other hand, slippage is also modified by adding the value of network fees to reimburse solvers the cost of execution. Since network fees were computed to be negative protocol fees, instead of paying solvers those network fees they paid us protocol fees. See Potential bug with auctions being settled late #380. With the proposed change, network fees are always paid as part of slippage to the solver. This is consistent with how slippage is handled in general.

The estimated impact on solver from adding a grace period is an increase in overall rewards by about 1.48 ETH in the accounting period 2024-08-06--2024-08-13.
The impact of the second change on slippage is not estimated precisely. The overcharging of protocol fees amounts to 0.6 ETH. The missing reimbursement of network fees is not estimated.
See this Dune query.

The changes should be mirrored to dune-sync and data for the accounting period starting on 2024-08-13 should be re-synced.

- a grace period of 1 block is introduced for a settlement still being valid even though the deadline passed by one block
- block deadlines were removed from places where it was used to modify surplus, execution costs, and fees
@fhenneke fhenneke requested a review from bram-vdberg August 14, 2024 14:01
Copy link
Contributor

@bram-vdberg bram-vdberg left a comment

Choose a reason for hiding this comment

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

LGTM!

@fhenneke
Copy link
Collaborator Author

Comparing the total performance rewards with this PR to the actual payouts for the last accounting period gives

Actual COW needed: 343097.8722
Actual ETH needed: 85.9442

New COW needed: 358344.1259
New ETH needed: 86.8461

Difference COW: 15246.2537 (around 1.19 ETH)
Difference ETH: 0.9019

The the estimates based on the Dune are somewhat accurate.

@fhenneke fhenneke merged commit 9c1a602 into main Aug 15, 2024
5 checks passed
@fhenneke fhenneke deleted the block_deadline_grace_period branch August 15, 2024 11:27
@github-actions github-actions bot locked and limited conversation to collaborators Aug 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants