oasislabs / oasis.js

🕸A web client for the Oasis platform

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

docs: Unclear how to obtain the number of confirmations an event has

omitar opened this issue · comments

In Web3 after I make a transaction I get an event emitter I can use to observe confirmations and count how many confirmations does transaction obtain. In combination with receipt which includes the event, I can in this way know after some time that the event has a satisfactory amount of confirmations.

If I am using service.addEventListener I do not really see any information about how confirmed those events are? Or a way to wait for them to be confirmed to a satisfactory level.

The gateway shouldn't emit an event until the block has been finalized. There's no a notion of "confirmations" because Oasis doesn't use PoW and the underlying consensus algorithm is Tendermint, which achieves finality once the block is completed.

@peterjgilbert please confirm this and reopen if I'm incorrect.

Maybe this should be put in documentation somewhere in client libraries as well? I do not think readers understand all those internals necessary. I would vote to reopen this issue to add something alongside this to documentation:

Service's method call returns only after the transaction has been finalized by the Oasis network.

And for events:

Event is emitted only after the block containing it has been finalized by the Oasis network.

Feel free to close the issue if you think such side-comments do not have place in client documentation.

Addressed by #285.