Skip to content

Bug: missing listener in data set #103

@silent-cipher

Description

@silent-cipher

We currently extract the listener address from transaction input like this:

  const listenerAddr = Bytes.fromUint8Array(
    event.transaction.input.subarray(16, 36)
  );

This works correctly when the data set is created through:

function createDataSet(
  address listenerAddr,
  bytes calldata extraData
) public payable returns (uint256)

However, a data set can also be created via:

function addPieces(
  uint256 setId,
  address listenerAddr,
  Cids.Cid[] calldata pieceData,
  bytes calldata extraData
) public payable returns (uint256)

In this flow, setId is 0 for new data sets, so the first 32-byte slot in calldata contains the setId. As a result, reading bytes 16..36 returns the zero address instead of the actual listener address.

We should update the listener extraction logic to correctly handle both transaction formats.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

Status
🎉 Done

Relationships

None yet

Development

No branches or pull requests

Issue actions