Skip to content

Conversation

@jtraglia
Copy link
Member

For DoS prevention, we should require that new bids be at least N% greater in value than the previous highest value bid before forwarding it to peers. This PR defines the percentage as 3% but we can change that to whatever we want. With 3%, an attacker would need to send ~701 valid signed bids to "spam" from 1 gwei to 1 ETH. This is the worst case scenario.

Percentage Messages to reach 1 ETH
1% ~2,082
2% ~1,046
3% ~701
4% ~529
5% ~425

Also:

  • Use overflow-safe integer arithmetic via quotient/remainder splitting
  • Add MIN_BID_INCREASE_PERCENT config (minimum % increase to forward)
  • Add unit tests for threshold boundary cases

- Use overflow-safe integer arithmetic via quotient/remainder splitting
- Add MIN_BID_INCREASE_PERCENT config (minimum % increase to forward)
- Add unit tests for threshold boundary cases
quotient = current_bid.value // 100
remainder = current_bid.value % 100
min_increase = quotient * MIN_BID_INCREASE_PERCENT
min_increase += (remainder * MIN_BID_INCREASE_PERCENT + 99) // 100
Copy link
Member

Choose a reason for hiding this comment

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

This is a ceiling so technically the threshold is ceiling of MIN_BID_INCREASE_PERCENT percent of current bid's value. I guess percentage gives us enough precision as value is in Gwei?

- _[REJECT]_ `bid.execution_payment` is zero.
- _[IGNORE]_ this is the first signed bid seen with a valid signature from the
given builder for this slot.
- _[IGNORE]_ this bid is the highest value bid seen for the corresponding slot
Copy link
Member

Choose a reason for hiding this comment

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

Is it better to describe something like "higher than other bids by at least MIN_BID_INCREASE_PERCENT"?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants