Skip to content

feat: bidder deposit revamp#746

Merged
aloknerurkar merged 120 commits intomainfrom
bidder-deposit-revamp
Sep 1, 2025
Merged

feat: bidder deposit revamp#746
aloknerurkar merged 120 commits intomainfrom
bidder-deposit-revamp

Conversation

@shaspitz
Copy link
Copy Markdown
Contributor

@shaspitz shaspitz commented Jul 30, 2025

In the previous version of the core protocol, bidders deposited funds w.r.t groups of consecutive blocks known as windows. This PR updates the core protocol to allow bidders to instead make deposits per-provider.

This new design eliminates the need for each bidder node to run its own off-chain "auto-deposit" logic, which continually redeposited bidder funds into up-to-date windows. These redeposit txes would happen regardless of whether preconf bids were being settled.

Now, redeposits are only required when a bidder's deposited amount goes below their target deposit amount for a provider, specifically from preconfs being settled. Further, EIP-7702 is leveraged to automatically replenish bidder deposits on-chain during the settlement process via the DepositManager.

  • Implements per-provider depositing mechanism in BidderRegistry
  • Introduces DepositManager contract for EIP-7702 enabled auto "top-up" logic. This on-chain mechanism replaces the previous auto-deposit feature of mev-commit bidder nodes
  • Updates mev-commit bidder node api
  • Updates provider-side deposit.go logic to accommodate new bidder semantics
  • Updates tools/dashboard to accommodate new bidder semantics
  • Many other misc file updates affected by changes in bidder semantics, event signatures, etc.
  • Updates integration tests accordingly

@shaspitz shaspitz marked this pull request as draft July 30, 2025 06:38
@shaspitz shaspitz changed the title Bidder deposit revamp feat: bidder deposit revamp Jul 30, 2025
@shaspitz shaspitz force-pushed the bidder-deposit-revamp branch 4 times, most recently from dbaa224 to 813aa72 Compare August 6, 2025 17:59
@shaspitz shaspitz force-pushed the bidder-deposit-revamp branch from a5ed4b3 to c5c0c28 Compare August 14, 2025 18:30
Comment thread contracts/contracts/core/BlockTracker.sol Outdated
Comment thread p2p/cmd/main.go
Comment thread p2p/pkg/depositmanager/deposit.go Outdated
Comment thread p2p/pkg/rpc/bidder/service.go
Copy link
Copy Markdown
Contributor

@chrmatt chrmatt left a comment

Choose a reason for hiding this comment

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

The overall logic of topping up via the deposit manager looks good to me. I haven't checked a lot of the other details.

Comment thread p2p/pkg/depositmanager/deposit.go Outdated
@shaspitz shaspitz requested a review from aloknerurkar August 29, 2025 06:07
@owen-eth
Copy link
Copy Markdown
Contributor

owen-eth commented Aug 29, 2025

We could use ReentrancyGuardTransient instead of ReentrancyGuard for these contracts - it uses transient storage introduced in dencun upgrade to make the nonreentrant modifier pretty much free. Not sure how much we care since this isn't L1

@shaspitz
Copy link
Copy Markdown
Contributor Author

We could use ReentrancyGuardTransient instead of ReentrancyGuard for these contracts - it uses transient storage introduced in dencun upgrade to make the nonreentrant modifier pretty much free. Not sure how much we care since this isn't L1

If you think the gas savings are worth it, I'm not against making this change for all relevant contracts before we redeploy. Seems best to implement in a separate PR to main since not directly related to bidder deposit changes

Comment thread contracts/contracts/core/BidderRegistry.sol Outdated
@shaspitz shaspitz requested a review from aloknerurkar August 30, 2025 02:03
Copy link
Copy Markdown
Collaborator

@aloknerurkar aloknerurkar left a comment

Choose a reason for hiding this comment

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

This is a monumental effort! Great work!

@aloknerurkar aloknerurkar merged commit e2da71e into main Sep 1, 2025
5 checks passed
@aloknerurkar aloknerurkar deleted the bidder-deposit-revamp branch September 1, 2025 08:29
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.

4 participants