There is a Core discussion about whether actually we can just use latest status on Arbbitrum and if we can then all this goes away because they will be pretty much instant.
If not ... we've now talked through the fact that we can call eth_getBlockByNumber() every say 30s with each of latest, finalized, and safe and we'll be able to provide a kind of countdown on the toast and the deposit table. See additional details for more. (NB. simplified this logic now with a more basic flow)
[ ] Using the logic below update the toast
[ ] Using the logic below update the deposits table under "Status" column as the deposit progresses
Additional details / background info
New simplified logic
Deposit made at block X
Call eth_getBlockByNumber(safe)
Inform user "X - result blocks until your deposit is safe on Arbitrum and can be used to trade"
Once X - result < 0 trigger green toast with deposit complete message
Previous logic
Deposit made at block X
Call eth_getBlockByNumber(latest)
Inform user it is X - result blocks until they reach latest status on Arbitrum
Once X - result < 0 call instead eth_getBlockByNumber(finalized)
Inform user it is X - result blocks until they reach finalized status on Arbitrum
Once X - result < 0 call instead eth_getBlockByNumber(safe)
Inform user it is X - result blocks until they reach safe status on Arbitrum
Once X - result < 0 tell the user the deposit is complete and their funds are available for trading
The Chore
We get stuck on this for a long time
Acceptance criteria
There is a Core discussion about whether actually we can just use
latest
status on Arbbitrum and if we can then all this goes away because they will be pretty much instant.If not ... we've now talked through the fact that we can call
eth_getBlockByNumber()
every say 30s with each oflatest
,finalized
, andsafe
and we'll be able to provide a kind of countdown on the toast and the deposit table. See additional details for more. (NB. simplified this logic now with a more basic flow)Additional details / background info
New simplified logic
eth_getBlockByNumber(safe)
X - result
blocks until your deposit is safe on Arbitrum and can be used to trade"X - result < 0
trigger green toast with deposit complete messagePrevious logic
eth_getBlockByNumber(latest)
X - result
blocks until they reachlatest
status on ArbitrumX - result < 0
call insteadeth_getBlockByNumber(finalized)
X - result
blocks until they reachfinalized
status on ArbitrumX - result < 0
call insteadeth_getBlockByNumber(safe)
X - result
blocks until they reachsafe
status on ArbitrumX - result < 0
tell the user the deposit is complete and their funds are available for tradingDocs
https://docs.arbitrum.io/for-devs/troubleshooting-building#how-many-block-numbers-must-we-wait-for-in-arbitrum-before-we-can-confidently-state-that-the-transaction-has-reached-finality