Skip to content

Wrong block author on Kreivo network #6229

@voliva

Description

@voliva

The block 0xbe1686e5…157eec8445e0 has the following information regarding block author:

Header digest logs:

[
  {
    "type": "preRuntime",
    "value": {
      "engine": "CMLS",
      "payload": "0x01010130"
    }
  },
  {
    "type": "preRuntime",
    "value": {
      "engine": "aura",
      "payload": "0x2ec0841100000000"
    }
  },
  {
    "type": "consensus",
    "value": {
      "engine": "RPSR",
      "payload": "0x5c488cc6a7b678f955047f7fc075881ade0c6cd0004699252df71165b76e4bba56616507"
    }
  },
  {
    "type": "seal",
    "value": {
      "engine": "aura",
      "payload": "0x72908525dd861bb5813aeafe393625576bd29a8ab4b3245e5869adb8d65d421e3eb7a9f4b9f0edf28e2d0d7f86208032648b32761ab7ad41e27905c603807b89"
    }
  }
]

Session.Validators:

[
  0: "D6AS6xwwDBQ89mRPQdUMG9UQnQ7knaNdx1Fk5SUETMwT9DL"
  1: "EFuS5c3xEmKPHYJz7KD9ZTXmRqaHggixxUfMPbfvvDvjKGm"
  2: "Eymc4KLiiPaSYSYhenT8gxhvBp8wt3ooAiJVzWqf6sDxyhe"
  3: "H4V4RJU6735JwQVnpWJ9Ljn9VhoKwCADpiTMD4bU4QqffYL"
  4: "H4WVkfa4FAMSQF4G2A9Zmgq8fcmjsCxZjWJ78htkWvLzbJa"
  5: "HCnk32t9YScHgdXAaQ4BwgbgBVMqHETfEVA336rm1NFeTg6"
]

Currently, PJS says the author for this block is H4WVkfa4FA…8htkWvLzbJa, index=4. However, looking at the aura preRuntime seal, it has a value of 0x2ec0841100000000, which in u64 is 293912622, which mod amount of validators (6) equals to idx=0, D6AS6xww…UETMwT9DL.

The problem here is that extractAuthor grabs only the first preRuntime log, which in this case is CMLS, not a recognised engine, and it fallsback to consensus RPSR, not an engine either, and then seal aura - But then reads the value of that seal as a u64, as if it were a preRuntime. Then 0x72908525dd861bb5 in u64 is 13050172629611548786, which mod 6 equals to idx=4.

Unless I misunderstood something, this is resulting in wrong block authors for networks that have a CMLS preRuntime seal before the aura one.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions