Skip to content

Support optimistic path in mev-boost-relay#419

Merged
canercidam merged 2 commits intomainfrom
caner/support-optimistic-path
May 7, 2026
Merged

Support optimistic path in mev-boost-relay#419
canercidam merged 2 commits intomainfrom
caner/support-optimistic-path

Conversation

@canercidam
Copy link
Copy Markdown
Member

Saves any builder as optimistic and sets the collateral to the right amount

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Apr 29, 2026

Claude finished @canercidam's task in 3m 34s —— View job


Review

  • Read PR diff
  • Analyze mev-boost-relay/mev-boost-relay.go changes
  • Post inline review feedback

Findings

Posted an inline comment on mev-boost-relay/mev-boost-relay.go covering four issues in the new SaveDeliveredPayload block:

  1. Builder registered too late — saving on SaveDeliveredPayload means the very first submission from each builder still hits full validation; only subsequent blocks use the optimistic path. Seed on submission (or via housekeeper) instead.
  2. Collateral is built by string concatbig.NewInt(0).Set(...).String() + "000" is a multiply-by-1000 disguised as text munging; the Set copy is also dead. Use new(big.Int).Mul(value, big.NewInt(1000)).
  3. Collateral frozen at first bid × 1000 — once written, the entry is never updated, so a small first bid pins collateral forever. For "always optimistic in playground," prefer a large fixed value.
  4. Race on MockDB.Builders — the write is guarded by deliveredPayloadsLock, but MockDB's embedded builder-reading methods (used by housekeeper / API) don't share that lock. Use a dedicated lock and override the read paths consistently.
    Branch

Comment thread mev-boost-relay/mev-boost-relay.go
@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Apr 29, 2026

Claude finished @canercidam's task in 2m 32s —— View job


Review

  • Read PR diff
  • Analyze mev-boost-relay/mev-boost-relay.go changes
  • Analyze playground/components.go changes
  • Post inline review feedback

Findings

The latest push (8553e1c) only bumps latestPlaygroundUtilsTag in playground/components.go; no functional change to the relay code. The four issues raised on the prior review still apply, consolidated into a single inline comment on the new SaveDeliveredPayload block:

  1. Collateral built by string concatvalue.String() + "000" is a multiply-by-1000 disguised as text. Use new(big.Int).Mul(bidTrace.Value.ToBig(), big.NewInt(1000)).String(). The big.NewInt(0).Set(...) copy is also dead.
  2. Builder registered too late — saving on SaveDeliveredPayload means the first submission per builder still hits full validation; only the second and onward blocks use the optimistic path. Seed on submission (or via housekeeper) instead.
  3. Collateral frozen at first bid × 1000 — once written, the entry is never updated, so a small first bid pins collateral forever. For "always optimistic," prefer a large fixed value.
  4. Race on MockDB.Builders — the write is guarded by deliveredPayloadsLock, but the embedded MockDB's builder-reading methods (used by housekeeper / API) don't share that lock. Use a dedicated buildersLock and override the read paths so both sides agree.
    Branch

Comment thread mev-boost-relay/mev-boost-relay.go
@canercidam canercidam merged commit e5d8e76 into main May 7, 2026
10 checks passed
@canercidam canercidam deleted the caner/support-optimistic-path branch May 7, 2026 21:20
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.

2 participants