Skip to content

feat: Add Fusaka support for MEV-Boost relay#745

Merged
metachris merged 35 commits into
flashbots:mainfrom
bharath-123:bharath/fulu
Sep 4, 2025
Merged

feat: Add Fusaka support for MEV-Boost relay#745
metachris merged 35 commits into
flashbots:mainfrom
bharath-123:bharath/fulu

Conversation

@bharath-123
Copy link
Copy Markdown
Collaborator

@bharath-123 bharath-123 commented Jul 3, 2025

📝 Summary

Fusaka support for MEV-Boost relay

Resolves: #739

This PR has been tested against rbuilder's fusaka support branch: flashbots/rbuilder#666

Note that rbuilder is not yet Fusaka compatible, so in our testing only EIP1559 txs were being sent in execution payloads from the builder. rbuilder still needs to be fulu compaitable.

This upgrade brings in two new additions:

  1. Addition of a getPayloadV2: Introduced in Add eth/v2/builder/blinded_blocks which does not return the execution payload and blobs ethereum/builder-specs#123, we don't return a response in getPayloadV2 compared to returning the fully signed beacon block in getPayloadV1. We do this to save n/w bandwidth for the proposer. It has been implemented in: Faheel/v2 get payload bharath-123/mev-boost-relay#62. More details can be seen in the PR links.
  2. Inferring fork version of builder payload by peeking into the raw payload for slot: Fusaka and Electra payloads are of the same structure. We need to know the fork version before parsing the payload. To do this, we try to get the slot from the raw payload. It is implemented in: fix: Parse blocks sent by builder with fork version. bharath-123/mev-boost-relay#63

✅ I have run these commands

  • make lint
  • make test-race
  • go mod tidy
  • I have seen and agree to CONTRIBUTING.md

Comment thread services/api/blocksim_ratelimiter.go Outdated
// Create and fire off JSON-RPC request
if payload.Version == spec.DataVersionElectra {
// TODO - bharath: Does the electra flashbots_validateBuilderSubmissionV4 work for fulu?
if payload.Version == spec.DataVersionElectra || payload.Version == spec.DataVersionFulu {
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

We need to wait for the flashbots_validateBuilderSubmissionV5 impl for Fusaka being worked on here: paradigmxyz/reth#17179

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

this has been merged to main in reth. Once its rebased to the fusaka-devnet-2 branch, we should be able to use it in rbuilder.

Comment thread services/api/service.go Outdated

// Log at start and end of request
log.Info("request initiated")
log.Info("getPayload request initiated")
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

will update this

Comment thread common/types.go
Comment on lines +71 to +76
FuluForkVersionHolesky = "0x07017000"
FuluForkVersionSepolia = "0x90000075"
FuluForkVersionGoerli = "0x06001020"
FuluForkVersionHoodi = "0x70000910"
FuluForkVersionMainnet = "0x06000000"

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

verify these fork versions

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Yes, these are correct 👍

@bharath-123 bharath-123 marked this pull request as ready for review July 11, 2025 07:51
Comment thread common/types_spec.go
Comment on lines 512 to +514
var err error

fuluRequest := new(builderApiFulu.SubmitBlockRequest)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Just a nit, we should remove this new blank line.

Comment thread common/types_spec.go
Comment on lines 622 to +624
var err error

// The SignedBlockContents type for fulu is the same as that of electra
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can remove this blank line too.

Comment thread services/api/service.go Outdated
Comment on lines +471 to +475
log.Infof("deneb fork detected (currentEpoch: %d / denebEpoch: %d)", common.SlotToEpoch(currentSlot), api.denebEpoch)
} else if hasReachedFork(currentSlot, api.capellaEpoch) {
log.Infof("capella fork detected (currentEpoch: %d / capellaEpoch: %d)", common.SlotToEpoch(currentSlot), api.capellaEpoch)
} else if hasReachedFork(currentSlot, api.fuluEpoch) {
log.Infof("fulu fork detected (currentEpoch: %d / fuluEpoch: %d)", common.SlotToEpoch(currentSlot), api.fuluEpoch)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is wrong. Fulu must be at the top of the list, otherwise this won't work as expected.

jtraglia
jtraglia previously approved these changes Jul 11, 2025
Copy link
Copy Markdown
Collaborator

@jtraglia jtraglia left a comment

Choose a reason for hiding this comment

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

This looks really good! Just a few small things.

@bharath-123
Copy link
Copy Markdown
Collaborator Author

bharath-123 commented Jul 14, 2025

since @metachris is on vacation,

Would love it if at least 2 of the following could take a look at the PR, on the same lines as flashbots/mev-boost#805 (comment):

@bharath-123 bharath-123 mentioned this pull request Jul 22, 2025
4 tasks
@metachris metachris requested a review from Copilot August 8, 2025 09:45
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Comment thread services/api/service.go Outdated
receivedAt := time.Now().UTC()
log := api.log.WithFields(logrus.Fields{
"method": "getPayload",
"method": fmt.Sprintf("getPayload%s", version),
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

this might cause issues for some log queries. maybe rather add another field "getPayloadVersion"?

metachris
metachris previously approved these changes Aug 13, 2025
Comment thread services/api/utils.go
}

func getSlotFromBuilderJSONPayload(input []byte) (uint64, error) {
slot := gjson.Get(string(input), "message.slot")
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

we already include a fast json parser: https://github.com/buger/jsonparser

maybe use that one instead of adding a second fast one? not feeling strongly about it, we could also consider switching to gjson (it has more stars).

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

i would kinda lean to using gjson since it also seems more well maintained. last commit to jsonparser is 3 years ago

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

sgtm, let's do that in another PR then 👍

metachris
metachris previously approved these changes Aug 20, 2025
jtraglia
jtraglia previously approved these changes Aug 21, 2025
@bharath-123 bharath-123 dismissed stale reviews from jtraglia and metachris via 0922938 August 28, 2025 15:34
@metachris metachris merged commit 7c88124 into flashbots:main Sep 4, 2025
2 checks passed
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.

Fulu Support

5 participants