EmerisHQ / demeris

Emeris web app
https://app.emeris.com/
Apache License 2.0
11 stars 2 forks source link

Account sequence takes a while to update for some chains #1805

Open luciorubeens opened 2 years ago

luciorubeens commented 2 years ago

Describe the bug

The response from the /chain/osmosis/numbers/<keyhash> endpoint is not updated immediately, especially notable when sending a multi-hop swap on osmosis.

CleanShot 2022-05-12 at 21 50 09

To Reproduce Steps to reproduce the behavior:

Try to make a swap immediately after another on osmosis chain.

Solution

A workaround could be to retry if it returns this code error.

faboweb commented 2 years ago

@EmerisHQ/emeris-backend

Pitasi commented 2 years ago

Adding some context:

The /chain/osmosis/numbers/<keyhash> endpoint hits the chain nodes directly using RPC and returns the result. I'm pretty sure this endpoint is cached by nginx for 2 seconds so we might want to take this into account as well.

I think the delay you are seeing could be because our nodes takes a while to sync between each other (e.g. the transaction was made to node X and you are asking numbers to node Y, but you need to wait some seconds for node Y to be in sync). I'm not sure if there's much we can do here, nothing "easy" comes to my mind 😕