massa
massa copied to clipboard
Generate unique event IDs and AsyncMessage IDs
Followup of https://github.com/massalabs/massa/pull/4197
- [ ] define Event IDs and generate them using the execution hash trail:
Hash::compute_from_tuple("EVENT_ID".to_bytes(), context.execution_trial_hash.to_bytes(), context.event_index.to_be_bytes())
- [ ] return the event ID when calling the emit_event ABI
- [ ] define AsyncMessage IDs and generate them using the trail:
Hash::compute_from_tuple("ASYNC_MSG_ID".to_bytes(), context.execution_trial_hash.to_bytes(), context.async_message_index.to_be_bytes())
- [ ] return the AsyncMessageID when emitting a message from the ABI
Actual AsyncMessageId impl:
https://github.com/massalabs/massa/blob/215bce594e600561903cd0aca1a06948c8f81904/massa-async-pool/src/message.rs#L29-L32
Actual AsyncMessageId impl:
Yes, I will check if we can do better in this issue, but first I need to make this work: https://github.com/massalabs/massa/pull/4197