algorand / go-algorand

Algorand's official implementation in Go.
https://developer.algorand.org/
Other
1.35k stars 470 forks source link

Improve DevMode with hybrid approach. #2770

Open winder opened 3 years ago

winder commented 3 years ago

Problem

DevMode is typically used by dapp developers to run tests of their dapps. DevMode allows them to submit many sequential transactions (that have to wait for the previous ones to be committed) without waiting 4 seconds per round. Most tests involve several rounds (for setting up accounts, deploying apps/creating assets, opting in the accounts, then calling the apps/ transacting on the assets), some tests involve many rounds (e.g. simulating an auction with many bids, or running an app that accrues interest over rounds...).

When DevMode is enabled new blocks are only generated when a transaction is sent. This gives the appearance of a stalled network and causes some weirdness with features like "waitForBlock".

Solution

Adjust the algorithm so that blocks are generated every 4.5 seconds as usual, in addition to creating a new block when a transaction enters the transaction pool.

Dependencies

Urgency

Medium, I think this would be a very nice improvement.

yaovi-a commented 3 years ago

Hey team! Please add your planning poker estimate with ZenHub @algobolson @algonautshant @AlgoStephenAkiki @nicholasguoalgorand @tolikzinovyev @tsachizehub @winder

algorandskiy commented 2 years ago

@algonoah opinion?

algonoah commented 1 year ago

Need to better understand the problem. On hold for now

algonoah commented 1 year ago

Created in response to https://github.com/algorand/go-algorand/issues/2716:

"On devMode, the next round isn't going to come, so the indexer will ALWAYS wait 1 minute between updates. So if you have an app that does "post txn, look for it on the indexer" then it will take 1 minute per loop, because the indexer uses waitForBlock to get the next one"