feat: Add Fusaka support for MEV-Boost relay#745
Conversation
| // 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 { |
There was a problem hiding this comment.
We need to wait for the flashbots_validateBuilderSubmissionV5 impl for Fusaka being worked on here: paradigmxyz/reth#17179
There was a problem hiding this comment.
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.
|
|
||
| // Log at start and end of request | ||
| log.Info("request initiated") | ||
| log.Info("getPayload request initiated") |
There was a problem hiding this comment.
will update this
| FuluForkVersionHolesky = "0x07017000" | ||
| FuluForkVersionSepolia = "0x90000075" | ||
| FuluForkVersionGoerli = "0x06001020" | ||
| FuluForkVersionHoodi = "0x70000910" | ||
| FuluForkVersionMainnet = "0x06000000" | ||
|
|
There was a problem hiding this comment.
verify these fork versions
There was a problem hiding this comment.
Yes, these are correct 👍
| var err error | ||
|
|
||
| fuluRequest := new(builderApiFulu.SubmitBlockRequest) |
There was a problem hiding this comment.
Just a nit, we should remove this new blank line.
| var err error | ||
|
|
||
| // The SignedBlockContents type for fulu is the same as that of electra |
There was a problem hiding this comment.
Can remove this blank line too.
| 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) |
There was a problem hiding this comment.
This is wrong. Fulu must be at the top of the list, otherwise this won't work as expected.
jtraglia
left a comment
There was a problem hiding this comment.
This looks really good! Just a few small things.
|
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): |
Faheel/v2 get payload
fix: Parse blocks sent by builder with fork version.
fix: use payload slot instead of head slot in getPayload
| receivedAt := time.Now().UTC() | ||
| log := api.log.WithFields(logrus.Fields{ | ||
| "method": "getPayload", | ||
| "method": fmt.Sprintf("getPayload%s", version), |
There was a problem hiding this comment.
this might cause issues for some log queries. maybe rather add another field "getPayloadVersion"?
| } | ||
|
|
||
| func getSlotFromBuilderJSONPayload(input []byte) (uint64, error) { | ||
| slot := gjson.Get(string(input), "message.slot") |
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
i would kinda lean to using gjson since it also seems more well maintained. last commit to jsonparser is 3 years ago
There was a problem hiding this comment.
sgtm, let's do that in another PR then 👍
1b8d3de to
319429a
Compare
319429a to
37383b2
Compare
📝 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:
eth/v2/builder/blinded_blockswhich does not return the execution payload and blobs ethereum/builder-specs#123, we don't return a response ingetPayloadV2compared to returning the fully signed beacon block ingetPayloadV1. 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.✅ I have run these commands
make lintmake test-racego mod tidyCONTRIBUTING.md