Document that log_cids entries can contain references to logTrie leaf node IPLDs OR log IPLDs. #120

Closed
opened 2021-12-02 06:01:20 +00:00 by i-norden · 0 comments
Member

Due to work around for https://github.com/vulcanize/go-ethereum/issues/161

You can distinguish the two in two ways:

  1. The CIDs will have different Multicodecs: EthLog == 0x9a vs EthLogTrie == 0x99
  2. The referenced IPLD block will RLP decode into [2]interface{}{} (first member the partial path, second the log RLP) for a log trie node and into &types.Log{} for a log

Also note that the only time a log_cids entry can reference a log IPLD instead of a logTrie leaf node IPLD is if the log doesn't contain any topics and has an empty data field (otherwise it's leaf node will be longer than 32 bytes). But you could have a log without any topics or data that produces a leaf node > 32 bytes in length if the partial path of the node is long enough.

@ashwinphatak drawing your attention to this is as it affects post-processing/data consumption.

Due to work around for https://github.com/vulcanize/go-ethereum/issues/161 You can distinguish the two in two ways: 1. The CIDs will have different Multicodecs: EthLog == 0x9a vs EthLogTrie == 0x99 2. The referenced IPLD block will RLP decode into `[2]interface{}{}` (first member the partial path, second the log RLP) for a log trie node and into `&types.Log{}` for a log Also note that the only time a log_cids entry can reference a log IPLD instead of a logTrie leaf node IPLD is if the log doesn't contain any topics and has an empty data field (otherwise it's leaf node will be longer than 32 bytes). But you could have a log without any topics or data that produces a leaf node > 32 bytes in length if the partial path of the node is long enough. @ashwinphatak drawing your attention to this is as it affects post-processing/data consumption.
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: cerc-io/ipld-eth-server#120
No description provided.