Open ancazamfir opened 3 years ago
But we should process this right away and not wait for the next event. Possibly something wrong with stream_batches()?
Isn't it the case that we need to wait for the source chain to advance to the next block height anyway, to build proofs for submitting the tx to the destination chain? So delaying the processing of these events should not slow down the packet worker in the common case.
Note: After Romain and I discussed this, we realized that there may be a tradeoff between latency versus efficiency (batching) at play here: we currently favor bigger batches by processing everything at the end. By moving to more aggressive event propagation, we will favor latency, at the expense of potentially submitting a bigger number (of smaller) transactions. Hope this makes sense! In any case, we also decided to deprioritize the work here because of (1) several unknowns, (2) unclear if the packet worker is affected, (3) it's not straightforward to reproduce.
Thanks @adizere for the summary! One more thing: to do this properly, we need better metrics to track what effect this change will have, ie. number of client updates submitted, number of queries, and time to relay at the very least.
Moved to low priority & backlog until new data comes in.
Crate
relayer
Summary of Bug
I was running
hermes listen
command and noticed that aNewBlock
event extracted by the monitor (tid 18 in my run) is not processed immediately but rather on the next event, for example:Notice the timestamps, and the 10sec gaps (ibc-0 is configured with 10 sec block time). The sequence seems to be:
H
with header time t is extracted att + 10
H + 1
with header timet + 10
is extracted att + 20
NewBlock event for height
H
is processed att + 20
I believe that with
timeout_commit = "10s"
configuration, we will see theNewBlock
event notification 10 seconds after the block time. But we should process this right away and not wait for the next event. Possibly something wrong withstream_batches()
?Here are full logs for a client update:
Version
master
Steps to Reproduce
Start a chain and run
hermes listen
command. I also added these traces:Acceptance Criteria
Process event batches immediately.
For Admin Use