[go: up one dir, main page]

DAC: new endpoint to get binary certificate in DAC CLI

Context

Currently the get_certificate command exposed in command_handlers has defined its own encoding for Certificate_repr.t. This is because:

  • Certificate_repr.encoding is Json_only and here we need binary encoding
  • This command will be used by Kernel SDK which needs the root_hash field to be 33 bytes long (first byte must be 0 then 32 bytes of data)

The 33 bytes long encoding for root_hash is not possible without Plugin resolution. Hence, in this MR you will find

  • New GET /v0/serialized_certificate which returns the correctly encoded in Binary certificate
  • New type serialized_certificate inside Certificate_repr.V0.Protocol_dependant module, to make obvious all these operations are linked to the protocol.
  • Encoding for the previously new type
  • helper function to correctly serialize such a serialized_certificate type.
  • Reworked wait_for_certificate function, which now calls new endpoint GET /serialized_certificate to return a correctly binary encoded certificate.

Closes #4514 (closed)

Manually testing the MR

Checklist

  • Document the interface of any function added or modified (see the coding guidelines)
  • Document any change to the user interface, including configuration parameters (see node configuration)
  • Provide automatic testing (see the testing guide).
  • For new features and bug fixes, add an item in the appropriate changelog (docs/protocols/alpha.rst for the protocol and the environment, CHANGES.rst at the root of the repository for everything else).
  • Select suitable reviewers using the Reviewers field below.
  • Select as Assignee the next person who should take action on that MR
Edited by Gauthier

Merge request reports

Loading