I am developing an application using solidity, web3js and eventeum. I am testing it locally using ganache-cli. I use Kafka to store all the events to process them at convenience instead of processing them directly.

  • The problem is that when I do truffle tests using my contract logic, the events are logged exactly in the order they were emitted.
  • When eventeum captures them, the events do not appear in order in the kafka topic.
  • When I listen to the same events simultaneously in separate web3js callback functions, they sometimes appear out of order.
  • All these events are emitted within a single transaction.
  • I am connected to the ganache from web3 and eventeum using http://localhost:8545 as the endpoint for provider.

Is it normal that events from events to appear out of order within a single transaction?


  • Does connecting using ws:// make a difference?
  • Is it an anomaly with ganache-cli?
  • Possible suspect: I also read this post : ethereum.stackexchange.com/questions/63745/… which says that for long chain of functions the order might get reversed. Any articles/posts on this as well. Mar 2, 2021 at 16:30
  • @amabkaycee That out-of-orderedness is because the contracts themselves emit them in an undesired order but it should still be consistent. Mar 2, 2021 at 17:57
  • 1
    In this case, I suspect the issue is asynchronous activities creating race conditions on the listener side. There is always a deterministic order on the blockchain side. Mar 2, 2021 at 17:58


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.