stratum-mining / stratum

stratum
https://stratumprotocol.org
Other
218 stars 126 forks source link

Congruent message-generator message identifiers #370

Open rrybarczyk opened 1 year ago

rrybarczyk commented 1 year ago

Currently, message-generator uses different key names to represent a message identifier:

  1. When identifying a PoolMessages type with the keys "common_messages", "mining-messages", "job_negotiator_messages", or "template_distribution_messages", the identifier key is "id".
  2. When identifying a PoolMessages type in the "frame_builders" key, the identifier key is "message_id".
  3. When identifying a PoolMessages type in the "actions" key, the identifier key is "message_ids". This key's value is an array of message identifiers, which is why it is plural.

Need to use the same identifier names to avoid confusion. The chosen identifier name is "message_id" for a singular message identifier and "message_ids" for an array of message identifiers. Therefore, the only change should be:

  1. When identifying a PoolMessages type with the keys "common_messages", "mining-messages", "job_negotiator_messages", or "template_distribution_messages", the identifier key SHOULD BE: "message_id".
rrybarczyk commented 1 year ago

Could also use each message's hex representation instead of a string? Or allow the user to type a string, then store as a hex.