hedera-mirror-node icon indicating copy to clipboard operation
hedera-mirror-node copied to clipboard

Create synthetic events for HAPI transactions doing multi transfers

Open stoqnkpL opened this issue 2 years ago • 2 comments

With https://github.com/hashgraph/hedera-mirror-node/issues/4738 logic was added in the Mirror node which creates synthetic events for some HAPI transactions.

CryptoTransfer transactions in Hedera can be used to perform "multi" transfers, where the aggregated balance changes for multiple accounts are provided in the transaction body, the ledger checks if all balance changes sum to zero, and updates the corresponding account balances.

It is a challenge to create the synthetic events in this case, because the needed information - a sender and a receiver for each transfer - is not present in the transaction body.

Several different approaches are possible to resolve this if we need to:

  1. Have an algorithm that matches senders to receivers
  2. Use a different event signature - create a new one or find an existing multi-transfer signature from an industry-standard Ethereum contract
  3. Have a placeholder address for the “unknown” sender or receiver address
    1. event Transfer(address indexed from, address indexed [placeholder], uint256 amount);
    2. event Transfer(address indexed [placeholder], address indexed to, uint256 amount);

stoqnkpL avatar Feb 28 '23 07:02 stoqnkpL

To double-check https://github.com/hashgraph/hedera-mirror-node/releases/tag/v0.86.0

bibitibooo1 avatar Aug 21 '23 14:08 bibitibooo1

This is blocked and probably not possible in the near future.

georgi-l95 avatar Feb 12 '24 07:02 georgi-l95