Add `message.topic` to gossipsub `message-id` in Altair
This commit is contained in:
parent
5d9d786499
commit
d64b4e7d24
|
@ -74,6 +74,15 @@ New topics are added in Altair to support the sync committees and the beacon blo
|
||||||
|
|
||||||
The specification around the creation, validation, and dissemination of messages has not changed from the Phase 0 document.
|
The specification around the creation, validation, and dissemination of messages has not changed from the Phase 0 document.
|
||||||
|
|
||||||
|
The derivation of the `message-id` has changed starting with Altair to incorporate the message topic along with the message data.
|
||||||
|
The `message-id` MUST be the following 20 byte value computed from the message:
|
||||||
|
* If `message.data` has a valid snappy decompression, set `message-id` to the first 20 bytes of the `SHA256` hash of
|
||||||
|
the concatenation of `MESSAGE_DOMAIN_VALID_SNAPPY` with the snappy decompressed message data and the topic name,
|
||||||
|
i.e. `SHA256(MESSAGE_DOMAIN_VALID_SNAPPY + snappy_decompress(message.data) + message.topic)[:20]`.
|
||||||
|
* Otherwise, set `message-id` to the first 20 bytes of the `SHA256` hash of
|
||||||
|
the concatenation of `MESSAGE_DOMAIN_INVALID_SNAPPY` with the raw message data and the topic name,
|
||||||
|
i.e. `SHA256(MESSAGE_DOMAIN_INVALID_SNAPPY + message.data + message.topic)[:20]`.
|
||||||
|
|
||||||
The new topics along with the type of the `data` field of a gossipsub message are given in this table:
|
The new topics along with the type of the `data` field of a gossipsub message are given in this table:
|
||||||
|
|
||||||
| Name | Message Type |
|
| Name | Message Type |
|
||||||
|
|
Loading…
Reference in New Issue