openethereum/parity-ethereum

parity pubsub returns multiple logs, where as geth returns 1 log at a time if multiple logs in tx

ewingrj opened this issue · 4 comments

Before filing a new issue, please provide the following information.

I'm running:

  • Parity version: v1.7.0-beta-5f2cabd-20170727
  • Operating system: MacOS
  • And installed: via installer homebrew

actual
If multiple events occur in a single tx, parity will return will return an array containing all logs when subscribed using pubsub.

expected
This is different then geth's behavior where geth will emit each event individually.

steps to reproduce

  1. subscribe to event logs.
  2. call a contract method that will emit multiple events.

web3/web3.js#1049 is a PR that was closed in web3js for context


Are there any compelling reasons for that? What's the point of splitting it on the node side and increasing the total payload size?

I'm not sure. I can't think of any. However I submitted PR to web3 to handle this case and it was closed, so I thought I'd submit a bug here.

I can take it up with web3 as well.

quoting @frozeman on the issue:
"the point of a subscription notifications is one notifcation per event
thats what we speced up a year ago
it also makes the code on the client side cleaner"

Yes :) The point of a subscriptions is one notifcation per event. This is in the specs since more than a year. Its also easier to process than iterating over arrays on the client side.
And as it stands one side has to change, either geth or parity, and i am in favour of one notification per event.