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

refactor: move serialisation out of ValidatorSigner #12422

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pugachAG
Copy link
Contributor

@pugachAG pugachAG commented Nov 8, 2024

Currently we add a method to ValidatorSigner for every data type we want to sign. I'm not sure what exactly is a benefit of doing that, but such approach results in quite a few annoying issues:

  • Overly verbose code: need to add 3 methods for every data type to be signed.
  • Not consistent with signature verification: we just call verify method on public key passing signature and bytes, why should signing be any different?
  • It blows up ValidatorSigner public API making it awkward to work with.

This PR repurposes sign_chunk_contract_accesses to be a generic sign_bytes method and replaces usage for witness contract code distribution related types. The rest will be addressed in a separate PR.

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.

1 participant