-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(mev-boost): update constraints api #276
feat(mev-boost): update constraints api #276
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Tried to run it locally and noticed the following:
Failed to send web demo event: Post "http://host.docker.internal:3001/events": dial tcp 198.19.248.254:3001: connect: connection refusedtime="2024-10-07T15:00:26.088Z" level=info msg="sending request for 1 constraint to relay" method=submitConstraint ua=bolt-sidecar url="http://172.16.0.21:4040/constraints/v1/builder/constraints" version=
time="2024-10-07T15:00:26.088Z" level=info msg="sent request for 1 constraint to relay. err = HTTP error response: 400 / Serde decode error: missing field `transactions` at line 1 column 378" method=submitConstraint ua=bolt-sidecar url="http://172.16.0.21:4040/constraints/v1/builder/constraints" version=
time="2024-10-07T15:00:26.088Z" level=warning msg="error calling submitConstraint on relay" error="HTTP error response: 400 / Serde decode error: missing field `transactions` at line 1 column 378" method=submitConstraint ua=bolt-sidecar url="http://172.16.0.21:4040/constraints/v1/builder/constraints" version=
time="2024-10-07T15:00:26.088Z" level=info msg="http: POST /constraints/v1/builder/constraints 502" duration=0.001555 method=POST path=/constraints/v1/builder/constraints status=502 version=
time="2024-10-07T15:00:26.19Z" level=info msg=submitConstraint method=submitConstraint ua=bolt-sidecar version=
time="2024-10-07T15:00:26.19Z" level=info msg="[BOLT]: adding inclusion constraints to cache. slot = 201, validatorPubkey = [171 209 38 120 199 52 99 236 234 88 103 168 12 175 37 109 92 94 107 165 63 241 136 177 67 164 213 190 131 54 90 210 87 237 243 158 170 27 168 117 60 76 223 76 99 47 249 158], number of relays = 1" method=submitConstraint ua=bolt-sidecar version=
time="2024-10-07T15:00:26.19Z" level=info msg="[BOLT]: added inclusion constraints to cache. slot = 201, validatorPubkey = [171 209 38 120 199 52 99 236 234 88 103 168 12 175 37 109 92 94 107 165 63 241 136 177 67 164 213 190 131 54 90 210 87 237 243 158 170 27 168 117 60 76 223 76 99 47 249 158], number of relays = 1" method=submitConstraint ua=bolt-sidecar version=
Failed to send web demo event: Post "http://host.docker.internal:3001/events": dial tcp 198.19.248.254:3001: connect: connection refusedtime="2024-10-07T15:00:26.191Z" level=info msg="sending request for 1 constraint to relay" method=submitConstraint ua=bolt-sidecar url="http://172.16.0.21:4040/constraints/v1/builder/constraints" version=
time="2024-10-07T15:00:26.191Z" level=info msg="sent request for 1 constraint to relay. err = HTTP error response: 400 / Serde decode error: missing field `transactions` at line 1 column 378" method=submitConstraint ua=bolt-sidecar url="http://172.16.0.21:4040/constraints/v1/builder/constraints" version=
time="2024-10-07T15:00:26.191Z" level=warning msg="error calling submitConstraint on relay" error="HTTP error response: 400 / Serde decode error: missing field `transactions` at line 1 column 378" method=submitConstraint ua=bolt-sidecar url="http://172.16.0.21:4040/constraints/v1/builder/constraints" version=
- Can you please remove also the web demo logs? It is now deprecated
- Validator pubkey isn't displayed well
- There is a
400
when sending constraints, we need to check whether this code should change or Helix.
I'm running on the latest unstable
commit, therefore consider rebasing as well!
pathGetHeader = "/eth/v1/builder/header/{slot:[0-9]+}/{parent_hash:0x[a-fA-F0-9]+}/{pubkey:0x[a-fA-F0-9]+}" | ||
pathGetHeaderWithProofs = "/eth/v1/builder/header_with_proofs/{slot:[0-9]+}/{parent_hash:0x[a-fA-F0-9]+}/{pubkey:0x[a-fA-F0-9]+}" | ||
pathGetPayload = "/eth/v1/builder/blinded_blocks" | ||
|
||
// Constraints namespace paths |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add reference link here?
mev-boost/server/constraints.go
Outdated
type SignedDelegation struct { | ||
Message Delegation `json:"message"` | ||
Signature phase0.BLSSignature `json:"signature"` | ||
} | ||
|
||
type Delegation struct { | ||
ValidatorPubkey phase0.BLSPubKey `json:"validator_pubkey"` | ||
DelegateePubkey phase0.BLSPubKey `json:"delegatee_pubkey"` | ||
} | ||
|
||
type SignedRevocation struct { | ||
Message Delegation `json:"message"` | ||
Signature phase0.BLSSignature `json:"signature"` | ||
} | ||
|
||
type Revocation struct { | ||
ValidatorPubkey phase0.BLSPubKey `json:"validator_pubkey"` | ||
DelegateePubkey phase0.BLSPubKey `json:"delegatee_pubkey"` | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here for reference links! Thank you
mev-boost/server/service.go
Outdated
log.Debug("delegate") | ||
|
||
payload := SignedDelegation{} | ||
if err := DecodeJSON(req.Body, &payload); err != nil { | ||
m.respondError(w, http.StatusBadRequest, err.Error()) | ||
return | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the log.Debug("delegate")
has little utility, perhaps could you print the payload
instead?
mev-boost/server/constraints.go
Outdated
Pubkey phase0.BLSPubKey `json:"pubkey"` | ||
Slot uint64 `json:"slot"` | ||
Top bool `json:"top"` | ||
Transactions []Transaction // Custom marshal and unmarshal implemented below |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Transactions []Transaction // Custom marshal and unmarshal implemented below | |
Transactions []*Transaction `json:"transactions"` |
You probably don't need to do additional encoding and decoding here so the concrete transaction type with custom marshal and unmarshal done here https://github.com/chainbound/bolt/blob/naman%2Ffeat%2Fmev-boost%2Fconstraints-api/builder/core/types/constraints.go#L178-L230 is probably not needed.
However you still have to specify the name of the field otherwise the error:
time="2024-10-07T15:00:26.088Z" level=info msg="sent request for 1 constraint to relay. err = HTTP error response: 400 / Serde decode error: missing field `transactions` at line 1 column 378" method=submitConstraint ua=bolt-sidecar url="http://172.16.0.21:4040/constraints/v1/builder/constraints" version=
is thrown
87bc2d2
to
e4e589e
Compare
This should be ready to be merged! |
0b1225f
to
2694da8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, let's test this e2e and make eventual fixes in other PRs.
3d8123e
to
eb47e26
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PBS flow is working on Kurtosis at latest commit. 🎉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Closes #272