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

Pre-Runtime digest message format issue #838

Closed
2 of 3 tasks
edwardmack opened this issue May 2, 2020 · 2 comments
Closed
2 of 3 tasks

Pre-Runtime digest message format issue #838

edwardmack opened this issue May 2, 2020 · 2 comments

Comments

@edwardmack
Copy link
Contributor

Expected Behavior

Calling chain RCP methods that return header with digest of type Pre-Runtime should be formatting as detailed in Defniniton 3.7 in Polkadot Host Protocol Specification.
Example from result when calling chain_getHeader on test substrate node: 0x0661757261202596c70f00000000

byte 1       - 06 - Pre-Runtime type
byte 2 - 5   - 61757261 - Eid (aura)
byte 6       - 20 - Scale enc length byte array (8 bytes)
byte 7 - 14  - 2596c70f00000000 - The 8 byte array

Current Behavior

Too many bytes are being included in Pre-Runtime digest message, example from gossamer: 0x064241424558f16c62c0cdea9bdb9b341227845a90516e8417eba2bc7c6cff39cd12120e212106e05aeca6ee2f40126a3edcf015a4a4bc9932aed7fef1257c114265184f0e1833b7c2b9be2656b0833f7060d7301d250c1041e1d949c3651f8fc74e25c90c00000000000000004f00000000000000

byte 1       - 06 - Pre-Runtime type
byte 2 - 5   - 4241445 - Eid (BABE)
byte 6       - 58 - Scale enc length byte array (22 bytes)
byte 7 - 22  - f16c62c0cdea9bdb9b341227845a90516e8417eba2bc - The 22 byte array
These extra bytes (`7c6cff39cd12120e212106e05aeca6ee2f40126a3edcf015a4a4bc9932aed7fef1257c114265184f0e1833b7c2b9be2656b0833f7060d7301d250c1041e1d949c3651f8fc74e25c90c00000000000000004f00000000000000`) are causing issues.  

Calling chain_getBlock from within polkadot-js gives errors such as Struct: failed on 'logs':: Bytes: required length less than remainder, expected at least 331575618, found 112 I believe this error is due to incorrect data in this digest log.

Possible Solution

  • Unknown, but this is probably related to the current runtime.

Steps to Reproduce

  1. RPC call chain_getHeader and examine logs for digest type starting with 0x06

Specification

  • go version:
  • gossamer version:
  • gossamer commit tag:
  • gossamer commit hash:
  • operating system:
  • additional links:

Checklist

  • I have read CONTRIBUTING and CODE_OF_CONDUCT
  • I have provided as much information as possible and necessary
  • I am planning to submit a pull request to fix this issue myself
@dutterbutter
Copy link
Contributor

@edwardmack please review to see if the issue is still relevant.

@dutterbutter dutterbutter added this to the Sprint 1 milestone Jan 11, 2021
@dutterbutter dutterbutter removed this from the Sprint 1 milestone Jan 21, 2021
@noot
Copy link
Contributor

noot commented Jan 26, 2021

closing since it is no longer relevant

@noot noot closed this as completed Jan 26, 2021
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

No branches or pull requests

4 participants