chainbound / bolt

Bolt: permissionless out-of-protocol proposer commitments.
https://chainbound.github.io/bolt-docs/
MIT License
27 stars 5 forks source link

Implement hash tree root for `ConstraintsMessage` #90

Open thedevbirb opened 2 weeks ago

thedevbirb commented 2 weeks ago

In our fork of Flashbots' relay we added an endpoint to submit signed constraints (https://chainbound.github.io/bolt-docs/api/constraints-api#relayv1builderconstraints), with the underlying message of type ConstraintsMessage. Right now, we verify signatures using the SSZ encoding as digest; we should use the hash tree root of such container instead, as done with other containers in the consensus specs.

### Tasks
- [ ] Implement `fastssz`'s `HashTreeRoot` interface for `ConstraintsMessage` (with tests)
- [ ] Modify `handleSubmitConstraints` signature checks by using the hash tree root as a digest