Skip to content
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

clarify builder signing domain #39

Merged
merged 2 commits into from
Jul 29, 2022
Merged

clarify builder signing domain #39

merged 2 commits into from
Jul 29, 2022

Conversation

tersec
Copy link
Contributor

@tersec tersec commented Jul 19, 2022

No description provided.

Copy link
Member

@ralexstokes ralexstokes left a comment

Choose a reason for hiding this comment

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

@terencechain raised the same issue so if this is not clear then I'm happy to update

the idea is that this follows the semantics of the spec which inherits the python handling of "default" arguments

if we want to make it explicit then I'd suggest specifying the arguments inline like:

compute_domain(DOMAIN_APPLICATION_BUILDER, fork_version=None, genesis_validators_root=None)

what do y'all think?

I generally don't want to stray too far from the pyspec style as I would like to retain the option to write more elaborate specs here in that style where we can, for example, generate conformance tests in a pretty straightforward way

@tersec
Copy link
Contributor Author

tersec commented Jul 19, 2022

This spec is not, however, written in Python pseudocode. Even after reading that's the intent, it's not something that I'd read into the actual prose.

Nothing about

Signing

All signature operations should follow the [standard BLS operations][bls]
interface defined in consensus-specs.

To assist in signing, we use a function from the [consensus specs][consensus-specs]:
[compute_domain][compute-domain]

There are two types of data to sign over in the Builder API:

  • In-protocol messages, e.g. BlindedBeaconBlock, which
    should compute the signing root using [compute_signing_root][compute-root]
    and use the domain specified for beacon block proposals.
  • Builder API messages, e.g. validator registration, which should compute the
    signing root using [compute_signing_root][compute-root] with domain given by
    compute_domain(DOMAIN_APPLICATION_BUILDER).
    As compute_signing_root takes SSZObject as input, client software should
    convert in-protocol messages to their SSZ representation to compute the signing
    root and Builder API messages to the SSZ representations defined
    above.

suggests Python semantics on the level of default arguments are more than accidental.

@ralexstokes
Copy link
Member

To assist in signing, we use a function from the [consensus specs][consensus-specs]:
[compute_domain][compute-domain]

I think this makes it clear, but like I said I'm open to clarifying further.

Do you like the way I wrote it above or would you rather spell out the data like you did here?

@tersec
Copy link
Contributor Author

tersec commented Jul 29, 2022

Do you like the way I wrote it above or would you rather spell out the data like you did here?

I do like your suggested approach: 8f68a98

Copy link
Member

@ralexstokes ralexstokes left a comment

Choose a reason for hiding this comment

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

lgtm!

@ralexstokes ralexstokes merged commit f997c49 into ethereum:main Jul 29, 2022
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.

2 participants