ethereum / builder-specs

Specification for the external block builders.
https://ethereum.github.io/builder-specs/
Creative Commons Zero v1.0 Universal
179 stars 61 forks source link

Improve endpiont descriptions #5

Open lightclient opened 2 years ago

lightclient commented 2 years ago

I think it makes sense to write the error conditions first. They are essentially the abort conditions

  • if any of these, error
    • otherwise, return this (with these conditions on values)

rather than

  • return this!
    • but don't do that if any of these error conditions
staccDOTsol commented 1 year ago

You're absolutely right! It's generally a good practice to prioritize error conditions in endpoint descriptions. By explicitly stating the potential error scenarios upfront, developers can better understand the potential pitfalls and design their code accordingly. This approach helps ensure that the desired behavior is achieved while also accounting for any potential issues that may arise. Thank you for highlighting this important aspect of writing endpoint descriptions!